How To Delete All Messages From A Folder In Pine
Sunday, March 23rd, 2008
Pine is a UNIX command line mail application. So how do you delete all messages in a folder?
The combination is
1 | ; A A D |
If after pressing ; you see
1 | [Command ";" not defined for this screen. Use ? for help] |
then you don't have a check in the "Enable aggregate command set" settings checkbox. To enable it, go to the main menu (M) -> Setup (S) -> Config (C) and scroll down to "Enable aggregate command set". Then press X (to check it), E (Exit). Now repeat the above.
Quick Perl Snippet: Finding If A File Has A Media Extension Using Regex
Friday, March 21st, 2008
Updated: May 1st, 2008
Sometimes in my line of work, I need to figure out if a url or filename point to a media file by checking for the file extension. If it's a url, however, it may be followed by various parameters. Not to overcomplicate things, I came up with the following Perl code:
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/perl -w
use strict;
my $name = "some_file.flv"; # or http://example.com/file.mp4?foo=bar
my $is_media_type = ($name =~ /\.(wmv|avi|flv|mov|mkv|mp..?|swf|ra.?|rm|as.|m4[av]|smi.?)\b/i);
if($is_media_type){
print "media extension found\n";
}
else{
print "not a media file\n";
} |
This gets the job done without triggering any false positives (at least for the files/urls I've been dealing with so far). Am I missing any obvious types? Do you have a better way to accomplish the same thing? If so, please share in the comments.
Must-Know People In The MySQL Field
Tuesday, March 18th, 2008
Updated: April 8th, 2008
If you're serious about MySQL, it doesn't hurt to know the people closely tied to its development and maintenance as well as famous bloggers. Here's my ongoing list of people I consider important:
Peter Zaitsev - MySQL Performance Blog, former head of MySQL AB High Performance Group. His company Percona is available for consulting. He's a co-author of High Performance MySQL 2nd edition (great book).
Baron Schwartz - also know as Xaprb, Baron a co-author of High Performance MySQL 2nd edition and creator of innotop and Maatkit. Maatkit is simply brilliant, and so is Baron. Baron recently joined Peter Zaitsev at Percona.
Jeremy Zawodny - MySQL guru, works for Yahoo, and is considered a legend. He wrote mytop and both editions of High Performance MySQL 2nd edition among other things. Here's Jeremy's twitter. I suggest subscribing to his rss feed as his blog is quite interesting and versatile.
Paul McCullagh - developer of the PBXT transactional storage engine for MySQL.
Ronald Bradford - active blogger and a recent addition to PrimeBase Technologies, the maker of PBXT.
Roland Bouman - a MySQL developer and blogger, active in the community. He likes to post really, really, REALLY long but detailed and informative posts. He's one of the speakers at the upcoming MySQL conference (as most of the people here, actually).
Jan Kneschke - senior software developer in the MySQL AB Enterprise Tools team. He maintains the MySQL Proxy and the awesome lighttpd web server (!!!).
Giuseppe Maxia - a MySQL QA developer and tester for MySQL Proxy. Giuseppe loves LUA and maintains a blog called The Data Charmer where he writes about the MySQL Proxy a lot.
The Pythian Group - a group of ingenious DBAs (who also blog). This company does remote DB management and consulting.
Paul Vallee - CEO of The Pythian Group. A smart, dedicated, really great guy.
Sheeri Cabral - a very active and insightful blogger and speaker who also happens to work for The Pythian Group. She posts often and calls herself a MySQL She-BA.
Farhan (Frank) Mashraqi - Director of Database Infrastructure at fotolog.com, one of the top 15 sites in the world. He maintains a blog called MySQL Database Administration.
… more to come.
If you want to see some pictures of these fascinating people, head over to:
Programming Comic: Lisp, Perl, And God
Monday, March 17th, 2008
Computer Science majors out there that went through tedious hours of studying Lisp - this is for you from xkcd. If you know Perl, it will make even more sense.
Source: http://xkcd.com/224/
See Also: Best Programming Comic Ever: Code Quality In WTFs/Minute
Central Room of Potatoes
Thursday, March 13th, 2008
Today Travis was messing around with a Chinese site blinkx has indexed a short while ago http://www.tudou.com and saw a cryptic error message that started coming up on all pages. The message looked something like this:
各位土豆:
为了给大家提供更好的服务,我们正在搬迁扩建土豆的中心机房。
3月14日凌晨0:00 ~ 夜间24:00,我们的服务暂停24小时。
3月15日凌晨0:00 新机房就搬迁完成了,土豆会准时回家。
Now, neither Travis nor I know the language of Chinese, so what do we do? Go to Google Translate, of course. Here's what Google Translate produced:
That's:
Members potatoes:
In order to provide you with better service, we are expanding the relocation of the central room of potatoes.
March 14 at 0:00 to 24:00 at night, our services will be suspended for 24 hours.
March 15 at 0:00 new room on the relocation is complete, potatoes will be time to go home.
No wonder the servers went down, being powered by potatoes from a central room of potatoes and all. I guess expanding to a larger room of even more potatoes was the only way out.

(+2 rating, 2 votes)
beer planet is Artem Russakovskii's blog. Artem is a software engineer at