Monday, June 30, 2008

OpenTTD - All work and no play makes CJ a dull boy

As life has been really busy recently, I'm working from home and it's both a bit uncomfortable and choatic, yesterday I just had to break out the old OpenTTD (which may or may not be an acronym of "Open Transport Tycoon Deluxe"). I have mentioned it before, but it always brings me a smile as I'm reminded that my classmate Ludvig Strigeus largely built or was was involved in both OpenTTD, ScummVM, µTorrent and now is working on Spotify. Impressive guy!

As I played not on the easiest setting and had forgotten how to signal trains, I wasn't particularly successful and restarted one game and slowly went bancrupt on the second, but still, it was lovely.

Transport Tycoon remains a very addictive game, it's not very good for any sort of realistic simulation and you always tend to end up in a mess or just filthy rich, but still it is a nice way to tickle that brain and your sense of dealing with what's urgent. :-)

Which reminds me I've got both work and other play I want to get done, ta'ta!


PS. You can download the game from the homepage, and necessary data files can be found here

(Update: It's really too nerdy, but because I'm playing around a bit with screencasting and I wanted to show someone my Transport Tycoon transport network, here we go: screencast.com/t/RrPvITU4 , recorded and uploaded with Jing which I really recommend for those simple screenshots or explanative screencasts)

Wednesday, June 25, 2008

My public keys

It's a bit silly with all the FRA-debate, but I figured I should anyway publish my public keys / certificate properly. Do note that the corresponding private keys are just kept encrypted with passphrases on my disks, thus not as reliable as if kept in some security tokens (I will however get some soon).

My X.509 / S/MIME certificate:

$ openssl x509 -in mail.der -fingerprint
SHA1 Fingerprint=D1:50:3A:C3:76:FD:37:95:58:4D:A4:F1:A9:1E:D4:F9:49:0C:8C:95
-----BEGIN CERTIFICATE-----
MIIC6jCCAlOgAwIBAgIQfieZBy5u6tREnLuiykK/mDANBgkqhkiG9w0BAQUFADBi
MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkg
THRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3Vpbmcg
Q0EwHhcNMDgwNzMxMTMzNDU3WhcNMDkwNzMxMTMzNDU3WjBKMR8wHQYDVQQDExZU
aGF3dGUgRnJlZW1haWwgTWVtYmVyMScwJQYJKoZIhvcNAQkBFhhjai5zdmVuaW5n
c3NvbkBnbWFpbC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDx
VgamRU9zL7ugY+2u/LHg4JyjLJhqUqvQmpwp4zHDSW4tjAOBmn2wRmF/53/LKqWu
w2nfvHig888V+uIa8+xVFgS1AyJ6xX3jqWQ0OD7GzjCAglV2auZ7cYNd3uMO9/yg
AdyxwwKHZnTSYhlBdL85En2RKbjGHimVlZag569pkxeA3dY6Tea7n79bmRuGzlSQ
C6CdZOcbbr7SWih6a35tfxxvDBQDjPQKZs1o6ois8AhdwwwepmiTT6Fsn9S8fje9
0UuFol7nEIswbK7lE+44W375iuxk1bXJep6VzWhB8kLWPB9DRMfjFcNuzABziRkH
Ei5GeKDfRc+IAEHbfmMZAgMBAAGjNTAzMCMGA1UdEQQcMBqBGGNqLnN2ZW5pbmdz
c29uQGdtYWlsLmNvbTAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBBQUAA4GBAAiG
70aW9v7pZEpYnUCABuodVaxJO29L2SLb0EFe+jhVaOJ/09i0d/hYRk+4AFDrLEXZ
a63RHDZ/quOYSHaDSsidpX35yRNtT4FSxhm4SsbZiUZfjZAMNxpnsqkooWiz+goU
ABIWtzdtjilKbVrc9WfAQsYJElTN3Qvo7T3h17IO
-----END CERTIFICATE-----

My PGP / GnuPG public key:
Key fingerprint = 0349 0021 407D 9955 A3B5 FC18 1294 5939 1766 8EFA
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.8 (Darwin)

mQGiBEWaw0cRBACZNwcwZDZgcYR3OepOH9rSlA/p2WwO/5SrczkQ10/J/+ASLMyp
991d628qNLqlJ1nUnjRFw7GgVxHhYgVCDabhaC9JZru3GTBDXvKet+3rxZZf+isd
328H3o41cFsYwmJRERP+YuiG+QXIljb6z2suei8+QNhy5bmRyyqb+nn64wCgswwL
Ud9cOKTI6T9LFg3Xch+IQc8D/1BW3qO0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5Al8vNTIoTfAXEnD4q+VJX/7uQIDAQAB
(Update: I had some issues with that the GnuPG key was expired, so I had to update that and get it onto a keyserver. The fingerprint is unchanged, and I will probably get myself Aladdin eToken PRO or an AET CrypToken any day now)

(Update 2: Now I have managed to securely generate and store on an Aladdin eToken PRO my X.509 / S/MIME certificate, so that's a new one now)

(Update 3: I got OneSwarm, so I added my public keys here as well)

(Update 4: I changed laptop and the server is offline currently, so changed one OneSwarm keys)

Wednesday, June 18, 2008

How to download webradio and webtv, RealMedia (RTSP) or Windows Media (MMS) streams easily - a comprehensive ripping tutorial

Now that it's once again time for P1 Sommar (check out my talker schedule!) for me it also means it's time to freshen up the streaming media dumping skills. I happen to enjoy my webradio with music left in rather than the crippled music-less media files Swedish Radio / SVT provide. Below I in three (an optional fourth) steps show that there is little practical difference between providing something through a streaming media protocol or providing it for download - it is pretty easy to download and save it for later anyway.

The case is pretty simple - when you listen to webradio or webtv, the browser window commonly embeds a player which is given the URL of a "playlist" provided over regular HTTP. The playlist however contains the URL of the actual media stream, commonly "hidden" to only be accessible using a streaming media protocol like RTSP or MMS. Media providers think (or hope, or assume, it doesn't really matter) that players able to receive these protocols will not allow the user to save the media stream to be replayed later and thus are more relaxed about letting licensed content be broadcasted through streaming media protocols. Fortunately using an open-source player like MPlayer or a download manager like FlashGet, also media streams can be saved like a charm.

The gray areas of radio ripping is discussed over at copyriot.se (in Swedish) and also don't miss out my list of great SR and SVT shows with all URLs conveniently in one place. Curiously this is not a simple case of piracy - the DMCA would surely be quick to decide, but there are plenty of arguable fair use purposes for stream ripping such as saving the content for replay later, bringing it with you on a portable player or converting it into a suitable format. The case is especially strong for content which is anyway broadcasted over analog radio or TV and as such are anyway freely available. However, IANAL, do this on your own risk and don't break any applicable laws.

  1. Open the source code of the page or frame the regular player is embedded in. Get the playlist SRC by looking for the player object parameter "PARAM NAME="SRC" VALUE="...". However, what comes after "VALUE=" commonly does not start with "http://" and thus is a relative URL, see the next point for where to find the base location to be able to download the playlist. Update: You can also try right-clicking on the Real Player embedded in the page and selecting "Copy clip URL" instead of even touching the source code




    If the playlist SRC above was a relative URL, get the base location from the location displayed in the frame or page info:



  2. Add the location and the playlist name together to download the playlist from that URL. The playlist then contains the stream URL at a line saying "src=":
    $ wget -O "030702 Mustafa Can.ram" "http://www.sr.se/webbradio/include/CreatePlaylist.asp?Type=db&Id=1115295&broadcastDate=&IsBlock=0&AudioFormat=1&AvailableAudioFormats=1"
    $ grep src "030702 Mustafa Can.ram"
    <audio src="rtsp://lyssna-rm.sr.se/isidor/p1/2008/04/47_webb_rh_sthlm_mustafa_cans_sommar_2_jul_p1-063383a05_376ff8c2_r2.rm"/>

  3. Download the stream with a program capable of receiving the protocol at hand (see wikipedia lists for rtsp:// and mms://, though I know for a fact some download programs like FlashGet for Windows or CocoaJT for Mac (in French ?!) and others listed here are also very capable of that). Below I use MPlayer, which works the same both for Linux, Windows and Mac OS X (except under Windows the binary is mplayer.exe, and under Mac OS X you should use /Applications/MPlayer OS X 2.app/Contents/Resources/mplayer.app/Contents/MacOS/mplayer ):

    $ mplayer -dumpfile "030702 Mustafa Can.rm" -dumpstream "rtsp://lyssna-rm.sr.se/isidor/p1/2008/04/47_webb_rh_sthlm_mustafa_cans_sommar_2_jul_p1-063383a05_376ff8c2_r2.rm"

  4. If you want to, edit the audio with Audacity, convert it to mp3 with lame or even iTunes. Video you can edit with JayCut and convert with FFmpeg or any from the jungle of mediocre video conversion tools there are out there, like Handbrake for Mac OS X or Videora iPod Converter for Windows.

    A note about file types, with RealMedia the playlist is a .ram file and the audio or video contained in .ra, .rv, .rm or .rmvb streams. With Windows Media, the playlist file is commonly an .asx or .asf file containing a .wmv or .wma stream. Also, in an .asx file, the stream address is found by the href parameter. I have not looked currently looked into ripping other formats such as Quicktime or Flash video.


And friends, remember sharing is caring!

(Update: I found out that my MPlayer OS X is both a bit outdated and while it has RTSP-streaming support, it doesn't seem to have the RealMedia codec. So to be able to decode the .rm to .wav on my mac before I clean it up in Audacity and export to wav, I found out the monster package of codes FFmpeg (it's Mac gui sister program is the somewhat less reliable FFmpegX) of course does it excellently like this:
$ ffmpeg -i foo.rm foo.wav
I also checked out the blogger exertia who seems to like Videolan/VLC, but while it's better maintained than MPlayer OS X, it didn't help me this time)

Sunday, June 15, 2008

No, this is the world's coolest bike! (City Bike "Conference Bike")

When it comes to crazy ideas, Fredrik Härén has mentioned mashing up the concepts of karaoke and a taxi ride ( = "karaoke taxi", it's a great success in some southasian country) and I wrote before how cool I think the Uno segway-turned-motorbike is... but this is absolutely adorably crazy! This I actually ran into something while biking around in old town - the "7-person party tandem bike"!


The company City Bike calls it a "conference bike". What it is is simply seven seats on a frame, with tandem pedals connected by a circle of universal joints. Everyone pedals, the guy in the back steers with a solid-looking steering wheel and the passengers can put their glasses in the cup holders in the middle. I can't wait to try it out for a night on town! Also, I envy the advertisement potential of this monstrosity...

There are so many reasons for not doing this kind of venture, I can imagine the conversation - "What about the legality of a seven-person bike vehicle, or the insurance issue? Has anyone else tried this before? Nevermind, let's do it!" Christian Rudolf has written about (in Swedish) about the entrepreneurship spirit of my home village Gnosjö as summed up by "generosity and helpfulness as a strategy", which I think is maybe at least one side of a multifaceted truth... but if I would similarly sum up Estonia, it would be (at least today) "audacity and disregard for experience as a strategy". Several times have I met Estonians who want to do or achieve something, where the Swede would argue for how it would not work, but the Estonian does not care. "Estonians are great, we have wifi and the most high-tech country in the world!" boasts the Estonian, and like a bumble-bee... sometimes they of course succeed and manage to soar. There are several traits shared between the Estonian and the Gnosjö spirit, though they are still very much not the same. Read more about how I feel about moving from Sweden to Estonia in the Emigrant Blog.

Finally, remember that there are no shortcuts to the perfect sound (notice Amazon customer tags such as "snakeoil" and "waste of money" - product page here and the Swedish hificlub selling praising the same cable)!

Friday, June 13, 2008

Dead poets rising against surveillance (brilliant video)

As I've been writing before, finally the Swedish media are being awakened (largely by the "blogosphere" or whatever you wish to call the social internet) about the abyss of surveillance society suddenly appearing right in front of us. It's not every day I am touched to tears by a youtube video, unfortunately it's only understandable in Swedish. Again from Erik at Framtidstanken:


Another notable participant in the debate is Patrik Fältström, our own IETF guru sharing his expert opinion and linking further to other good articles on the topic.

By the way, I am convinced that we're focusing too much on how Big Brother may watch us, and are forgetting about... our other siblings. I've got to write something about sousveillance and the clowd soon.