Hacking youtube videos for iPhun (and profit)
If you’re not an iPhone owner, then you’re probably not going to be interested by this post. If you don’t like custom ringtones then you’re definitely not going to be interested by this post. If you’re still reading, I’ll explain you quickly how to convert youtube videos to iphone ringtones.
This is basically going to be a quick walkthrough rather than a long explanation. Basically you need a way to download the youtube video (like youtube-dl) and ffmpeg compiled with faac support.
For FreeBSD users, this is as simple as installing the two ports: net/youtube_dl and multimedia/ffmpeg (make sure to run ‘make config’ and check that FAAC is on). For MacOS X users, the easiest way will be to download youtube-dl to your home directory (and put it in /usr/local/bin if you wish) and install ffmpeg following these instructions. Windows users can install iRinger (haven’t tried it but it looks quite nifty).
Ok, now for the actual information (this is actually pretty easy).
First, find a video you like (in my case, Bird is the word in Family Guy) and download it.
$ youtube-dl 'http://www.youtube.com/watch?v=2WNrx2jq184'
Then drop the video part and convert the MPEG stream to AAC.
$ ffmpeg -i 2WNrx2jq184.flv -f ipod -vn birdistheword.m4r
Alright, that’s it! Wait, I want to get rid of the first few seconds and the last few seconds as well. Let’s just play it in mplayer (or QuickTime, or iTunes) and find the offset (-ss option) then the length (-t option). The -y option is to force overwrite the output file.
$ ffmpeg -i 2WNrx2jq184.flv -f ipod -vn -ss 28.6 -t 44.2 -y birdistheword.m4r
Once this is finished, just send the ringtone to the iPhone, either using scp if your iphone is jailbroken (put it in /Library/Ringtones/) or via iTunes (just drag and drop it in Ringtones, then sync the iPhone). Enjoy!
Permanent TSB Open24 Online Banking
I really hate perl, really, but sometimes it really does its job well.
So today, for the first time, I’ve used WWW:Mechanize (www/p5-WWW-Mechanize) and I’ve created a simple script to check my irish bank account on Permanent TSB Open24 Online Banking.
Here is the result. It’s far from perfect, and the code is ugly but it does the trick. if I find some motivation another day, I’ll probably add new features besides accounts summary.
EDIT: link was broken, it’s fixed now.
Vim and TextMate
Yesterday while cleaning my hard drive, I found the 20MinutesWiki video that presents TurboGears I downloaded some days ago and watched it. It’s quite impressive but what I seen besides technical stuff was the editor Kevin Dangoor (the presenter) was using : TextMate. It had some completion features that seemed quite nice. So, as a vim user, I decided to look if someone already wrote such a plugin and finally found it!
As an example, you can add this to your ~/.vim/ftplugin/c.vim (you need to change delimiter to ‘?’) :
Iabbr inc #include "?file?.h"^M??
There are some issues though, the most important being it breaks the indentation (well, you can still use Ctrl-F).