4 tricks to speed up ssh connections

I use ssh connections to manage remote servers it’s one of the main task in my work, so over time I’ve learnt some tricks to speed up the connection phase of the ssh protocol, so in this article I’ll show you how to: Configure ssh to use ipv4 only Configure ssh to use a particular [...]

Linux Shell: DF and DU report different values

Sometime it happen that the command df and the command du report different results such as: df -h /tmp Filesystem Size Used Avail Use% Mounted on /dev/vzfs 16G 12G 4G 75% /tmp While a du command show somethign different such as: du -hs /tmp/ 10G /tmp/ There are usually different reason when this happen.

Linux Shell:Timeout

Sometimes it’s useful to write a bash script that do something like “Do this job, if it’s still running after XX second kill it”, how to implement this in a normal bash environment ? Nothing simpler: Use the timeout shell command to achieve this. From its info page: timeout runs the given COMMAND and kills [...]

Linux shell:lsblk

While installing a new computer (soon a post on my new arch-linux laptop) I’ve re-discovered a command that I don’t use frequently, but that can be really useful : lsblk lsblk lists information about all or the specified block devices. The lsblk command reads the sysfs filesystem to gather information. The command prints all block [...]

Linux shell: Introduction to Flock

Recently a colleague of mine should run multiple parallel jobs on a server (around 20 in our specific case), every job does “an elaboration” and this can take a time longer or shorter in respect of the others, once a job finishes its task it must read from a text file the first line that [...]