Wednesday, July 30, 2008

My current python "IDE"

The script below is one that I'm currently using to quickly setup my python coding environment.
import os
os.popen4('gnome-terminal -e python --working-directory ~/scripts/python -t PYTHON')
os.popen4('gnome-terminal --working-directory ~/scripts/python')
os.popen4('xterm -e "cd scripts/python && /bin/bash"')

You may be asking yourself why I'm opening 3 terminals. I personally like having lots of text in front of me at once so I can focus on reading/thinking and not using the mouse (or the keyboard).

Xterm is there because it is really really fast. Gnome-terminal is there due to it's superior copy/paste support (I grew up on Windows, sue me).

Saturday, July 12, 2008

determining your visible IP address using perl and

A while back Ashish Shukla put together
a great hack for using perl an to determine your IP address. My modified version of this is below:
#!/usr/bin/perl -w - This script uses service.

use LWP::Simple;
use strict;

my $url = "";

my $content = get($url);
print "$content\n";