Archive for October, 2011

Check the number of arguments in a bash script

October 30, 2011 Leave a comment

My bash script requires a parameter. How to check its presence?



if [ "$#" -ne 1 ]
      echo "Usage: $0 <input_file>"
      exit 1
# else
# work with "$1" ...
Categories: bash Tags: ,

Gmail Strikethrough Button

October 26, 2011 Leave a comment

Greasemonkey script here.

Tip from here.

Categories: google Tags: , ,

Books on graphs and graph algorithms

October 26, 2011 Leave a comment


Categories: algorithms, graphs


October 25, 2011 Leave a comment

“Nothing happens unexpectedly, everything has an indication,
we just have to observe the connections.”

Disasters Information Service · Emergency Communication · Budapest, Hungary

Find RSOE EDIS on Facebook too.

See the facts that your government doesn’t want you to know…

Categories: Uncategorized Tags: , , , ,

Ubuntu 11.10 — Oneiric Ocelot

October 25, 2011 Leave a comment

The upgrade went well. Here I collect some notes.

If you right click on the Desktop, you’ll notice that the “Create Launcher” option is gone :( Here is how to get the dialog:

gnome-desktop-item-edit ~/Desktop/ --create-new

For this you need the “gnome-panel” package installed. Tip from here.

I still find it very frustrating that there is no bottom panel. When I launched “gnome-panel”, it also added a top panel which hid the Unity panel :( But I found a working solution: add “gnome-panel” to the list of startup applications and log out. When you log back in, you will have a basic bottom panel with the Unity top panel. Now it’s usable for me.

Ubuntu 11.10 switched from gdm to lightdm. So if you want to stop the X, use “sudo service lightdm stop“.

I had some problems with the terminals: sometimes they were not refreshed correctly, so the text became unreadable. Here I found a fix: open CompizConfig-Settings-Manager (ccsm), go to Workarounds, and turn on “Force synchronization between X and GLX”. (edit: it didn’t help… If you have a solution, tell me.)

The global menu is still annoying, here is how to get rid of it (tip from here):

sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt

If you want to enable the screen saver, check out this article.

To enable/disable autologin, go to Settings -> System Settings… -> User Accounts, Unlock it (top right corner) and perform your modification.

Install Microsoft core fonts:

sudo apt-get install ttf-mscorefonts-installer

Hibernate your Ubuntu

October 25, 2011 Leave a comment

Hibernating didn’t work on my laptop. Ubuntu said there was not enough swap space. Well, it was true, I only made a 1 GB swap partition while my laptop had 3 GB RAM.

I had an ext3 partition which was not completely full, there was 4 GB free space on it. First I made a backup of this partition to an external HDD. Then I resized this partition with gparted, cutting off 3.3 GB at the end of the partition. My laptop has 3 GB RAM so I made a swap partition that is a bit larger (just to be sure).

After that, following this SwapFaq guide, I could tell Ubuntu to use this new swap partition for hibernating.

Note that hibernating doesn’t work with swap files. You need a swap partition for that.

“The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible. swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache. The default setting in Ubuntu is swappiness=60.” (source)

Current swappinness value:

cat /proc/sys/vm/swappiness

How to change the swappinness value:

sudo vi /etc/sysctl.conf

Then change this line (or add it to the end of the file if it doesn’t exist):


Save file and reboot.

Hibernate from command-line

sudo pm-hibernate

I added a launcher to my Desktop with the command “gksudo pm-hibernate“.

Categories: ubuntu Tags: , ,

An interactive viewer for .dot files

October 24, 2011 Leave a comment

XDot is an interactive viewer for graphs written in Graphviz‘s dot language. See some screenshots here.


sudo apt-get install xdot


Categories: python Tags: , , ,

Ferenc (Franz) Liszt

October 24, 2011 Leave a comment

The famous Hungarian pianist Ferenc (Franz) Liszt was born 200 years ago on October 22, 1811.

Here is a nice parody with Tom and Jerry: Hungarian Rhapsody No.2.

Some links:

Categories: fun Tags: ,

Seconds in one year

October 24, 2011 Leave a comment

In 1 year there are about seconds.

Exact value:

365 * 24 * 60 * 60 = 31536000


>>> math.pi * 10**7


120074 seconds, i.e. 33.35 hours.
Categories: Uncategorized Tags: , , ,

From 12.04, LTS support is increased to 5 years

October 22, 2011 Leave a comment

Starting with Ubuntu 12.04, Canonical increases the LTS support from 3 years to 5 years. That is, 12.04 will be supported until 2017!

Normal releases are still supported for 18 months.

Announcement here.

Categories: ubuntu Tags: