Posted by odie5533 on May 31, 2010
Twisted is a great framework for Python, but they don’t support RDT or RTSP protocol used for streaming Real video. The RDT/RTSP handler in MPlayer is a bit buggy and suffers from disconnect problems when receiving RTSP packets after switching to raw mode for RDT (though perhaps such occurrences are out of specification, they do [...]
Posted by odie5533 on May 30, 2010
Because manually downloading songs from Grooveshark is too tedious, here’s a nice process to automatically save all the songs you listen to on Grooveshark. Unlike other methods, this does not use any extra bandwidth so you don’t need to listen to the song and download it, once is enough.
Posted by odie5533 on May 16, 2010
Resize-match-dpi is a GIMP Script-Fu script written in Scheme to resize or scale an image along with scaling the DPI. Let’s consider an image being scanned which is 4.75″ x 4.70″. We scan the image at 300 DPI with a pixel resolution of 1425 x 1409 and we want to scale it down to 1280×1266. [...]
Posted by odie5533 on May 5, 2010
This AWK script uploads an image to TinyPic.com and returns the direct url to the uploaded image. Example script usage: $ awk -f tinypic.awk The_Grass_Snake_-_Natrix_natrix.jpg http://i39.tinypic.com/dlnb6r.jpg Let me start by saying I have no idea why I wrote this in AWK. I’ve only used AWK once before for a very short one-liner. I find AWK [...]
Posted by odie5533 on April 14, 2010
Wiki Parser is a Python program which takes a Wikipedia dump and hosts it locally, offline. To save disk space, Wiki Parser keeps the dump compressed and serves articles to a web browser without decompressing the entire file. I originally created it to serve up Wikipedia articles from a compressed version, but seek times on [...]
Posted by odie5533 on August 1, 2009
Most of the programming I do is packet replication and automation. My workflow is to first analyze the handshakes and protocols in FireFox with the Tamper Data add-on. I use WireShark to nail down the interaction details. Finally, I recreate everything using the Twisted library in Python. Here’s a boilerplate to quickly recreate packets using [...]
Posted by odie5533 on January 10, 2009
When downloading a file from Perl, there’s many ways to go about it. You can use LWP, libcurl, wget, curl the program, etc. My shell hoster doesn’t include many perl bindings so I can’t use LWP or libcurl. I use `curl -s $url` to download urls. The only problem with using any of the above [...]
Posted by odie5533 on December 21, 2008
Here’s a snippet for uploading a file via FTP using the Twisted Python library available from TwistedMatrix. from twisted.protocols.basic import FileSender from twisted.protocols.ftp import FTPClient from twisted.internet.protocol import ClientCreator from twisted.internet import reactor def fileTransferFail(failure): failure.printTraceback() reactor.stop() def cbStore(consumer, filename): fs = FileSender() d = fs.beginFileTransfer(open(filename, ‘r’), consumer) d.addCallback(lambda _: consumer.finish()).addErrback(fileTransferFail) return d [...]
Posted by odie5533 on November 8, 2008
I get so many hits to my site every day from people looking for it, so here it is. Download HaloHBF v0.1
Posted by odie5533 on November 2, 2008
I have an mp3 player. No video, no wma, no ra, no ogg, just mp3. So I have to convert all my media to mp3 to work on my player. Most media I use can simply be listened to and the video, while nice to have, is not necessary. I have written a batch file [...]