25 October 2011

bash: skip X lines of a file or command output

If you wish to cat a file or remove the first X lines from a command output, you can use the tail command, this way:
tail -n+(X+1)
So if you would like to skip the first line, the command will be: “tail -n+2” (X=1). For the 3rd line, the command will be: “tail -n+4” (X=3).

20 October 2011

nginx - unknown directive "ssl" in nginx.conf

When you configure nginx, add the “--with-http_ssl_module” option.
Please note that this will require the OpenSSL library to be installed.
apt-get install libssl-dev

13 October 2011

XEN: Error: Device (vbd) could not be connected. Failed to find an unused loop device.

I was getting the following error
Error: Device 51714 (vbd) could not be connected. Failed to find an unused loop device
In order to fix it, check how many loop devices are in use:
# losetup -a
Then check how many loop devices are defined:
# ls -la /dev/loop* | wc -l
If you need to increase this number edit or create the /etc/modprobe.d/local-loop.conf with the following line:
options loop max_loop=128
This will create 128 loop devices. Now you should reboot the machine or reload the loop module (with all guests off):
# rmmod loop
# modprobe loop

12 October 2011

XEN - How can i exit the XEN console?

In order to exit from the XEN console, use the following combination of keys:

Ctrl + ]