Jun
7
Debian: Naming USB devices with uDev
June 7, 2009 | Leave a Comment
I use three different small backup drives as three backup volumes. I turn them on on sunday, the backup scripts runs overnight, and I turn them off on monday morning. I’ve shared the backup script in a previous post.
The problem is that the backup script starts by mounting the backup drives. It expects them to have the same device name in /dev everytime. For example, it expects backup1 to be /dev/sde1. It turns out that these assigned device names can randomly change. Sometimes, backup1 appears as /dev/sdh1. The solution, in this case, is to assign a persistent name to each device. That is what udev is for. Udev will be called when a drive is plugged. If the plugged drive match a udev rule, it will be assigned the name defined in the rule.
The first step is to find criterias that will allow to identify a single drive and then create a rule for it.
Run the following command for the drives you need to name (replace sde1 by what you need):
In my case, I get the following result:
KERNEL==”sde1″
SUBSYSTEM==”block”
DRIVER==”"
ATTR{start}==”63″
ATTR{size}==”2930272002″
ATTR{stat}==” 48 1558 3506 228 19 0 38 248 0 156 476″looking at parent device ‘/block/sde’:
KERNELS==”sde”
SUBSYSTEMS==”block”
DRIVERS==”"
ATTRS{range}==”16″
ATTRS{removable}==”0″
ATTRS{size}==”2930277168″
ATTRS{capability}==”12″
ATTRS{stat}==” 60 1573 3722 504 19 0 38 248 0 348 752″looking at parent device ‘/devices/pci0000:00/0000:00:02.1/usb2/2-4/2-4:1.0/host4/target4:0:0/4:0:0:1′:
KERNELS==”4:0:0:1″
SUBSYSTEMS==”scsi”
DRIVERS==”sd”
ATTRS{device_blocked}==”0″
ATTRS{type}==”0″
ATTRS{scsi_level}==”3″
ATTRS{vendor}=="ST315003"
ATTRS{model}=="41AS "
ATTRS{state}==”running”
ATTRS{timeout}==”30″
ATTRS{iocounterbits}==”32″
ATTRS{iorequest_cnt}==”0×57″
ATTRS{iodone_cnt}==”0×57″
ATTRS{ioerr_cnt}==”0×0″
ATTRS{modalias}==”scsi:t-0×00″
ATTRS{evt_media_change}==”0″
ATTRS{queue_depth}==”1″
ATTRS{queue_type}==”none”
ATTRS{max_sectors}==”240″
…
I have outlined the unique values and criterias that will allow me to identify backup1. I also outlined the subsystem lines that will be used in the udev rule.
The rule that will match this drive is:
More information about udev rules can be found online.
That done, you can test our rule by launching the following command:
If the rule matched the drive, you can ls /dev/disk/by-label and find backup1 in the list.
You can now edit the backup script and replace mount /dev/sde1 by mount /dev/disk/by-label/backup1. The latter should always refer to the right drive.
Thanks to the authors of the following two guides that lead me to this solution:
Apr
15
Debian: remove unused packages
April 15, 2009 | Leave a Comment
Two days ago, I ran into a strange problem with my email server which refused to send any more emails. It turned out my hard drive was full… I started by emptying the tmp directory and running aptitude clean and aptitude autoclean but that wasn’t enough to free enough space to allow me to breathe for long. Some Googling lead me to deborphan, a package that will list packages installed because they were once a dependancy but that are now useless to the system. Those packages identified, I just had to remove them all.
A few commands to do the same thing:
Now my server can breathe and so can I.
Apr
15
Debian, read the bootup messages
April 15, 2009 | Leave a Comment
While Debian boots, several warning, error or information messages appear and quickly disappear from the screen. If you wish to log these messages in order to consult them later on, you need to enable the bootlog by editing a single configuration file.
The file should say something like
Simply ,change it to
You should now have these messages logged in /var/log/boot.
Apr
14
Access Subsonic via Apache
April 14, 2009 | Leave a Comment
I have setup Subsonic on my server last week as a standalone applicaiton. That means that Subsonic runs its own webserver. The only drawback of this method of deployment is that, to access the application, I had to type http://<subsonic server>:8080.
To access Subsonic while using port 80, I enabled the mod_proxy and added a VirtualHost as follow.
To enable the proxy module, run :
To access Subsonic via Apache, create a Virtual Host similar to the one below :
ServerAdmin <email>
ServerName subsonic.<subsonicserver>.com
ServerAlias subsonic
ServerSignature Off
<Proxy http://127.0.0.1:8080>
Allow from all
</Proxy>
ProxyPreserveHost on
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
Link Summary
Apr
9
Install Subsonic on Debian Etch
April 9, 2009 | 1 Comment
Subsonic is a web application allowing you to stream or download your music collection over the Internet. It is the newest application of the kind after the famous Ampache and Jinzora. I have recently tried Ampache but was disapointed by the user experience so when Framasoft added a notice about Subsonic, I was immediatly interested.
The installation is pretty simple:
- Download the standalone version
- Untar the downloaded archive in the directory of your choice for example /var/subsonic
- Edit subsonic.sh if you feel you need to change the default settings (port or memory allowed)
You are now ready to launch subsonic by running subsonic.sh
To use Subsonic, connect to http://<your_server>:8080
Connect using the admin:admin account and you should now see the Subsonic main page.
To add music to your collection, browse to Music Folder and add your music collection, for example
Rock /mnt/data/music/rock
You can now log out, sign in using your user and enjoy your music from anywhere

Subsonic Main page
One nice feature offered by Subsonic is to reencode your music to a lower bitrate to limit the bandwidth usage, to do so, you need Lame. Download the lame archive from the official site, untar it, and rename the generated folder to “lame”. Then, copy this folder to /var/subsonic/transcode. You’re all done. Enjoy
Browse to the settings and immediately change the admin password. You can then create a new user for yourself.
Link Summary
Mar
29
World Gone Web Mobile
March 29, 2009 | 1 Comment
Thanks to a post on Rob Gray’s blog I discovered WP Touch, a wordpress plugin that offers an optional mobile interface to iPhone/iPodTouch users visiting your blog. The result for this blog is as follow :
The plugin will leave your mobile visitors the possibility to browse your regular site by turning off the Mobile Theme option in the footer of the page.
Feb
18
Debian: from Etch to Lenny
February 18, 2009 | Leave a Comment
Today (or yesterday as I write), Debian Lenny was released. If you with to upgrade, the procedure is as follow:
- Edit /etc/apt/sources.list and replace all occurences of “etch” by “lenny”
- run apt-get update or aptitude update
- run aptitude upgrade
- run aptitude dist-upgrade
The little discovery I made tonight was that apt needed keys to update the package list. Sometimes these keys need updated.
Here is the message I was getting when running aptitude update:
W: There are no public key available for the following key IDs:
A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems
#
There is the command apt-keys update to fix that issue. Still, tonight, that didn’t do it for me. The trick was to proceed as follow:
A70DAF536070D3A1apt-key add /root/.gnupg/pubring.gpg
apt-get update
I’m now updated to Lenny and it looks as though my email server is down. Might turn out to be a long evening.
Feb
15
Customize Windows XP to look like Mac OS X
February 15, 2009 | Leave a Comment
I frequently use Mac OS X, Windows XP and Linux (Debian, KDE4). I have a MacBook which I use by default to browse the Internet, answer email, etc. I turn on my desktop computer and run Linux if I’m about to edit a video. If I am about to code a little something from home, I’ll turn my desktop and run Linux. Of the three OS, Windows XP has the least enjoyable default interface. I usually customize it to make it look more like the MacBook one.
The launcher
First thing I do is install a launcher (to replace the missing Mac OS X Spotlight). I use Colibri. I have also tried Enso Humanized.
The Dock
The second thing I really miss is the Dock. On Windows I have used Rocket Dock, Object Dock and RK Launcher to replace this important item. Currently I am running RK Launcher and totally hid the Windows taskbar. There is a theme for RK Launcher shared on DevianArt by Asdrubale88 to make your dock look just like the Leopard one.
The theme
At work, on my windows, I run Rocket Dock and HUmanized Enso as a launcher and didn’t go any further. But on my home computer, I always change the default theme to use either or Panther or a Leopard one. There are several availalbe but I usually look for one on Deviant Art or on CrystalXP.net. Right now, I am trying with the MacOSXSmooth from CrystalXP.
The Desktop wallpaper
If there is one thing I hate about Windows it’s the default wallpaper with the hills. It never stays on my computer more than 10 minutes after installation. I usually replace it by no wallpaper at all until I have time to look for something else. A good place to start is interfacelift. At the moment, I am using the Apple logo centered on a black backgroung.
The cursor set
It is possible to go further than that and also change the mouse cursors set. An easy to install Mac OS X cursor set is available on Usher.
Expose
If you really want your windows to emulate Mac OS X you can also install an equivalent to Expose like Shock Aero 3D.
More information
I have been doing this [customize Win XP to look like mac] for quite a while but just had to do it again on a reinstallation of my home computer. To find most of these informations back, I read through this post on WikiHow.
Link Summary
- http://www.samanthaha.../2009/02/desktop1.jpg
- Colibri, type ahead
- Enso Humanized
- Rocket Dock
- ObjectDock
- RK launcher
- DevianArt: RK Launcher theme
- DeviantArt where art meets application
- CrystalXP
- Mac Os X Smooth theme
- http://www.samanthaha.../2009/02/desktop2.jpg
- InterfaceLift
- InterfaceLift
- Usher, techblog by Damian Gaweda
- ShockAero3D
- http://www.samanthaha.../2009/02/desktop3.jpg
- Pimp Your Windows to ...ok like a mac desktop
- WikiHow
Jan
31
How to fix Apple Mail
January 31, 2009 | Leave a Comment
Today, I experienced my first big bug with Apple Mac OS X 10.5 running on my Mac Book. I’ve used this laptop for a year and 3 months. I can easily tolerate a bug a year and be a very happy user, nonetheless, bugs need fixed.
Today, after turning on the laptop, Mail refused to run. It started, displayed my inboxes and accounts then crashed displaying: “Mail quit unexpectedly, ignore, report or relaunch”. After relaunching, the same thing happened… I reported the issue to Apple but didn’t wait on their answer to try a reboot (a Windows user instinct). The same thing happened all over again.
Finally, I found the solution:
- Go to ~/Library
- Move the Mail folder mv Mail Mail.old
- Run Mail. Everything works. Click Next then Done.
- Close Mail
- Move the newly created (and almost empty) Mail folder mv Mail Mail.new
- Move the original Mail folder back where it was mv Mail.old Mail
- Restart Mail and hopefully, everything is fine.
Easy enough and actually a lot less painless than rebooting.
See you in a year for my next Mac OS X bug fix.
Jan
24
Installing Qt4 on Mac OS X
January 24, 2009 | Leave a Comment
I wanted to install Darwin Ports in order to install Qt4 on my Mac but that turned out unsessfully for me. Qt4 would install but I was unable to locate qmake in order to compile a Qt4 application.
Anyway, I found another way to acomplish this (which might also make it possible to install Amarok2 later on) using the KDE4 for Mac OS X packages availalble at mac.kde.org/?id=download. All you need to download and install are the first two packages “Base System” and “Qt4.4″ (respecting that order).
The installation completed qmake is available from /opt/local/bin/qmake.
To install a Qt4 application, it’s simple.
- Download the source and unzip it.
- Using the terminal, cd into the directory
- run /opt/local/bin/qmake
- run make
- run sudo -c “make install”
Using Spotlight, you should be able to run the installed application.
I tested it with QtMPC (a MPD server client)



