This guy is a comic genius! Sheer hilarity.
Comic Genius
September 29th, 2009WebService::MobileMe uploaded to the CPAN
July 26th, 2009Just a quick post to announce a new perl module I uploaded to the CPAN the other day. It’s still to be considered alpha quality as it is lacking error checking and other such necessary stuffs but is working for me.
Usage looks like:
my $mme = WebService::MobileMe->new(
username => 'yaakov', password => 'HUGELOVE' );
my $location = $mme->locate;
print < <"EOT";
As of $location->{date}, $location->{time}, Yaakov was at
$location->{latitude}, $location->{longitude} (plus or minus
$location->{accuracy} meters).
EOT
$mme->sendMessage( message => 'Hi Yaakov!', alarm => 1 );
The online documentation is available via search.cpan.org.
Git Web: http://git.thegrebs.com/?p=WebService-MobileMe
Git Clone: http://git.thegrebs.com/git/WebService-MobileMe
YAPC|10
June 1st, 2009I will be at YAPC|10 in Pittsburgh the end of June. Here’s a schedule of the talks I plan to attend. There are a few holes not because the talks at those time suck but because they rock so hard I can’t decide which I want to attend.
Playing a Tone Through an Arduino Connected Piezo
March 23rd, 2009I’m working on a top secret project, all I’ll say is it involves the Arduino, Twitter, and the refrigerator, and needed to play a tone through a piezo connected to the Arduino. I looked around and the closest I could find was a tutorial that included code to play a melody.
This wasn’t quite what I wanted and the playTone function expects the notes and timing to be in global variables which makes the baby jesus cry. The premise was simple though. Take the period and divide by two then bring the output high then low for this amount of time, repeat to make up the desired duration.
void setup () {
pinMode(pinSpeaker, OUTPUT);
}
void loop () {
playTone(750, 500);
delay(750);
}
// duration in mSecs, frequency in hertz
void playTone(long duration, int freq) {
duration *= 1000;
int period = (1.0 / freq) * 1000000;
long elapsed_time = 0;
while (elapsed_time < duration) {
digitalWrite(pinSpeaker,HIGH);
delayMicroseconds(period / 2);
digitalWrite(pinSpeaker, LOW);
delayMicroseconds(period / 2);
elapsed_time += (period);
}
}
This simple sketch plays a 500Hz tone for 750 mSec, pauses 750 mSec and repeats. To use it in your sketch simply define pinSpeaker and set it for output, copy playTone to your sketch and call it with the duration in milliseconds and the frequency in hertz.
I am so totally a nerd
March 3rd, 2009Somebody came into the IRC support channel for work and their nick was ‘turtle’. I made a logo joke and a co-worker corrected my short LOGO triangle. This prompted me to waste 20 minutes in a LOGO interpreter.
REPEAT 3 [REPEAT 3 [FD 100 RT 120] RT 120]
PENUP
FD 100
PENDOWN
RT 90
REPEAT 360 [FD 1.75 RT 1]
pitz prepares to rock my socks
February 22nd, 2009Matt Wilson must be spying on my dialogs in sekrit IRC channels. After setting up Task this evening I mentioned there being several project ticketing systems, like Ditz, that store data in the RCS. I was lamenting the fact that there wasn’t any of these systems written in anything other than ruby that I was aware of.
Reading my RSS feeds before bed, I found “My new ticket tracking system is now vaporware” from Matt Wilson’s blog talking about Pitz, his soon to exist Python implementation of Ditz.
Please take a few moments to read over the feature set and example commands on the Pitz site and let Matt know about any ideas/suggestions you may have.
~/.bashrc Perl Module Version Tip
January 9th, 2009I often need to quickly check the version of a perl module currently installed. A while back I got tired of running:
1.2357
So I added a quick function to .bashrc:
perl -M$1 -e "print \$$1::VERSION, \"\n\""
}
Now I just run:
1.2357
git diff and white space
January 7th, 2009So I’m getting ready to make a commit to wxperl and I run a
to check on changes and git yelled at me that I had some trailing white space. Well it didn’t yell but it hi-lighted the white space in red. Way awesome!
Net::Abuse::Utils v0.10 Released
December 28th, 2008I just released Net::Abuse::Utils v0.10 to CPAN. If you can’t wait, grab it here.
If you haven’t heard of this module before, see this online example of some of the data that can be returned. Online docs are available as well at search.cpan.org.
From the Changes file:
- New get_domain function that converts host name to domain name
- Memoize support though commented out by default, enable by
uncommenting the following two lines in lib/Net/Abuse/Utils.pm
# use Memoize;
# memoize(‘_return_rr’);
A future version will likely allow Memoization via an export tag.
The get_domain function is fairly spiffy taking a host name like ‘michael.thegrebs.com’ and turning it into the domain name, ‘thegrebs.com’, but with proper recognition of second level zones like .co.uk.
The Memoization support is weak and I almost removed it but decided to leave it in but commented out for this release. It speeds up batch processing of large quantities of requests fairly well. Processing a days worth of spam used to take an average of 5 minutes and is now down to a minute and a half. This is quite a bit more increase than I expected as I am using bind with heavy local caching.
There were a few more changes mostly related to distribution related stuff, see git for the full gory details.
Not a horribly significant release but it’s been a while since the last one and I wanted to get get_domain out there.
Geeky Weather Station Stuffs
December 21st, 2008I recently received a nice Honeywell weather station. It turns out they are actually manufactured by a company called Irox which also sells stations under it’s own name but they seem to be more popular in Europe. Being a geek, one of the first things I did was check out Linux or OS X support. Unfortunately only one piece of software supports this weather station under Linux, Weather Display. There Linux software is freeware but not open source and leaves quite a bit to be desired but at least it would talk to the weather station and collect data from it.
With a bit of Googling I found Saratoga Weather which seems to be based on a template from Carter Lakes. Unfortunately the PHP code is a bit of a mess with 43 separate php files all in a top level directory and including each other. With a bit of work I was able to bend it to my will but every little change was a pain to accomplish.
I started slowly re-implementing things in Perl. I found an online WD data-file parser which greatly helped in figuring out what the fields in Weather Displays native log files meant. Fast-forward a couple of weeks and I think things are pretty much done feature wise. I lack NWS warning/watch/advisory notification, the thermometer image with today’s information is still PHP generated, and I don’t yet have a wind graph. These last few details shouldn’t take too much work when I get around to it. I also have a few features the original lacks, graphs, a daily tweet with today’s high/low, and sane code :p.
The information from my weather station is available online at http://weather.thegrebs.com/ and the source is available via git clone from http://git.thegrebs.com/git/wxperl. You may also browse the repo via Git Web at http://git.thegrebs.com/?p=wxperl.



