random($code) pre-launch checklistby lhl (Design Spec | Drupal | random($code) | RFE | TODO)Note to visitors: this site is pre-launch, and will be undergoing extensive overhauls ... err, when I have time. So, after election project stuff I went on vacation for a little while, which led to a couple other things. In between, I moved my blog over to a new system, and everything has halted while I grind away in crunchtime on work work. TODO addusers.pl for Confluenceby lhl (Major | Perl | Web | Public Domain)Here's a script I wrote a couple weeks ago for easing user management for Confluence. It turns adding users and users to groups into a much less painful affair. Requires: WWW::Mechanize HTML::TokeParser Crypt::RandPasswd Should be an easy breezy install w/ CPAN ( Instructions are included with the code, and the code is pretty straightforward as well. If you're dealing with lots of users, trust me, it'll save you time. iTunes Openerby lhl (AppleScript | Major | OS X | Public Domain)I've been horrible about releases, here's one that fixes iTunes' crap M3U handling. Here's the original blog entry I wrote about it. Basically, this will intercept M3Us and then create individual playlists for them instead of dumping the songs directly into your Library (where after playing the first song, the songs in the lists are scattered to whatever your Library ordering is). flickrer - automatic Flickr uploadingby lhl (GPL | Major | Perl | Web)Here's a script I've been using for the past couple of weeks since I started really using Flickr. Requires: File::Basename File::Copy LWP::UserAgent Flickr::Upload Should be an easy breezy install w/ CPAN ( flickrer first checks that it isn't already running via a process search, then looks the files from the DropCash PHP Outputby lhl (Example | Major | PHP | random($foo) | Web | Public Domain)I started my first Dropcash campaign today. and coded up a large custom "badge" for my campaign with a little bit of PHP glue. If you're using PHP5 you'll probably want to use SimpleXML, which looks totally rockin', but for us less adventurous shlubs, give PEAR::XML_Serializer an install (you might need to -f for since it's still 'beta') and check this out: <?php
// Caching
$cache = '/tmp/dropcash';
$agelimit = 5 * 60; // 5 minutes
$timestamp = @filemtime($cachefile);
$age = time() - $timestamp;
if($age > $agelimit || $_SERVER['QUERY_STRING'] == 'update') {
$f = fopen($cache, 'w');
fwrite($f, file_get_contents('http://www.dropcash.com/campaign/[user]/[campaign_name]/xml'));
}
$xml = file_get_contents($cache);
require_once 'XML/Unserializer.php';
$u = &new XML_Unserializer();
$u->unserialize($xml);
$dc = $u->getUnserializedData();
$percent = $dc['percentage'];
$percentpx = floor($percent * 4); // 400px bar
$goal = $dc['goal'];
$collected = $dc['total_collected'];
?>
This will probably make more sense w/ the rest of the badge code since it's a bit style-based (for the percentpx). record - a simple recording script for your Macby lhl (GPL | Major | OS X | Shell | Unix)Written originally for OSCON 2002, this is a simple record script that I wrote for my Mac (and my home-built headphone-embedded binaural microphone). I recently updated this to make sure that it still works (it does), although honestly, if you have an iPod, I recommend picking up a Griffin iTalk, it's great. Still, this is a handy script to have in your ~bin just in case. I recommend using Fink to install esdrec and lame: sudo fink install esound sudo fink install lame TODO: switch modify encoding paramaters? CRM114 Mail.app Training Scriptsby lhl (AppleScript | CRM114 | GPL | Mail | Mail.app | Major)At the beginning of this year, I knew I needed a new Spam filtering solution and switched to a getmail (much better than fetchmail) and more robust Procmail setup, running CRM114, an advanced learning filter based on alien space technology (well, more accurately, math beyond my ken). Full setup information belongs in the scope of another site, but I also wrote some AppleScripts to make training much easier w/ Apple's Mail.app I've included the earlier manual training scripts, as well as the subsequent 'smart' training script that I continue to use today. I suspect I'll continue using this until I switch to a fully automated, web/db-based TUNE method. Self-Updating Web Softwareby lhl (Brainfart | Example | PHP | Related | TODO | Web)Anil announced the recent release of MT 3.12, which has, among other things, One of the great things about Drupal is its integrated URL handling, so that's definitely part of the way to go. Apache, or 'full system' integration is certainly a big step for web software to take. Of course, there are those pesky permissions problems and securities risks... Here's a little bit I wrote a while back for a file that's in a public folder listing (labeled '!!!_donotclick_youwillbebanned.foo' and w/ a robots.txt Deny rule) to block aggressive spiders: include.py - Trac Macroby lhl (GPL | Python | Trac)Inserts the output of an external URL. Example: [[include(http://www.example.com/)]] Ver: 0.7.1+ hiptop.pl - Sidekick Address Exporter 0.2.1by lhl (GPL | Major | Perl | Unix)Written last winter, this is the Mechanize script I used to dump my T-Mobile Sidekick's (Danger Hiptop) Address Book into an iCal compatible format. It's quite unfinished, and possibly not working anymore (if the site's changed). But in case there's still (for shame, Danger, for shame) not any syncing software available, this is a good starting point. Originally posted on the Danger Forums here. |