Blog posts tagged "hacking"

Flickr Trends

March 3rd, 2009

snow vs flowers

Based on Derek’s NYT Trender and some APIs we haven’t gotten around to releasing, I spent 20 minutes whipping up Flickr Trends yesterday morning.

App Engine is awesome for this kind of stuff.

Favorite’s I’ve found so far:

Flushing Rails Database (MySQL) Sessions

December 7th, 2005

I use Rails’ database session backend for LM. (for login, as well as “flash”) Without any sort of built in garbage collection the sessions table gets very large, very quickly. Beyond aesthetic issues, this can also cause MySQL’s key buffer to fill up. (which on Debian is by default set quite low)

So I wrote up a quick flush method, and saved it in a file models/session.rb.

class CGI::Session::ActiveRecordStore::Session
  def self.flush_old_empty_sessions
     self.delete_all "DATE_SUB(NOW(),INTERVAL 6 HOUR) > 
     updated_at and BIT_LENGTH(data) <= 688"

This says nuke all sessions which are over 6 hours old, and which are empty. (688 is the length of the serialized session with an empty flash)

MySQL specific, and susceptible to changes in either session structure or its serialization. But it was quick and easy and worked for me.

Then you simply need a cron job like: ruby script/runner 'CGI::Session::ActiveRecordStore::Session.flush_old_empty_sessions'

Tagged: Uncategorized , , , , ,

Status Update: XML::RSS, Magpie, cvs2rss, wp-agg, etc

May 28th, 2005

Dan from GeekUprising is now the official maintainer of XML::RSS. I imagine his first major change will be to incorporate the patch he sent me last Fall splitting the RSS creation logic from the RSS parsing logic (while still being transparent to people who don’t want that kind of thing). Congratulations, and welcome.

cvs2rss has been missing since the last server move, but well placed nudge from Phil got me to dig up the archives today, so voila, as they.

My aggregator for WordPress, affectionately known as wp-agg is officially superseded by FeedWordPress. Charles has done a great job growing the idea to something useful to someone other then me, and polished it off by actively maintaining it. Nice work. I’ll be switching the Magpie blog as soon as I get a chance.

Sourceforge stats after a 6 month hiatus (or was it 18 months? now I’m forgetting), are finally back, now with largely useless graphs. I had a hunch that usage had continued to grow and it has, with 5,000 page views a day, and 6,000 downloads a month. Wow. Really need to revive the website to handle the enlarged community. Need a good domain name first.

You know, now that I’m a contractor again, if someone wanted to hire me for 20-25 hours of work I’ve got a list of features that I’d love to have time to roll out as MagpieRSS version 0.8.

Tagged: Uncategorized , , , , , ,

Package Surgery

August 16th, 2004

I’ve started putting together Debian packages for our dev platform at work, and stumbled upon an obvious, and yet new to me technique for building quick and dirty .debs … package surgery. I’ve got a MySQL 4.1.3 package (an official package won’t be showing up anytime soon is the rumor) by the simple expedient of downloading the 4.1.3 source from, and copying over the debian directory from the official package. Similarly a PHP 5.0.1 package that is compatible with Apache2 (apache2-mpm-prefork) is available by downloading DotDeb’s php5 package, and tweaking its debian/rules file. (rumor has it an official one of these might show up soon-ish)

Both are still pretty rough around the edges (I’m having trouble with config files not being installed, and not being updated properly), but hopefully in the next few days they’ll be available to a few brave souls. (Though they already install pretty cleanly on an up-to-date sarge)

In the mean time, anyone know where I can find instructions on setting up an apt source?

Tagged: Uncategorized , , , ,

Cascadia Anarchist Tech Skill-Share

October 24th, 2003

If you’re a radical techie in or around Seattle (crews from Vancouver and Portland are coming) then you should to CATS this weekend, Saturday and Sunday, at the IMC.

CATS is an informal skill swap and socialize aimed at activists who are using technology in their work. Bring your own presentations, discussions, projects and hardware. Except conversations on collaboration, geek culture (and its negative impact on diversity), building secure webservers, VoIP (we’re all hoping someone will show up, and tell us all how its done), Debian NP, and whatever else people are moved to discuss.

See the wiki for some projects which people have said they would be willing to talk about (or have been volunteered to speak about)

Now and forever.