Saturday, 23 May 2009

Mormon Radio - In Latin!

Mormon radio is available at http://radio.lds.org


Sadly, the media transport is RTMPT, a proprietary adobe format, which limits reception to those with an adobe flash plugin. That also means x86 PC architecture.


This excludes all streaming audio devices in the world except Adobe Flash. Oh - and there will be iPhone support soon.


How can this seem nearly OK? There are loads of widely supported mechanisms for streaming audio - why choose one with such limited support? This is like publishing the bible only in Latin - because everyone speaks Latin - or at least everybody who needs to read the Bible speaks latin. And what's so special about the iPhone that cuts out my streaming radio?

(Read more at: http://tech.lds.org/forum/showthread.php?t=3119)


Vatican radio on the other hand does it quite well:

http://www.radiovaticana.org/en1/diretta.asp


It supports wma, real (and mp3 in the left column) and no need for any freaky platform-restricted plugins.


So, I'm a church member and I can wake up to Vatican Radio, but not Mormon Radio - why, exactly?

Someone has to make an active decision and sign a large purchase order to do things as wrong as this.

However, by standing on the shoulders of advocates of software freedom, using wireshark to look at the network packets and recognize RTMP as the protocol, swfmill to take to pieces the flash radio player to get the audio addresses, and flvstreamer to dump the audio, I managed to cobble together a system that allows the stream to be converted into an MP3 stream so that mp3 players can pick it up. I've called this the Wycliffe hack in commemoration of John Wycliffe who strove to make religious material available to everyone.

flvstreamer/flvstreamer_x86 -v -r rtmpt://fls2g1.services.att-idns.net/al1/8004_8806_01 -s http://radio.lds.org/mc_files/flash/theMormonChannelPlayer.swf> -p http://radio.lds.org/eng/listen-now -o /dev/stdout > RADIO.flv


Of course I don't want to dump to a file called RADIO.flv, I want to convert the stream to mp3, but commands like this work:

cat RADIO.flv | ffmpeg -f flv -i - -f wav -


if they read from flvstreamer stdout, they fail!


So while I've solved the hardest problem, I need to sort out the glue.

Saturday, 2 May 2009


About a year ago I was called as second councillor to the Bishop in Wakefield Ward.

One of my responsibilities is to arrange the meeting programme and to give out speaking assignments, and then conduct the meeting for four months of the year.

I like to be well prepared for things which would otherwise be embarrassing, so to help me I produced an open office writer template that has four pages.

The first page is a meeting programme, with some grey fields to be filled in with things like,
  • the date and meeting type
  • the person conducting the meeting
  • the speaker names and topics, and duration etc.
By filling this in I get a regularly formatted meeting programme which helps me when conducting the meeting.


The bonus, however, is pages 2-4, which are speaker assignment letters and are automatically filled in for me. They inform each of the speakers of
  • the date and topic
  • how long they should plan to speak for and at what time they should finish
  • what other topics will be addressed in the same meeting
  • some tips on good preparation
  • who to contact for further information
So I write out the meeting programme and the computer generates a helpful invitation letter which I can edit if particular speakers need additional information or encouragement.

And I hit print!

Recently the template broke because I used a variable date internally which now (I guess) seems to conflict with some changes in OpenOffice 3. As OpenOffice documents are zip files, the simplest fix was to unzip the template and do a search and replace on the document xml, to replace date with mdate:

$ mkdir t
$ cd t
$ unzip ../vSacrament\ Meeting\ Assignments.ott
$ sed -i -e 's/name="date"/name="mdate"/g' content.xml
$ zip -r ../x.odt .


And then open and re-save the document in OpenOffice

Thursday, 23 April 2009

Practical Jokes

Practical Jokes - all the fun of mean tricks with none of the guilt.

Ever have trouble coming up with a mean trick that is appropriate to the
situation and also compliant with your nice personality? Of course you
have!

Practical Jokes have none of these problems, and are often expected to
be in bad taste. What's more you'll gain the reputation of being fun to
be with.

Stop your individualistic and crass cheap bullying and buy our practical
jokes today! People will like you for it!

Monday, 20 April 2009

Wild virtues

While reading Daniel Hannan's "If you pay people to be poor, you'll never run out of poor people" blog post, I came across this lovely quote from G. K. Chesterton:
"When a religious scheme is shattered, it is not merely the vices that are let loose. The vices are, indeed, let loose, and they wander and do damage. But the virtues are let loose also; and the virtues wander more wildly, and the virtues do more terrible damage. The modern world is full of the old Christian virtues gone mad. The virtues have gone mad because they have been isolated from each other and are wandering alone. Thus some scientists care for truth; and their truth is pitiless. Thus some humanitarians only care for pity; and their pity is often untruthful." - GK Chesterton

Tuesday, 17 March 2009

Auto-mount of windows shares on Ubuntu login

Based on https://wiki.ubuntu.com/MountWindowsSharesPermanently and updated:

$ sudo apt-get install libpam-mount smbfs
$ echo "@include common-pammount" | sudo tee -a /etc/pam.d/gdm
$ echo "@include common-pammount" | sudo tee -a /etc/pam.d/login

fix up server= and mountpoint= below

$ sed -i -e '/<!-- Volume definitions -->/a<volume user="*" fstype="cifs" server="10.42.0.1" path="users/%(USER)" mountpoint="/home/%(USER)/ntfs" options="uid=%(USERUID),gid=%(USERGID),iocharset=utf8,fmask=0770,dmask=0770" />' /etc/security/pam_mount.conf.xml

Make sure unix password is same as windows password and unix username same as windows username unless we use ldap in nis, but thats another story…

Monday, 9 March 2009

MS PPTP VPN server with linux

I've been tearing my hair out for the last 8 working hours trying to get my Ubuntu Hardy VPN helper to connect me to a Windows 2003 PPTP service.

A windows PC would connect fine, but my linux clients would all fail, generating this message in the Windows server Event log: "You do not have permission to connect using the selected authentication protocol."

I'd done what I could to make sure my RAS policies specified MSCHAP, MSCHAPv2 and had EAP disabled (I had no certs and was fed up of RAS failing for lack of them). My linux clients were also selected to use only MSCHAP and MSCHAPv2 - but still no joy!

The final missing tip was the last post at: http://www.eggheadcafe.com/forumarchives/Windows2000ras_routing/Jan2006/post25331080.asp
where it seemed that I had to make sure the RAS servers own authentication methods matched (or probably were a superset of) the authentication methods of the policy. Once that was fixed, it all worked fine.

While I was there I also set the correct adaptor for use by DHCP/DNS/WINS as I only have one active adaptor anyway!

Tuesday, 17 February 2009

USB-B3G on Asterisk

I got a couple of the yealink USB-B3G from Maplin Electronics at £3 each, meaning to get them to work with asterisk.

By being busy I get last-movers advantage and find it all works from years of other people doing it for me:
  1. The kernel already has the USB drivers installed.
  2. USB2KAPI provides a libusb style daemon to control the device, available from http://kb2kskype.sourceforge.net/
  3. The asterisk driver for that is written at http://www.artaylor.co.uk/usbb2k.html
nice!