Monthly Archive for May, 2009

Something that’s annoying

... losing your passwd/group files when you don’t have a (recent) backup.

Well, it is especially annoying when you’re connected remotely and don’t have a root shell. When you have root privileges, here’s your solution:

cd /var/db/pkg
for i in `grep useradd */+INSTALL | cut -d: -f1`; do
    env PKG_PREFIX=/usr/local/ sh $i ${i%%/*} PRE-INSTALL;
    env PKG_PREFIX=/usr/local/ sh $i ${i%%/*} POST-INSTALL;
done

Obviously that can be done in one line, I just wrapped it to make it easier to read.

You’re welcome.

Moonshine enters FreeBSD Ports

I’ve had the port locally for some time, but since the tree was frozen and there was no rush to commit it, I forgot about it. Anyway, here it is!

Also, I added the pulseaudio option (on by default) to the moonlight port, which makes the moonshine experience much more interesting.

When everybody’s talking about Moonlight 2.0 Preview, we’re finally getting somewhere with 1.0 :-)

FreeBSD(ish) blogs get some TLC

Quick summary of the changes:

  • WordPress MU updated to 2.7.1

  • Automatic upgrade is fixed now, so hopefully I’ll be upgrading wpmu and the plugins faster from now on

  • K2 theme updated: if you’re planning on using it, I recommend activating Advanced Navigation in K2 options and also use Widgets (both in Appearance menu) or your sidebar will look funny.

  • New plugins: All in One SEO (search engine optimization), Sociable (share on social websites), WPhone (iphone friendly css), Akismet (anti-spam), Twitter (display twitter feeds)

  • Removed plugins: Iwphone (superseded by WPhone)

  • Plugins considered for removal (shout if you want to keep them): Sol-Digg and Sol-Delicious (superseded by Sociable), Spam Karma 2 (superseded by Akismet)

Also I’m having issues with bundled OpenID delegation support, so I’ll keep the third-party plugin for now. As usual, send me an email if you would like new themes/plugins, or if something got broken.

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!