Archive

Archive for January, 2013

.xsession-errors can grow HUGE

January 31, 2013 1 comment

Problem
Something funny happened to me today. I logged in to my desktop machine at my workplace when a warning message told me that “disk space is low”. A quick “df -h” indicated that it’s true, my HDD is at 100%! How is it possible, I should occupy no more than 30%. After hunting for 10 minutes for the guilty file/directory, it turned out that the file .xsession-errors in my HOME directory grew more than 200GB! WTF?

Solution
I removed this file and under the name .xsession-errors I put a link on /dev/null. However, after a reboot the symbolic link was gone and .xsession-errors became a regular file again. Tricky :) So I added the following lines to the end of my .bashrc file:

# .xsession-errors can grow huge... remove it
if [ ! -h $HOME/.xsession-errors ]
then
    /bin/rm $HOME/.xsession-errors
    ln -s /dev/null $HOME/.xsession-errors
fi

if [ ! -h $HOME/.xsession-errors.old ]
then
    /bin/rm $HOME/.xsession-errors.old
    ln -s /dev/null $HOME/.xsession-errors.old
fi

It verifies if .xsession-errors is a symbolic link. If not, remove it and replace it with a symbolic link.

Lock and unlock the screen from command line

January 30, 2013 Leave a comment

Question
Is there a way to lock/unlock the screen from a script?

Answer
The answer is “yes”. Lock the screen:

gnome-screensaver-command -l

Unlock the screen:

gnome-screensaver-command -d

Demo (lock the screen, then unlock it in 5 seconds):

gnome-screensaver-command -l && sleep 5 && gnome-screensaver-command -d

Tip from here.

How to disable the HUD’s use of the Alt key?

January 30, 2013 Leave a comment

Annoyance
Pressing the Alt key brings up the HUD. How to get rid of it?

Solution
http://askubuntu.com/questions/122209/how-do-i-modify-or-disable-the-huds-use-of-the-alt-key

Launch System Settings, then Keyboard -> Shortcuts -> Launchers. On Key to show the HUD, press Backspace to disable it.

Categories: ubuntu Tags: , , ,

Rip streamed audio

January 30, 2013 Leave a comment

Problem
You want to rip a streamed radio.

Solution

  • fetch StreamRipStar, which is a frontend for streamripper
  • install streamripper (via apt-get)
  • configure StreamRipStar, specify the audio stream’s URL and start ripping

Tip
If you want to rip Slay Radio (best Commodore 64 tunes!), use this address: http://relay3.slayradio.org:8000/.

Make room! Make room!

January 29, 2013 Leave a comment

Problem
Under Gnome/Unity, you want to increase the number of virtual workspaces.

Solution
Start CompizConfig Settings Manager (ccsm), then General -> General Options -> Desktop Size tab. Here adjust the horizontal and vertical virtual size.

The title of this post is a reference to a novel of Harry Harrison.

Categories: ubuntu Tags: , , ,

VLC gets stuck

January 29, 2013 Leave a comment

Problem
On my Linux box, VLC gets stuck sometimes and only the good old “kill -9” can shoot it out. Is there a single command to kill it?

Solution

alias killvlc='kill -9 `ps ux | grep vlc | grep -v grep | tr -s " " | cut -d" " -f2`'
Categories: bash Tags: ,

Online Convert(er)

January 27, 2013 Leave a comment

http://www.online-convert.com/

I wanted to convert a PDF with Calibre but it failed. I tried with Online Convert(er) too and it succeeded…

Categories: Uncategorized Tags: , , , ,
Follow

Get every new post delivered to your Inbox.

Join 72 other followers