Letting Go (of domain names) Is Never Easy

So, I have registered a few more domain names than I really need. The domain names are usually a result of this:

  1. I get a good (or bad) idea for a web site project
  2. I think of good (and bad) domain names for the project
  3. I register a domain name for the web site
  4. But, because I already have work, family and a whole bunch of existing projects to attend to, I never get very far with implementing the web site

Then, a year later, the domain name needs to be renewed. One possible action:

A slight hope of continuing the project and some squirreling tendencies makes me renew the domain registration.

Another possible action:

Let the domain name registration expire.

But it does not feel good at all:

No! Not one of my domain names! They are part of the family! If I let them expire they will be bought by someone running a parked domain monetization scheme!

I actually counted to three domains of mine that will expire during the months to come. And then there are a couple of domain names I want to register if they become available… Letting Go Is Never Easy!

Btw, have you tried my Google Apps™ Test service? It checks if a domain name is connected to Google Apps, the Google Apps mail service, Google Sites or Blogger.

Network printer power-on when needed

My FreeBSD server is now equipped with a TellStick for control of 433.92 Mhz wireless remote switches. Our home is not (yet 🙂 fully controlled by remote switches but we have a few of them now. One of the features I wanted was to control some lights but for some reason the TellStick in the server closet does not reach one of the remote switches so I might get an extender for that later on.

Something that seems to work very well is remote control of a 230V fan (actually an old dual-fan PSU, but it’s a temporary solution) in the server closet. The server closet is next to our bedroom so in order to get rid of some noise at night I now use the TellStick to turn off the fan at 22:00 and start it again at 8:00.

The hack that this blog post is about is meant to power-on my networked HP LaserJet 2200 on demand.  We seldom print everyday so it’s rather pointless to have the printer on all the time. I implemented this solution for fun and I’m not sure that I’m going to keep it.

I thought for a while about how to detect when any computer on the network was trying to print, and I decided to try to listen for ARP who-has requests. This is (almost) the script I use:

/usr/sbin/tcpdump -i em0 -q -l -n arp dst host 2>/dev/null |
while read line; do
  /home/david/bin/printer.sh 1 > /dev/null 2>&1

As you might deduce from the script it will try to turn on the printer for every ARP request for the printer IP address. This will cause more power-on signals to be sent than necessary, but I call that a feature! 🙂

The printer.sh script looks like this:

`dirname $0`/nexa.sh D 2 $1

And this is the nexa.sh script:

/usr/local/bin/sudo `dirname $0`/rfcmd LIBUSB NEXA $1 $2 $3

Rfcmd is a command line tool for interfacing with the TellStick. I run it as root and I use libusb for the USB support.

A future improvement could be to turn off the printer after it’s been unused for a certain time, but now I simply call printer.sh to turn it off at midnight.

I don’t know if it is bad for the printer to cut the power but it already has a serious smear issue so I’ll only keep it until the toner runs out and then buy a new printer. Brand new networked laser printers with duplex start at €200 here in .se so it shouldn’t be too expensive to get one with good Linux support when the time comes.

Moving IMAP accounts from Courier to Google Mail

I ran imapsync on my mail server like this to move a couple of accounts away from my server:

imapsync  –syncinternaldates –host1 localhost –user1 user –password1 secret  –host2 imap.gmail.com –port2 993 –ssl2 –user2 [email protected] –password2 secret  –authmech1 LOGIN –authmech2 LOGIN –split2 100

(WordPress is a bit too clever, so — above means two hyphens. Sorry.)

Parts of the output looks weird but everything seems to work anyway. For example:

Host imap.gmail.com says it has NO CAPABILITY for AUTHENTICATE LOGIN
Success login on [imap.gmail.com] with user [[email protected]] auth [LOGIN]

Spotify Mixer DJ Software

This is not a new idea. A Swedish forum has a discussion thread Dj:a med Spotify that suggested the same thing months ago.

With both despotify and libspotify available, someone with time and interest could make something like UltraMixer but with Spotify as the main source of music. A DJ with this application would have the world’s biggest record crate!

Some possible obstacles:

  • Playing more than one song at a time. Could be solved with multiple Spotify accounts.
  • How does streaming affect BPM and changing pitch? Use a big cache?
  • Maybe the libspotify Terms of Use has some restriction affecting this

I will also suggest Spotify integration to the UltraMixer developers. Maybe that could earn me a “Professional” license? 🙂

By the way, has anyone made a uniform interface to despotify and libspotify so that they can be used interchangeably?

SSL certificate anguish revisted

About one year and one month ago I wrote about SSL certificate anguish. Recently the certificate has expired so I wanted to create a new one. Unfortunately the apache2-ssl-certificate tool went missing and as my server runs Ubuntu 8.04.2 (Hardy) it’s simply not there!

I did this to create the new self-signed certificate:

  1. Download the apache2-common package for Dapper
  2. Extract it with dpkg-deb
  3. Install /usr/share/apache2/ssleay.cnf and /usr/sbin/apache2-ssl-certificate manually
  4. Run apache2-ssl-certificate --force -date 365
    (There should be two dashes before “force” and one dash before “date”. Very logical, and WordPress might not show it properly.)

Maybe I should have increased the time the certificate is valid to more than that, but then I won’t get the chance to revisit this blog post in about a year… 🙂

Tired of Lighttpd

The initial VPS package I ordered did not have very much RAM so I decided to run Lighttpd. Since then I have upgraded the VPS to a pretty luxurious package so the RAM limitation hardly applies anymore.

I still haven’t moved all my websites from the old server to the VPS and I just realized that a big threshold is moving the web server configuration from Apache to Lighttpd. Now I plan to revert to Apache on the VPS before migrating more websites.

Lighttpd is not bad, but I’ll save it for simpler setups than my 20+ virtual hosts  including multiple forums, blogs, wikis…

My laptop is back from service

After the RAM failure I procrastinated for two weeks before sending the laptop to service and then it took a month (including Christmas and stuff) to get it back. After service they tried to return it to the wrong address by changing the first letter in the street name from S to T and dropping the first digit in the street number. Weird.

According to the notes they only changed “planar” (motherboard in ThinkPad lingo, I think) and “palm rest” but the latter looks the same to me. I just hope that everything works so I don’t have to send it again.

Update I inserted the hard disk, booted memest86 from the grub menu and let it run a few tests. After that I pressed Esc to exit memtest and it said “Halting” but it didn’t shutdown so I powered off. Booting again never lights up the screen! I did see that the display problem was not fixed though. Pretty annoying.

Update 2 next morning The screen lit up properly and the laptop tried PXE boot as I had removed the hard disk drive again. I need to investigate further.

Moved the first Ruby on Rails site from Apache to Lighttpd

Yesterday I managed to move the first Ruby on Rails site to its new home on the VPS. The move had been easier if I hadn’t decided to use Lighttpd this time around, but finally I got everything working. The site I moved is only the administration interface for the energy drink database used by taurin.se, but now I should be able to move that site too. The administration interface should probably also be upgraded from its ancient Ruby on Rails version, but I’m saving that for later. (Technical debt again?)

The Ruby on Rails parts of my Lighttpd configuration currently consists of a $HTTP[“host”] conditional like this:

$HTTP["host"] == "admin.taurin.se" {
    var.site = "admin.taurin.se"
    var.RAILS_ENV = "production"
    include "incl-rubyonrails.conf"

And the hopefully reusable include file incl-rubyonrails.conf looks like this:

server.document-root        = basedir + site + "/public"
server.indexfiles           = ( "dispatch.fcgi", "index.html" )
server.error-handler-404    = "/dispatch.fcgi"

fastcgi.server =  (".fcgi" => ( site =>
"socket" => "/tmp/" + site + ".fastcgi",
"bin-path" => basedir + site + "/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => RAILS_ENV )

The var.basedir variable is also set before including the file above.