Favourite command of the day – xbmc-send

Using xbmc-send one can remotely via SSH trigger a rescan of the media library. For example the videos like here below.
apathy:~ $ xbmc-send --action="XBMC.updatelibrary(video)"
Sending action: XBMC.updatelibrary(video)

The xbmc-send command can be used for a lot of things and is well worth looking further into.
This works fine for me on OpenELEC version 3.0.6.


Google authenticator on Raspberry Pi

Google authenticator logoAfter adding ssh keys as I try to always do on my systems I went on to installing the Google authenticator module.

Install and setup
construct:~# apt-cache search google-authenticator
libpam-google-authenticator - Two-step verification
construct:~# apt-get install libpam-google-authenticator

then as my user I just run google-authenticator to set it up:
henrik@construct ~ $ google-authenticator
Continue reading


No SQLite over NFS

I was recently going to view the contents of a backed up database and ran into the following error:
%sqlite3 backup_db_130614.db
SQLite version 3.7.4
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
Error: disk I/O error

So I pulled another backup, tried again and got the same error and this all repeated a couple of times. After verifying on the live database that all was fine I started looking around for an answer to what was going on with my backups.

As it turns out, you cannot run SQLite over nfs due to locking issues. Simple as that, but perhaps a little less than optimal error message.

From the FAQ over at www.sqlite.org:

This is because fcntl() file locking is broken on many NFS implementations. You should avoid putting SQLite database files on NFS if multiple processes might try to access the file at the same time.


Updates to a couple of my FreeNAS scripts

I have updated a couple of the scripts mentioned earlier that I use on FreeNAS. Originally I intended to bundle them together but reconsidered and now feel they are better off available separately. So here is basically a brief of the changes and what would have been a common README.

If there is actually anyone using the script to back up the configuration via email you really should read on and then update to this version! Continue reading


Standard agreement revisited

I just updated the license on my XenServer at home and always find the likes of the following clause entertaining:

XenServer user agreement

XenServer user agreement

Sure, when it comes to a virtualisation environment and not the app store in OS X I can actually understand the reasoning. But still, not beeing allowed to create nuclear weapons or being Cuban no matter where you live is a bit humorous I think..

Luckily though this will all be easy for me to comply with.

FreeNAS webGUI warning

Replacing a harddrive in a ZFS pool on FreeNAS

I recently bought a Western Digital RED drive to replace one of my old Western Digital Caviar Green drives in my FreeNAS storage. As previously mentioned I run a RAIDZ wich is comparable to a RAID-5 so I can do this without data loss.

The RED drives are supposed to be specifically designed for use in 1-5 drive NAS situations and have gotten pretty good reviews so even though it is a bit pricy I wanted to give it a go. In perspective the drive is only 100SEK cheaper then the Caviar Greens were two and a half years ago when I bought those.

Before replacing the drive it is recommended to scrub the pool to make sure everything is in order.

One thing to note is that in order for ZFS to accept a new drive as a replacement it has to have an LBA count that is equal or higher than the old drive. Look it up on the old drive:
[root@void] ~# camcontrol identify ada0 | grep LBA48
LBA48 supported 3907029168 sectors

Then verify with the datasheet for the new drive before purchase. In my case this.

This is a quick step by step of how I did it using the GUI. The next drive getting replaced will be so via cli only.

Continue reading


Quick script to poll parcel status

Sometimes when waiting for a package I like to check the status of it now and then (in reality this means every moment I have over – or rediculously often).
I also like to do things on the command line.

Enter small script of the day;
(this relates to Schenker in Sweden)

%cat schenker.sh
if [ "${1}" = "" ] ; then
cat < Continue reading


Trying some Nexa switches with the Tellstick

Nexa wireless switches

Nexa wireless switches

A couple of days ago I happened by that Swedish chain with random things for around the house mentioned previously again and saw that they had Nexa wireless switches on sale (more..).

Naturally I had to try them!

They are pretty smart, and starts to auto learn the moment you plug them in. Setup with the Tellstick was a breeze, just add the switch as a protocol arctech self learning switch, give it a house number between 1 and 6710883 and a unit number. And off you go!

I have just added the first of the three so I can’t really comment on the reliability but expectations are high.

These have three memory locations, so perfect for tellstick plus remote and future fun.


Local spamassassin rules

I’m the maintainer for a FreeBSD port (hopefully more soon), unfortunately they have made the strange decision to publish all maintainers email addresses completely readable online. Subsequently almost all spam that gets through is being sent to this specific address. Even though it’s few it’s still irritating and I dislike manual repetitive tasks such as filtering spam. I have even considered turning it into a spam trap but that feels like letting the spammers win.

The solution – adding a pair of rules that gives that address an additional spam rating.
Continue reading


Upgrading to SSD in the Mac

MacBook Pro open

MacBook Pro open with new SSD installed

I finally took the step to ditch the old spinner in my MBP since the prices of SSDs have gotten very compelling. I got a 256GB Samsung 830-Series for just less than 1200 SEK and that let me avoid the hassle of moving to a smaller drive.

The switch itself was a series of simple steps as follows.
First I ran a manual time machine backup (I backup my entire system to ease a full restore in case of crash or theft). Then I rebooted and did another manual backup just to be sure.
Continue reading