Howto Get Enough Sleep Despite StumbleUpon with Ubuntu

What?

I am a long-term StumbleUpon user, which means that I don’t get much sleep. Now, after almost 4 years of stumbling, I have decided to get my life back. Well, at least some sleep!

What does this do?

Every night when I have to work on the next day (Sunday night to Thursday night ), at 23:25 my computer shows me this little warning message:

go to bed warning

After the 5 minutes have passed, the computer shuts itself automatically down.

I use this little trick with Ubuntu, but it should work anywhere where Gnome is installed.

How?

Thanks to the power of Linux, this is not difficult to do for yourself, and configure it however you want it to behave:

  1. Open /etc/crontab with your favourite text editor (no need for crontab -e since this is the system wide crontab), e.g.
  2. Add the following lines (replace manker with your username!)

  3. The first part of both lines 25 23 * * 0-4 means that the commands are executed at 23:25, but only Sunday (day 0) to Thursday (day 4). Read man 5 crontab for a detailed description of that format.
  4. The first command uses zenity to show a warning message. You have to execute this as the same user that you use for working, or you will not see the message, so change manker to your username (root does not work either).
  5. The second command shutdown -h +5 means that the computer will halt in 5 minutes. This has to be run as root, and it also shows nice warning messages in all your open terminals so you can’t really miss it.
  6. Save the file, and stumble until it is 23:25.

Sweet dreams!

Recovering from Hack

Hi fellow readers, two days ago I have noticed that my blog got hacked. Somebody has used php injection to add lots of links to dubious sites to my blog. This was invisible to the browsers but very much for search engines, and as a result I have been kicked out of the google index. Oh well. I have just upgraded to the newest version of wordpress, and the content is back too. While I am at it, I will also select and customize a brand new theme to make this site look uber-cool and hip again. That means that this site’s look might change several times within the next few days, I hope everything will be back to normal and sleek looking by the end of the week.

UPDATE

It looks like everything is back to normal again, wohoo! I have done a clean install with the newest release of WordPress, and configured more strict access rights in .htaccess. I have even found a cool looking theme that I like better than the last one 🙂 This version also has much better anti spam filtering.

Get More Space Out of Your ext3 Partition

I have just discovered that ext3 defaults to reserving 5% of its partition exclusively for root, as a precaution measure that your system does not get FUBAR when you use it for your root partition. I have a 230GB external USB disk that I use for all my big storage requirements, downloaded stuff, backups etc. Due to this reservation I had 11.5GB of unusable disk space, thankfully this is easy to fix:

Replace sdf1 with your partition name. You don’t even have to unmount your disk. Voilá, 11.5 GB more space for free 🙂 Here is the output of df -h as proof:

Before:

After:

If you like this, you might also be interested in How to change Ubuntu forced fsck.

Update: The free space limitation is also used to prevent fragmentation. So if you set the limit to zero and operate on a very full harddisk for a while, your filesystem might slow down.