navelfluff

Morjens bara

Ett steg mot självständigheten

Idag var oxÃ¥ en stor – och svÃ¥r – dag som kommer i varje faders liv, dÃ¥ hans dotter växer upp ett steg. Ett steg längre frÃ¥n faderns skydd och kontroll. Ett steg mot självständigheten.

Min åttaåriga lilla fröken ska få en telefon. Idag beställde jag den.

Det var mycket val och kval före jag kom till ett beslut om hurdan lur det skulle vara. Min hustru tyckte nåt enkelt och billigt. Min dotter, som vant sej vid min världssyn på telefoner ansåg det naturligt att en telefon ska ha navigator och spel (Angry birds och Rocket bunnies). Och gärna oxå Mobile sketchbook. Och bakgrundsbild med hästar. Helst skulle den få vara rosa oxå. Vad kan då en älskande fader annat än beställa en ZTE Blade androidlur. Med nätavtal.

Mitt Stora Problem är detta. Androiden är ju en “social plattform”. Hela grejen är ju den att man kan kommunicera pÃ¥ en hel hoper sätt med den. Jag ringer faktiskt rätt lite, men jag tweetar och fejsbokar, lyssnar pÃ¥ poddcastar, checkar in med Foursquare, surfar, mailar och skickar ibland nÃ¥gra bilder med min telefon. Men nu lyder frÃ¥gan, vad ska jag göra med min dotters telefon? Än är hon för ung för Facebook (F13). Mailen kommer jag att introducera i sakta mak. Hon fotar gärna, sÃ¥ jag vill ju att hon ska kunna dela med sej bilder, men det ska vara till en strikt begränsad grupp tills hon kan “hÃ¥lla reda pÃ¥ sej själv”.

Men det hela får en väldigt konstig krok. Jag hade nämligen tänkt introducera barnen till interaktivt bruk av Internätet under övervakad situation. Med en maskin hemma som är under uppsyn. Med en förälder som man kan fråga då det behövs, och vars närvaro kan fungera som moralpolis när det blir aktuellt.

Inte är det lätt. Surfbrädan fÃ¥r jag gömma undan fast hon ju nog kommer att hitta den en dag. LikasÃ¥ skulle jag vilja sätta ett barnfilter pÃ¥ Youtube. Vi surfade omkring med min son, fem Ã¥r, pÃ¥ tuben och rÃ¥kade komma över en Bamse-snutt med “förbättrad” lyrik och en Pingu-snutt med inte precis barnvänliga översättningar. Inte precis nÃ¥t jag vill exponera mina ungar för.

SÃ¥ det blir visst att ha det där samtalet alla geekfäder fasar för. Internätet är skoj men man mÃ¥ste skydda sej sÃ¥ att man inte behöver Ã¥ngra sej efterÃ¥t…

Now on Android

I’ve been a Nokia user since 1995. My first phone was the immensely neat 2110. I moved into Series 60 as soon as it was feasible, meaning that i am one of the few who got the Nokia 3650, the blue and white phone with the number keys laid out in a circle, and apparently designed by Fisher-Price. My last Nokia phone was the Communicator E90 which i had until the magic smoke came out, which was about three weeks ago.

I have now departed from the Nokia ship. I have an Android. A HTC Desire Z.

While it felt sad (and a little bit like a betrayal), i haven’t regret my choice. I really like this phone. That stuff i’ve talked about before, integration, extsis on this phone. My address book on this phone is consolidated from my accounts at work, Google (which is where i keep my civilian mail), Twitter, Flickr and Facebook. Applications seamlessly use location, the camera or Google maps for location visualization. The phone comes with a built in DLNA controller which can play media on this phone or on the television, using the phone or the UPnP media servers at home. And i’ve come to foursquare on a daily basis.

Compared to my previous phone, the keyboard is a bit worse, but nearly everything else is better.

Chumba! Wamba!

I was informed by my colleague the other week that the Chumbies have invaded Finland and that the Chumby One model is for sale at Verkkokauppa for 99€. Weak spot. I have dreamed for this cute but kind of useless … no, just cute device since the original “Latte” model was introduced, yonks ago. Checking my archives, that would be the 13th of November 2006. Whoa.

With little sanity to hesitate me, i ordered not one but two of these puppies. One to hack and the other just to toy gently with [0]. And yesterday they arrived. I named them Chumba and Wamba (yeah). Wamba is still in the cardboard box because my wife is still in a state of denial that i paid a hundred euros for a clock radio [1]. The closest thing to a nod of approval was received upon informing her that it can work as alarm clock.

Currently, i am in two confused minds. And one blissful. I have a device which shows the time, displays pretty pictures and plays The Dividing Line. Which is nice. Also, i have this wonderful little thingy, an embedded Linux computer with a wireless network connection and a touch display and i can’t even begin to think what funky things i should be doing with it! But most of all, i’m fascinated by how my kids react to the physical user interface, how effortlessly and naturally they interact with the dangling spider on the display by tilting the box, or how they make it moo by turning it upside down.

So even if i won’t ever get this to be my wireless link between home and office, or a controller of my yet-to-be-realized home automation network, or even a music library controller, i can still learn how to do things differently. I guess it’s about time to start learning Open Laszlo, since Flash is the native UI platform on the Chumby. Or FlashDevelop. Or HaXe or the Ming lib. Or just port Silverlight to the Chumby and have our guys dev some really slick schtick for it :) (or maybe not)

A usability guru Don Norman once wrote about information appliances, and i think a Chumby is well suited  to become one once i decide what one or two things it is supposed to do well. Now it’s more a twitter-like miracle that you can do anything with and hence there’s not really anything to do with it well. No focus, so to say. The only thing i’ve done so far is to ssh into it and create a cron script that switches between night mode and day mode at 22:00 and 7:00 respectively. But once i come up with something, i’ll surely let you know.

[0] Update: Wamba’s power supply was broken so now i’ve got to make it an RMA to Verkkokauppa. And bob knows when i’ll have another one. Yeah, they want me to return the whole device, not just the psu. Bustards.

[1] The fact that she showed me the two pairs of nice but not entirely cheap pairs of nearly identical shoes she got for herself might have saved me from more excruciating scrutiny.

Rolling backup on the cheap

Within, i’ll present a free and low-pain solution to implement a backup copy method for Windows using an external hard disk. The same method could also be used for backups over the network.

A user at a customer of mine needed a way to copy his documents to an external disk which is easy and cheap. While it would be possible to use Windows backup, it’s not the nicest of programs to work with (he’s on Windows XP, the backup software on Win7 is probably much nicer), so i decided against it.

My requirements were:

  • Simplicity – easy to use for the user
  • Unobtrusive – doesn’t require complex installs to the computer which may be against the company IT policy
  • Open – doesn’t lock out the user if the backup program fails or goes out of date
  • Maintainable – even if i went away, somebody else could update and maintain the system

So with some painful research, i ended up with the Toucan backup Portable App. In fact, i had done an installation like this before but with less elegance, which is to say that i will here spare you from some lack-of-elegance. Not bad.

The whole method is based on example code from the Toucan help files.

Step 0: A wee bit of theory (won’t hurt … much)

We’re going to create two backup routines. One will create a full backup of a source directory onto a target directory on a removable disk. The other one will create an archive containing all files that have changed since the last full backup. Both of these are created with Toucan’s differential backup. Five full backup files will be kept and automagically cleaned out when a full backup is performed. Everything is configurable and probably also schedule-able.

Step 1: Preparation

The first thing to do is to give the external hard disk a persistent mapping. With the external hard disk plugged in, right click My Computer, choose Manage, select the Disk management tool. Right click the external disk, choose Change Drive Letter and Paths and select a nice and backup-friendly letter, say Q.

Then, get the Toucan Portable App. Toucan portable is designed to run within the PortableApps framework but it’ll work nice by itself. By design, that means it will run without making any changes on your system, and we’ll use that to actually run Toucan from the external disk itself. If you want the PortableApps framework, go ahead. It won’t hurt. Much :)

Install Toucan on the external disk, Q:. Due to the PortableApps framework, it’ll install in some directory structure underneath the root of Q. Navigate to the Toucan executable and run it.

Step 2: Configure what to back up

The Toucan user interface is a bit scary, but don’t worry. I’ll keep you company until we’re ready to run. Click on the Backup tab. Click the big plus-sign button in the Job Name box to create a new Job. Give the job the name Full backup. In the Type box, select Differential (which may seem misleading but bear with me).

From the big area on the left, select one directory (or even one whole disk, but that’s going to be a lot to backup) you want backed up. I suggest you choose a reasonably small hierarchy to start with, otherwise the testing phase will take some time. Press the plus-sign button in the middle of the screen to have that directory added to your backup list. Unfortunately, Toucan doesn’t support differential backups on multiple source directories. If you want that, you’ll need to repeat this article multiple times. But there are worse pains than that.

In the Backup Location text box, enter @backupfolder@\ (we’ll get to that shortly – oh, and don’t miss that backslash \ at the end of @backupfolder@ as it’s probably important).

Press the Save button which is in the Job Name box.

Step 3: The automagic bits

Click the Variables tab. Click the plus-sign button to create a variable. Name it backupfolder. You’ll get two lines of text in the big box below, one being your computer’s name. Double click that one and enter Q:\backup (or @drive@\backup which would be the cooler and more portable notation). Click the save button.

Click the Script tab. Press the plus-sign button and name a script Backup-rotational. Paste the following into the edit window:

Delete "@backupfolder@\BaseFile-5.zip"
Rename "@backupfolder@\BaseFile-4.zip" "@backupfolder@\BaseFile-5.zip"
Rename "@backupfolder@\BaseFile-3.zip" "@backupfolder@\BaseFile-4.zip"
Rename "@backupfolder@\BaseFile-2.zip" "@backupfolder@\BaseFile-3.zip"
Rename "@backupfolder@\BaseFile-1.zip" "@backupfolder@\BaseFile-2.zip"
Rename "@backupfolder@\BaseFile.zip" "@backupfolder@\BaseFile-1.zip"
Backup "Full backup"

Press the save button.

Yeah, i know it’s ugly, but the Toucan scripting language is just about that developed. It does get worse though.

Anew, press the plus-sign button and create another script. Call it Diff-backup. The only code it will have is:

Backup "Full backup"

Press the save button.

Step 4: Intermediate testing

Still within the Script tab, select the Backup-rotational script and press Run. You should get a few warnings that there aren’t any BaseFile-n.zip files to delete or rename but the backup bit should work fine. The jolly magic here which we couldn’t really influence is that when Toucan runs a differential backup but there is no file to “different against”, it will save the full backup into the file BaseFile.zip.

A reasonably big hierarchy will backup in 15 minutes, a smaller one in a minute or so. If there were severe errors, check your code. If it matches mine, there must be a bug in my code, which you should remark about in the comments section below.

When the Backup-rotational script has run, choose the Diff-backup script and run that. If you want to, you can make some changes to the source hierarchy before running the Diff-backup to see some reality in the process.

Step 5: Enter Batman

You’ll still need two batch files to make the whole magic run. In the directory where Toucan.exe is installed, create the following two files with the contents below:

do-full-backup.cmd

del Q:\backup\20*.zip Toucan Script "Backup-rotational"

do-diff-backup.cmd

Toucan Script "Diff-backup"

The sad bit is that you need to delete the incremental files from the batch file, as Toucan doesn’t expand wildcards (caveat: this script only works in the 3rd millennium Gregorian time – if you’re reading this in another time zone, please edit your script to suite).

Run the two batch files. Watch the output and observe what happens in your backup directory.

Step 6: Shortcuts or schedules

Add shortcuts to your user’s desktop or set a schedule using your favourite cron replacement. Educate said user to run those shortcuts on a regular basis.

Step 7: Restoring files (this should never happen)

In case Bad Things happen, go to the backup directory of your external hard disk. Check out the BaseFile.zip (or an older BaseFile-n.zip if you realize the Bad Thingness only weeks later) or the relevant timestamp-named file if the Bad Thing just happened. Navigate and restore. Take a bow.

You’re done.

The iPad is real (finally)

After much speculation and a lot of waiting, The Steve Jobs Magic Factory has released the iPad. After all, i did suggest – heck, request – the iPad already in December 2007. I’m sure Steve will want to deliver me a slate in person when he has one manufactured. You know, for my suggestion/request which must have been the source of his inspiration. And for the name i suggested. Right, Steve?

And i’m kinda buggered that i didn’t register ipad.com back then just in case he’s forgotten about me now :)

Wanted: Networked ePaper photo frame

I just realized what was wrong with digital photo frames. The fact that they shine, like monitors do. They emit light to display a picture.

If they would require light to show a picture, much like a printout, they would look a whole lot more natural. And the answer to that is to use e-paper. Colour e-paper to be specific. It doesn’t even have to be touch sensitive, though that would be a bonus. I’m just not sure if touch sensitive electronic paper is invented yet. Could be. Should be.

So if somebody out there just got a terrific business idea with this, the least you can do is send me a few networked epaper photo frames for making you stinking rich. Thank you.

Enter Aylee

…or “Installing Debian and the Coherence UPnP media server on a Linksys NSLU2 NAS thing”.

My two Slugs Bun-bun and Kiki are getting a new companion, Aylee. Aylee is a shape-shifter by nature, which means she is running Debian.

Getting Debian on the Slug was surprisingly uncomplicated. I first booted the off-the-shelf Slug. Using ping -b 192.168.1.255 i figured out it was using the “standard Slug IP address” 192.168.1.77. Using its web interface (which still was running the old R24 firmware), i sent it the Debian installer and waited. A few minutes later, the installer was on the Slug, which then booted.

The next step was to ssh installer@192.168.1.77. The password is install. This will start the actual installing process, which will get all the freshest Debian files for the Slug from o’er the Internets. I chose all the easiest and blankest defaults with the only added spice that my Slug would also be a file server. This comes late in the process from Tasksel. The whole installation process takes a number of hours to complete, which was a reminder from the days of old when installations, well, took hours.

The installation process also asked which hard disk it should use and format. I had gone through the extra work of formatting it on the off-the-shelf NSLU2 interface, but this was unnecessary.

During the installation, i was recommended to install ntp or ntpdate. So when the Slug finally had done its installing magic and rebooted (which it does automagically after it “cannot stress enough” the importance about rebooting), i ran apt-get update and apt-get upgrade. Much to my surprise, my system was already up to date. Take that, Windows :) .

The next step was to apt-get install ntpdate. This installed ntpdate but didn’t seem to configure it, so i had to do some manual labour.

cd /etc/cron.hourly
cat > ntpdate
#!/bin/sh
ntpdate fi.pool.ntp.org > /dev/null
^D
chmod +x ntpdate
run-parts --verbose .

Replace fi in fi.pool.ntp.org to whichever country you’re in, or just leave the country bit out (i.e. just write ntpdate pool.ntp.org) for the automagia to do its thing. At ^D, press Control-D. run-parts --verbose . will run the scripts in the current directory (you saw the ., right?) and report how things went. It was this way i realized that the script ntpdate needs to start with the magic line #!/bin/sh and that it must be made executable with chmod +x. You can leave out the > /dev/null bit to begin with and if you get an hourly email from root that ntpdate has adjusted the clock with zero point zero something seconds, everything works as it should and you can add the > /dev/null bit which will silently keep your Slug in time and not give you more email.

My aim with Aylee is to have it as a photo server. As a challenge, i’m going to use the Coherence UPnP server for this. If all goes pear-shaped, i should still be able to re-flash and shape-shift Aylee back into something easier to handle :)

Coherence runs on Python and Python is already on the base Debian installation. There are a number of ways to install Coherence. One is using aptitude, but that will install an old version of Coherence. Another option is to manually install all the dependencies. Not fun. And the Simple way is to use EasyInstaller which in itself first must be installed. For that you need to get setuptools for your version of Python (say python --version to your slug to find out) and run the downloaded file as a script, i.e. sh setuptools-version-py2.x-egg.

At this time, i thought i would be installing Coherence (easy_install Coherence) but ran into a dependency problem. And i thought easy_install would take care of just those. Pfft. I was missing the packages Twisted and Twisted.Web and was suggested to install them. Not knowing exactly how, i said easy_install Twisted. This looked promising for a moment until i was informed the easy_installer was missing gcc, the GNU C compiler..

Duh. This was going to take some time. Compiling stuff on the Slug? Not my idea of fun.

After successfully installing Coherence 0.5.8 with aptitude instead (aptitude install python-coherence) i became a bit disappointed that the offered version was about one year old. Also, i could not get my photos to show on XBMC using UPnP though they showed okay on my Samsung telly. So it was back to the documentation. According to it, the dependencies can be installed with apt-get as well:

apt-get install python-twisted-core
apt-get install python-twisted-web
apt-get install python-configobj

You could also install the dependencies with easy_install, which i only read after having installed the above packages with apt-get. Not that it should matter much.

After that, i could  finally get the latest greatest Coherence installed using easy_install Coherence. About time, i say :)

There were a bunch of warnings during the installation, but a coherence --version at least confirmed that the software did install.

Finally, i installed rsync so i could copy the jpeg versions of my photos from my laptop to Aylee. Which it is doing currently. It’ll take a while. Unfortunately, the kids are now watching Moomins from the telly, so i can’t test my XBMC now. But i have hopes. And the hardware.

Minimal bginfo

Update: The VBscript code i had was both long and buggy. The new code is short and sweet, and at least works no less than the previous code.

BGinfo is a nifty piece of software which can print out a whole lot of technical information on the desktop background of a Windows box. As an administrator for a bunch of client machines, BGinfo has proven Most Useful.

There are two issues, however. Sometimes the information i use on my backgrounds can be a bit over the top. And then there’s one little bit of info not included in the admittedly colossal BGinfo arsenal: whether the computer needs rebooting after having been updated. So here’s my fix.

Step Zero is to download BGinfo from the link above and save it anywhere that can be addressed over the Windows network during a logon procedure. I chose the domain controller’s Netlogon share, or \\%LOGONSERVER%\NETLOGON in the examples below. In reality, i used the real name of the logon server instead of %LOGONSERVER% but i suppose the variable name will work just as well. You might need to add %-signs for added magic.

I then created a minimal BGinfo template with just the hostname, IP address and a custom field i call Is Reboot Required. The template uses the user’s own default wallpaper and the BGinfo data is aligned to the top right of the window. Your mileage may vary. Save the template with the BGinfo executive. My path is \\%LOGONSERVER%\NETLOGON\bginfo-minimal.bgi

The custom field Is Reboot Required points to the output of a certain is-reboot-required Visual basic script, saved with above two files as is-reboot-required.vbs:


If CreateObject("Microsoft.Update.SystemInfo").RebootRequired Then
Echo "Reboot required"
End if

Old code. Don’t use:

function readFromRegistry (strRegistryKey, strDefault )

Dim WSHShell, value
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
value = WSHShell.RegRead( strRegistryKey )

if err.number <> 0 then
readFromRegistry= strDefault
else
readFromRegistry=value
end if

set WSHShell = nothing

end function

str = readFromRegistry( "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations", "no" )
if( isNull( str )) then
msg = ""
else
msg = "Reboot required"
end if

Echo msg

What the script does is check whether (Windows Update, usually) requires some files to be renamed during the next reboot cycle. This information is stored in the PendingFileRenameOperations registry key. If it’s non-empty,If our computer’s Microsoft Update client deems a reboot is required, we emit the administrator-friendly message “Reboot required”, otherwise we just shut up (having a “Reboot not required” message on the wallpaper isn’t what i call good usability).

Disclaimers: This script works when plugged in but not when run on the command line, oddly enough. And, i’m no VBS guru. The script was created by creative copy-pasting from other resources on the ‘Net.

To paste things together, i created the following one-liner batch file bginfo-minimal.cmd:


\\%LOGONSERVER%\NETLOGON\bginfo.exe \\%LOGONSERVER%\NETLOGON\bginfo-minimal.bgi /timer:0 /nolicprompt

Finally, i added \\%DOMAINCONTROLLER%\NETLOGON\bginfo-minimal.cmd in the startup scripts. Since this happened a week ago, i can’t remember if i did it through Group Policy or through the Administrator’s logon script or (ungh) through the Startup group in the Start menu but in any case it works. If i did it the Right Way (through Group Policy), that means i had to create a new Organizational Unit “Wizards”, add a custom group Admins, add Domain Administrators to it, create a new Group Policy to the Wizards, and apply the bginfo-minimal.cmd from the right path to that group, for that is the way of Windows Server 2003. But then again, i might just have been lazy.

Revo InstallFail

I have it! I have it! I have my rhombic computer! :) (yes, it looks as a skewed box and i don’t know why)

After much searching, the customs did find my little Asus. I went to the customs office, checked out the computer (no tax but 22% VAT) and happily drove home.

Plugging in was easy as pie. The power brick is of the laptop kind, which means it has a detachable power cord with a “mickey mouse” connector, so changing it from a US cord to an EU one was no problem. I would have hated having an ugly adapter around. Kudos to Asus for that.

Two seconds after powering up, i was greeted with a Splashtop-powered minimal interface with a web browser, chat and Skype. The setup also included a media player but since it didn’t play media resources on the network, didn’t give it much more thought. Also, it seemed like i wasn’t seeing full HD resolution on the telly. Quite a shame really. A near-instantly starting media centre would be… nice!

The next step was going to the system installation feature. And even though i’d bought a Linux computer, the installer only offered me one choice: Windows Vista. With no license key. So counting Splashtop as Linux, i indeed got a computer with Linux.

Next i’m going to test booting from an XBMC Live distribution on USB.

Raiders of the lost box

The home entertainment network project has progressed with the box having been located.

After having waited nearly a week for the customs department to signal me that i can come and fetch my Asus, a colleague of mine suggested i’d give ‘em a ring. Unlike many other official instances here, the customs still live in the Soviet era when they were stiff and unfriendly and in such a monopolistic position that they didn’t have to care [0]. So i did call them.

I was a bit surprised when my call was answered nearly immediately. I told the receptionist that i had this EMS tracking number and i wanted to know where my box was. According to the tracking, it has been under their wings for a week now. But no, when it comes to EMS tracking numbers, i would have to call the postal services, Itella [1].

Which i did.

The AVR [2] at Itella calmly told me that i was in line, that the typical waiting time was eight minutes, that the call was being recorded and that queuing was going to cost me. Schweet. From there on, things took a turn for the better.

Seven and a half minutes later, a gentleman with butler-like qualities answered, clearly stating his full name and enquiring what i might be enquiring today. Upon telling him, he agreed that the package indeed should be at the customs but instead of asking me to call back, he double checked by recipient address and said he’d check with the customs.

One minute later, he confirmed that my computer indeed was where i had suspected but that he was not able to get its current status at this notice. Could he perhaps call me back after handling the issue with the customs?

Heck yeah!

He repeats his name (in case i want to call him back, i suppose?) and gets on the job.

Another ten minutes and my phone rings again. We now know that the computer is at the customs’ location by the airport and i should ring the customs tomorrow mid day to confirm i can pick it up. Incidentally i’m going for a customer meeting tomorrow just by the airport. How excellent!

I tell him what a hoopy frood he’s been and how much i appreciate his efforts. I give a pile of thanks over the wire and a happy so-long. He responds with a butler’s calmness, thank you and goodbye sir.

Respex and kudos to the Itella customer service. You rule.

I wish the coming weekend was longer, so that i could get down and do some serious tinkering. Thankfully, going to see Riverside (and hopefully interview/photograph) on Saturday is a valid reason not to be too buggered about it.

And there are other, more architectural problems, of which i’ll be writing shortly.

 

[0] Thinking of it, couldn’t there be competing customs?

[1] Long gone are the times when the post was called the post.

[2] automated voice recognition, which was able to tell my “no” apart from the other option (“yes”)

Bad Behavior has blocked 9336 access attempts in the last 7 days.

Bear