Wake Up with Bash

Like so many, I have problems sleeping… and waking up. While I’m not sure what to do about making myself fall asleep faster (the mind just won’t turn off), I am now using this method of waking myself up. It has worked wonderfully for the past week. I have had about 6 hours of sleep each night, and wake up completely refreshed and ready to go. Before this, I would get 7-8, and sometimes 9 hours of sleep, and would wake up dead tired and completely unmotivated; all I wanted to do was check for urgent mail, and fall back into bed. Needless to say, I’m loving the extra few hours in the morning. Maybe I’ll eventually become a “morning person.” (I like the theory of early morning wake up, but I generally hate it in practice :-)).

My method for the “quiet” alarm was to schedule my wake up in Evolution, and have the appointment alarm execute “banshee –play”. I would have a Banshee instance running, paused on a quiet song that would slowly increase volume. Subsequent songs in the wake up playlist would be fairly mellow. The idea is to have the first song fade in, so there’s no abrupt noise to jolt you awake. The fall back alarm is your typical buzzing alarm clock we all despise.

The Evolution approach has actually been fairly annoying. I don’t always like to wake up at exactly the same time, so having recurring wake up appointments just leaves me having to edit the appointment each night. So tonight I wrote a simple timeout shell script that takes a string that is passed to the date program to calculate a timeout.

$ ./wakeup.sh 8am && banshee --play
Terminating on Tue Nov 1 08:00:00 EST 2005
Expires in: 06:12:19

That’s pretty simple. It will then show the full date/time string, so you can verify date properly parsed your wake up time string, and then it will count down the number of hours, minutes, and seconds before “expiring.” This is nice because it gives you an idea of exactly how much sleep you may get (provided you can fall asleep shortly thereafter). When it expires, it will either exec the second argument, or just quit if no second argument was specified, so you can use it just like sleep.

For those interested, the script is here. Happy waking up!

Oh, and Banshee 0.9.9 was released.

Mono Development Best Practices

After seeing much code over the past few months that uses some not-so-good practices (myself being the producer of some of the code that fell into one or two of these), today I started the Best Practices page on the Wiki.

I’d like to get a tentative list of these “best practices” going that I can then roll into a more useful, organized, and verbose list in a few weeks. I think it will be very beneficial to anyone who develops under mono, especially newcomers, to be able to glance at this list to keep from falling into these not-so-obvious traps that seem to be repeated here and there. Awareness, awareness, awareness!

So if you have an item to add to the list, please do so. If you don’t have write support on the Wiki, just mail them to me (aaron aaronbock net)… or feel free to add them as comments on this entry.

Parallel Mono Installs

I am finally running a sane version of SUSE 10! Having been running Beta 2 for over a month, it feels good to be running a desktop that doesn’t make me feel like my laptop is 10 years old (Nautilus was buggy and sloooooww).

For the first time I now desire to keep the distro-provided Mono stack, but need newer tools from source to do my own development. Today I set up my development environment again, and documented having parallel mono stacks on the Mono Wiki.

This is just a basic environment setup, so if anyone has some nice tweaks for their own parallel environments, please update the page!