Mercurial > hg > config
changeset 0:f3ab51c79813
adding configuration from https://svn.openplans.org/svn/config_jhammel/
author | k0s <k0scist@gmail.com> |
---|---|
date | Thu, 15 Oct 2009 11:41:26 -0400 |
parents | |
children | f58e8e81e16b |
files | .Xresources .bash_overrides .bash_profile .bashrc .emacs .fluxbox/init .fluxbox/keys .fluxbox/menu .fluxbox/startup .fluxbox/styles/Black .gtkrc-2.0 .hgrc .irssi/config .mailcap .mozilla/userContent.css .mutt/aliases .muttrc .subversion_config/config .xinitrc .xpdfrc bin/antixls.sh bin/clrscr bin/keyshelp.sh bin/onelineit.sh bin/pastebin.sh bin/venvit.sh bin/wgrep.py bin/yt2mp3.sh python/address.py python/anagram.py python/cgiescape.py python/clearsilver.py python/dictarg.py python/dictify.py python/hexify.py python/listify.py python/lolspeak.py python/lsex.py python/onelineit.py python/randomize.py python/realpath.py python/signature.py python/smartopen.py python/states.py python/str2lnk.py python/tablify.py |
diffstat | 46 files changed, 2465 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.Xresources Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,7 @@ +*background: black +*foreground: white + +Emacs.menu.attributeBackground: rgb:00/00/00 +Emacs.menu.attributeForeground: rgb:BB/BB/BB + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.bash_overrides Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,109 @@ +#!/bin/bash + +function unlink { + command unlink `echo $@ | sed 's/\/$//g'` +} + +function find { + + if (( ! $# )) + then + return + fi + + if [ -d $1 ] + then + DIR="$1" + shift + else + DIR="$PWD" + fi + + if [ "$#" == "1" ] + then + `which find` -L "$PWD" -not -path '*.svn*' -iname "$1" + return 0 + fi + + COMMAND="`which find` -L \"$DIR\" -not -path '*.svn*' $@" +#echo $COMMAND # for debugging + `which find` -L "$DIR" -not -path '*.svn*' "$@" +} + +cd() { + + ENV="" + # find if you're in a + if [ -n "${WORKING_ENV}" ] + then + ENV="${WORKING_ENV}" + fi + if [ -n "${VIRTUAL_ENV}" ] + then + ENV="${VIRTUAL_ENV}" + fi + + + if [ -d "$@" ] + then + command cd "$@" + else + if [ -e "$@" ] + then + command cd `dirname "$@"` + else + if [[ "$@" == "^" && -n "${ENV}" ]] + then + command cd "${ENV}" + else + command cd "$@" + fi + fi + fi + + # handle ENVs + if [ -e "bin/activate" ] + then + if [ -n "${ENV}" ] + then + if [ "${ENV}" != "${PWD}" ] + then + if [[ -n "`type -t deactivate`" ]] + then + deactivate + fi + else + return + fi + fi + source "bin/activate" + fi + + ENV="" + # find if you're in a + if [ -n "${WORKING_ENV}" ] + then + ENV="${WORKING_ENV}" + fi + if [ -n "${VIRTUAL_ENV}" ] + then + ENV="${VIRTUAL_ENV}" + fi + + if [ -n "${ENV}" ] + then + FULLPWD=$(python -c 'import os; print os.getcwd()') + if (( ! `expr match "${FULLPWD}" "${ENV}"` )) + then + if [[ -n "`type -t deactivate`" ]] + then + deactivate + fi + fi + fi + unset ENV +} + +emacsclient() { + command emacsclient $@ > /dev/null & +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.bash_profile Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,5 @@ +# /etc/skel/.bash_profile + +# This file is sourced by bash for login shells. The following line +# runs your .bashrc and is recommended by the bash info pages. +[[ -f ~/.bashrc ]] && . ~/.bashrc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.bashrc Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,283 @@ +source /etc/profile + +# Test for an interactive shell. There is no need to set anything +# past this point for scp and rcp, and it's important to refrain from +# outputting anything in those cases. +if [[ $- != *i* ]] ; then + # Shell is non-interactive. Be done now! + return +fi + +# Enable colors for ls, etc. Prefer ~/.dir_colors #64489 +if [[ -f ~/.dir_colors ]] ; then + eval $(dircolors -b ~/.dir_colors) +elif [[ -f /etc/DIR_COLORS ]] ; then + eval $(dircolors -b /etc/DIR_COLORS) +fi + +export CLICOLOR=1 +export EDITOR='emacs -nw' + +# aliases +alias ls='ls --color=auto' +alias grep='grep --colour=auto' +alias wget='wget --no-check-certificate' +alias datestamp='date +%Y%m%d%H%M%S' +alias zfilt='grep -v "eprecat" | grep -v "ERROR Zope"' +alias svnst='svn st | grep -v "^\?"' +alias awd="python -c 'import os; print os.path.realpath(\".\")'" +alias distribute='python setup.py egg_info -RDb "" sdist bdist_egg register upload' +alias random="python -c 'import sys, random; foo = sys.argv[1:]; random.shuffle(foo); print \" \".join(foo)'" + +PS1='> ' +PS2='. ' +PROMPT_COMMAND='echo -ne "\033]0;${SSH_CLIENT/*/$HOSTNAME:}${PWD/~/~}\007"' + +export PATH=~/bin:~/python:$PATH:/usr/sbin:/usr/games/bin +export PYTHONPATH=~/python:$PYTHONPATH + +cdwin() { + DIR=$(xwininfo | dictify.py xwininfo | awk '{ print $NF }' | sed 's/"//g') + DIR=${DIR/\~/$HOME} + cd $DIR +} + +eend() { + FILE=$1 + shift + emacs +`wc -l "$FILE"` $@ +} + +# nice fast find function +EXCLUDES="(\.svn)|(\.mo$)|(\.po$)|(\.pyc$)" +ff() { + + if (( $# < 2 )) + then + FILENAME='*' # default -- look in all files + else + FILENAME=$2 + fi + CMD='command find -L $PWD -iname "${FILENAME}" -print0 | xargs -r0 grep -il "$1" | egrep -v "${EXCLUDES}"' +# echo $CMD + eval $CMD + +} + +chainff() { + if (( $# < 2 )) + then + return 0 + fi + + RESULTS=`ff "$2" "$1"` + shift 2 + + for i in $RESULTS + do + for arg in $@ + do + if grep -il "$arg" "$i" &> /dev/null + then + touch /dev/null + else + i="" + break + fi + done + if [ -n "$i" ] + then + echo $i + fi + done +} + +tmpfile() { + + +if [ "$#" == "0" ] +then + args="." +else + args=$@ +fi + +for i in $args +do + NEWNAME=${i}.$RANDOM + + while [ -e $NEWNAME ] + do + NEWNAME=${NEWNAME}.tmp + done + echo "$NEWNAME" +done +} + +edpe() { + +# edit and pipe the buffer to stdout +FILE=`tmpfile` +$EDITOR $FILE +cat $FILE +rm $FILE + +} + +swap() { + if [ "$#" != "2" ] + then + echo "Usage: $FUNCNAME <first_arg> <second_arg>" + return + fi + for i in "$1" "$2" + do + if [ ! -w "$i" ] + then + echo "$FUNCNAME: Can't move $i" + return 1 + fi + done + + NEWNAME=`basename $1`.$RANDOM + + while [ -e $NEWNAME ] + do + NEWNAME=${NEWNAME}.tmp + echo "$NEWNAME" + done + + mv `basename $1` $NEWNAME + mv `basename $2` `basename $1` + mv $NEWNAME `basename $2` +} + +isrunning() { + for i in "$@" + do + ps axwww | grep "$i" | grep -v 'grep' + done | sort | uniq + +} + +killbyname() { + kill `isrunning "$@" | awk '{ print $1 }' | onelineit.py` +} + +ztest() { + +ZCTL=`find $PWD -name 'zopectl'` +if [ ! -x "$ZCTL" ] +then + echo 'zopectl not found' + return 1 +fi + +if [ "$#" == "1" ] +then + FLAG="False" + for i in '-h' '--help' + do + if [ "$i" == "$1" ] + then + FLAG="True" + break + fi + if [ "$FLAG" == "False" ] + then + ${ZCTL} test -s Products.$1 2>&1 | zfilt + echo "i'm done!" + return 0 + fi + done + +fi + +return 0 + +${ZCTL} test $@ 2>&1 | zfilt + +} + +tf() { + if [[ $@ ]] + then + echo "true" + else + echo "false" + fi +} + +# full name +fn() { + python -c "import os; print os.path.realpath('$*')" +} + +# which view +whview() { + less `which $@` +} + +#which emacs +whemacs() { + emacs -nw `which $@` +} + +pyfile() { +python -c "import $1; print $1.__file__" +} + +function colors() { + + CLR_WHITE="\033[0;37m" + CLR_WHITEBOLD="\033[1;37m" + CLR_BLACK="\033[0;30m" + CLR_GRAY="\033[1;30m" + CLR_BLUE="\033[1;34m" + CLR_BLUEBOLD="\033[0;34m" + CLR_GREEN="\033[0;32m" + CLR_GREENBOLD="\033[1;32m" + CLR_CYAN="\033[0;36m" + CLR_CYANBOLD="\033[1;36m" + CLR_RED="\033[0;31m" + CLR_REDBOLD="\033[1;31m" + CLR_PURPLE="\033[0;35m" + CLR_PURPLEBOLD="\033[1;35m" + CLR_YELLOW="\033[0;33m" + CLR_YELLOWBOLD="\033[1;33m" + CLR_NOTHING="\033[0m" +} + +colors + +# contextual fastfind +cff () { + + if (( $# < 2 )); then + local FILENAME='*' # default -- look in all files + else + local FILENAME=$2 + fi + + for i in `ff "$1" "$FILENAME"`; do + echo -e "$CLR_GREEN--->>> ""$CLR_YELLOWBOLD""$i""$CLR_NOTHING" : + grep --color=auto -i -n -C 3 "$1" $i + done + +} + +svndance(){ +if (( $# )) +then + svn import $1 + cd .. + rm -rf $OLDPWD + svn co $1 $OLDPWD + cd $OLDPWD +else + return 1 +fi +} + +### include overrides for commands +source ~/.bash_overrides
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.emacs Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,80 @@ +(server-start) +(if (boundp 'tool-bar-mode) (tool-bar-mode 0)) +(setq inhibit-startup-message t) +(setq make-backup-files nil) +(put 'downcase-region 'disabled nil) +(setq truncate-lines nil) +(setq truncate-partial-width-windows nil) +(setq use-file-dialog nil) +(setq python-indent 4) +(setq python-guess-indent nil) +(setq-default indent-tabs-mode nil) +(defface extra-whitespace-face '((t (:background "pale green"))) "Used for tabs and such.") + +(autoload 'doctest-mode "doctest-mode" "doctest editing mode." t) + +(transient-mark-mode 1) + +(put 'upcase-region 'disabled nil) +;; Show line-number in the mode line +(line-number-mode 1) + +;; Show column-number in the mode line +(column-number-mode 1) + +;; Bind major editing modes to certain file extensions +(setq auto-mode-alist (cons '("\\.zcml$" . sgml-mode) auto-mode-alist)) +(setq auto-mode-alist (cons '("\\.pt$" . sgml-mode) auto-mode-alist)) +(setq auto-mode-alist (cons '("\\.cpt$" . sgml-mode) auto-mode-alist)) +(setq auto-mode-alist (cons '("\\.cpy$" . python-mode) auto-mode-alist)) +(setq auto-mode-alist (cons '("\\.vpy$" . python-mode) auto-mode-alist)) + +;; Turn off the status bar and on the mouse if we're not in a window system +(menu-bar-mode (if window-system 1 -1)) +(add-hook 'text-mode-hook 'turn-on-auto-fill) + +(add-hook 'sgml-mode-hook 'turn-off-auto-fill) + +(setq grep-command "grep -liE") + +;; recentf stuff +(require 'recentf) +(recentf-mode 1) +(setq recentf-max-menu-items 25) +(global-set-key "\C-x\ \C-r" 'recentf-open-files) + +;; full-steam-ahead-and-damn-the-torpedoes +(defun + full-steam-ahead-and-damn-the-torpedoes + (prompt) t) +(defalias 'y-or-n-p + 'full-steam-ahead-and-damn-the-torpedoes) +(defalias 'yes-or-no-p + 'full-steam-ahead-and-damn-the-torpedoes) + +(require 'uniquify) +(setq uniquify-buffer-name-style 'post-forward) + +;; wheel mouse +(global-set-key [mouse-4] 'scroll-down) +(global-set-key [mouse-5] 'scroll-up) + +;; substring buffer switching mode +(iswitchb-mode 1) + +(global-set-key "\M-g" 'goto-line) + +;; (when (load "flymake" t) +;; (defun flymake-pyflakes-init () +;; (let* ((temp-file (flymake-init-create-temp-buffer-copy +;; 'flymake-create-temp-inplace)) +;; (local-file (file-relative-name +;; temp-file +;; (file-name-directory buffer-file-name)))) +;; (list "pyflakes" (list local-file)))) + +;; (add-to-list 'flymake-allowed-file-name-masks +;; '("\\.py\\'" flymake-pyflakes-init))) + +;; (add-hook 'find-file-hook 'flymake-find-file-hook) +(server-start)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.fluxbox/init Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,101 @@ +session.screen0.window.focus.alpha: 122 +session.screen0.window.unfocus.alpha: 47 +session.screen0.overlay.lineWidth: 1 +session.screen0.overlay.lineStyle: LineSolid +session.screen0.overlay.joinStyle: JoinMiter +session.screen0.overlay.capStyle: CapNotLast +session.screen0.iconbar.deiconifyMode: Follow +session.screen0.iconbar.wheelMode: Screen +session.screen0.iconbar.iconWidth: 70 +session.screen0.iconbar.iconTextPadding: 10l +session.screen0.iconbar.alignment: Relative +session.screen0.iconbar.usePixmap: true +session.screen0.iconbar.mode: Workspace +session.screen0.tabs.intitlebar: true +session.screen0.tabs.maxOver: false +session.screen0.titlebar.left: Stick +session.screen0.titlebar.right: Minimize Maximize Close +session.screen0.tab.rotatevertical: True +session.screen0.tab.width: 0 +session.screen0.tab.alignment: Left +session.screen0.tab.placement: TopLeft +session.screen0.tab.height: 0 +session.screen0.menu.alpha: 82 +session.screen0.slit.alpha: 255 +session.screen0.slit.onhead: 0 +session.screen0.slit.onTop: False +session.screen0.slit.layer: Dock +session.screen0.slit.maxOver: false +session.screen0.slit.direction: Vertical +session.screen0.slit.placement: BottomRight +session.screen0.slit.autoHide: false +session.screen0.toolbar.layer: Desktop +session.screen0.toolbar.onTop: False +session.screen0.toolbar.visible: true +session.screen0.toolbar.alpha: 63 +session.screen0.toolbar.widthPercent: 44 +session.screen0.toolbar.placement: BottomCenter +session.screen0.toolbar.autoHide: false +session.screen0.toolbar.tools: workspacename, prevworkspace, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock +session.screen0.toolbar.onhead: 0 +session.screen0.toolbar.maxOver: true +session.screen0.toolbar.height: 0 +session.screen0.focusNewWindows: true +session.screen0.focusModel: MouseFocus +session.screen0.fullMaximization: true +session.screen0.sloppywindowgrouping: true +session.screen0.defaultDeco: NORMAL +session.screen0.decorateTransient: true +session.screen0.antialias: true +session.screen0.imageDither: false +session.screen0.rowPlacementDirection: LeftToRight +session.screen0.desktopwheeling: true +session.screen0.windowPlacement: RowSmartPlacement +session.screen0.edgeSnapThreshold: 0 +session.screen0.rootCommand: fbsetbg ~/image/wallpaper +session.screen0.strftimeFormat: %k:%M +session.screen0.workspacewarping: true +session.screen0.windowScrollAction: +session.screen0.colPlacementDirection: TopToBottom +session.screen0.showwindowposition: true +session.screen0.tabFocusModel: ClickToTabFocus +session.screen0.userFollowModel: Follow +session.screen0.autoRaise: false +session.screen0.windowScrollReverse: false +session.screen0.reversewheeling: false +session.screen0.workspaces: 5 +session.screen0.resizeMode: Bottom +session.screen0.menuDelayClose: 0 +session.screen0.menuMode: Delay +session.screen0.followModel: Ignore +session.screen0.allowRemoteActions: false +session.screen0.menuDelay: 0 +session.screen0.clickRaises: true +session.screen0.opaqueMove: false +session.screen0.workspaceNames: one,two,three,four,five, +session.screen0.windowMenu: +session.screen0.focusLastWindow: true +session.tabPadding: 0 +session.modKey: Mod1 +session.keyFile: ~/.fluxbox/keys +session.cacheLife: 5l +session.menuFile: ~/.fluxbox/menu +session.tabs: false +session.groupFile: ~/.fluxbox/groups +session.autoRaiseDelay: 250 +session.tabsAttachArea: Window +session.colorsPerChannel: 4 +session.focusTabMinWidth: 0 +session.slitlistFile: ~/.fluxbox/slitlist +session.imageDither: True +session.forcePseudoTransparency: true +session.doubleClickInterval: 250 +session.cacheMax: 200l +session.useMod1: true +session.opaqueMove: False +session.configVersion: 1 +session.appsFile: ~/.fluxbox/apps +session.styleFile: ~/.fluxbox/styles/Black +session.ignoreBorder: false +session.styleOverlay: ~/.fluxbox/overlay +session.numLayers: 13
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.fluxbox/keys Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,41 @@ +!mouse actions added by fluxbox-update_configs +OnDesktop Mouse1 :hideMenus +OnDesktop Mouse2 :workspaceMenu +OnDesktop Mouse3 :rootMenu +OnDesktop Mouse4 :nextWorkspace +OnDesktop Mouse5 :prevWorkspace + +# File generated by FluxConf +Mod1 Tab :nextwindow +Mod1 Shift Tab :prevwindow +Control Mod1 Left :prevworkspace +Control Mod1 Right :nextworkspace +Mod1 F1 :Workspace 1 +Mod1 F2 :Workspace 2 +Mod1 F3 :Workspace 3 +Mod1 F4 :Workspace 4 +Mod1 F5 :Workspace 5 +Mod1 F6 :Workspace 6 +Mod1 F7 :Workspace 7 +Mod1 F8 :Workspace 8 +Mod1 F9 :Workspace 9 +Mod1 F10 :Workspace 10 + +F11 :Fullscreen + +# commands +Control Mod1 b :ExecCommand sleep 1; xset dpms force off # blank screen +Control Mod1 c :ExecCommand xterm -geometry 21x9 -T "`date +'%b %-d'`" -e 'cal; sleep 10' # calender +Control Mod1 d :ExecCommand date | xclip -i # put now's date on the X clipboard +Control Mod1 e :ExecCommand emacs $(test -f "$(xclip -o)" && xclip -o) # emacs +Control Mod1 f :ExecCommand firefox +Control Mod1 g :ExecCommand gkrellm +Control Mod1 h :ExecCommand /home/jhammel/bin/keyshelp.sh # hotkeys help +Control Mod1 i :ExecCommand import /home/jhammel/screenshot.png +Control Mod1 l :ExecCommand echo http://letmegooglethatforyou.com/?q=$(xclip -o) | xclip -i +Control Mod1 o :ExecCommand xclip -o | /home/jhammel/python/onelineit.py | xclip -i # put the clipboard contents on one line +Control Mod1 p :ExecCommand xclip -o | /home/jhammel/bin/pastebin.sh | xclip -i # send the clipboard contents to pastebin and replace with the URL +Control Mod1 s :ExecCommand /home/jhammel/python/smartopen.py "$(xclip -o)" # smartopen +Control Mod1 t :ExecCommand gnome-terminal # terminal + +Mod4 t :ToggleDecor
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.fluxbox/menu Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,102 @@ +# Generated by fluxbox-generate_menu +# +# If you read this it means you want to edit this file manually, so here +# are some useful tips: +# +# - You can add your own menu-entries to ~/.fluxbox/usermenu +# +# - If you miss apps please let me know and I will add them for the next +# release. +# +# - The -r option prevents removing of empty menu entries and lines which +# makes things much more readable. +# +# - To prevent any other app from overwriting your menu +# you can change the menu name in .fluxbox/init to: +# session.menuFile: /home/you/.fluxbox/my-menu +[begin] (Fluxbox) + [exec] (term) {gnome-terminal} + [exec] (firefox) {firefox} </var/tmp/portage/fluxbox-0.9.15.1-r2/temp/home/.fluxbox/icons/firefox-icon.xpm> + [exec] (blank) {xset dpms force off} +[submenu] (Terminals) + [exec] (xterm) {xterm} + [exec] (gnome-terminal) {gnome-terminal} </var/tmp/portage/fluxbox-0.9.15.1-r2/temp/home/.fluxbox/icons/gnome-terminal.xpm> + [exec] (small gterm) {gnome-terminal --window-with-profile=tterm --zoom=0.86} +[end] +[submenu] (Net) +[submenu] (Browsers) + [exec] (firefox) {firefox} </var/tmp/portage/fluxbox-0.9.15.1-r2/temp/home/.fluxbox/icons/firefox-icon.xpm> + [exec] (konqueror) {konqueror} + [exec] (lynx) {xterm -e lynx fluxbox.org} +[end] +[submenu] (Mail) + [exec] (evolution) {evolution} +[end] +[submenu] (chat) + [exec] (irssi) {gnome-terminal --window-with-profile=tterm --zoom=0.75 --geometry=65x17-0-18 -e irssi} + [exec] (xchat) {xchat-2} + [exec] (gaim) {gaim} +[end] +[end] +[submenu] (Editors) + [exec] (emacs) {emacs} + [exec] (meld) {meld} + [exec] (gedit) {gedit} + [exec] (nano) {xterm -e nano} + [exec] (vim) {xterm -e vim} + [exec] (vi) {xterm -e vi} +[end] +[submenu] (Multimedia) + [submenu] (Graphics) + [exec] (gimp) {gimp} + [exec] (inkscape) {inkscape} + [exec] (dia) {dia} + [end] + [submenu] (Audio) + [exec] (audacity) { audacity } + [exec] (xmms) { xmms } + [end] + [submenu] (Video) + [exec] (gxine) { gxine } + [exec] (realplay) { realplay } + [end] + [exec] (amarok) { amarok } +[end] +[submenu] (X-utils) + [exec] (xclock) {xclock} + [exec] (clrscr) {clrscr | xclip -i} + [exec] (xkill) {xkill} + [exec] (gkrellm) {gkrellm} + [exec] (Reload .Xresources) {xrdb -load /home/jhammel/.Xresources} +[end] +[submenu] (Office) + [exec] (OpenOffice) {soffice} + [exec] (xclock) {xclock} + [exec] (cal) {xterm -geometry 21x9 -T "`date +'%b %-d'`" -e 'cal; sleep 10' } + [exec] (evince) {evince} +[end] +[submenu] (fluxbox) + [exec] (edit menu) { emacs ~/.fluxbox/menu} + [exec] (edit init) { emacs ~/.fluxbox/init} + [exec] (edit keys) { emacs ~/.fluxbox/keys} + [config] (Configure) +[submenu] (Styles) + [stylesdir] (~/.fluxbox/styles) +[end] + [workspaces] (Workspace List) +[submenu] (Tools) + [exec] (Window name) {xprop WM_CLASS|cut -d \" -f 2|xmessage -file - -center} + [exec] (Screenshot - JPG) {import screenshot.jpg && display -resize 50% screenshot.jpg} + [exec] (Screenshot - PNG) {import screenshot.png && display -resize 50% screenshot.png} +[end] +[submenu] (Window) + [restart] (gnome) {gnome-session} +[end] + [commanddialog] (Fluxbox Command) + [reconfig] (Reload config) + [restart] (Restart) + [exec] (About) {(fluxbox -v; fluxbox -info | sed 1d) 2> /dev/null | xmessage -file - -center} + [separator] + [exit] (Exit) +[end] +[end]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.fluxbox/startup Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,11 @@ +# fluxbox startup-script: + +/usr/bin/fbsetroot -solid black + +xrdb ~/.Xresources +xset b off +xset s off +xset dpms 1200 2400 3600 + +exec /usr/bin/fluxbox +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.fluxbox/styles/Black Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,133 @@ +menu.title: solid + menu.title.color: black + menu.title.textColor: grey + menu.title.textShadowColor: #000000 + menu.title.textShadowXOffset: 1 + menu.title.textShadowYOffset: 1 + menu.title.opacity: 60 + +menu.frame: solid + menu.roundCorners: TopRight TopLeft BottomLeft BottomRight + menu.frame.color: black + menu.frame.textColor: white + menu.frame.opacity: 80 + +menu.hilite: solid + menu.hilite.color: black + menu.hilite.textColor: grey + menu.hilite.textShadowColor: #000000 + menu.hilite.textShadowXOffset: 1 + menu.hilite.textShadowYOffset: 1 + menu.hilite.opacity: 50 + +menu.bullet: triangle +menu.justify: right + + +dockappholder.*.frame: flat gradient crossdiagonal + dockappholder.*.frame.color: snow + dockappholder.*.frame.colorTo: black + dockappholder.*.frame.opacity: 65 + +dockappholder.*.borderWidth: 1 +dockappholder.*.borderColor: #000000 + +borderColor: black +borderWidth: 1 +handleWidth: 3 + + outlineColor: + menu.borderWidth: 1 + menu.title.height: 15 + menu.item.height: 15 + + *.font: smoothansi:pixelsize=14 [vga] + +rootCommand: Esetroot -s ~/.fluxbox/backgrounds/ANGEL.JPG + + +toolbar: Solid +toolbar.color: black + +toolbar.roundCorners: TopRight TopLeft +toolbar.label: parentrelative +toolbar.clock: parentrelative +toolbar.iconbar.unfocused: parentrelative +toolbar.iconbar.focused: parentrelative +toolbar.iconbar.empty: parentrelative + +toolbar.iconbar.focused.textColor: white +toolbar.iconbar.unfocused.textColor: grey +toolbar.color: black +toolbar.button: Raised Bevel1 Gradient Horizontal +toolbar.button.picColor: black + +toolbar.button.pressed: Sunken Bevel1 Gradient Horizontal + +toolbar.button.pressed.picColor: grey + +toolbar.label.textColor: grey +toolbar.windowLabel.textColor: grey +toolbar.clock.textColor: grey +toolbar.textColor: grey + +toolbar.borderWidth: 2 +toolbar.bevelWidth: 1 +toolbar.borderColor: black +toolbar.clock.font: Sans Serif-9:shadow +toolbar.clock.justify: Center +toolbar.iconbar.focused.font: Sans Serif-9:shadow +toolbar.iconbar.unfocused.font: Sans Serif-9:shadow +toolbar.workspace.font: Sans Serif-9:shadow + +window.alpha: 180 + +window.label.focus: parentrelative +window.label.focus.color: black +window.label.focus.colorTo: black +window.label.focus.textColor: white + +window.*.opacity: 50 +window.label.unfocus: parentrelative +window.label.unfocus.color: black +window.label.unfocus.colorTo: black +window.label.unfocus.textColor: dark grey + +window.title.focus: flat +window.title.unfocus: flat + +window.handle.focus: parentrelative +window.handle.focus.color: black +window.handle.focus.colorTo: black + +window.handle.unfocus: parentrelative +window.handle.unfocus.color: black +window.handle.unfocus.colorTo: black + +window.button.focus: Raised Bevel1 Gradient Horizontal +window.button.focus.color: black +window.button.focus.colorTo: black +window.button.focus.picColor: grey + +window.button.unfocus: Raised Bevel1 Gradient Horizontal +window.button.unfocus.color: black +window.button.unfocus.colorTo: black +window.button.unfocus.picColor: #ffffff + +window.frame.focusColor: black +window.frame.unfocusColor: black + +window.grip.focus: parentrelative +window.grip.focus.color: black +window.grip.focus.colorTo: black + +window.grip.unfocus: parentrelative +window.grip.unfocus.color: black +window.grip.unfocus.colorTo: blackf + +window.borderWidth: 2 +window.handleWidth: 3 +window.bevelWidth: 1 +window.borderColor: black +window.font: Sans Serif-8:shadow +window.justify: center
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gtkrc-2.0 Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,2 @@ +include "/usr/share/themes/Tenebrific/gtk-2.0/gtkrc" +gtk-key-theme-name = "Emacs" \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgrc Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,3 @@ +[ui] +username = k0s <k0scist@gmail.com> +ignore = /home/jhammel/.hgignore \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.irssi/config Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,235 @@ +servers = ( + { + address = "irc.freenode.net"; + chatnet = "freenode"; + autoconnect = "Yes"; + }, + { address = "irc.stealth.net"; chatnet = "IRCnet"; port = "6668"; }, + { address = "irc.efnet.net"; chatnet = "EFNet"; port = "6667"; }, + { + address = "irc.undernet.org"; + chatnet = "Undernet"; + port = "6667"; + }, + { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; }, + { + address = "irc.quakenet.org"; + chatnet = "QuakeNet"; + port = "6667"; + }, + { address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; } +); + +chatnets = { + freenode = { type = "IRC"; }; + IRCnet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "5"; + max_whois = "4"; + max_query_chans = "5"; + }; + EFNet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "3"; + max_whois = "1"; + }; + Undernet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + DALnet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "3"; + max_whois = "30"; + }; + QuakeNet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + SILC = { type = "SILC"; }; +}; + +channels = ( + { name = "#topplabs"; chatnet = "freenode"; autojoin = "Yes"; }, + { name = "#trac"; chatnet = "freenode"; autojoin = "Yes"; }, + { name = "#geotrac"; chatnet = "freenode"; autojoin = "Yes"; }, + { name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; }, + { name = "silc"; chatnet = "silc"; autojoin = "No"; } +); + +aliases = { + J = "join"; + WJOIN = "join -window"; + WQUERY = "query -window"; + LEAVE = "part"; + BYE = "quit"; + EXIT = "quit"; + SIGNOFF = "quit"; + DESCRIBE = "action"; + DATE = "time"; + HOST = "userhost"; + LAST = "lastlog"; + SAY = "msg *"; + WI = "whois"; + WII = "whois $0 $0"; + WW = "whowas"; + W = "who"; + N = "names"; + M = "msg"; + T = "topic"; + C = "clear"; + CL = "clear"; + K = "kick"; + KB = "kickban"; + KN = "knockout"; + BANS = "ban"; + B = "ban"; + MUB = "unban *"; + UB = "unban"; + IG = "ignore"; + UNIG = "unignore"; + SB = "scrollback"; + UMODE = "mode $N"; + WC = "window close"; + WN = "window new hide"; + SV = "say Irssi $J ($V) - http://irssi.org/"; + GOTO = "sb goto"; + CHAT = "dcc chat"; + RUN = "SCRIPT LOAD"; + UPTIME = "eval exec - expr `date +%s` - \\$F | awk '{print \"Irssi uptime: \"int(\\\\\\$1/3600/24)\"d \"int(\\\\\\$1/3600%24)\"h \"int(\\\\\\$1/60%60)\"m \"int(\\\\\\$1%60)\"s\" }'"; + CALC = "exec - if which bc &>/dev/null\\; then echo '$*' | bc | awk '{print \"$*=\"$$1}'\\; else echo bc was not found\\; fi"; + SBAR = "STATUSBAR"; + INVITELIST = "mode $C +I"; + Q = "QUERY"; + "MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save"; + EXEMPTLIST = "mode $C +e"; + ATAG = "WINDOW SERVER"; +}; + +statusbar = { + # formats: + # when using {templates}, the template is shown only if it's argument isn't + # empty unless no argument is given. for example {sb} is printed always, + # but {sb $T} is printed only if $T isn't empty. + + items = { + # start/end text in statusbars + barstart = "{sbstart}"; + barend = "{sbend}"; + + topicbarstart = "{topicsbstart}"; + topicbarend = "{topicsbend}"; + + # treated "normally", you could change the time/user name to whatever + time = "{sb $Z}"; + user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}"; + + # treated specially .. window is printed with non-empty windows, + # window_empty is printed with empty windows + window = "{sb $winref:$itemname{sbmode $M}}"; + window_empty = "{sb $winref{sbservertag $tag}}"; + prompt = "{prompt $[.15]itemname}"; + prompt_empty = "{prompt $winname}"; + topic = " $topic"; + topic_empty = " Irssi v$J - http://irssi.org/help/"; + + # all of these treated specially, they're only displayed when needed + lag = "{sb Lag: $0-}"; + act = "{sb Act: $0-}"; + more = "-- more --"; + }; + + # there's two type of statusbars. root statusbars are either at the top + # of the screen or at the bottom of the screen. window statusbars are at + # the top/bottom of each split window in screen. + default = { + # the "default statusbar" to be displayed at the bottom of the window. + # contains all the normal items. + window = { + disabled = "no"; + + # window, root + type = "window"; + # top, bottom + placement = "bottom"; + # number + position = "1"; + # active, inactive, always + visible = "active"; + + # list of items in statusbar in the display order + items = { + barstart = { priority = "100"; }; + + user = { }; + window = { }; + window_empty = { }; + lag = { priority = "-1"; }; + act = { priority = "10"; }; + more = { priority = "-1"; alignment = "right"; }; + barend = { priority = "100"; alignment = "right"; }; + }; + }; + + # statusbar to use in inactive split windows + window_inact = { + type = "window"; + placement = "bottom"; + position = "1"; + visible = "inactive"; + items = { + barstart = { priority = "100"; }; + window = { }; + window_empty = { }; + more = { priority = "-1"; alignment = "right"; }; + barend = { priority = "100"; alignment = "right"; }; + }; + }; + + # we treat input line as yet another statusbar :) It's possible to + # add other items before or after the input line item. + prompt = { + type = "root"; + placement = "bottom"; + # we want to be at the bottom always + position = "100"; + visible = "always"; + items = { + prompt = { priority = "-1"; }; + prompt_empty = { priority = "-1"; }; + # treated specially, this is the real input line. + input = { priority = "10"; }; + }; + }; + + # topicbar + topic = { + type = "root"; + placement = "top"; + position = "1"; + visible = "always"; + items = { + topicbarstart = { priority = "100"; }; + topic = { }; + topic_empty = { }; + topicbarend = { priority = "100"; alignment = "right"; }; + }; + }; + }; +}; +settings = { + core = { + real_name = "Jeff Hammel"; + user_name = "jhammel"; + nick = "jhammel"; + }; + "fe-text" = { actlist_sort = "refnum"; }; +}; +hilights = ( { text = "jhammel"; }, { text = "achtung"; } { text = "goulash"; } );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.mailcap Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,89 @@ +text/html; elinks -dump -dump-charset iso-8859-15 -default-mime-type text/html %s; needsterminal; copiousoutput; +application/msword; antiword %s; copiousoutput; +application/pdf; pdftotext -layout -enc ASCII7 %s -; copiousoutput; +application/vnd.ms-excel; /home/jhammel/bin/antixls.sh %s; copiousoutput; +application/x-annodex;/usr/bin/gxine %s +video/quicktime;/usr/bin/gxine %s +video/x-quicktime;/usr/bin/gxine %s +audio/x-m4a;/usr/bin/gxine %s +application/x-quicktimeplayer;/usr/bin/gxine %s +video/mkv;/usr/bin/gxine %s +video/x-ms-asf;/usr/bin/gxine %s +video/x-ms-wmv;/usr/bin/gxine %s +video/x-ms-wma;/usr/bin/gxine %s +application/vnd.ms-asf;/usr/bin/gxine %s +application/x-mplayer2;/usr/bin/gxine %s +video/x-ms-asf-plugin;/usr/bin/gxine %s +video/x-ms-wvx;/usr/bin/gxine %s +video/x-ms-wax;/usr/bin/gxine %s +video/msvideo;/usr/bin/gxine %s +video/x-msvideo;/usr/bin/gxine %s +video/x-flic;/usr/bin/gxine %s +audio/x-basic;/usr/bin/gxine %s +audio/x-8svx;/usr/bin/gxine %s +audio/8svx;/usr/bin/gxine %s +audio/x-16sv;/usr/bin/gxine %s +audio/168sv;/usr/bin/gxine %s +image/x-ilbm;/usr/bin/gxine %s +image/ilbm;/usr/bin/gxine %s +video/x-anim;/usr/bin/gxine %s +video/anim;/usr/bin/gxine %s +image/jpeg;/usr/bin/feh %s +image/png;/usr/bin/feh %s +image/x-png;/usr/bin/feh %s +video/mng;/usr/bin/gxine %s +video/x-mng;/usr/bin/gxine %s +audio/x-ogg;/usr/bin/gxine %s +audio/x-speex;/usr/bin/gxine %s +audio/x-real-audio;/usr/bin/gxine %s +video/mpeg;/usr/bin/gxine %s +video/x-mpeg;/usr/bin/gxine %s +x-mpegurl;/usr/bin/gxine %s +application/x-flac;/usr/bin/gxine %s + +application/x-ogg;/usr/RealPlayer/realplay %s +application/ogg;/usr/RealPlayer/realplay %s +text/vnd.rn-realtext;/usr/RealPlayer/realplay %s +image/vnd.rn-realpix;/usr/RealPlayer/realplay %s +application/smil;/usr/RealPlayer/realplay %s +audio/mp3;/usr/RealPlayer/realplay %s +audio/x-mp3;/usr/RealPlayer/realplay %s +audio/mpeg;/usr/RealPlayer/realplay %s +audio/mpg;/usr/RealPlayer/realplay %s +audio/x-mpeg;/usr/RealPlayer/realplay %s +audio/x-mpg;/usr/RealPlayer/realplay %s +audio/mpegurl;/usr/RealPlayer/realplay %s +audio/x-mpegurl;/usr/RealPlayer/realplay %s +audio/wav;/usr/RealPlayer/realplay %s +audio/x-wav;/usr/RealPlayer/realplay %s +audio/x-pn-wav;/usr/RealPlayer/realplay %s +audio/x-pn-windows-acm;/usr/RealPlayer/realplay %s +audio/x-pn-windows-pcm;/usr/RealPlayer/realplay %s +application/vnd.rn-realmedia-secure;/usr/RealPlayer/realplay %s +application/vnd.rn-realaudio-secure;/usr/RealPlayer/realplay %s +audio/x-realaudio-secure;/usr/RealPlayer/realplay %s +video/vnd.rn-realvideo-secure;/usr/RealPlayer/realplay %s +audio/vnd.rn-realaudio;/usr/RealPlayer/realplay %s +audio/x-realaudio;/usr/RealPlayer/realplay %s +application/vnd.rn-realmedia;/usr/RealPlayer/realplay %s +application/vnd.rn-realmedia-vbr;/usr/RealPlayer/realplay %s +image/vnd.rn-realpix;/usr/RealPlayer/realplay %s +audio/x-pn-realaudio;/usr/RealPlayer/realplay %s +video/vnd.rn-realvideo;/usr/RealPlayer/realplay %s +application/vnd.rn-realsystem-rmj;/usr/RealPlayer/realplay %s +application/vnd.rn-realsystem-rmx;/usr/RealPlayer/realplay %s +audio/aac;/usr/RealPlayer/realplay %s +audio/m4a;/usr/RealPlayer/realplay %s +audio/mp2;/usr/RealPlayer/realplay %s +audio/mp1;/usr/RealPlayer/realplay %s +audio/rn-mpeg;/usr/RealPlayer/realplay %s +audio/scpls;/usr/RealPlayer/realplay %s +audio/x-scpls;/usr/RealPlayer/realplay %s +application/streamingmedia;/usr/RealPlayer/realplay %s +application/sdp;/usr/RealPlayer/realplay %s +application/x-sdp;/usr/RealPlayer/realplay %s +audio/basic;/usr/RealPlayer/realplay %s +audio/x-pn-au;/usr/RealPlayer/realplay %s +audio/aiff;/usr/RealPlayer/realplay %s +audio/x-aiff;/usr/RealPlayer/realplay %s +audio/x-pn-aiff;/usr/RealPlayer/realplay %s
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.mozilla/userContent.css Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,22 @@ +/* + * Edit this file and copy it as userContent.css into your + * profile-directory/chrome/ + */ + +@-moz-document url-prefix(https://mail.google.com), + url-prefix(http://mail.google.com) +{ + #ds_spam b { + visibility: hidden; + } + + #ds_spam b::before { + content: "Spam"; + visibility: visible; + font-weight: normal; + } +} + +input { + background: white; +}; \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.mutt/aliases Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,7 @@ +alias ra Rob Miller <robm@openplans.org> +alias rm Rob Marianski <rmarianski@openplans.org> +alias dev opencore-dev@lists.openplans.org +alias ui opencore-ui@lists.openplans.org +alias ops operations-discussion@lists.openplans.org +alias design topp-design-discussion@lists.openplans.org +alias wfh wfh@lists.openplans.org \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.muttrc Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,49 @@ +set allow_ansi # allow ANSI color codes in messages. +set attach_split # handle every single attachment instead of concat +set check_new # search for new messages in maildir/MH folders. +set smtp_url="smtp://jhammel@mail.openplans.org" +set spoolfile=imaps://mail.openplans.org/INBOX +set folder=imaps://mail.openplans.org +set editor="emacs -nw" +set nomove +set from="jhammel@openplans.org" +set hostname="openplans.org" +set timeout=5 +set mail_check=5 +set sort=reverse-threads +set sort_aux=date-received +set pager_stop +set realname="Jeff Hammel" +set record="imaps://mail.openplans.org/INBOX.Sent" +set abort_unmodified=no +set implicit_autoview +set markers=no + +set use_from=yes +set use_envelope_from=yes + +source ~/.mutt/aliases +set alias_file=~/.mutt/aliases # Keep aliases in this file. + +color normal default default + +macro index d "<delete-message><previous-undeleted>" +macro pager d "<delete-message><previous-undeleted>" + +# Ignore all headers +ignore * + +# Then un-ignore the ones I want to see +unignore From: +unignore To: +unignore Reply-To: +unignore Subject: +unignore Date: +unignore CC: +unignore BCC: + +# Now order the visable header lines +hdr_order From: Subject: To: CC: BCC: Reply-To: Date: + +bind pager < previous-line +bind pager > next-line \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.subversion_config/config Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,103 @@ +### This file configures various client-side behaviors. +### +### The commented-out examples below are intended to demonstrate +### how to use this file. + +### Section for authentication and authorization customizations. +[auth] +### Set store-passwords to 'no' to avoid storing passwords in the +### auth/ area of your config directory. It defaults to 'yes'. +### Note that this option only prevents saving of *new* passwords; +### it doesn't invalidate existing passwords. (To do that, remove +### the cache files by hand as described in the Subversion book.) +# store-passwords = no +### Set store-auth-creds to 'no' to avoid storing any subversion +### credentials in the auth/ area of your config directory. +### It defaults to 'yes'. Note that this option only prevents +### saving of *new* credentials; it doesn't invalidate existing +### caches. (To do that, remove the cache files by hand.) +# store-auth-creds = no + +### Section for configuring external helper applications. +[helpers] +### Set editor to the command used to invoke your text editor. +### This will override the environment variables that Subversion +### examines by default to find this information ($EDITOR, +### et al). +# editor-cmd = editor (vi, emacs, notepad, etc.) +### Set diff-cmd to the absolute path of your 'diff' program. +### This will override the compile-time default, which is to use +### Subversion's internal diff implementation. +# diff-cmd = diff_program (diff, gdiff, etc.) +### Set diff3-cmd to the absolute path of your 'diff3' program. +### This will override the compile-time default, which is to use +### Subversion's internal diff3 implementation. +# diff3-cmd = diff3_program (diff3, gdiff3, etc.) +### Set diff3-has-program-arg to 'true' or 'yes' if your 'diff3' +### program accepts the '--diff-program' option. +# diff3-has-program-arg = [true | false] + +### Section for configuring tunnel agents. +[tunnels] +### Configure svn protocol tunnel schemes here. By default, only +### the 'ssh' scheme is defined. You can define other schemes to +### be used with 'svn+scheme://hostname/path' URLs. A scheme +### definition is simply a command, optionally prefixed by an +### environment variable name which can override the command if it +### is defined. The command (or environment variable) may contain +### arguments, using standard shell quoting for arguments with +### spaces. The command will be invoked as: +### <command> <hostname> svnserve -t +### (If the URL includes a username, then the hostname will be +### passed to the tunnel agent as <user>@<hostname>.) If the +### built-in ssh scheme were not predefined, it could be defined +### as: +# ssh = $SVN_SSH ssh +### If you wanted to define a new 'rsh' scheme, to be used with +### 'svn+rsh:' URLs, you could do so as follows: +# rsh = rsh +### Or, if you wanted to specify a full path and arguments: +# rsh = /path/to/rsh -l myusername +### On Windows, if you are specifying a full path to a command, +### use a forward slash (/) or a paired backslash (\\) as the +### path separator. A single backslash will be treated as an +### escape for the following character. + +### Section for configuring miscelleneous Subversion options. +[miscellany] +### Set global-ignores to a set of whitespace-delimited globs +### which Subversion will ignore in its 'status' output, and +### while importing or adding files and directories. +global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store *.pyc *.egg-info +### Set log-encoding to the default encoding for log messages +# log-encoding = latin1 +### Set use-commit-times to make checkout/update/switch/revert +### put last-committed timestamps on every file touched. +# use-commit-times = yes +### Set no-unlock to prevent 'svn commit' from automatically +### releasing locks on files. +# no-unlock = yes +### Set enable-auto-props to 'yes' to enable automatic properties +### for 'svn add' and 'svn import', it defaults to 'no'. +### Automatic properties are defined in the section 'auto-props'. +# enable-auto-props = yes + +### Section for configuring automatic properties. +[auto-props] +### The format of the entries is: +### file-name-pattern = propname[=value][;propname[=value]...] +### The file-name-pattern can contain wildcards (such as '*' and +### '?'). All entries which match will be applied to the file. +### Note that auto-props functionality must be enabled, which +### is typically done by setting the 'enable-auto-props' option. +# *.c = svn:eol-style=native +# *.cpp = svn:eol-style=native +# *.h = svn:eol-style=native +# *.dsp = svn:eol-style=CRLF +# *.dsw = svn:eol-style=CRLF +# *.sh = svn:eol-style=native;svn:executable +# *.txt = svn:eol-style=native +# *.png = svn:mime-type=image/png +# *.jpg = svn:mime-type=image/jpeg +# Makefile = svn:eol-style=native +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.xinitrc Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,1 @@ +exec startfluxbox
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.xpdfrc Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,1 @@ +urlCommand "firefox -remote 'openURL(%s)'"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/antixls.sh Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,14 @@ + +SSCONVERT=`which ssconvert 2> /dev/null`; +if [ -z "${SSCONVERT}" ]; then + echo "${SSCONVERT} not found. Please install gnumeric."; + return 1; +fi; +for i in "$@"; +do + OUTPUT=${i%.xls}.txt; + $SSCONVERT -I Gnumeric_Excel:excel -T Gnumeric_stf:stf_csv "$i" "$OUTPUT" 2>/dev/null; + cat "$OUTPUT"; +done + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/clrscr Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,2 @@ +#!/bin/bash +for i in `seq 1000`; do echo; done
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/keyshelp.sh Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,11 @@ +#!/bin/bash + +# help message for fluxbox keys +if which gxmessage +then + XMESSAGE="gxmessage -borderless" +else + XMESSAGE=xmessage +fi + +cat <(echo -e "Press <Control>+<Alt>+key to use the commands: \n") <(sed -n '/Control Mod1.*ExecCommand/ {s/Control Mod1//g;s/ExecCommand//g;s/:.*#/:/g;p}' ~/.fluxbox/keys) | ${XMESSAGE} -timeout 20 -nearmouse -file -
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/onelineit.sh Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,4 @@ +#!/bin/bash + +sed -e 's/^ *//g' -e 's/ *$//g' | tr '\n' ' ' +echo \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/pastebin.sh Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,13 @@ +# all spaces must be converted to '+' +# all newlines must be converted to %0D%0A +# this is probably better off converted in a python script + +CONTENT_DATA=`python -c "import sys; print '%0D%0A'.join(sys.stdin.read().split('\n'))" | sed 's/ /+/g'` + +#echo $CONTENT_DATA +#CONTENT_DATA=`echo ${CONTENT_DATA} | sed 's/ /+/g'` +#echo $CONTENT_DATA +#CONTENT_DATA=`echo ${CONTENT_DATA} | sed 's/$/%0D%0A/g'` + +wget --post-data="content=${CONTENT_DATA}&s=Submit+Post&description=&type=1&expiry=&name=" -O- http://www.pastebin.ca/index.php | grep 'meta http-equiv="refresh"' | sed 's/^.*\(http:[^"]*\).*/\1/' +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/venvit.sh Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,28 @@ +#!/bin/bash + +if (( $# != 1 )) +then + echo "Usage: $0 <svn-location>" + exit 0 +fi + +NAME=$1 + +for i in /trunk /branches /tag +do + NAME=${NAME%%$i*} +done +NAME=${NAME##*/} + +#echo $NAME + +VIRTUAL_ENV_LOCATION="${HOME}/virtualenv/virtualenv.py" + +python ${VIRTUAL_ENV_LOCATION} ${NAME} +cd ${NAME} +source bin/activate +mkdir src/ +cd src/ +svn co $1 ${NAME} +cd ${NAME} +python setup.py develop
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/wgrep.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +import sys +import urlparse +import urllib2 +import tempfile +import shutil +import subprocess + +def usage(): + print 'Usage: %s <url> <pattern>' % sys.argv[0] + sys.exit(0) + +def geturl(origurl): + # get the url + url = urlparse.urlsplit(origurl) + if not url[0]: + url = urlparse.urlsplit('http://%s' % origurl) + return url + +if __name__ == '__main__': + if len(sys.argv[1:]) != 2: + usage() + urlparts = geturl(sys.argv[1]) + url = urlparse.urlunsplit(urlparts) + + # ensure the url is openable + try: + u = urllib2.urlopen(url) + except urllib2.HTTPError, e: + print '%s\n%s' % (url, e) + sys.exit(1) + + thedir = tempfile.mkdtemp() + + # wget the files + wget = subprocess.Popen(['wget', '-r', '-l0', + '--no-parent', + '--no-check-certificate', + '-P', thedir, + u.url], + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + ) + out, err = wget.communicate() + code = wget.returncode + if code: + sys.exit(code) + + # do da grep + grep = subprocess.Popen(['grep', '-r', '-l', + sys.argv[2], + thedir], + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + ) + out, err = grep.communicate() + for i in out.split('\n'): + print i.replace('%s/' % thedir, '%s://' % urlparts[0], 1) + + destructive = True + if destructive: + shutil.rmtree(thedir) + else: + print thedir
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/yt2mp3.sh Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,12 @@ +#!/bin/bash + +YOUTUBEDL=/home/jhammel/music/youtube-dl + +URL=$1 +TITLE=$($YOUTUBEDL --get-title $URL) +$YOUTUBEDL -b -i -r 50k $URL -o "%(title)s.%(ext)s" +EXT=mp4 +rm -f audiodump.wav +mplayer -vc null -vo null -ao pcm "$TITLE.$EXT" +lame -q 2 audiodump.wav "$TITLE.mp3" +rm "$TITLE.$EXT" \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/address.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,68 @@ +#!/usr/bin/python + +import sys +from states import * + +def validate_zipcode(zip, zip4=None): + """ validate a zipcode""" + + if not zip: + # a non-existant zip-code is a valid zipcode + # ... i think.... + return True + + if '-' in zip: # in this case, split zip into zip5 + zip4 + zip, zip4 = zip.split('-') + + zdict = { 'zip5': zip, 'zip4': zip4 } + + # if the 4-digit extension exists, add it to zip + if zip4: + zip += '-' + zip4 + + # validate zip code format + for i in 5, 4: + zstring = 'zip' + str(i) + z = zdict.get(zstring, '') + if z: + if (not z.isdigit()) or (len(z) != i): + return False + + return zip + +def normalizeaddress(query): + """ returns normalize address, if it is an address """ + + # normalize the address + query = ','.join([i.strip() for i in query.split('\n')]) + querylist = [i.strip() for i in query.split(',')] + + lastentry = querylist[-1] + + if lastentry[-1].isdigit(): + # it must be a zip code + if lastentry[1].isalpha(): + querylist = querylist[:-1] + lastentry.split() + if not validate_zipcode(querylist[-1]): + return False + state = querylist[-2] + else: + state = querylist[-1] + + if not getstate(state): + return False + + return ', '.join(querylist) + +def address(query): + """ + format an address + -- query should be a string + """ + +if __name__ == '__main__': + i = normalizeaddress(' '.join(sys.argv[1:])) + if i: + print i + else: + print 'Not an address'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/anagram.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,105 @@ +#!/usr/bin/env python + +import os + +dictionary = [] + +def read_dictionary(f): + for name in f.readlines(): + name = name.strip('\n') + word = ''.join(name.split()).lower() + dictionary.append(word) + +def is_in(string1, string2): + + string2 = list(string2) + + try: + for i in string1: + string2.remove(i) + except ValueError: + return None + + return ''.join(string2) + +def anagramize(theword, wordlist, level=0): + + if 0: + print '%s%s : %s' % ('-' * level, theword, wordlist) + + anagrams = [] + + # start the search with a new word + for index in range(len(wordlist)): + word = wordlist[index] + subword = is_in(word, theword) + if subword == '': + anagrams.append(word) + continue + + if subword is None: + continue + + + sublist = [ i for i in wordlist[index:] + if is_in(i, subword) is not None ] + subgram = anagramize(subword, sublist, level+1) + +# import pdb; pdb.set_trace() + if subgram is not None: + anagrams += [ ' '.join((word, i)) for i in subgram ] + + if 0: + print '%s%s returning %s' % ('-' * level, theword, anagrams) + + if anagrams: + return anagrams + return None + +if __name__ == '__main__': + import sys + from optparse import OptionParser + + parser = OptionParser() + parser.add_option("-f", dest="filename", help="dictionary to read", + default='') + (options, args) = parser.parse_args() + + if not os.path.exists(options.filename): + + dicts = [ '/home/jhammel/docs/dict.txt', + '/usr/share/dict/cracklib-small', + '/usr/share/dict/american-english' ] + + for i in dicts: + if os.path.exists(i): + options.filename = i + break + else: + print 'Dictionary not found' + parser.print_help() + sys.exit(1) + + if not args: + print 'please provide an anagram' + sys.exit(0) + + f = file(options.filename, 'r') + read_dictionary(f) + + anagram = ' '.join(args) + + print anagram + print '-' * len(anagram) + + anagram = ''.join(anagram.split()).lower() + + # don't use letter names + dictionary = [ i for i in dictionary if (len(i) > 1) or i in 'ai' ] + + wordlist = [ i for i in dictionary + if i and is_in(i, anagram) is not None ] + + anagrams = anagramize(anagram, wordlist) + + print '\n'.join(anagrams)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/cgiescape.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +import sys +import cgi + +print cgi.escape(sys.stdin.read()) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/clearsilver.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,221 @@ +#!/usr/bin/python + +import sys, os + +KEY_RETURN=""" +""" + +class ClearSilver(object): + """ + a blatant rip-off of quicksilver/katapult + """ + def __init__(self, startswith=''): + self.matches = {} + self.sortable = True + if startswith: + self.build_matches(startswith) + + def returnmatch(self): + keys = self.matches.keys() + if len(keys) == 1: + return keys[0], self.matches[keys[0]] + if self.sortable: + keys.sort() + return keys + + def find_matches(self, startswith): + nixlist = [] + for i in self.matches: + if not i.startswith(startswith): + nixlist.append(i) + + for i in nixlist: + self.matches.pop(i) + + return self.returnmatch() + + +class PATHsilver(ClearSilver): + + def build_matches(self, startswith=''): + path = os.environ['PATH'].split(':') + path.reverse() + for directory in path: + try: + for binary in os.listdir(directory): + if binary.startswith(startswith): + self.matches[binary] = '/'.join((directory,binary)) + except OSError: # directory not found + continue + return self.returnmatch() + + + def exec_match(self, key): + item = self.matches[key] + os.execl(item, item) + + +class Wordsilver(ClearSilver): + dictfile = '/usr/share/dict/cracklib-small' + + def build_matches(self, startswith=''): + f = file(self.dictfile, 'r') + for i in f.readlines(): + if i.startswith(startswith): + i = i.rstrip('\r\n') + self.matches[i] = i + return self.returnmatch() + + def exec_match(self, key): + item = self.matches[key] + print key + +class BookmarkSilver(ClearSilver): + def __init__(self, startswith=''): + ClearSilver.__init__(self) + self.sortable = False + if startswith: + self.build_matches(startswith) + + def add_url(self, i, startswith): + delimiter = '//' + j = i[i.index(delimiter) + len(delimiter):] + j = j.rstrip('/') + if j.startswith(startswith): + self.matches[j] = i + j = j.strip('w.') + if j.startswith(startswith): + self.matches[j] = i + + def build_matches(self, startswith=''): + # find the firefox files + firefoxdir = '/'.join((os.environ['HOME'], '.mozilla', 'firefox')) + profile = file('/'.join((firefoxdir, 'profiles.ini')), 'r').readlines() + profile = [i.rstrip('\n\r \t') for i in profile] + index = profile.index('Name=default') + delimiter = 'Path=' + while 1: + index += 1 + if profile[index].startswith(delimiter): + profile = '/'.join((firefoxdir, profile[index][len(delimiter):])) + break + bookmarks = '/'.join((profile, 'bookmarks.html')) + history = '/'.join((profile, 'history.dat')) + import re + history = file(history, 'r').read() + history = re.findall('http.*//.*\)', history) + history.reverse() + for i in history: + i = i[:i.index(')')] + self.add_url(i, startswith) + + bookmarks = file(bookmarks, 'r').read() + bookmarks = re.findall('"http.*//.*"', bookmarks) + + for i in bookmarks: + i = i.strip('"') + i = i[:i.index('"')] + self.add_url(i, startswith) + + return self.returnmatch() + + def exec_match(self, key): + item = self.matches[key] + + os.system("firefox " + item) + +if __name__ == '__main__': + + matcher_type = 'PATHsilver' + + # parse options + options = { 'D' : 'Wordsilver', 'H' : 'BookmarkSilver' } + for i in sys.argv[1:]: + i = i.strip('-') + if options.has_key(i): + matcher_type = options[i] + + # init the 'GUI' + import curses + stdscr = curses.initscr() + curses.noecho() + curses.cbreak() + stdscr.keypad(1) + + try: +# XXX should include colors at some point -- not right now, though +# curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE) + + c = '' + matcher = None + matches = None + entered='' + + while 1: + y, x = stdscr.getmaxyx() + stdscr.refresh() + c = stdscr.getch() + stdscr.erase() + + # handle backspaces + if c == curses.KEY_BACKSPACE or c == 127: + entered = entered[:-1] + matcher = None + matches = None + else: + + try: + c = chr(c) + except ValueError: + continue + + if c == KEY_RETURN: + break + + entered += c + + if not matcher: + matcher = eval(matcher_type + "()") + matches = matcher.build_matches(entered) + else: + + if c.isdigit() and int(c) < min(10, len(matches)): + for i in matches: + if i.startswith(entered): + break + else: + matches = matches[int(c):int(c)+1] + break + + matches = matcher.find_matches(entered) + + + if isinstance(matches, list): + i=1 + for match in matches: + if i >= y: continue + if i <= 10: + numstr = " :" + str(i-1) + else: + numstr = "" + stdscr.addstr(i,0, match + numstr) + i += 1 + stdscr.addstr(0,0, entered) + + if matches: stdscr.addstr(1,0, matches[0] + " :0") + else: + stdscr.addstr(0,0,entered + " -> " + matches[1]) + + finally: + # 'GUI' cleanup + curses.nocbreak() + stdscr.keypad(0) + curses.echo() + curses.endwin() + + # execute the program (if found) + if not matches: + sys.exit(1) + matcher.exec_match(matches[0]) + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/dictarg.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,54 @@ +#!/usr/bin/python + +import sys + +def dictarg(adict, argv=sys.argv[1:]): + + shopts = {} + + # build list of keys + for i in adict.keys(): + for j in i: + s = str(j) + if len(s) == 1: + if shopts.has_key(s): + continue + shopts[s] = i + break + else: + print >> sys.stderr, "dictarg: couldn't generate key for '%s'" % i + sys.exit(1) + + optstring = "?" + for i in shopts.keys(): + optstring += i + ':' # all these options should have arguments + + # look for command line args + import getopt + + opts, args = getopt.getopt(argv, optstring) + + if ('-?', '') in opts: + print 'Options:' + for i in shopts: + print '-%s %s [%s]' % (i, shopts[i], adict[shopts[i]]) + sys.exit(0) + + for o, v in opts: + o = o[1:] # cut off the dash + adict[shopts[o]] = v + +# test if invoked from command line +if __name__ == '__main__': + adict = {} + for i in sys.argv: + adict[i] = len(i) + + # print the help + dictarg(adict, ['-?']) + + # test functionality + print 'Enter test arguments: ', + line = sys.stdin.readline()[:-1].split(' ') + dictarg(adict, line) + print adict
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/dictify.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +divider = ':' + +def dictify(string): + lines = [ i.strip() for i in string.split('\n') if i.strip() ] + return dict([i.split(divider,1) for i in lines + if len(i.split(divider,1)) == 2]) + +if __name__ == '__main__': + import sys + feh = sys.stdin.read() + thedict = dictify(feh) + if sys.argv[1:]: + for i in sys.argv[1:]: + if thedict.has_key(i): + print thedict[i] + else: + print thedict
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/hexify.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,3 @@ +#!/usr/bin/env python +import sys +print ''.join([ '%'+ hex(ord(i))[-2:] for i in ' '.join(sys.argv[1:]) ])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/listify.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,20 @@ +def listify(listitems, ordered=False): + """ return an html list """ + if not hasattr(listitems, '__iter__'): + thelist = ( listitems, ) + if ordered: + tag, invtag = '<ol>\n', '</ol>' + else: + tag, invtag = '<ul>\n', '</ul>' + + thelist = tag + + for i in listitems: + thelist += ' <li> ' + str(i) + ' <li>\n' + + thelist += invtag + return thelist + +if __name__ == '__main__': + import sys + print listify(sys.argv)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/lolspeak.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +loldict = { 'am': 'is', + 'and': 'n', + 'are': 'r', + 'ate': 'eated', + 'back': 'bak', + 'business': 'bizness', + 'bye': 'bai', + 'cat': 'kitteh', + 'cheeseburger': 'cheezburger', + 'cute': 'kyooot', + 'food': 'foodz', + 'fucking': 'fuxing', + 'have': 'has', + 'help': 'halp', + 'hi': 'hai', + 'is': 'iz', + 'kitty': 'kitteh', + 'later': 'l8r', + 'making': 'makin', + 'means': 'meens', + 'more': 'moar', + 'news': 'newz', + 'please': 'plz', + 'power': 'powr', + 'saturday': 'caturday', + 'says': 'sez', + 'takes': 'takez', + 'thanks': 'kthx', + 'time': 'tiem', + 'the': 'teh', + 'there': 'thar', + 'this': 'dis', + 'towel': 'towul', + 'uses': 'uzes', + 'young': 'yung', + 'your': 'ur' + } + +def translate(string): + retval = [] + for word in string.split(): + retval.append(loldict.get(word.lower(), word)) + return ' '.join(retval) + +if __name__ == '__main__': + import sys + if sys.argv[1:]: + print translate(' '.join(sys.argv[1:])) + else: + print translate(sys.stdin.read()) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/lsex.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,39 @@ +#!/usr/bin/env python +import os + +# make sure duplicate path elements aren't printed twice +def ordered_set(alist): + seen = set() + new = [] + for item in alist: + if item in seen: + continue + seen.add(item) + new.append(item) + return new + +def lsex(path=None): + """ + list executable files on the path + o path: list of directories to search. if not specified, use system path + """ + + if path is None: + # use system path + path = ordered_set(os.environ['PATH'].split(':')) + + executables = [] + + # add the executable files to the list + for i in path: + if not os.path.isdir(i): + continue + files = [ os.path.join(i,j) for j in os.listdir(i) ] + files = filter(lambda x: os.access(x, os.X_OK), files) + files.sort() # just to make the output pretty + executables.extend(files) + return executables + +if __name__ == '__main__': + for i in lsex(): + print i
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/onelineit.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +def onelineit(string): + string = string.split('\n') + string = [ i.strip() or '\n' for i in string ] + string = ' '.join(string) + string = string.split('\n') + string = [ i.strip() for i in string if i.strip() ] + + return '\n\n'.join(string) + +if __name__ == '__main__': + import sys + print onelineit(sys.stdin.read())
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/randomize.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +import os +import random +import subprocess +import sys + +from optparse import OptionParser + +if __name__ == '__main__': + parser = OptionParser() + parser.add_option("-e", "--exec", dest="callable", + help="program to execute") + (options, argv) = parser.parse_args() + args = [] + for i in argv: + if os.path.isdir(i): + for root, dirs, files in os.walk(i): + args.extend([os.path.join(root, f) for f in files]) + else: + args.append(i) + random.shuffle(args) + if options.callable: + for i in args: + subprocess.call([options.callable, i]) + else: + print '\n'.join(args)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/realpath.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,4 @@ +#!/usr/bin/env python +import os, sys +for i in sys.argv[1:]: + print os.path.realpath(i)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/signature.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,30 @@ +import random +import sys +import time + +from optparse import OptionParser + +parser = OptionParser() +parser.add_option('-f', '--file') +parser.add_option('-o', '--output') +(options, args) = parser.parse_args() + +if options.file: + f = file(options.file) +else: + f = sys.stdin + +lines = [ line.strip() or '\n' for line in f.read().strip().split('\n') ] +content = '\n'.join(lines) +fortunes = [i.strip() for i in content.split('\n\n') ] +f.close() + +while 1: + if options.output: + f = file(sig, 'w') + print >> f, random.choice(fortunes) + f.close() + else: + print random.choice(fortunes) + time.sleep(1) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/smartopen.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,150 @@ +#!/usr/bin/python + +""" smart open the data passed in """ + +import urllib +import urllib2 +import sys +import os +import address + +class Location: + """ + generic class for locations + """ + + def __init__(self, baseurl=""): + self.baseurl = baseurl + + def url(self, query): + return self.baseurl + self.process(query) + + def process(self, query): + return query + + def test(self, query): + return True + + def open(self, query): + if not self.test(query): + return False + url = self.url(query) + os.system("firefox '%s'" % url) + return True + +class URL(Location): + """a straight URL""" + + def process(self, query): + if '://' in query: + return query + return 'http://' + query + + def test(self, query): + """try to open the url""" + + if ' ' in query or '\n' in query: + return False + + try: + site = urllib.urlopen(self.process(query)) + except IOError: + return False + return True + +class GoogleMap(Location): + """try to google-maps the address""" + + def __init__(self): + gmapsurl='http://maps.google.com/maps?f=q&hl=en&q=' + Location.__init__(self, gmapsurl) + + def process(self, query): + theaddress = address.normalizeaddress(query) + if not theaddress: + return theaddress + return urllib.quote_plus(theaddress) + + def test(self, query): + return bool(self.process(query)) + +class Revision(Location): + def __init__(self): + revision_url = 'http://trac.openplans.org/openplans/changeset/' + Location.__init__(self, revision_url) + + def process(self, query): + return query[1:] + + def test(self, query): + if query[0] != 'r': + return False + return query[1:].isdigit() + + + +class TracTicket(Location): + def __init__(self): + # url for # data + number_url = 'http://trac.openplans.org/openplans/ticket/' + Location.__init__(self, number_url) + + def process(self, query): + if query.startswith('#'): + return query[1:] + return query + + def test(self, query): + query = self.process(query) + if len(query.split()) != 1: + return False + return query.isdigit() + +class Wikipedia(Location): + """try to open the query in wikipedia""" + def __init__(self): + wikiurl = 'http://en.wikipedia.org/wiki/' + Location.__init__(self, wikiurl) + + def process(self, query): + return urllib.quote_plus('_'.join(query.split())) + + def test(self, query): + 'test to see if the article exists' + + # need a phony user agent so wikipedia won't know we're a bot + headers = {} + headers['User-Agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4' + + request = urllib2.Request(self.url(query), None, headers) + f = urllib2.urlopen(request).read() + + if 'Wikipedia does not have an article with this exact name' in f: + return False + return True + +class Google(Location): + def __init__(self): + googleurl = 'http://www.google.com/search?hl=en&q=' + Location.__init__(self, googleurl) + + def process(self, query): + return urllib.quote_plus(query) + +# get data to be operated on +data = ' '.join(sys.argv[1:]) +if not data: + data = sys.stdin.read() + +locations = [ URL, + GoogleMap, + Revision, + TracTicket, + Wikipedia, + Google + ] + +for loc in locations: + loc = loc() + if loc.open(data): + sys.exit(0)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/states.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,75 @@ +states = { + "AL": "Alabama", + "AK": "Alaska", + "AS": "American Samoa", + "AZ": "Arizona", + "AR": "Arkansas", + "AE": "Army P.O. Box", + "AP": "Army Post Office", + "CA": "California", + "CO": "Colorado", + "CT": "Connecticut", + "DE": "Delaware", + "DC": "District of Columbia", + "FL": "Florida", + "GA": "Georgia", + "GU": "Guam", + "HI": "Hawaii", + "ID": "Idaho", + "IL": "Illinois", + "IN": "Indiana", + "IA": "Iowa", + "KS": "Kansas", + "KY": "Kentucky", + "LA": "Louisiana", + "ME": "Maine", + "MD": "Maryland", + "MA": "Massachusetts", + "MI": "Michigan", + "MN": "Minnesota", + "MS": "Mississippi", + "MO": "Missouri", + "MT": "Montana", + "NE": "Nebraska", + "NV": "Nevada", + "NH": "New Hampshire", + "NJ": "New Jersey", + "NM": "New Mexico", + "NY": "New York", + "NC": "North Carolina", + "ND": "North Dakota", + "OH": "Ohio", + "OK": "Oklahoma", + "OR": "Oregon", + "OT": "Other", + "PA": "Pennsylvania", + "PR": "Puerto Rico", + "RI": "Rhode Island", + "SC": "South Carolina", + "SD": "South Dakota", + "TN": "Tennessee", + "TX": "Texas", + "US": "United States", + "UT": "Utah", + "VT": "Vermont", + "VI": "Virgin Islands", + "VA": "Virginia", + "WA": "Washington", + "WV": "West Virginia", + "WI": "Wisconsin", + "WY": "Wyoming", +} + +def getstate(query): + """ + return the state name of the query, + or None if its not in the list + """ + + if query in states.keys(): + return states[query] + + if query in states.values(): + return query + + return None
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/str2lnk.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,24 @@ +#!/usr/bin/python + +def str2lnk(string): + """transform a string to a legitimate link name for html""" + illegal_characters=' @,?/\\#' + for i in illegal_characters: + string = string.replace(i, '_') + newstring = '' + for i in string.split('_'): + if i: + newstring += i + '_' + return newstring[:-1] + +if __name__ == '__main__': + import sys + try: + newstring=sys.argv[1] + except IndexError: + print '%s' % str2lnk.__doc__ + print 'Usage: %s <string to be made a link>' % sys.argv[0] + sys.exit(0) + + newstring = ' '.join(sys.argv) + print str2lnk(newstring)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/tablify.py Thu Oct 15 11:41:26 2009 -0400 @@ -0,0 +1,19 @@ +def tablify(table_lines, header=True): + table = '<table>\n' + if header: + tag, invtag = '<th> ', ' </th>' + else: + tag, invtag = '<td> ', ' </td>' + if not hasattr(table_lines, '__iter__'): + table_lines = ( table_lines, ) + for i in table_lines: + table += '<tr>' + if not hasattr(i, '__iter__'): + i = (i,) + for j in i: + table += tag + str(j) + invtag + table += '</tr>\n' + tag = '<td> ' + invtag = ' </td>' + table += '</table>' + return table