Category: Snippets

  • Consuming Twitter streams from Java

    A while ago I was playing with the Twitter Streaming API, one of the first things I wanted to do was collect a lot of data for off-line analysis (in Hadoop).  I wrote a hacky little utility class called TwitterConsumer.java that did just the trick. Basically you just initialise it with a valid Twitter account…

  • Fedora Core 5 yum.conf

    Just a quick snippet of my /etc/yum.conf file which includes the ATrpms and FreshRpms repositories. [main] cachedir=/var/cache/yum keepcache=0 debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 metadata_expire=1800 [atrpms] name=Fedora Core $releasever – $basearch – ATrpms baseurl=http://dl.atrpms.net/fc$releasever-$basearch/atrpms/stable [freshrpms] name=Fedora Linux $releasever – $basearch – freshrpms baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms

  • Trac – Emptying a Wiki database

    A quick bit of shell magic to empty a Trac wiki database in a freshly installed Trac environment. In this example /var/www/html/trac is assumed to be the Trac environment you created with trac-admin. $ for page in `trac-admin /var/www/html/trac wiki list | cut -d’ ‘ -f1 | grep “^[A-Z]” | grep -v “Title”`; do trac-admin…