Migration to a new lowpower server (Thinkpad T420)

November 24th, 2014

I recently bought myself a spar’o’meter, (kill’a’watt like device) which is able to measure the power usage of electrical equipment. To my horror I found that my “lowpower” AMD fusion based server consumed around 50 watt! Clearely something had to be done.

Luckily I had the right piece of equipment at hand. A lenovo thinkpad T420 with a broken/shattered LCD. Any decent laptop is built to minimize power consumption, so using an T420 alone would save on the electrical bill, but I went a bit further. More precisely:

  • Took off the (broken) TFT and disconnected it from the mainboar
  • Took out the bluetooth module
  • Took out the wireless module
  • Disabled all unneeded peripherals, serial ports, usb ports,
  • Bouht myself a 1TB WD red 2.5″, which consumes around 1 watt.
  • Removed the DVD drive.
  • Enabled maximum power settings in the bios.

I then put in 2 x 4GB of memory and together with the core i5 cpu, this would be a nice server with a built-in “ups”. On the software part, I migrated away from one big server years ago. I run esxi on my servers now. There was a small issue here, as ESXi 5.5 does not have support for the Intel Gigabit 82579 LM chip out of the ISO file.

This is not a biggie. You patch the iso with the correct driver for the E1000E chip using the esxi-customizer script and then you boot the customized .iso file.

I ended up with a esxi host that consumes 12 watt. A factor 4 better than my old AMD fusion based setup. And it feel snappier as well. The trade-off: I had to go from 2 x 2TB disks to 1 x 1TB. But that alone saved 10-15 watt.

About fixing Bluesound playlists after CIFS migration

November 2nd, 2014

I recently wiped TomatoUSB and installed OpenWRT Barrier Breaker on my Linksys E3000 based router. In that process I also migrated our FLAC collection from my x86 based server edison  to the OpenWRT router. Life was good….. until my wife complained that the her Bluesound playlists had stopped working.

Luckily I have root access to my Bluesound and can fix stuff like this. Heres the issue and the fix.

After the switch to OpenWRT the world look like this as seen from the Bluesound:

root@Stue /tmp/var/data$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root               903080    342168    515040  40% /
tmpfs                   127488        48    127440   0% /tmp
tmpfs                   127488        36    127452   0% /dev
/dev/mmcblk0p3         2778768     86668   2550944   3% /tmp/var/data
shm                     127488         0    127488   0% /dev/shm
//192.168.1.254/flac 153703308  74379356  79323952  48% /tmp/var/mnt/OPENWRT-flac

But a peek inside the playlist.db on the Bluesound shows the following

‘StoredPlaylist::files’ => ‘/var/mnt/EDISON-flac/Arvo Part – Alina/01-Spiegel im Spiegel (Version fur Violine und Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/02-Fur Alina (fur Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/03-Spiegel im Spiegel (Version fur Violoncello und Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/04-Fur Alina (fur Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/05-Spiegel im Spiegel (Version fur Violine und Klavier).flac
/var/mnt/EDISON-flac/Arvo Part – Alina/03-Spiegel im Spiegel (Version fur Violoncello und Klavier).flac’

Notice how the name of the CIFS server is part of the playlist entry. After figuring out the format of the playlist.db, it was trivially easy to write a little perl program to convert them. I did have to take care of some latin1 to utf8 as well, but that was also easy. For anyone who cares:

#!/usr/bin/perl -w
#
# convert_playlist.pl – version 1.0 gamma. Project hours: 1
#
# —————————————————————————-
# “THE WISHLIST LICENSE” (Revision 42):
# <zensonic@zensonic.dk> wrote this file.  As long as you retain this notice you
# can do whatever you want with this stuff.
#
# If you feel it saved your world a gift from http://amzn.com/w/2Y27QA7V5FUGU
# is highly appriciated
# —————————————————————————-
#
# Copyright 2014.11.01 by Thomas S. Iversen (zensonic@zensonic.dk)

use strict;
use Storable qw(nstore retrieve);

die “$0 <path_to_playlist> <regexp_match> <regexp_replace>” if(!($#ARGV+1 == 3));
my $filename = $ARGV[0];
my $regexp_match = $ARGV[1];
my $regexp_replace = $ARGV[2];
my $storable;

die “$filename does not exist\n” if(! -f $filename);
$storable = retrieve($filename);
foreach my $playlist (@$storable) {
my $name=$playlist->{‘StoredPlaylist::name’};
print “Converting playlist ‘$name’\n”;
$playlist->{‘StoredPlaylist::files’}=~s/$regexp_match/$regexp_replace/g;

# capital danish
$playlist->{‘StoredPlaylist::files’}=~s/\xc5/\xc3\x85/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xc6/\xc3\x86/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xd8/\xc3\x98/g;

# lower danish
$playlist->{‘StoredPlaylist::files’}=~s/\xe5/\xc3\xA5/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xe6/\xc3\xA6/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xf8/\xc3\xB8/g;

# lower swedish
$playlist->{‘StoredPlaylist::files’}=~s/\xe4/\xc3\xA4/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xf6/\xc3\xB6/g;

# capital swedish
$playlist->{‘StoredPlaylist::files’}=~s/\xc4/\xc3\x84/g;
$playlist->{‘StoredPlaylist::files’}=~s/\xd6/\xc3\x96/g;
}

my $filename_new=$filename . “.new”;
print “Saving playlist as $filename_new\n”;
nstore($storable, $filename_new);

Which I then ran as

root@Stue /tmp/var/data$ ./convert_playlist.pl stored_playlists.db EDISON OPENWRT
Converting playlist ‘Svensk jul’
Converting playlist ‘Hvid januar’
Converting playlist ‘Lektier’
Converting playlist ‘Moderne salmer’
Converting playlist ‘Total afslapning’
Converting playlist ‘P�ske’
Saving playlist as stored_playlists.db.new

And then the last part

mv playlist as stored_playlists.db.new playlist as stored_playlists.db
reboot

And restart the Bluesound app on the phone (it caches). Happy wife :-)

BluOS 1.12.1

November 1st, 2014

Yet another version with support for more streaming services. And yet again I found myself looked out of my player. I am getting faster and faster at regaining root on the player :-).

Cool that new features keep being developed!

Upgrading crucial M4 SSD firmware from grub2

October 28th, 2014

The download page for firmware for the Crucial M4 SSD have three options

  • One for windows 7
  • One for windows 8
  • One generic .iso for mac and windows

Lets for arguments sake think that someone have an x200s (no cdrom) with linux, then what? Actually not that hard:

sudo mount -o loop crucial-m4-070h-07-00.iso /mnt

sudo cp /mnt/boot/isolinux/memdisk /mnt/boot/isolinux/boot2880.img /boot/

sudo umout /mnt

sudo vi /etc/grub.d/40_custom

menuentry ‘Firmware Upgrade’ {
linux16 /memdisk floppy raw
initrd16 /boot2880.img
}

sudo update-grub2

sudo reboot

<hold shift for grub2 menu>

select ‘Firmware Upgrade’

Non-disruptive in my end, going from 0009 to 070H, but if you break anything, I will yell unicorns at you and let you keep the pieces. Because a crazy dane decideds to do this without backup, you should not do the same!

BluOS 1.12.0

October 17th, 2014

A new BluOS for my Bluesound. Version 1.12.0 brought Murfie and HDTracks support. And I almost trashed it in my attempt to gain root on the device after the upgrade. They have a bad habbit of shutting me out :-)

Barrier Breaker on my Linksys E3000

October 15th, 2014

I finally got the time after the release of Barrier Breaker to install it on my Linksys E3000. I have been really happy with the Tomato USB by shibby that I installed back in february.

TomatoUSB is a lean mean router distribution, actively developed and work really well. So why did I switch then? To a less polished, more do it yourself router? Mainly due to the fact that it turns my router into a generic linux distro. It gets more versatile. I can install whatever I pleases. At the cost of ease of use. An ok tradeoff when you are an fulltime Unix administrator at work.

edison% ssh root@192.168.1.254
root@192.168.1.254’s password:

BusyBox v1.22.1 (2014-09-21 02:05:47 CEST) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

_______                     ________        __
|       |.—–.—–.—–.|  |  |  |.—-.|  |_
|   –   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
|__| W I R E L E S S   F R E E D O M
—————————————————–
BARRIER BREAKER (14.07, r42625)
—————————————————–
* 1/2 oz Galliano         Pour all ingredients into
* 4 oz cold Coffee        an irish coffee mug filled
* 1 1/2 oz Dark Rum       with crushed ice. Stir.
* 2 tsp. Creme de Cacao
—————————————————–

BluOS 1.10.2

July 17th, 2014

Another small update to the Bluesound. I also noticed that someone has beenplaying around with Filter::Crypto::Decrypt in the source

root@Stue ~$ ls -al ms.pl
-rwxr-xr-x    1 root     root        164749 Jul 15 15:53 ms.pl
root@Stue ~$ wc ms.pl
1         3    164749 ms.pl
root@Stue ~$ cut -b 1- ms.pl
use Filter::Crypto::Decrypt;
ab176d4898affa5dcb8882cb377cfac18ee9bf79d1ccb3d50d7cebb3891….

That should actucally be fun to reverse engineer.

BluOS 1.10.1

July 2nd, 2014

Another BluOS update for my Bluesound N100. This time the major new thing is support for spotify. Good for Bluesound and the young generation. Not a biggie for me. I am old skool and have ripped all my CDs to .flac.

I love the Bluesound, but still miss stuff in the interface towards it. Mots notably I miss custom tagging of music (albums, songs, artists wise). ‘her music’, ‘his music’, ‘kids music’. And then being able to see only music that I care about in the interface.

But I am really being nitpicky now. Bluesound is about streaming quality. The interface is only next in priority :-).

The old king is dead (NAD 3020i) ….

June 28th, 2014

….. long live the new king (NAD C356BEE)!

Our old NAD 3020i died. Or rather it could still amplify our music, but it started to smell when it was on and the smell of burnt electronics inside the house is neither normal, nor healthy. So we went looking for a replacement…. Rotel ra-11 looked nice. So did the pioneer A-70. And the NAD C326BEE … We also had a very very serious look at NAD D 3020. The latter was discared due to

  • us being in doubt about the D 3020’s ability to deliver the same power as the NAD 3020i, even though its specs was 50% better.
  • reviews stating that the sound was actually better when feeding it an analog source as opposed to a digital one. Then it did not make much sense to feed it with the output of the Bluesound N100 we own.

My wife, who brought the NAD 3020i into our relationship preferred NAD over the competition and in the end we had to choose between the C326BEE and the C356BEE. Being marginally more expensive, we went with the bigbrother and are happy about it.NAD_C356BEEI will have to play around with the serial port of the 356BEE and maybee put a usb2serial in the back of the Bluesound and do some magic there. But that will have to wait until later.

BluOS 1.8.2

April 4th, 2014

Once in a while you get an unexpected present. For me that present can be related to IT and wierd enough for most people, the present can be as simple as a firmware upgrade. This time it was for my  BlueSound Node (N100).

I quickly updated the node and after gaining root access to the box

edison% ssh 192.168.1.119 -l root
root@192.168.1.119’s password:

I noticed that stuff is actively being worked on by the chief developer. I would like him to write changelog in the header of the files though :-). I have run a diff against the previous codebase and besides the visible changes with support for a couple of more services, a lot have been done, under the hood. I would like the lead developer to keep a changelog inside the files for us hackers to read :-p