Remote tail with GeekTool

April 7th, 2011

Today I discovered a wonderful OSX control panel called GeekTool, which lets you put all kinds of stuff on your desktop. I wish I had known about this long ago, but better late than never =)

My goal was to tail a logfile on a remote server and display it on my desktop. GeekTool supports three types of “Geeklet”: File, Image, and Shell. File displays the content of a file, Image displays an image, and Shell displays the output of a shell command (good thing I’m here to clarify!) Each of them has various options, which the GeekTool website documents in further detail.

The shell geeklet is implemented as a (probably recurring) shell command that gets run, with the output being shown on completion. Unfortunately, this rules out the simple approach of `ssh user@server “tail -f /var/log/yourlog”`. By running an ssh process to tail the log and piping the output into a local file, we can happily have our “log tail” without continuous ssh connects and disconnects: `ssh -f user@server “tail -f /var/log/yourlog” > /tmp/server_log_yourlog`.

Throw in a file geeklet, and you’re done. I happened to want the newest text on top, so I used a shell geeklet of `tail -r -100 /tmp/server_log_yourlog`. Enjoy your upside-down live server logs on your desktop!

Sign an applet jar with an existing ssl certificate

November 15th, 2010

Since this was a bit of a pain for me, I figured I’d post a quick how-to. I couldn’t find any one page with info, so this pseudocody howto is gathered from a few places.

The only easy way seems to be using a java tool called not-yet-commons-ssl which will do this for you. So download their latest jar and use it (update as necessary for your version of not-yet-commons):

java -cp not-yet-commons-ssl-0.3.11.jar org.apache.commons.ssl.KeyStoreBuilder your-new-keystore-password-here yourdomain.tld.key yourdomain.tld.crt

This will leave you with a yourdomain.tld.jks file, which you can then go ahead and sign your applet with:

jarsigner -keystore yourdomain.tld.jks -keypass your-new-keystore-password-here applet.to.sign.jar yourdomain.tld

ffmpeg with x264 and libavfilter on debian squeeze

September 27th, 2010

Since the deprecation of vhook, it’s hard to watermark videos in ffmpeg. With the new google summer of code changes, it’s possible to do watermarking again. The problem is, this requires building a recent version of ffmpeg. And if you want x264 support too, the package in Squeeze isn’t recent enough, so that has to be compiled too. Anyway, here’s the “guide”. It’s based off FFmpeg image overlay and install ffmpeg on Debian Lenny from SVN and x264 from GIT, with a few small adjustments.

Let’s start by installing all the dependencies for debian’s ffmpeg package:
aptitude build-dep ffmpeg

We need to add the debian-multimedia repository. Edit your sources.list:
vi /etc/apt/sources.list

Add in these lines for the debian-multimedia repository:
deb http://www.debian-multimedia.org squeeze main non-free
deb-src http://www.debian-multimedia.org squeeze main non-free

Then add the repository key so dpkg doesn’t complain (you’ll need install wget):
aptitude install wget
wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb
dpkg -i debian-multimedia-keyring_2008.10.16_all.deb

Then update:
aptitude update

Now we’ll install some packages to flesh out ffmpeg’s format support:
aptitude install libmp3lame-dev libxvidcore4-dev libfaad-dev libfaac-dev liba52-0.7.4-dev

And we’ll need subversion and git to grab sources for ffmpeg and x264, respectively:
aptitude install subversion git

Now, let’s go ahead and check out the summer of code branch of ffmpeg
svn co svn://svn.ffmpeg.org/soc
cd soc/libavfilter/
./checkout.sh
cd ffmpeg/
./configure --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libgsm --enable-postproc --enable-libxvid --enable-pthreads --enable-libvorbis --enable-gpl --enable-x11grab --enable-nonfree --enable-filter=movie --enable-avfilter --enable-libfaac

At this point, the configure script will complain that “ERROR: libx264 not found”. So now it’s time to install x264:
cd ../../..
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0squeeze1" --default

Now, back to ffmpeg:
cd ../soc/libavfilter/ffmpeg/
./configure --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libgsm --enable-postproc --enable-libxvid --enable-pthreads --enable-libvorbis --enable-gpl --enable-x11grab --enable-nonfree --enable-filter=movie --enable-avfilter --enable-libfaac
make
checkinstall --pkgname=ffmpeg --pkgversion "4:0.7+svn`date +%Y%m%d`" --backup=no --default

And that’s it! You now have ffmpeg on your debian squeeze system (should work fine with lenny if you change the debian-multimedia sources.list entries).
Update: Added libfaac.

PwnageTool 2.0

July 19th, 2008

PwnageTool (jailbreaking/unlocking for iphone) has been released. There’s enough excitement that all the mirrors are (essentially) down, so I’m mirroring a copy too.

PrintRoom Albums

April 10th, 2008

I today had the unfortunate experience of having to deal with PrintRoom, which is pathetic. Not only do all pictures (in my case, anyway) get stamped with a low-rent watermark, but they’re shown through a flash-based interface, and scaled to 1.2x original size by a low-quality algorithm!

Needless to say, I took personal exception. So I wrote a script to download all the photos out of a PrintRoom album. It required a perl interpreter, the LWP::Simple module, and wget installed on your system. If you don’t know what this means, the script is not for you. If you have a compatible system and are stuck with printroom, then download the script.