I’m using a generic procedure to trap and describe the error or abnormal situations, instead of the usual ‘2>…’ error construct. The idea will be to have a procedure like this simplified version: and then, used as in this example: The issues are: BASH_SOURCE is the running source. T…
Tag: linux
Create a heredoc that doesn’t interpret anything
I’m writing a script for a friend who is not experienced with bash. The script generates a backup script, generates a crontab and runs crontab to create a cron job. I want to date these backups, so currently the script (what’s relevant) is: This, however, generates finalCutScript.bash with the dat…
test kitchen stuck on “creating virtual machine”
Running chefdk on Windows 10 with hyperv. I can use kitchen create to create Windows VMs and it works fine but I just tried a Linux VM and I’m getting this errror: Now it does create a VM which I can manually ssh into via PuTTY or from cmd via openssh for Windows so I don’t know why its hanging-
How to avoid defunct python processes in Linux?
With python3 (3.4.3) on Ubuntu 14.04 I have created a Forker class which I use in two different processes to create child processes. Here is the Forker class: In the two different Linux processes I derive from this class and then call e.g. something like: However, I still get a couple of defunct python proces…
Docker-compose – mongodb could not be authenticated
After installing Docker Toolbox on Windows 10 and starting docker-machine, I run docker-compose up, I run into this error: The following packages cannot be authenticated mongodb-org-shell The code in the dockerfile: RUN apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv EA312927 RUN echo &…
PHP Xdebug Netbeans Breakpoints
After working fine, with no config changes for months xdebug/netbeans is now useless. I can create breakpoints but whenever it has ‘stepped in’ to a further scope its impossible to step thru and simply jumps out of the inner scope to the caller. There are no exceptions generated. Using tail -f xde…
Apache Access Control to IPs (X-Forwarded-For) or valid-user
I used to block access to certain folder of my Apache server using valid-user or ip directive, like the following: Now, I have placed my server behind an F5-BIGIP device which won’t let me fully DNAT client’s connections. The device is also behind a Linux server that serves as gateway with DNAT/SN…
how to keep a subprocess running and keep supplying output to it in python?
I am not able to keep alive a tunnel created by subprocess to fire multiple commands. first i tried this to execute a subprocess then i tried this in first case it executes the commands and then exits the gdb making it impossible to keep suplying commands to gdb and in second case it does not execute after b …
chmod: changing permissions of ‘my_script.sh’: Operation not permitted
when I’m trying to make shell script that error is shown ,what i must do ?? [sudo] password for rehamadel: [rehamadel@localhost bin]$ ls -l my_script.sh Answer Resolving the operation not permitted error: You created the file via: This means, the owner and group of the file is root. You are not allowed …
How to use source command within Jenkins pipeline script
I recently rewrite bash execution command into Jenkins pipeline. The old code is like Now I use pipeline script to wrap the command, like this However, I got an error, as…/.jenkins/script.sh: line 9: source: environment.sh: file not found. When I try to less environment.sh, it display correctly. So I su…