Archive for December, 2006

reddit annoyance

I really hate it when reddit posts are to videos that auto play when opened. I kind of lost my cool and threw a fit the other day when it happened again, and I had 12 tabs opened and one of them was blaring something. People there refuse to add the [video] tag to title…so whatever, I can’t change their behavior as much as I would like to…Added this to my /etc/rc.local


amixer set Master 0%

That will stop 99% of the times when I accidentally leave my sound on from home but don’t want it on when I reboot.

What I would really like to do is use a greasemonkey script to warn, or turn off videos that load in tabs…but that will do for now.

What is that smell?

*sniff* *sniff* Smells like some sort of db rebuild? Must be an old copy of postgres, and they are running the vacuume on it.

More Ubuntu tips

Another problem I faced today was the Ubuntu (debian) installer not finding the nics during install. I went ahead with the install and then tackled it afterward.

Once it was all installed and rebooted, I logged in and edited the /etc/network/interfaces file and put this in it:


auto eth0
iface eth0 inet dhcp

Boom, restart networking (/etc/init.d/networking restart), and you are good to go.

Ubuntu and HP servers

From time to time some HP machines give me a problem with the installer. After choosing the local (the second item) it freezes. After messing with it and doing some googeling I found a fix. Flip to the console (alt+F2) and do a ps aux | grep kbd. There are a couple of hits. The one that has the kdb.postinst, kill -12 that. Flip back to the installer, there will be an error. Hit ok, and at the main menu move down one from configure keyboard. Apparently there is a bug in the installer that tries to probe some weird usb keyboards.

Microsoft rules

I heard they were sending out free laptops to bloggers…I didn’t get mine yet, so I figured I needed to generate some good buzz here about the upcoming launch of vista.

Vista is great, I will use it everytime it boots up on my machine. I can’t wait till it starts coming on boxes that I order for co-workers. If it’s still on there by the time it hits their desk, I am sure they will love it too!

Man’s constant battle

My girlfriend wanted to go shopping today, but didn’t have anyone to go with. Being the great guy I am I suggested I could go along and hang out while she shopped. I must say, she was very cognizant of my presence and the idea that I would only be able to tolerate so much of that.

At any rate we got to talking about shopping and the gifts that are usually touted as “Man Gifts”. Sure enough most of the things we talked about were on sale in the stores. They fell into two distinct categories, hair removal and ties.

There were devices for trimming the hair in your nose, your face, and yes even your back. It’s like the marketing world views men in some constant struggle with body hair. I can almost see the commercial of a leather clad warrior, wielding a sword, battling gangling tentacles of hair coming in at all directions…and to top it off, when our hero is victorious…he is handed a tie and told to put it on.

YAHTZEE

Funny how things go sometimes. On Friday I was staring down a 4 day weekend, and really didn’t have a lot planned. I knew I would be at the laptop and wanted to mess around with some code. I started off messing around with Java and the Swing libs. I got the idea that it might be fun to try to write a fat client yahtzee clone. I have no experience with game mechanics and the idea was interesting. So the first thing I did was make a window and then a menu bar and that was fun and all, but I wanted to roll some dice. Next I jumped online to find some dice images which was more difficult than I thought it would be. I finally found some, but I had to crop them from another image.

One thing led to another and I decided that I would slap together an html page with them and whip up a little javascript to roll them. Then I wanted to write a little more to save certain dice per throw and re-roll others. I got that all working and thought it was fun. Then I figured what the hay, maybe I could write it all in JS.

Next thing I know I have a bunch of it working and decided to see it through. Wow, was that interesting. I wrote it all out and got most of it working over a couple of days. However looking at the code I realized I needed to refactor it. I started rewriting all the methods and abstracting things out, and coming up with neat ways to make it all work. Next thing I know, boom, it’s Christmas morning and I am coming up with cool ways to determine Small Straights and processing arrays of integers, etc.

It was one of those projects that the problem set was small enough that a little white hot key smacking was producing results and difficult enough that it kept me interested.

At any rate: http://nathanpowell.org/dice/

Have fun!

Hopefully more places follow suit

As someone who makes a living from web based tech it may seem odd, but I really hate HTML email. I use a text based console program to read my mail, and HTML email sucks in that.

Hopefully this story is true.

DoD bans HTML email

Irssi

I use IRC every day. I like it ok. It’s a nice way to stay in contact with friends and other folks in the IT world. There is idle chatter for sure, but it’s also a nice way to aggregate knowledge. Lots of smart people in a channel with different specialties is good for everyone in the channel. You can trade ideas, ask questions, answer questions, get a second (or more) set of eyes on a solution you like…etc. So naturally there is a need for an IRC client. I use Irssi, and have for some time.

Geeks love to argue, it’s what we do. We can make more out of the mundane than any other group. Of course this leads to arguments as to which IRC client is superior and why.

One thing I like about Irssi is that it’s scriptable in Perl. Never mind the fact that I have never actually written a script for Irssi, it’s something I point to when defending my position that it’s superior.

I decided I needed to finally take a look at the scripting for Irssi. What a pain. The documentation is typical for a small OSS project, as in…it sucks. After looking at gobs of scripts and reading tons of code I decided to look at CPAN to see if there was an easier way. Of course there was.

I found POE::Session::Irssi there. A couple of seconds later I was grabbing events and parsing them like a pro.

For those that may come here via google, here is a short and sweet code set to get you up and running:


use strict;
use vars qw($VERSION %IRSSI);
 
use Irssi;
use Glib;
use POE qw(Loop::Glib);
use POE::Session::Irssi;
 
sub foo {
  my $args = $_[ARG1];
  my ($server, $channel, $nick, $address) = @$args;
  $server->command("MSG $channel Hello World!");
}
 
POE::Session::Irssi->create( irssi_signals => { 'message join' =>  \&foo, } );

Pretty straight forward. The ‘create’ method can look for signals or commands. You name the hash key for which event you wish to grep and then can either inline the sub, or as I have here a reference to a sub. From there it’s a matter of doing what you want to do with when that event is triggered.

In the above example, when someone joins a channel you are in, it prints ‘Hello World’ to the screen.

There were a couple of other things I have figured out while messing with this, that I will save for another post.

Shut up and compete

This is what I am talking about. Finally an American company looks at the situation and says “we can do this better”.

**EDIT** Fixed link - thanks Patrick