I am trying to find files that include either of the following two patterns: By AND, I mean a logical and. I am using the following command: to check if a file has INTO and SELECT, but this returns the string if either one exists, but I need both. Answer If the patterns have to occur on the same line,
Fabric nonzero return code 137
I have the following task in fabric, designed to brute force kill all celery workers in an emergency It fails with Why is this? The commnd itself works fine from the an ssh shell as user “operatore” on the server. Or at least how can I get fabric to give me some more information to work with……
R packages: RCurl and curl packages install failure on Linux
I hope you can help with this issue I have come across whilst installing RCurl and curl packages for R. Answer That looks like that you have different versions of libcurl. One approch could be the following one (for your console): Then you can use ldd libcurl.so to find all dependencies and shared libraries t…
printf in awk with Umlauts doesn’t work
Can somebody please give me an alternative to the following awk statement. As soon as I give a “n” for string, it skips after Umlaut. I don’t want to use gsub because I have many special characters and don’t want to write a script for this. Also if not in awk, can somebody help me in o…
How to create and run multiple ec2 instances with same configurations and software installed?
Fairly new to cloud computing, so bear with me if question is obvious or silly. With tons of information available on internet, I was able to successfully create an ec2 linux instance and installed R and Rstudio on it. Ran my scripts on it which went really well but took too long (16 hrs) and very expensive a…
Can docker run additional libraries my OS doesnt support?
I have an OS(Amazon Linux) that doesn’t support a library (libcgj). If I host the application via docker container, can I use this library? Answer As long as your application’s base images is one of those OSs that support your library, I think you should be fine. However, if you could give some mo…
crontab shell script starts another script: remove char error
I want to run a shell script through crontab which does something and then runs another shell script which checks a certain folder for certain files and creates a directory for each file. The first script “my_crontab.sh” looks like this: Crontab executes “my_crontab.sh” and “star…
Run shell script exactly once with cronjob
I have a cron job that calls a script that checks for updates once every hour. If there are updates, it will call update.sh, which in turn calls commands.sh. I would like each “new” commands.sh to be run exactly once. I was thinking of writing to a file each time I run commands.sh with some unique…
BASH regex check not matching on linux
I have been scripting something in BASH and I have found a strange bug. I have been developing on Mac (El Capitan) and everything is working flawlessly. But deployment on Ubuntu 16.06 server is failing and I have no idea why. My code follows for input 6LfMYB8TAAAAACRZ9bP-0GN9y4zKUYPtj255-e8A this fails. And f…
Customize linux terminal PS1 variable in a function before starting a session
I often start a terminal session to servers from different tabs of my terminal. I would like to create a function that before starting the session it changes the title of the tab so that I can easily recognize which tab has which session open. Let’s pretend here that my session is an ssh session. When I…