November 26, 2006

What's in a name?

Alright, who's with me?

You make a hammer designed to smash stuff better.
And you name it the "Fatmax Xtreme Fubar."

That's right, it's The FUBAR. They claim that it stands for "Functional Utility Bar" but you and I know that's just a typo for "fucked up beyond all recognition."

Genius, yeah?

http://www.popsci.com/popsci/flat/bown/2006/product_76.html

Posted by hachu at 08:31 PM | Comments (0)

9 day weekend!

The week in review....

Friday after work, I hung around at home. I think this was about when I hacked together an autofeeder scanner and software to try to dump a bunch of old papers onto DVDs.

Saturday, I met up with Karen in Alameda for dinner at Luciano's and then went to Berkeley to hang around (couldn't get a table for pool)

Sunday was sports day with Walter and his Stanford people.

I slept in on Monday and met up with Cynthia for lunch at Sushi Maru.

Tuesday, I slept in and met up with Andy for lunch at Ryowa. Then I met up with Hanah for dinner at Homma's and watched Borat afterwards.

The next day, I met up with Nader and Andy for lunch at Halu Ramen, watched the first episode of Battlestar Galactica, and then met up with at Sanders' for board games.

Thanksgiving was at my cousin's house, and we ate korean bbq and duck cuz we all like that more than turkey. The morning was spent playing some frisbee and football with the Leland '98 people since Amy set up a gathering.

Friday was more sleeping in and a bunch of cleanup in the garage. (okay, so I blew up 2 more harddrives on accident). Ivy had a potluck at her house, so I hung out there for the entire evening.

On Saturday, I met up with Esther, Tanya, and Andrew for lunch at A&J's and then a walk around Stanford campus. After splitting, I met up with Johnny, Mike, and Andrew for a game of Halo. And then it was off to TGI Friday's with the lawyers and Irene to celebrate them passing the bar and Irene's bday. Finished the night off with some good old board games and bridge.

Badminton on Sunday followed by some cleanup and dinner at home. Was supposed to wake my tennis racket at Peggy (try to play tennis) but there's rain.

It's nice to take a break from work. :)

Posted by hachu at 08:23 PM | Comments (0)

November 15, 2006

Hansel >>> Spammers

-- Total Geek Alert for all those of you who can't code and rather not think about it --

Heh. So this weblog posting system has a bit of a problem. It's always hit by spammers. It used to be that spammers just posted links to various sites. Then to various posts on weak message boards. Now it's registering a bunch of fake domains so you can't filter out the above.

It's pretty easy to see 30 or so fake posts get tossed in, add a url and filter them out.

This week, I got 700 instead of 30. All of them with garbage domain names like http://silhouette.ryxobuzor.org or whatever. All of them resolve to 64.92.169.152.

So, I decided to tweak the code a bit:
Presenting: The Hansel-pwns-j00 DNS-based comment filtering code!

Basically, this uses the Moveable Type 2.661 IP Ban List and the perl Socket library to look at the url field for a url. Then it tries to get the IP. Then it checks with the list. If it's in the list, reject. I'm using this followed by MT-Blacklist. All cuz I'm too lazy and chicken to upgrade MT to version 3.

I just made up the following and added it over the MT-Blacklist-specific stuff in MTblPost.pm.

### The Hansel-pwns-j00 DNS Code Starts Here ###
# get ip out of domain name
use Socket;
my $dnsurl = $q->param('url');
$dnsurl =~ m|(\w+)://([^/:]+)(:\d+)?/(.*)|;
my $dnsurldomain = $2;

if ((length($dnsurldomain) > 0) && (length(inet_aton($dnsurldomain)) > 0)) {
my $dnsip = inet_ntoa(inet_aton($dnsurldomain));

# handle ban list
require MT::IPBanList;
my $banlist_iter = MT::IPBanList->load_iter({ blog_id => $entry->blog_id });
while (my $ban = $banlist_iter->()) {
my $banned_ip = $ban->ip;
if ($dnsip =~ /$banned_ip/) {
$app->log('DNS-based denial on '.$blog->name.' for url: '.$q->param('url'));
return $app->handle_error($app->translate("DNS hack says you are not allowed to post comments."));
}
}
}
### DNS Code Ends Here ###

Posted by hachu at 01:33 PM | Comments (2)

Werk werk

Since August, I've been shifted upwards in the rankings at work. Instead of testing, lab monkey, and basic internal tools development, I'm now actually working on a company product.

It's a hell of a lot of work. Don't get me wrong. It being a lot of work doesn't mean it's bad. In fact, I find it highly educational, interesting, and challenging too. It doesn't feel tedious, in fact I kinda like it. But at the end of the day, it's still very tiring.

Which brings up Thanksgiving week. The almightly Steve Jobs has decreed that this Thanksgiving week, all of Apple (which includes us) has the option to take the whole week off instead of the usual 4-day weekend.

It's a good break. Especially since some of the stuff I need to finish my work is dependent on those who might feel like saving their 3 extra days off for later. But I have no idea what to do with it.

One of my friends commutes to San Diego, should I follow along? They have to work and I'm guessing my other friends would have school so it's not like they'd have time to show me around.

Should I make a solo trip to Tahoe to warm up for the season? But the snow sucks.

How about simply hibernate at home? Nah... too boring.

It's not like I can fly anywhere since tickets back for Thanksgiving weekend will cost a fortune.

At the least, I can drive around and have lunch with people not in my usual area.

Any ideas anybody?

Posted by hachu at 01:24 PM | Comments (0)