Sometimes, especially during work in lab environments we need to stop all our instances ie. to avoid additional charges from cloud operator. Openstack offers a convenient way to do it – shelving. When you shelve an instance all machine’s volumes are saved but VM instance does not utilizing compute host resources. This state persists until you unshelve a specified machine. Openstack does not offer option to shelve/unshelve of all your instances at once, you need to do it on every machine separately. This simple bash script gives you an ability to shelve or unshelve all machines at once. Continue Reading
Bash
DU command doesn’t take into account hidden files and directories. For example if you want check disk usage of all files and directories in current directory you can use the following command:
$ du -sm *
Unfortunately this command doesn’t show hidden files and directories. Continue Reading
Suppose we have text with vowels. Vowels are special characters used in some languages to mark a special sound. Example with Polish characters:
$ echo "ąćęłńóśź" ąćęłńóśź
Sometimes it’s necessary to quick show differences between two outputs of two Linux commands. You can dump stdout into separated files of course and process them later but fortunately there is a simpler solution.
Imagine that you want compare output of two executions of ‘ps’ command – first execution now and the second after 10 seconds. You can use ‘diff’ command to show differences side-by-side (-y option).
$ diff -y file1 file2
Now let’s replace file1 and file2 by input streams (< char) from ‘ps’ command. Continue Reading