• whee
    May 15 2008 02:58p.m. UTC |
    Description
    wheee
    Sites posted to: None
    Clogs posted to:john, Outdoor Adventures
    Tags: whee, squee
  • Fun times
    May 14 2008 10:15p.m. UTC |
    Description
    Everyone hates it that I'm sick and not doing well.
    Sites posted to: None
    Clogs posted to: None
    Tags: san, francisco
  • postgres comparison tool
    May 14 2008 11:43a.m. UTC |
    #!/bin/sh
    # John Menerick

    hosts="62.65.130.180 62.65.130.181"
    opts="-p 6543 -U postgres"
    tmpdir="$(mktemp -d /tmp/iuaeiueve.XXXXXXXXXXXXXXXX)"


    lasthost=""
    for host in $hosts; do
    psql $opts -h "$host" -l | \
    awk 'BEGIN { getline; getline } $2 ~ /\|/ { print $1 }' \
    > "$tmpdir/db.$host"

    if [ "$lasthost" ]; then
    echo "Comparing DBs from $lasthost and $host"
    diff -u "$tmpdir/db.$lasthost" "$tmpdir/db.$host"
    fi
    lasthost="$host"
    done

    for db in $(cat "$tmpdir/db.$lasthost"); do
    echo "Comparing Database $db ..."

    echo '\d' | psql $opts -h "$lasthost" "$db" | \
    awk '$5 ~ /table/ { print $3 }' > "$tmpdir/tables.$lasthost"

    while read table; do
    echo -n "Comparing $db table $table ... "
    lastcount=""
    lasthost=""
    allcount=""
    for host in $hosts; do
    echo -n "${host} ... "
    count="$(echo "select count(*) from $table" | \
    psql $opts -h "$host" "$db" | \
    awk 'BEGIN { getline; getline } { print $0; exit 0 }')"
    allcount="$allcount $count"
    if [ "$lastcount" ]; then
    if [ "$lastcount" -ne "$count" ]; then
    echo "mismatch: $lasthost \($lastcount\) != $host \($count\)"
    fi
    fi
    lasthost="$host"
    done
    echo "$allcount"
    done < "$tmpdir/tables.$lasthost"
    done

    rm -rf "$tmpdir"
    Sites posted to: None
    Clogs posted to: None
  • flying to India
    May 05 2008 05:04p.m. UTC |
    Description
    On a flight to India
    Sites posted to: None
    Clogs posted to: None
  • awards ceremony
    May 05 2008 05:03p.m. UTC |
    Description
    Yay for Om
    Sites posted to: None
    Clogs posted to: None
    Tags: om, malik
  • weekly post
    May 05 2008 02:10p.m. UTC |
    Description
    The weekly post of the month.
    Sites posted to: None
    Clogs posted to: None
    Tags: post, john, week
  • Hai Guys
    Apr 28 2008 03:01p.m. UTC |
    Description
    OMG HAI GUYS!
    Sites posted to:
    Clogs posted to: None
    Tags: Web, 2.0, Expo
  • Art
    Apr 23 2008 10:50a.m. UTC |
    Description
    Art
    Sites posted to: None
    Clogs posted to: None
    Tags: Art
  • hai
    Apr 18 2008 04:59p.m. UTC |
    Sites posted to: None
    Clogs posted to: None
    Tags: hai
  • times gone past
    Apr 18 2008 10:45a.m. UTC |
    Description
    How we grow. Every year, since high school, I have lost two people close to me. Not even half-way through the year, I have lost three. Ugh.
    Sites posted to: None
    Clogs posted to: None
    Tags: Jason, Lee, KIA

john

Age: 30 Sex: Male
Posts: 160 Active Since: Oct 2007
Location: Spring L.., MI, USA
About me: The Cellspin guy who keeps everything running. more..
My Community Blog Subscriptions
advertisement
advertisement
advertisement