Wed Nov 29 15:08:00 CST 2006

quick

Gotta post quick, before the month name changes and I get another one-post-month.

Didn't make a rather unlikely schedule for thesis defense. Despite it not being really feasible once it was made, it would have been feasible had I been ahead of my previous goals. Or something. Short version, I feel guilty, and very likely should, but not for failing at something that wasn't possible when it was finally decided that it was the goal. That wasn't short.... whatever.

Life + time with my gal = good.

Might have wished the local Schlotzsky's back open after it not being so (if the universe works that way, which I don't think). Had I only known the power I had at the moment I was speaking the wish, I would have chosen different words.

Got a new usb thumb-drive device. Went overboard for the 4G model. Don't want to have to re-resolve this issue of pocketable bits in the next couple years. This prompted me to figure out that I should have been using vfat instead of msdos as the fstype when mounting such things lo these many years (so as to get those long names). Big self-head-bonk on that one. Now if someone would explain, in 30sec or less how to setup fstab so I can mount such drives to specific points, I would be very happy and grateful. That is, get my computer to remember which drive is which and be ready to put them with my name for them. Maybe I should just start reading the relevant pages and howtos > 5 min from sleeping-time so I get through them, but I'd rather just have the 30 second version.

Got another cheese-wire. Yet to open it. Someday I'll get to finishing my review of the ones that I wish to warn you, dear reader, away from. But not today.

Well, this is the last set of paragraph markers I yyp'ed when I started, so this post is at an end. Be sure to tune in for the next, same bat-channel, some bat-time.


Posted by Phillip | Permalink | Categories: Me Talking

Fri Nov 3 18:50:26 CST 2006

command line wikipedia

A helpful friend and I put this together. It is a little script to access wikipedia from the command line (inspired by dict). I have it saved as "wikip". It is nice and minimal, I usually use -p, but that requires you get the name of a page just right (which can be annoying if someone made the wikipedia page with odd capitalization.

#!/bin/sh
##################################################
# configuration

# set to default browser
browser="lynx -nopause"
##################################################

search="0"
text="0"
extra=""

if [ -z "$1" ] ; then
  echo "What wikipedia entry do you want?"
  echo "Usage: wikip [-s] [-t] [-f] [-o] [-l]  terms..." 1>&2
  echo "   -s search" 1>&2
  echo "   -t dump as text, no interface" 1>&2
  echo "   -f use firefox, not default browser ($browser)" 1>&2
  echo "   -o use opera, not default browser ($browser)" 1>&2
  echo "   -l use lynx, not default browser ($browser)" 1>&2
  echo "   -p use less to paginate, forces dump as text, i.e. no browser" 1>&2
  exit 1
fi

option="1"
while [ "$option" = "1" ] ;
do
  option="0"
  if [ "$1" = "-l" ] ; then
    browser="lynx -nopause"
    option="1"
    shift
  elif [ "$1" = "-s" ] ; then
    search="1"
    option="1"
    shift
  elif [ "$1" = "-t" ] ; then
    text="1"
    option="1"
    shift
  elif [ "$1" = "-o" ] ; then
    browser="opera -newpage"
    option="1"
    shift
  elif [ "$1" = "-f" ] ; then
    browser="firefox"
    option="1"
    shift
  elif [ "$1" = "-p" ] ; then
    extra=" | less"
    text="1"
    option="1"
    shift
  fi
done

term=`echo $*|sed 's/\ /_/g'`

if [ "$search" = "1" ] ; then
  URL="http://en.wikipedia.org/wiki/Special:Search/$term"
else
  URL="http://en.wikipedia.org/wiki/$term"
fi

if [ "$text" = "1" ] ; then
  eval lynx -nopause -nolist -dump \"$URL\" $extra
else
  $browser "$URL" 
fi

Posted by Phillip | Permalink | Categories: Useful Code