ponedeljek, 24. september 2012

suspend/hibernate from command line

If you want to put your computer to hibernate from command line you have several options:
  1. echo disk | sudo tee /sys/power/state
  2. pm-hibernate
  3. pmi action hibernate #have to do sudo apt-get install powermanagement-interface before using it
If you want to put your computer to suspend from command line you have several options:
  1. echo mem | sudo tee /sys/power/state
  2. pm-suspend
  3. pmi action suspend #have to do sudo apt-get install powermanagement-interface before using it

nedelja, 23. september 2012

Toggle touchpad under Linux

If you want to toogle touchpad device under Linux, you have to do this:
sudo apt-get install unclutter

Put following lines into toggleTouchpad.sh:
          #!/bin/bash
deviceName="AlpsPS/2 ALPS DualPoint TouchPad"
isEnabled=`xinput --list-props "$deviceName" | grep -e "Device Enabled.*1$"`
if [ -n "$isEnabled" ]; then
    echo Disabling touchpad $deviceName
    xinput --set-prop "$deviceName" "Device Enabled" 0
    unclutter &
else
    echo Enabling touchpad $deviceName
    killall unclutter
    xinput --set-prop "$deviceName" "Device Enabled" 1
fi
 
Name of my touchpad device is AlpsPS/2 ALPS DualPoint TouchPad. You can find the list of all input devices issuing
xinput list
then you just have to guess what device it is :)
Then you can link this bash script to a keyboard shortcut and you are done.

There is also another way of doing this. Issu following command
synclient  TouchpadOff=1
If this command disables your touchpad then toogleTouchpad.sh might look like this:
#!/bin/bash

isEnabled=`synclient | grep -e ".*TouchpadOff.*0$"`

if [ -n "$isEnabled" ]; then
    echo Disabling device
    synclient TouchpadOff=1
    unclutter &
else
    echo Enabling device
    killall unclutter
    synclient TouchpadOff=0
fi
 

četrtek, 13. september 2012

Ubuntu 12.04.1 LTS and "Waiting for network configuration"

If you are running an Ubuntu 12.04.1 server and you see "Waiting for network configuration" message during boot and then another one "Waiting for 60 moreseconds for network configuration" then you have udev configured wrongly.

I got this error while cloning a VirtualBox VM and reinitializer MAC address for the network card. But if you have physical server, you probably changed network cards, ...

The solution is to check the file /etc/udev/rules.d/70-persistent-net.rules and see if you have more entries that you should have or the name of the subsystem is not the same as the network interface configured in /etc/network/interfaces or the MAC address is not right.

sreda, 5. september 2012

Theme change

I think it is time to change appearance of this blog. :)
What do you think?