~
~
:wq

Wednesday 1 February 2012

Touchpad freezes sometimes in Ubuntu 11.10. Workaround

Randomly and fortunately not too often (maybe two or three times in the last 5 months) the mouse cursor freezes on my laptop (Ubuntu 11.10 64Bits). This usually happens when using thunderbird, however I don't have a test-case to report to launchpad yet.

This is quite annoying and what I did in the previous occasions was to hit CTRL-ALT-F1 and restart lightdm.

However It has just happened once again right now, so I did a quick search and I've found a clean workaround to bring (activate) the touchpad again. Simply launch a terminal (ctrl-alt-t) if you already don't have one at hand and execute:

synclient TouchpadOff=0

Credits to effenberg0x0 from ubuntu forums.

Synclient (from it's man page): is a program that lets you change your Synaptics TouchPad driver for XOrg/XFree86 server parameters while X is running.

Further info:

  • man synaptics
  • man synclient

Thursday 5 January 2012

Quick check of services status

This is just quick and dirty post.

A oneliner to check if all your server services have started rightly after a reboot. This first attempt is aimed for Debian and derivatives:

checkservices () { for service in /etc/rc2.d/S*; do STATUS=$(/etc/init.d/$(ls -l $service | awk '{print $NF}') status 2>/dev/null); [ "$STATUS" != "" ] && printf "Status of ${service##*/}:\t$STATUS\n"; done; }

Example:

root@server:~# checkservices
Status of S04openvpn:    * VPN 'server' is running
Status of S05bind9:      * bind9 is running
Status of S05dhcp3-server:      Status of DHCP server: dhcpd3 is running.
Status of S05sysstat:    * sadc cron jobs are enabled
Status of S06postfix:    * postfix is running

Make it portable (Did I said that this was a quick and dirty post?) :-D

checkservices () { for service in /etc/rc$(runlevel|awk '{print $NF}').d/S*; do STATUS=$(/etc/init.d/$(ls -l $service | awk '{print $NF}') status 2>/dev/null); [ "$STATUS" != "" ] && printf "Status of ${service##*/}:\t$STATUS\n"; done; }

Example (centos server):

[root@server ~]# checkservices
Status of S05kudzu:     kudzu has run
Status of S06cpuspeed:  cpuspeed is stopped
Status of S07iscsid:    iscsid (pid  1980) is running...
Status of S08ip6tables: Firewall is stopped.
[...]