Baby Steve vs. Baby Maya

Posted in General on February 11th, 2010 by slacy – Be the first to comment

Maya & Petra (August 2009)

Posted in General on February 10th, 2010 by slacy – Be the first to comment

ipv6 and 1e100.net

Posted in General on February 10th, 2010 by slacy – 5 Comments

I saw this weird article about 1e100.net the other day, and I was just poking around and realized how google.com traffic is getting tracked as 1e100.net

It’s via ipv6. Check this out:

$ host ipv6.google.com
ipv6.google.com is an alias for ipv6.l.google.com.
ipv6.l.google.com has IPv6 address 2001:4860:b006::63
ipv6.l.google.com has IPv6 address 2001:4860:b006::6a
ipv6.l.google.com has IPv6 address 2001:4860:b006::69
ipv6.l.google.com has IPv6 address 2001:4860:b006::68
ipv6.l.google.com has IPv6 address 2001:4860:b006::67
ipv6.l.google.com has IPv6 address 2001:4860:b006::93
$ host 2001:4860:b006::63
7.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.0.0.b.0.6.8.4.1.0.0.2.ip6.arpa domain name pointer pv-in-x67.1e100.net.

So, if you’re on an IPv6 enabled connection (as maybe some corporations are, and then they NAT to IPv4 or something) anyway, if you hit ipv6.google.com, then someone will see traffic to the IPv6 addrs listed above, whose reverse-DNS points back at 1e100.net instead of back at google.com.

I’m guessing that this is really just because of legitimate IPv6 users hitting ipv6.google.com.

Maya & Bryce (August 2009)

Posted in General on February 9th, 2010 by slacy – Be the first to comment

summing datetime.timedelta objects in Python

Posted in General on February 9th, 2010 by slacy – Be the first to comment

Argh! The following snippet is totally broken:

import datetime 

times = [datetime.timedelta(hours=1), datetime.timedelta(minutes=30)]
print sum(times)
print min(times)
print max(times)

It raises “TypeError: unsupported operand type(s) for +: ‘int’ and ‘datetime.timedelta’”

The thing is, I want this function to be able to sum both a list of floats, integers, or timedelta objects.  Other than doing a bunch of type checking, or writing my own sum method, is there some easy way to do this that I’m missing? I guess I could write:

print datetime.timedelta(milliseconds=sum([d.milliseconds for d in times]))

Yuk.  That’s not really type safe either, since I’d have to check the type of times[0] before I started.

August 10th, 2009

Posted in General on February 8th, 2010 by slacy – Be the first to comment

About a million new pictures.

Posted in General on February 7th, 2010 by slacy – Be the first to comment

Finally caught up with uploading photos to our website. I’ve just finished uploading over 3,100 photos from August 2009 through early February 2010.  I’ll try to post some highlights here over the next few days.

Using cookies.sqlite in wget or curl

Posted in General on February 3rd, 2010 by slacy – Be the first to comment

Newer versions of FireFox use a sqlite3 database to store their cookies.

Older versions of FireFox used a .txt file.  wget and curl know how to parse the older style text file, but not the sqlite3 database.

So, I wrote a quick script to extract the cookies.sqlite database and generate a file that looks just like the old cookies.txt file, and then you can pass that to wget or curl. Here’s the script:

#!/bin/bash

function cleanup {
rm -f $TMPFILE
exit 1
}

trap cleanup  SIGHUP SIGINT SIGTERM

# This is the format of the sqlite database:
# CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);

# We have to copy cookies.sqlite, because FireFox has a lock on it
TMPFILE=`mktemp /tmp/cookies.sqlite.XXXXXXXXXX`
cat $1 >> $TMPFILE
sqlite3 -separator '	' $TMPFILE << EOF
.mode tabs
.header off
select host,
case substr(host,1,1)='.' when 0 then 'FALSE' else 'TRUE' end,
path,
case isSecure when 0 then 'FALSE' else 'TRUE' end,
expiry,
name,
value
from moz_cookies;
EOF
cleanup

Usage should be like this:

$ extract_cookies.sh $HOME/.mozilla/firefox/*/cookies.sqlite > /tmp/cookies.txt
$ wget --load-cookies=/tmp/cookies.txt http://mysite.com
$ # OR
$ curl --cookie /tmp/cookies.txt http://mysite.com

You could use this script to wrap curl or wget itself in a similar extraction scheme, so that you always get the most current cookie values when you run wget.

Screen Resolutions 2

Posted in General on January 27th, 2010 by slacy – Be the first to comment

FYI : If you’re viewing this on my website, then the image is likely squashed, due to my retarded theme.  Looks OK in RSS readers, etc.

Screen size comparison

Posted in General on January 27th, 2010 by slacy – Be the first to comment