OpenVPN comes with example-scripts to update /etc/resolv.conf using "resolvconf" or systemd-resolvconf. I don't use one of them therefore I modified the script so that it simply changes /etc/resolv.conf directly. I placed a variable "IMMUTEABLE" in this script. If IMMUTEABLE is set to 1, this script will change the fileattribute of /etc/resolv.conf to immuteable. In that way it is possible to prevent other programms like dhcp-clients to change /etc/resolv.conf while openvpn is running.
GNU parallel is an amazing command line tool for executing jobs in parallel using one or more machines. It has a lot of features and therefore a lot of options. Fortunately the manual page is full of examples.
Most linux-users know $OLDPWD. It's an environment variable to get the recently used directory. Sometimes it would be nice to remember more visited directories. In such cases pushd and popd would be a good choice..
Most common shells do have a directory stack. By looking in the man-page of bash I found the following description of the DIRSTACK:
echo error >&2
A sysadmin needs his tools. I really need at least 3 tools to be productive:
Terminal-Emulator (or screen/tmux if I am working without X)
This is my Rule Of Three. Those 3 tools can make my life much easier. Therefore I have to choose those tools wisely. And of course I have to know them very well, so I can get all the benefits of them. In this article I want to introduce one of my "favourite" shells: zsh
Sometimes it is useful to compare to directories and display the differences. diff can do the trick for you
diff -r dir1/ dir2/
If you just want a overview about the differences then just use "brief":
diff --brief -r dir1/ dir2/
git can show you the differences too, and it can do it colorful if you want
git diff dir1/ dir2/
dr@tardis> for i in `ls -d *`; do du -hs $i; done 4,0K cron-job.txt 48K etc 4,0K install.sh 4,0K README.Debian.TXT 4,0K README.TXT 16K usr