12 Mar 2007

controlling tv-playing linux machine using apple remote

i whipped a little home mashup of a tv tuner, mplayer on linux and the apple remote.

background

patricia has a samsung laptop which i have hijacked and replaced windows with linux. right now it is in our living room where it is connected to a USB1 tv tuner i bought a couple years back (i never got it to work on my powerbook.) so with the magic of the usbvision linux module and mplayer, it acts as a tv.

the only problem is that we have to get up off our lazy asses to change the channels, and that is no fun. given that we both have macs with the apple remote, i decided to figure out a way to control it using the apple remote.

by combining a udp server, running mplayer in slave mode and with some public domain code for listening to apple remote events on the mac, i now have a mplayer powered apple remote controller tv player on a laptop.

mplayer controls over udp

i'm sure there are other network control protocols for mplayer, but i didn't look very hard. i initially wrote a 20 line python udp server that pipes the output into mplayer's stdin. you can switch mplayer into slave mode so that you can type commands on the console to control it.

but after thinking about it a little, my 20 line udp server was really just:

netcat -l -u -p 8070 | mplayer -slave -quiet -flip -fs tv://bbc1 ...
i also configured gdm to auto login (after a 10s timeout) to the tv user and the xinitrc just starts this application. so when mplayer starts up, it will open in slave mode which means it accepts commands from stdin.

apple remote control

the apple remote control uses infrared. i couldn't really find much about getting it working under linux, but then again, i didn't have many infrared receivers on the hardware side of things. so instead, i just took some sample code from here on controlling the apple remote and hacked it to send a UDP packet on each keypress i was interested in containing a mplayer control string, eg:

tv_step_channel -1
so all it was doing was blasting this mplayer slave command through my home network and mplayer on my linux machine was picking it up and acting on it.

conclusion

although it would be more interesting to hack apple remote support in linux, this is the second best thing that can be done easier if you happen to have a macbook pro connected to the same network as your linux tv viewing machine.

for kicks and giggles, where is the python code that i wrote before i remembered that all that could boil down to a netcat command, and also the patch against the AppleRemote example code that controls mplayer over the network.

downloads

tv_serv.py
apple_remote-mplayer_network_slave_control.diff

... Read More


12 Mar 2007

does your street have a wikipedia entry?

wikipedia has an entry for the street i live on. apparently i'm living in what used to be london's old chinatown!

... Read More


12 Mar 2007

online-fobia

at the beginning of the year, i had a began to feel really stressed out by constant connectivity. i started unconsciously making myself more scarce and less online. checking email less frequently, working offline more, less IMing, less IRCing, etc.

the result was that more and more stuff was getting piled up and every time i came online to check mail or IM, i would get more and more stuff in my inboxes making me even more afraid of checking mail.

i've recently noticed the problem and actively trying to find ways around it. reducing the number of commitments i have is one thing that i'm working to achieve. deliberately taking myself offline and lowering the expectation of a speedy reply also works.

but really, the solution is to start implementing ways to deal with this stressful information and attention overload. one thing i've started looking at is getting things done, this methodology of keeping on top of this overload.

the idea is to really move things that need your attention from a huge queue into many smaller queues which you can act on in spurts. the challenge is to make these small queues meaningful. like for instance, you would make a queue for things that you need to "email", or "research", etc. and then you deal with those queues in spurts of 15-30 minutes. having the knowledge that those tasks will be done some time later is nice -- but i still need to schedule time to deal with them.

i'm still experimenting on how it can work for me, until it really figure it out, i'm still afraid of checking email frequently or being online on IM. argh.

... Read More


23 Feb 2007

crazy opening times in hk

i stopped over for a couple of days in hong kong enroute to sydney because there were a lack of reasonably priced tickets to sydney during chinese new year -- and i optimistically booked tickets to hk before i scoped out the sydney flights (more on that later)

i got a chance to visit friends and relatives in sydney which i hadn't seen for about two years. one thing that never ceases to amaze me is the opening times for shops in hong kong. i think it should be like this all over the world -- shops are usually open till 10pm on a normal day, and many are open till 12am. during chinese new year eve, it gets even more crazy with shops like levi's opening for 24 hours or regular clothing shops opening till 3:30am.

don't believe me? check this picture out yourself.

Hktimes

this whole phenomenon seems to be stemmed by hong kong's amazing competitiveness and the equally crazy working hours where people are regularly working 9am to 9pm at regular desk jobs, making it impossible to spend that hard earned cash.

... Read More


14 Feb 2007

hurray for empower on planes

currently 10km up in the air and travelling at 574km/h (according to my seat back display) on a cathay pacific flight to hk.

and i'm in economy class and i have my macbook pro plugged into the in-seat power supply. you can get an empower adapter for macbook pro from apple for £39 (a bit on the expensive side) but it is great not having to worry about power for the next 8 hours. all planes should have these!

the only down side is that it doesn't provide enough power to charge your battery, so make sure you have a full charge on your plane.

... Read More


10 Feb 2007

using orange gprs with mac via bluetooth

when in a pinch without any reasonable wifi or internet access, orange gprs is the way to go. at £1/day if you buy an extra with your pay as you go account (dial 450 and then press 3-1-1-1-1) you can get unlimited GPRS up until midnight on the day of purchase. so don't go and by it at 11:30pm unless you are really desperate.

set up your phone with GPRS, you can go to this handy page:

http://setup.orange.co.uk/myPhone/Internet/

then once you get through all the prompts, you should be sent the GPRS settings for your phone. for instance, on my nokia 6600, the settings are in:

Settings > Connection > Access Points


Orangegprs

note the order which they are displayed, you will need to note that when you connect with it via your mac. for instance, mine is the first one "1".

the other critical step to do while you still have network access is to download some GPRS scripts. you can go to Ross Barkman's Modem Scripts and downoad the Nokia or Sony Ericcson GPRS scripts. those are the ones that i've tried and had good results.

after extracting the download, you'll need to drop them into "/Library/Modem Scripts".

after that, you'd want to pair your phone with your mac via bluetooth. once you do that, in your network preferences you should be able to select the Bluetooth interface and have the following options (for a nokia 6600):

Bluetoothnet1

choose Nokia GPRS CID1 for if your access point appears to be the first, or CID2 if it is the second, and so on. you can experiment with the 57.6K scripts too, but it wasn't necessary for me.

Bluetoothnet2

remember to put in "None" in the telephone number, and you don't have to fill in any of the account name and passwords.

and in PPP options:
Bluetoothnet3-1

remember to switch off "Send PPP echo packets", otherwise you'll find your GPRS session disconnecting every couple of minutes.

once that is all done, you should be able to go to "Internet Connect", select Bluetooth and dial out.

for debugging purposes, you can enable "Use verbose logging" in the PPP options and open up "Console.app" and look at /var/log/ppp.log for more information.

a final note, for sony ericsson phones, they setup access points slightly differently, so instead of the phone number "None", you must put in the name of the orange access point, which in my case is "orangewap".

... Read More


11 Jan 2007

fuse on mac

this is something i've wanted for a long time, finally someone released it.

google just released a kernel extension called MacFUSE that has the same API as the FUSE (userspace file system) for Linux. so now i can run sshfs_mount on my mac as well. sweet!

... Read More


04 Jan 2007

plotkit spotted in the wild

taking netnewswire through its late evening paces as i trade sleep for rss. i ran across this screenshot, which i did a double take -- is that plotkit?

 Gonfunko Public Images Tl Mainwindow

it turns it out is. i'm impressed. i need to spend more time on plotkit to bring in all the changes and patches that have been sent to me. damn it, i need to find more time or sleep less!

... Read More


31 Dec 2006

wifi on coaches between cambridge and london

after my blog post about the lack of working wifi on the coaches between cambridge and london, i was surprised to receive an email from Jim Baker at Moovera Networks about the status of the wifi on those coaches;

"The six month Wi-Fi trial that National Express was running has come to an
end but this very week we're configuring new units for installation on these
coaches, for permanent service on the same route. We expect to have these
installed during the first two weeks of January. "

firstly, i'm extremely impressed that someone involved with the project of putting wifi on coaches contacted me because of a short paragraph i wrote. i didn't even really rant, i just noted that it didn't work for me and that i had to use GPRS.

secondly, it is pretty cool that these will be permanent. but there is a problem where the seats don't have enough space for me to use my macbook pro comfortably. but it would make the 2 hour journey more enjoyable if i wasn't taking the trains.

... Read More


31 Dec 2006

the mysterious "duck tape"

i had to do some emergency repairs on new years eve, and thus i dropped by the local hardware store for some duct tape. turns out the only brand homebase had was the confusingly named, "duck tape".

 Common Graphics Products Duckproducts Productshots Item 49-1

turning to google and wikipedia, it turns out that duck tape is a brand of duct tape. or it is possible that duct tape used to be called duck tape but was renamed duct tape to make things confusing for consumers.

to make matters worse, apparently australians have not been exposed to the wonders of duct tape, and instead used the phrase "duct tape" to refer to an inferior quality tape that doesn't have the holding power of cotton threads!

finally, duct tape apparently comes in different colours, even a transparent one for when the silvery finish of everlasting holding power is not good enough for you.

... Read More