Everyone knows of the now infamous google malware database corruption. Google was able to fix the issue quickly, which is great and all. But what really impresses me is their open attitude when it comes to their end user products, like this post on the gmail blog.
You may be a big headless giant robot, but you're our big headless giant robot.
Wednesday, February 04, 2009
Sunday, January 11, 2009
Renaming MP3 by ID tag
Ever tried to recover from an IPOD dump, and get a bunch of files with the useless names? Here's a script to fix that.
And here's the perl script:
$ ls *.mp3 | ./rename.pl - | while read line; do OLD=`echo $line | cut -d, -f1`; NEW=`echo $line | cut -d, -f2`; mv "$OLD" "$NEW"; done
And here's the perl script:
#!/usr/bin/perl
#
#Your Love Means Everything.mp3: (tag v1.0)
#songname: Your Love Means Everything
#artist: Coldplay
#album: Varie
#year:
#comment:
#genre: Other(12)
#
while( <> )
{
chomp;
my %hsh = ();
my @info = `id3ed -i "$_"`;
foreach my $iline ( @info )
{
chomp $iline;
#print $iline . "\n";
if( $iline =~ /songname:\s+\b(.+?)$/ ){
$hsh{ song } = $1;
}
if( $iline =~ /artist:\s+\b(.+?)$/ ){
$hsh{ artist } = $1;
}
if( $iline =~ /album:\s+\b(.+?)$/ ){
$hsh{ album } = $1;
}
}
my $newname = "$hsh{ artist }" . "-" . "$hsh{ album }" . "-" . "$hsh{ song }" . ".mp3";
$newname =~ s/\s+/_/g;
print "$_,$newname\n";
}
Monday, January 05, 2009
Autologging in and running app in X
I've been keen on doing this for some time, but a combination of:
- lack of need
- lack of time
Thursday, December 25, 2008
Monday, December 22, 2008
Wednesday, December 10, 2008
My first fvwm module
I've been using FVWM for some time now, but have never tried writing any kind of modules to extend it. Yesterday I tried it out, and I've got my first working FVWM module.

I wrote the module in Perl, and you can view there source here. Basically what it does is capture window focus events, and will set the transparency of the window to whatever is set in a configuration file
You can add as many types of applications (one per line). For instance, Firefox has
To install the module, place it somewhere where the .fvwmrc ModulePath will find it, then place it into the StartFunction section:

I wrote the module in Perl, and you can view there source here. Basically what it does is capture window focus events, and will set the transparency of the window to whatever is set in a configuration file
pblair@laptop:~$ cat ~/.fvwm/fvwmPeteTrans.cfgThe above config will set all xterminals to 60% opacity when the focus moves away from it, but will return it to complete opacity once focus returns to it.
XTerm:0.60
You can add as many types of applications (one per line). For instance, Firefox has
$ xprop | grep CLASSSo you could either place "Navigator" or "Firefox" at the left of the colon.
WM_CLASS(STRING) = "Navigator", "Firefox"
To install the module, place it somewhere where the .fvwmrc ModulePath will find it, then place it into the StartFunction section:
AddToFunc StartFunctionP.S. You need "xcompmgr" and "transset" installed. And be sure to change the absolute pathnames within the module to the respective locations on your system.
+ I Module FvwmPeteTransFocus
+ I FvwmButtons
Tuesday, December 09, 2008
Guerilla Refactoring
In the world of software development, refactoring is the process of updating code (usually for the better). But the problem may exist where management sees the existing application as "good enough" and doesn't want to allocate any budget towards fixing what in their eyes "aint broke".
Enter guerilla refactoring.
I must admit that I fall victim to this. I find lots of things at work that could be expanded upon, or made better, which would drastically increase the use of the package, make it more robust, or simply more elegant and orthogonal. I ensure that it doesn't eat into my work time, and the end product is usually something that I will directly benefit from, but hopefully also something that will make someone else's life better/easier/simpler.
P.S. I recommend this podcast from NPR.
Enter guerilla refactoring.
I must admit that I fall victim to this. I find lots of things at work that could be expanded upon, or made better, which would drastically increase the use of the package, make it more robust, or simply more elegant and orthogonal. I ensure that it doesn't eat into my work time, and the end product is usually something that I will directly benefit from, but hopefully also something that will make someone else's life better/easier/simpler.
P.S. I recommend this podcast from NPR.
Long time no see
It's been about a year and a half since my last entry. I had lost complete interest in blogging and any self self congratulations that come with the territory.
But I'm starting to feel like I have more to share again, and I hope to see more posts here in the near future.
But I'm starting to feel like I have more to share again, and I hope to see more posts here in the near future.
Thursday, December 06, 2007
Shiny new iPod
Received a third-gen iPod nano on Monday as a thank-you for some work that I've been doing (at work), and just finally got the thing working!
These third-gen buggers require that the iTunesDB be signed with the device's serial number.
First I had to find the serial number by doing a "find" on "/proc" and grepping for "usb". The device came up, and I simply "cat"-ed the file to get the serial number.
Then, I used gnupod to sign my DB, using the command:
These third-gen buggers require that the iTunesDB be signed with the device's serial number.
First I had to find the serial number by doing a "find" on "/proc" and grepping for "usb". The device came up, and I simply "cat"-ed the file to get the serial number.
Then, I used gnupod to sign my DB, using the command:
mktunes.pl -m /media/IPOD/ --fwguid=$(cat ~/ipod.serial )Presto-- songs! No need to iTunes (well.. I don't run windows or OSX), but I just need to figure out how to get video and calendars onto this, and I'm set-- woohoo!
Saturday, June 02, 2007
BGP + RBL == Scary?
Well, we'll see.
http://www.pch.net/documents/tutorials/maps-rbl-bgp-cisco-config-faq.html
It makes sense, but something in my gut worries me when the router is automagically null-routing based on a RBL. Maybe I don't grasp the power of it... I'm looking forward to any discussion on this at MAAWG.
http://www.pch.net/documents/tutorials/maps-rbl-bgp-cisco-config-faq.html
It makes sense, but something in my gut worries me when the router is automagically null-routing based on a RBL. Maybe I don't grasp the power of it... I'm looking forward to any discussion on this at MAAWG.
Friday, June 01, 2007
Sunday, May 13, 2007
Change of view
This is entirely premature, but...
It looks like I'll be changing departments at work. The paperwork still needs to go through, but it looks like I'll be working in the Abuse department at work. I'm really looking forward to the change and the challenge. I was told that they need someone with both system-admin and programming skills, and that I suited that nicely.
With a mailbox count in the millions, email abuse (as well as abuse in other departments) is a critical aspect to the company. Untold dollars are wasted by abusers who eat bandwidth, annoy customers, ruin our reputation as a provider, etc etc.
Once things become official, I'll post more details. Until then, here's to counting the days!
It looks like I'll be changing departments at work. The paperwork still needs to go through, but it looks like I'll be working in the Abuse department at work. I'm really looking forward to the change and the challenge. I was told that they need someone with both system-admin and programming skills, and that I suited that nicely.
With a mailbox count in the millions, email abuse (as well as abuse in other departments) is a critical aspect to the company. Untold dollars are wasted by abusers who eat bandwidth, annoy customers, ruin our reputation as a provider, etc etc.
Once things become official, I'll post more details. Until then, here's to counting the days!
Thursday, April 19, 2007
Children of Hurin
Just picked up a copy of the Children of Hurin from Book City earlier tonight-- It's been a while since I've had any time to read any fiction, and am really looking forward to this book. I only learned of it three days ago via radio, and was surprised by the low media attention that it has received-- I would imagine that following the critical hype of the LOTR films, that any new material from JRR Tolkien would be met by more attention.
Apparently not.
Apparently not.
Saturday, March 24, 2007
Perl programmer, who me?
Yikes-- it's true. Just purchased Programming Perl, 3rd Ed., from Chapters and am starting to pick it up.
First impressions: It's a damned ugly language to work with, but is very flexible, so I understand why so many sys-admins love it; you can really hack together a quick and dirty application in no time flat.
We'll see how much I like it as time goes.
First impressions: It's a damned ugly language to work with, but is very flexible, so I understand why so many sys-admins love it; you can really hack together a quick and dirty application in no time flat.
We'll see how much I like it as time goes.
Tuesday, March 13, 2007
Saturday, December 30, 2006
Spammers... damned spammers

Here's a screenshot of a little python application that I wrote to manage some spammers on the system. I've 'sed'ed their domains to example.com, but it basically shows how many messages are currently queued on one of our outbound smtp servers.
Every shift, I run an application that monitors the queues, and when an individual account exceeds the maximum number of allowed egress messages, my application logs it, and removes it from the queue.
But, spammers are smart little buggers, so they of course create multiple accounts from which they spam a little bit from.
My software is smart enough that it keeps track of all found spammers from the past 30 days, and simplifies their email address, then compares that to all of the email addresses in the current out queue. If the simplified "known spammer" address matches any of the current addresses, then those current addresses are treated as a single address and their queues are aggregated. If the aggregate exceeds the threshold, then all messages are removed and the synonymous accounts are flagged as spammers for later termination.
Note: The addresses in the above screen cap are the ones that come out of the filter against the known/previous offenders. Only usernames that have been previously declared spammers are aggregated.
Oh, and here's a little graph showing the outbound message queue on a single server. The drop was when I started work that day.

Every shift, I run an application that monitors the queues, and when an individual account exceeds the maximum number of allowed egress messages, my application logs it, and removes it from the queue.
But, spammers are smart little buggers, so they of course create multiple accounts from which they spam a little bit from.
My software is smart enough that it keeps track of all found spammers from the past 30 days, and simplifies their email address, then compares that to all of the email addresses in the current out queue. If the simplified "known spammer" address matches any of the current addresses, then those current addresses are treated as a single address and their queues are aggregated. If the aggregate exceeds the threshold, then all messages are removed and the synonymous accounts are flagged as spammers for later termination.
Note: The addresses in the above screen cap are the ones that come out of the filter against the known/previous offenders. Only usernames that have been previously declared spammers are aggregated.
Oh, and here's a little graph showing the outbound message queue on a single server. The drop was when I started work that day.

Monday, November 06, 2006
New phone
Wednesday, October 25, 2006
Python: Functional programming
Thursday, October 05, 2006
Leslie Lamport
I just stumbled upon Leslie Lamport's website, which has electronic copies of most of his published work.
I've studied some of Lamport's work in the past (mainly in regards to Lamport Logical Clocks & totally ordered multicasting, etc) and was recently doing some digging to find out how & why he created the LaTeX extensions to TeX.
That was when I came upon his papers.. wow.
I've studied some of Lamport's work in the past (mainly in regards to Lamport Logical Clocks & totally ordered multicasting, etc) and was recently doing some digging to find out how & why he created the LaTeX extensions to TeX.
That was when I came upon his papers.. wow.
Friday, September 15, 2006
Graduate school
Katharine has submitted her final MRP to the school of graduate studies, and will do her oral defence in just under a week. Should all go well, then she'll have her MA.
This has gotten me thinking about my own future possibilites in graduate school. I have the marks, and just have to maintain my average with the requisite math courses (Calculus, Linear Algebra, Statistic) and my current courses.
I spoke with a professor with whom I'm aquainted, and I must admit that he's piqued my interest in pursuing a M.Sc at Trent.
This means that I'll have to pay higher attention to my studies, since I've (until now) been treating my B.Sc. as a terminating degree.
This has gotten me thinking about my own future possibilites in graduate school. I have the marks, and just have to maintain my average with the requisite math courses (Calculus, Linear Algebra, Statistic) and my current courses.
I spoke with a professor with whom I'm aquainted, and I must admit that he's piqued my interest in pursuing a M.Sc at Trent.
This means that I'll have to pay higher attention to my studies, since I've (until now) been treating my B.Sc. as a terminating degree.
Subscribe to:
Posts (Atom)










