First import
git-svn-id: http://photonzero.com/dotfiles/trunk@1 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
commit
83d40113d2
60 changed files with 4264 additions and 0 deletions
67
.bash_aliases
Normal file
67
.bash_aliases
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#alias ls='ls -F --color'
|
||||
#[ -x /usr/games/fortune ] && /usr/games/fortune bofh-excuses
|
||||
#alias la='ls -Fal --color'
|
||||
#alias uptime="uptime | cowsay"
|
||||
#alias date="date | cowsay"
|
||||
|
||||
|
||||
#Imperatives
|
||||
# enable color support of ls and also add handy aliases
|
||||
#alias dir='ls --color=auto --format=vertical'
|
||||
#alias vdir='ls --color=auto --format=long'
|
||||
|
||||
case `uname` in
|
||||
Linux)
|
||||
if [ "$TERM" != "dumb" ]; then
|
||||
eval "`dircolors -b`"
|
||||
fi
|
||||
alias ls='ls -F --color=auto'
|
||||
;;
|
||||
Darwin)
|
||||
alias ls='ls -FG'
|
||||
;;
|
||||
FreeBSD)
|
||||
alias ls='ls -FG'
|
||||
;;
|
||||
*)
|
||||
if [ "$TERM" != "dumb" ]; then
|
||||
eval "`dircolors -b`"
|
||||
fi
|
||||
alias ls='ls --color=auto'
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
# some more ls aliases
|
||||
alias ll='ls -lF'
|
||||
#alias la='ls -A'
|
||||
alias la='ls -alF'
|
||||
#alias l='ls -CF'
|
||||
|
||||
alias vi='vim'
|
||||
alias grep="grep --color=auto"
|
||||
alias screen="screen -R"
|
||||
|
||||
#Cosmetic/useful
|
||||
alias naim="naim --noscreen"
|
||||
alias wallall="wallall -p"
|
||||
alias cal="cal -3"
|
||||
alias google='surfraw google'
|
||||
alias hd='od -Ax -tx1z -v'
|
||||
|
||||
#Sysdadmin
|
||||
alias aptsearch="aptitude search"
|
||||
alias openports="lsof -i 4 -n"
|
||||
alias saupdate="sa-learn --mbox --spam ~/mail/spam"
|
||||
alias pshosers="ps axeo pcpu,pid,user,command | sort -k 1 -r | head -11 "
|
||||
alias memhosers="ps axeo size,pcpu,pid,user,command | sort -n -r | head -11 "
|
||||
|
||||
#Some orly aliases
|
||||
alias yarly="orly -y"
|
||||
alias nowai="orly -n"
|
||||
alias srsly="orly -s"
|
||||
|
||||
#Funnies
|
||||
alias whothefuckis='finger'
|
||||
alias whoami="echo 24601"
|
||||
7
.bash_logout
Normal file
7
.bash_logout
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# ~/.bash_logout: executed by bash(1) when login shell exits.
|
||||
|
||||
# when leaving the console clear the screen to increase privacy
|
||||
|
||||
if [ "$SHLVL" = 1 ]; then
|
||||
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
|
||||
fi
|
||||
27
.bash_profile
Normal file
27
.bash_profile
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# $FreeBSD: src/share/skel/dot.profile,v 1.19.2.2 2002/07/13 16:29:10 mp Exp $
|
||||
#
|
||||
# .profile - Bourne Shell startup script for login shells
|
||||
#
|
||||
# see also sh(1), environ(7).
|
||||
#
|
||||
|
||||
# remove /usr/games and /usr/X11R6/bin if you want
|
||||
PATH=$HOME/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin; export PATH
|
||||
|
||||
# Setting TERM is normally done through /etc/ttys. Do only override
|
||||
# if you're sure that you'll never log in via telnet or xterm or a
|
||||
# serial line.
|
||||
# Use cons25l1 for iso-* fonts
|
||||
# TERM=cons25; export TERM
|
||||
|
||||
BLOCKSIZE=K; export BLOCKSIZE
|
||||
EDITOR=vim; export EDITOR
|
||||
PAGER=less; export PAGER
|
||||
|
||||
# set ENV to a file invoked each time sh is started for interactive use.
|
||||
ENV=$HOME/.bashrc; export ENV
|
||||
XMMS_PATH="tcp://10.42.0.2:6600"
|
||||
|
||||
#alias ls='ls -FG'
|
||||
#alias la='ls -FGal'
|
||||
source ~/.bashrc
|
||||
86
.bashrc
Normal file
86
.bashrc
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||
# for examples
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[ -z "$PS1" ] && return
|
||||
|
||||
# don't put duplicate lines in the history. See bash(1) for more options
|
||||
export HISTCONTROL=ignoredups
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
|
||||
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
#case "$TERM" in
|
||||
#xterm-color)
|
||||
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
# ;;
|
||||
#*)
|
||||
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
# ;;
|
||||
#esac
|
||||
|
||||
case $TERM in
|
||||
xterm*|rxvt*)
|
||||
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
|
||||
;;
|
||||
*)
|
||||
TITLEBAR="\033k\033\134";
|
||||
esac;
|
||||
PS1="${TITLEBAR}\[\033[0m\]\[\033[0;32m\]\u\[\033[0m\]\[\033[0;37m\]@\[\033[0m\]\[\033[0;32m\]\h\[\033[0m\]\[\033[0;37m\]:\[\033[0;34m\][\[\033[1;36m\]\w\[\033[0;34m\]]\[\033[0;0m\]\$ "
|
||||
#PS1="${TITLEBAR}\[\033[0m\]\[\033[0;34m\][\[\033[0m\]\[\033[1;33m\]\$(date +%H:%M)|\!\[\033[0m\]\[\033[0;34m\]] \[\033[0m\]\[\033[0;32m\]\u\[\033[0m\]\[\033[0;37m\]@\[\033[0m\]\[\033[0;32m\]\h\[\033[0m\]\[\033[0;37m\]:\[\033[0m\]\[\033[1;36m\]\w\[\033[0m\]\[\033[0;0m\]\$ "
|
||||
#PS1="${TITLEBAR}\[\033[0m\]\[\033[1;34m\][\[\033[0m\]\[\033[1;33m\]\$(date +%H:%M)\[\033[0m\]\[\033[1;34m\]] \u\[\033[0m\]\[\033[0;37m\]@\[\033[0m\]\[\033[1;34m\]\h\[\033[0m\]\[\033[0;37m\]:\[\033[0m\]\[\033[1;36m\]\w\[\033[0m\]\[\033[0;0m\]\$ "
|
||||
#PS1="${TITLEBAR}\[\033[0m\]\[\033[0;32m\][\$(date +%H:%M)] \[\033[0;33m\]\u\[\033[0m\]@\[\033[0;31m\]\h\[\033[1;37m\]:\[\033[0m\]\[\033[1;34m\]\w\[\033[1;37m\]\$ \[\033[0;0m\]"
|
||||
# Comment in the above and uncomment this below for a color prompt
|
||||
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
#
|
||||
#\[\033]0;\u@\h:\w\007\]\[\033[0m\]\[\033[0;32m\][$(date +%H:%M)] \[\033[1;33m\]\u\[\033[0m\]@\[\033[1;31m\]\h\[\033[1;37m\]:\[\033[0m\]\[\033[1;34m\]\w\[\033[1;37m\]$ \[\033[0;0m\]
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Alias definitions.
|
||||
# You may want to put all your additions into a separate file like
|
||||
# ~/.bash_aliases, instead of adding them here directly.
|
||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
#if [ "$TERM" != "dumb" ]; then
|
||||
# eval "`dircolors -b`"
|
||||
# alias ls='ls --color=auto'
|
||||
#alias dir='ls --color=auto --format=vertical'
|
||||
#alias vdir='ls --color=auto --format=long'
|
||||
#fi
|
||||
|
||||
# some more ls aliases
|
||||
#alias ll='ls -l'
|
||||
#alias la='ls -A'
|
||||
#alias la='ls -al'
|
||||
#alias l='ls -CF'
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
9
.muttrc
Normal file
9
.muttrc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
set alias_file=~/.mutt_alias
|
||||
set folder=~/mail/
|
||||
set move=no
|
||||
set mark_old=no
|
||||
set pager_stop=yes
|
||||
set postponed=+postponed
|
||||
set signature=~/.sig
|
||||
#set sort=date-received
|
||||
set spoolfile=+misc
|
||||
130
.procmailrc
Normal file
130
.procmailrc
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
USER = michener
|
||||
DEBUG = yes
|
||||
VERBOSE = yes
|
||||
#LOGABSTRACT = yes
|
||||
#LOGFILE = /home/digital/michener/.procmaillog
|
||||
MAIL = /home/michener/mail
|
||||
MAILDIR = $MAIL
|
||||
|
||||
### cron mail
|
||||
:0
|
||||
* ^Subject: [a-z.]+ ((daily|weekly|monthly|security) (run|check) output|Postgres Vacuumdb Analyze|Postgres Backup)$
|
||||
{
|
||||
:0
|
||||
* ^From: [a-z0-9 ]+ \<(root|pgsql)(@([-a-z0-9.]+\.)?csua\.berkeley\.edu)?\>$
|
||||
/dev/null
|
||||
|
||||
:0
|
||||
* ^From: (root|pgsql)(@([-a-z0-9.]+\.)?csua\.berkeley\.edu)? \([^)]*\)$
|
||||
/dev/null
|
||||
|
||||
:0
|
||||
* ^From: [a-z0-9 ]+ \<(root|pgsql)(@([-a-z0-9.]+\.)?CSUA\.Berkeley\.EDU)?\>$
|
||||
/dev/null
|
||||
}
|
||||
|
||||
:0
|
||||
* ^From.*mailer-daemon
|
||||
* ^Subject.*(notify|returned)
|
||||
/dev/null
|
||||
|
||||
:0
|
||||
* ^Subject:.*(Returned|failure|failed|Surveys|daily)
|
||||
* ^To.*(postmaster|webmaster|hostmaster|survey-owner|mailer-daemon|owner-csua|www)
|
||||
/dev/null
|
||||
|
||||
:0
|
||||
* ^From.*cron
|
||||
/dev/null
|
||||
## keg & scotch daily output
|
||||
:0
|
||||
* ^Subject:.*(keg|scotch)
|
||||
* ^To.*(root@keg|root@scotch)
|
||||
#$MAIL/runs
|
||||
/dev/null
|
||||
|
||||
### more cron mail
|
||||
:0
|
||||
* ^From: root \<root\>$
|
||||
/dev/null
|
||||
|
||||
:0 # postmaster mail, separate for easy deletion
|
||||
* ^TO_(postmaster|daemon|csua-approval)(@[-a-z0-9.]+\.berkeley\.edu)?([,> ]|$)
|
||||
/dev/null
|
||||
|
||||
|
||||
#spam :(
|
||||
#:0 HB
|
||||
#* <256000
|
||||
#* !? /usr/local/bin/spamc -c
|
||||
#$MAIL/spam
|
||||
#/dev/null
|
||||
|
||||
:0
|
||||
* ^Subject:.*[fF][cC][yY][iI].*
|
||||
/dev/null
|
||||
|
||||
:0
|
||||
* ^From:.*Mirza Party.*
|
||||
/dev/null
|
||||
|
||||
:0
|
||||
* ^From:.*solylunasf@yahoo.com.*
|
||||
/dev/null
|
||||
|
||||
|
||||
# root mail
|
||||
:0:
|
||||
* ^TO_root@
|
||||
$MAIL/root
|
||||
|
||||
#:0:
|
||||
#* ^TO_politburo@
|
||||
#* ^TO_officers@
|
||||
#$MAIL/politburo
|
||||
|
||||
## windows-1251
|
||||
#:0
|
||||
#* ^Subject:.*windows-1251
|
||||
#$MAIL/spam
|
||||
|
||||
#run spamass
|
||||
#:0 fw
|
||||
#| spamassassin
|
||||
|
||||
:0
|
||||
* ^Subject:.*SPAM.XXX.*
|
||||
/dev/null
|
||||
|
||||
# de-HTML
|
||||
:0 fbw
|
||||
* ^Content-Type:[ ]*text/html
|
||||
| lynx -dump -stdin \
|
||||
&& echo "" \
|
||||
&& echo "=================================================" \
|
||||
&& echo "This HTML message has been made into text by lynx" \
|
||||
&& echo "================================================="
|
||||
|
||||
|
||||
#:0 c
|
||||
#| grep "^Subject" | cut -d ":" -f 2- | nc 10.42.0.7 10101 -q 1
|
||||
|
||||
:0
|
||||
* ^To.*barak@michener.com
|
||||
$MAIL/michener.com
|
||||
|
||||
:0
|
||||
* ^To.*bmichener@berkeley.edu
|
||||
$MAIL/bmichener.berkeley
|
||||
|
||||
:0
|
||||
* ^To.*ringhunters@yahoogroups.com
|
||||
$MAIL/ringhunters
|
||||
|
||||
:0
|
||||
$MAIL/misc
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
140
.screenrc
Normal file
140
.screenrc
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
# $Id: screenrc,v 1.3 1998-06-15 20:06:42-07 mconst Exp mconst $
|
||||
|
||||
# make bells in other windows audible
|
||||
bell "Bell in window %^G"
|
||||
|
||||
# get rid of some useless stuff in /usr/local/etc/screenrc
|
||||
bind P
|
||||
bind R
|
||||
|
||||
# add an easy key to renumber the current window
|
||||
bind \# colon "number "
|
||||
|
||||
# unbind the keys for "kill all windows"
|
||||
bind \\ echo "You cannot hope to slay so many windows at once!"
|
||||
register \\ ^A\
|
||||
bind ^\ process \\
|
||||
|
||||
# make h consistent with ^H as "move to previous window"; use C for hardcopy
|
||||
bind h prev
|
||||
bind C hardcopy
|
||||
|
||||
# make ^N and ^P next and prev for laziness
|
||||
bind ^N next
|
||||
bind ^P prev
|
||||
|
||||
# make "kill this window" a bit harder to hit
|
||||
bind k echo "Your weak spell bounces harmlessly off the window."
|
||||
bind K kill
|
||||
|
||||
# unbind "toggle wrap mode" and flow control, which I tend to hit by mistake
|
||||
bind r echo "Despite your effort, the wrap mode remains unchanged."
|
||||
bind f echo "Despite your effort, the flow control remains unchanged."
|
||||
register r ^Ar
|
||||
register f ^Af
|
||||
bind ^R process r
|
||||
bind ^F process f
|
||||
|
||||
# make split more convenient: it now brings up the previous window
|
||||
# instead of a blank one, and it leaves the cursor in the new region
|
||||
register S "^O:split^M^O^I^O^O"
|
||||
bind S process S
|
||||
|
||||
# bind generic function keys to switch windows
|
||||
bindkey -k k0 select 9
|
||||
bindkey -k k1 select 0
|
||||
bindkey -k k2 select 1
|
||||
bindkey -k k3 select 2
|
||||
bindkey -k k4 select 3
|
||||
bindkey -k k5 select 4
|
||||
bindkey -k k6 select 5
|
||||
bindkey -k k7 select 6
|
||||
bindkey -k k8 select 7
|
||||
bindkey -k k9 select 8
|
||||
#bindkey -k k; select 0
|
||||
|
||||
bindkey "\033[[A" select 1
|
||||
bindkey "\033[[B" select 2
|
||||
bindkey "\033[[C" select 3
|
||||
bindkey "\033[[D" select 4
|
||||
bindkey "\033[[E" select 5
|
||||
|
||||
bindkey "\033[11~" select 1
|
||||
bindkey "\033[12~" select 2
|
||||
bindkey "\033[13~" select 3
|
||||
bindkey "\033[14~" select 4
|
||||
bindkey "\033[15~" select 5
|
||||
bindkey "\033[17~" select 6
|
||||
bindkey "\033[18~" select 7
|
||||
bindkey "\033[19~" select 8
|
||||
bindkey "\033[20~" select 9
|
||||
bindkey "\033[21~" select 0
|
||||
|
||||
bindkey "\033[11~" select 1
|
||||
bindkey "\033[12~" select 2
|
||||
bindkey "\033[13~" select 3
|
||||
bindkey "\033[14~" select 4
|
||||
bindkey "\033[15~" select 5
|
||||
|
||||
# make keypad_delete send ascii 127. this is wrong: really I ought
|
||||
# to fix all the termcaps that have kD=\177 instead of kD=\E[3~, but
|
||||
# this works and I don't care that much.
|
||||
bindkey -k kD stuff \177
|
||||
|
||||
# by default, always let me know when background windows produce text
|
||||
defmonitor on
|
||||
|
||||
# don't lock up when one display dies
|
||||
defnonblock on
|
||||
|
||||
# keep 5000 lines of history in all windows
|
||||
defscrollback 5000
|
||||
|
||||
# make ^O the escape character, and make ^Oo a literal ^O
|
||||
#escape ^Oo
|
||||
|
||||
# use the xterm's title bar to display window titles, but display ordinary
|
||||
# screen messages on the bottom line, as usual
|
||||
#hardstatus off
|
||||
#hardstatus ignore
|
||||
|
||||
# make the timeout for multicharacter key bindings nice and short
|
||||
maptimeout 100
|
||||
|
||||
# let messages be displayed for a long time if they're not interrupted
|
||||
msgwait 15
|
||||
|
||||
# use interesting messages
|
||||
nethack on
|
||||
|
||||
# use nifty cool dynamic window title updating
|
||||
shelltitle "$ |bash"
|
||||
|
||||
# by default, wait an entire minute before deciding a window is silent
|
||||
silencewait 60
|
||||
|
||||
# suppress the default startup message
|
||||
startup_message off
|
||||
|
||||
# pretend to be a vt100, since no one has heard of terminal type "screen"
|
||||
#term vt220
|
||||
term xterm-color
|
||||
|
||||
# use an xterm's title bar to display the hardstatus line
|
||||
termcapinfo xterm hs:ts=\E]0;:fs=\007:ds=\E]0;\007
|
||||
|
||||
# make bells in this window audible
|
||||
vbell off
|
||||
|
||||
# make only the first window show up in the utmp, and report idle time to it
|
||||
#screen -t "] |login" 0
|
||||
#reportidle
|
||||
#deflogin off
|
||||
deflogin on
|
||||
|
||||
#Add neato titlebar and windowlist.
|
||||
hardstatus on
|
||||
hardstatus alwayslastline
|
||||
#caption always "%{= C}screen[%n] | %c | %h%="
|
||||
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %D %m/%d %C%a "
|
||||
windowlist string " screen[%n %t] %h"
|
||||
530
.vim/autoload/rubycomplete.vim
Normal file
530
.vim/autoload/rubycomplete.vim
Normal file
File diff suppressed because it is too large
Load diff
18
.vim/charm.vim
Normal file
18
.vim/charm.vim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
fu! SendToCharm(subject,mood)
|
||||
if a:subject == ""
|
||||
let subject=input("Subject: ")
|
||||
else
|
||||
let subject=a:subject
|
||||
endif
|
||||
if a:mood == ""
|
||||
let mood=input("Mood: ")
|
||||
else
|
||||
let mood=a:mood
|
||||
endif
|
||||
exe "w!"
|
||||
exe "!cat % | charm -q -s \"".subject."\" -m \"".mood."\""
|
||||
endf
|
||||
|
||||
if !exists(":PostToLJ")
|
||||
command PostToLJ :call SendToCharm("","")
|
||||
endif
|
||||
BIN
.vim/colors/.barak.vim.swp
Normal file
BIN
.vim/colors/.barak.vim.swp
Normal file
Binary file not shown.
99
.vim/colors/barak.vim
Normal file
99
.vim/colors/barak.vim
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" File: "/home/michener/.vim/barak.vim"
|
||||
" Version: 1.4
|
||||
" Created: "Sun Jul 30 23:54:41 PDT 2006"
|
||||
" Updated: "Sun Jan 7 02:12:52 PST 2007"
|
||||
" Copyright (C) 2006, Barak Michener <michener@csua.berkeley.edu>
|
||||
" Modified from colorscheme "dante":
|
||||
" Copyright (C) 2002, Caciano Machado <caciano@inf.ufrgs.br>
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Colorscheme Option:
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
hi clear
|
||||
if exists("syntax on")
|
||||
syntax reset
|
||||
endif
|
||||
let g:colors_name = "barak"
|
||||
|
||||
" General colors
|
||||
hi Normal ctermfg=gray guifg=grey75 guibg=black
|
||||
hi Directory term=bold ctermfg=blue guifg=royalblue
|
||||
hi ErrorMsg term=standout ctermfg=white ctermbg=red guifg=white guibg=red3
|
||||
"hi NonText term=bold ctermfg=darkgray guibg=gray3 guifg=gray20
|
||||
hi NonText term=bold ctermfg=gray guibg=gray3 guifg=gray40
|
||||
hi SpecialKey term=bold ctermfg=darkgray guifg=gray30
|
||||
hi LineNr term=underline ctermfg=darkgray guifg=ivory4 guibg=gray4
|
||||
hi IncSearch term=reverse cterm=reverse gui=reverse,bold guifg=darkgoldenrod2
|
||||
hi Search term=reverse ctermfg=black ctermbg=yellow guifg=gray10 guibg=gold2
|
||||
hi Visual term=bold,reverse cterm=bold,reverse ctermfg=gray ctermbg=black gui=bold,reverse guifg=gray40 guibg=black
|
||||
hi VisualNOS term=bold,underline cterm=bold,underline gui=bold,underline
|
||||
hi MoreMsg term=bold ctermfg=green gui=bold guifg=olivedrab1
|
||||
hi ModeMsg term=bold ctermfg=red cterm=bold gui=bold guifg=red
|
||||
hi Question term=standout ctermfg=green gui=bold guifg=olivedrab1
|
||||
hi WarningMsg term=standout ctermfg=red gui=bold guifg=red3
|
||||
hi WildMenu term=standout ctermfg=black ctermbg=yellow guifg=black guibg=gold2
|
||||
hi Folded term=standout ctermfg=blue ctermbg=white guifg=royalblue1 guibg=white
|
||||
hi FoldColumn term=standout ctermfg=blue ctermbg=white guifg=royalblue3 guibg=white
|
||||
hi DiffAdd term=bold ctermbg=blue guibg=royalblue2
|
||||
hi DiffChange term=bold ctermbg=darkmagenta guibg=maroon
|
||||
hi DiffDelete term=bold cterm=bold ctermfg=lightblue ctermbg=cyan gui=bold guifg=lightblue guibg=cyan4
|
||||
hi DiffText term=reverse cterm=bold ctermbg=red gui=bold guibg=red3
|
||||
hi Cursor guifg=bg guibg=fg
|
||||
hi lCursor guifg=bg guibg=fg
|
||||
hi StatusLine term=reverse cterm=reverse gui=reverse guifg=gray60
|
||||
hi StatusLineNC term=reverse cterm=reverse gui=reverse guifg=gray40
|
||||
hi VertSplit term=reverse cterm=reverse gui=bold,reverse guifg=gray40
|
||||
hi Title term=bold ctermfg=magenta gui=bold guifg=aquamarine
|
||||
|
||||
if version >= 700
|
||||
hi Pmenu ctermfg=white ctermbg=blue guifg=white guibg=MidnightBlue
|
||||
hi PmenuSel ctermfg=darkblue ctermbg=white guibg=white guifg=MidnightBlue
|
||||
hi PmenuSbar ctermfg=lightgray ctermbg=darkgray
|
||||
hi PmenuThumb cterm=reverse
|
||||
hi WildMenu term=standout ctermfg=white ctermbg=blue
|
||||
endif
|
||||
|
||||
" syntax hi colors
|
||||
hi Comment term=bold ctermfg=darkgreen guifg=ForestGreen
|
||||
hi PreProc term=underline ctermfg=darkmagenta guifg=magenta3
|
||||
hi Constant term=underline ctermfg=red guifg=firebrick3
|
||||
"hi Type term=underline ctermfg=darkcyan gui=none guifg=CadetBlue3
|
||||
hi Type term=underline ctermfg=darkcyan gui=none guifg=turquoise3
|
||||
hi Statement term=bold ctermfg=blue gui=none guifg=RoyalBlue1
|
||||
hi Identifier term=underline ctermfg=darkcyan guifg=DeepSkyBlue
|
||||
hi Function ctermfg=darkcyan guifg=MediumPurple2
|
||||
hi Ignore term=bold ctermfg=darkgray gui=bold guifg=gray45
|
||||
hi Special term=underline ctermfg=brown guifg=khaki3
|
||||
hi Error term=reverse ctermfg=gray ctermbg=red guifg=gray guibg=red3
|
||||
hi Todo term=standout ctermfg=black ctermbg=yellow gui=bold guifg=gray10 guibg=yellow4
|
||||
hi Underlined term=underline cterm=underline ctermfg=blue gui=underline guifg=slateblue
|
||||
hi Number term=underline ctermfg=darkyellow guifg=goldenrod1
|
||||
" syntax hi links
|
||||
hi link String Constant
|
||||
hi link Character Constant
|
||||
hi link Number Constant
|
||||
hi link Boolean Constant
|
||||
hi link Float Number
|
||||
"hi link Function Identifier
|
||||
hi link Number Constant
|
||||
hi link Conditional Statement
|
||||
hi link Repeat Statement
|
||||
hi link Label Statement
|
||||
hi link Keyword Statement
|
||||
hi link Exception Statement
|
||||
hi link Operator Statement
|
||||
hi link Include PreProc
|
||||
hi link Define PreProc
|
||||
hi link Macro PreProc
|
||||
hi link PreCondit PreProc
|
||||
"hi link StorageClass Type
|
||||
hi link StorageClass Statement
|
||||
"hi link Structure Type
|
||||
hi link Structure Statement
|
||||
hi link Typedef Type
|
||||
hi link Tag Special
|
||||
hi link SpecialChar Special
|
||||
hi link Delimiter Special
|
||||
hi link SpecialComment Special
|
||||
hi link Debug Special
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
83
.vim/colors/dante.vim
Normal file
83
.vim/colors/dante.vim
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" File: "/home/caciano/.vim/dante.vim"
|
||||
" Created: "Thu, 23 May 2002 00:12:20 -0300 (caciano)"
|
||||
" Updated: "Sat, 24 Aug 2002 14:04:21 -0300 (caciano)"
|
||||
" Copyright (C) 2002, Caciano Machado <caciano@inf.ufrgs.br>
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Colorscheme Option:
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
hi clear
|
||||
if exists("syntax on")
|
||||
syntax reset
|
||||
endif
|
||||
let g:colors_name = "dante"
|
||||
|
||||
" General colors
|
||||
hi Normal ctermfg=gray guifg=peachpuff3 guibg=black
|
||||
hi Directory term=bold ctermfg=blue guifg=royalblue
|
||||
hi ErrorMsg term=standout ctermfg=white ctermbg=red guifg=white guibg=red3
|
||||
hi NonText term=bold ctermfg=darkgray guibg=gray3 guifg=gray20
|
||||
hi SpecialKey term=bold ctermfg=darkgray guifg=gray30
|
||||
hi LineNr term=underline ctermfg=darkgray guifg=ivory4 guibg=gray4
|
||||
hi IncSearch term=reverse cterm=reverse gui=reverse,bold guifg=darkgoldenrod2
|
||||
hi Search term=reverse ctermfg=black ctermbg=yellow guifg=gray10 guibg=gold2
|
||||
hi Visual term=bold,reverse cterm=bold,reverse ctermfg=gray ctermbg=black gui=bold,reverse guifg=gray40 guibg=black
|
||||
hi VisualNOS term=bold,underline cterm=bold,underline gui=bold,underline
|
||||
hi MoreMsg term=bold ctermfg=green gui=bold guifg=olivedrab1
|
||||
hi ModeMsg term=bold cterm=bold gui=bold
|
||||
hi Question term=standout ctermfg=green gui=bold guifg=olivedrab1
|
||||
hi WarningMsg term=standout ctermfg=red gui=bold guifg=red3
|
||||
hi WildMenu term=standout ctermfg=black ctermbg=yellow guifg=black guibg=gold2
|
||||
hi Folded term=standout ctermfg=blue ctermbg=white guifg=royalblue1 guibg=white
|
||||
hi FoldColumn term=standout ctermfg=blue ctermbg=white guifg=royalblue3 guibg=white
|
||||
hi DiffAdd term=bold ctermbg=blue guibg=royalblue2
|
||||
hi DiffChange term=bold ctermbg=darkmagenta guibg=maroon
|
||||
hi DiffDelete term=bold cterm=bold ctermfg=lightblue ctermbg=cyan gui=bold guifg=lightblue guibg=cyan4
|
||||
hi DiffText term=reverse cterm=bold ctermbg=red gui=bold guibg=red3
|
||||
hi Cursor guifg=bg guibg=fg
|
||||
hi lCursor guifg=bg guibg=fg
|
||||
hi StatusLine term=reverse cterm=reverse gui=reverse guifg=gray60
|
||||
hi StatusLineNC term=reverse cterm=reverse gui=reverse guifg=gray40
|
||||
hi VertSplit term=reverse cterm=reverse gui=bold,reverse guifg=gray40
|
||||
hi Title term=bold ctermfg=magenta gui=bold guifg=aquamarine
|
||||
|
||||
" syntax hi colors
|
||||
hi Comment term=bold ctermfg=darkcyan guifg=cyan4
|
||||
hi PreProc term=underline ctermfg=darkblue guifg=dodgerblue4
|
||||
hi Constant term=underline ctermfg=darkred guifg=firebrick3
|
||||
hi Type term=underline ctermfg=darkgreen gui=none guifg=chartreuse3
|
||||
hi Statement term=bold ctermfg=darkyellow gui=none guifg=gold3
|
||||
hi Identifier term=underline ctermfg=darkgreen guifg=darkolivegreen4
|
||||
hi Ignore term=bold ctermfg=darkgray guifg=gray45
|
||||
hi Special term=underline ctermfg=brown guifg=sienna
|
||||
hi Error term=reverse ctermfg=gray ctermbg=red guifg=gray guibg=red3
|
||||
hi Todo term=standout ctermfg=black ctermbg=yellow gui=bold guifg=gray10 guibg=yellow4
|
||||
hi Underlined term=underline cterm=underline ctermfg=darkblue gui=underline guifg=slateblue
|
||||
hi Number term=underline ctermfg=darkred guifg=red2
|
||||
" syntax hi links
|
||||
hi link String Constant
|
||||
hi link Character Constant
|
||||
hi link Number Constant
|
||||
hi link Boolean Constant
|
||||
hi link Float Number
|
||||
hi link Function Identifier
|
||||
hi link Number Constant
|
||||
hi link Conditional Statement
|
||||
hi link Repeat Statement
|
||||
hi link Label Statement
|
||||
hi link Keyword Statement
|
||||
hi link Exception Statement
|
||||
hi link Operator Statement
|
||||
hi link Include PreProc
|
||||
hi link Define PreProc
|
||||
hi link Macro PreProc
|
||||
hi link PreCondit PreProc
|
||||
hi link StorageClass Type
|
||||
hi link Structure Type
|
||||
hi link Typedef Type
|
||||
hi link Tag Special
|
||||
hi link SpecialChar Special
|
||||
hi link Delimiter Special
|
||||
hi link SpecialComment Special
|
||||
hi link Debug Special
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
469
.vim/colors/ps_color.vim
Normal file
469
.vim/colors/ps_color.vim
Normal file
|
|
@ -0,0 +1,469 @@
|
|||
" Vim colour file --- PSC
|
||||
" Maintainer: Pan, Shi Zhu <Go to the following URL for my email>
|
||||
" URL: http://vim.sourceforge.net/scripts/script.php?script_id=760
|
||||
" Last Change: 18 July 2006
|
||||
" Version: 2.9
|
||||
"
|
||||
" Please prepend [VIM] in the title when writing e-mail to me, or it will
|
||||
" be automatically treated as spam and removed.
|
||||
"
|
||||
" See the help document for all details, the help document will be
|
||||
" installed after the script has been sourced once, do not open the
|
||||
" script when you source it for the first time.
|
||||
"
|
||||
|
||||
" Initializations: {{{1
|
||||
"
|
||||
|
||||
" without user_commands, all these are not possible
|
||||
if !has("user_commands")
|
||||
finish
|
||||
end
|
||||
|
||||
function! s:init_option(var, value)
|
||||
if !exists("g:psc_".a:var)
|
||||
execute "let s:".a:var." = ".a:value
|
||||
else
|
||||
let s:{a:var} = g:psc_{a:var}
|
||||
endif
|
||||
endfunction
|
||||
command! -nargs=+ InitOpt call s:init_option(<f-args>)
|
||||
|
||||
function! s:multi_hi(setting, ...)
|
||||
let l:idx = a:0
|
||||
while l:idx > 0
|
||||
let l:hlgroup = a:{l:idx}
|
||||
execute "highlight ".l:hlgroup." ".a:setting
|
||||
let l:idx = l:idx - 1
|
||||
endwhile
|
||||
endfunction
|
||||
command! -nargs=+ MultiHi call s:multi_hi(<f-args>)
|
||||
|
||||
InitOpt style 'cool'
|
||||
InitOpt inversed_todo 0
|
||||
InitOpt use_default_for_cterm 0
|
||||
InitOpt statement_different_from_type 0
|
||||
if s:style == 'warm'
|
||||
InitOpt fontface 'mixed'
|
||||
else
|
||||
InitOpt fontface 'plain'
|
||||
endif
|
||||
|
||||
if !has("gui_running")
|
||||
call s:init_option("cterm_style", "'".s:style."'")
|
||||
|
||||
" Forces 'cool' style when gui is not present Since the 'warm' style for
|
||||
" terminal isn't available now, and probably never will be.
|
||||
if s:cterm_style=='warm' | let s:cterm_style = 'cool'
|
||||
endif
|
||||
if s:use_default_for_cterm==1 | let s:cterm_style = 'default'
|
||||
elseif s:use_default_for_cterm==2 | let s:cterm_style = 'defdark'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
InitOpt other_style 0
|
||||
|
||||
if has("gui_running")
|
||||
if s:style=='warm' || s:style=='default'
|
||||
set background=light
|
||||
elseif s:style=='cool' || s:style=='defdark'
|
||||
set background=dark
|
||||
else | let s:other_style = 1
|
||||
endif
|
||||
else
|
||||
if s:cterm_style=='cool' || s:cterm_style=='defdark'
|
||||
set background=dark
|
||||
elseif s:cterm_style=='default'
|
||||
set background=light
|
||||
else | let s:other_style = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
highlight clear
|
||||
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
let s:color_name = expand("<sfile>:t:r")
|
||||
|
||||
if s:other_style==0 | let g:colors_name = s:color_name
|
||||
" Go from console version to gui, the color scheme should be sourced again
|
||||
execute "autocmd TermChanged * if g:colors_name == '".s:color_name."' | "
|
||||
\."colo ".s:color_name." | endif"
|
||||
else
|
||||
execute "runtime colors/".s:style.".vim"
|
||||
endif
|
||||
|
||||
" Command to go different schemes easier.
|
||||
execute "command! -nargs=1 Colo if '".s:color_name."'!=\"<args>\" | "
|
||||
\'let g:psc_style = "<args>"| endif | colo '.s:color_name
|
||||
|
||||
" Give control to 'reloaded' scheme if possible
|
||||
if s:style == 'reloaded'
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
|
||||
" Relevant Help:
|
||||
" :h highlight-groups
|
||||
" :h psc-cterm-color-table
|
||||
" :ru syntax/hitest.vim
|
||||
"
|
||||
" Hardcoded Colors Comment:
|
||||
" #aabbcc = Red aa, Green bb, Blue cc
|
||||
" we must use hard-coded colours to get more 'tender' colours
|
||||
"
|
||||
|
||||
|
||||
" GUI:
|
||||
"
|
||||
" I don't want to abuse folding, but here folding is used to avoid confusion.
|
||||
if s:style=='warm'
|
||||
" Warm style for gui here {{{2
|
||||
" LIGHT COLOR DEFINE START
|
||||
|
||||
highlight Normal guifg=#000000 guibg=#e0e0e0
|
||||
highlight Search guifg=#902000 guibg=#f8f8f8
|
||||
highlight Visual guifg=fg guibg=#a6caf0
|
||||
highlight Cursor guifg=#f0f0f0 guibg=#008000
|
||||
" The idea of CursorIM is pretty good, however, the feature is still buggy
|
||||
" in the current version (Vim 7.0).
|
||||
" The following line will be kept commented until the bug fixed.
|
||||
"
|
||||
" highlight CursorIM guifg=#f0f0f0 guibg=#800080
|
||||
highlight Special guifg=#907000 guibg=bg
|
||||
highlight Comment guifg=#606000 guibg=bg
|
||||
highlight Number guifg=#907000 guibg=bg
|
||||
highlight Constant guifg=#007068 guibg=bg
|
||||
highlight StatusLine guifg=fg guibg=#a6caf0
|
||||
highlight LineNr guifg=#686868 guibg=bg
|
||||
highlight Question guifg=fg guibg=#d0d090
|
||||
highlight PreProc guifg=#009030 guibg=bg
|
||||
if s:statement_different_from_type==1
|
||||
highlight Statement guifg=#4020a0 guibg=bg
|
||||
else
|
||||
highlight Statement guifg=#2060a8 guibg=bg
|
||||
endif
|
||||
highlight Type guifg=#0850a0 guibg=bg
|
||||
if s:inversed_todo==1
|
||||
highlight Todo guifg=#e0e090 guibg=#000080
|
||||
else
|
||||
highlight Todo guifg=#800000 guibg=#e0e090
|
||||
endif
|
||||
" NOTE THIS IS IN THE WARM SECTION
|
||||
highlight Error guifg=#c03000 guibg=bg
|
||||
highlight Identifier guifg=#a030a0 guibg=bg
|
||||
highlight ModeMsg guifg=fg guibg=#b0b0e0
|
||||
highlight VisualNOS guifg=fg guibg=#b0b0e0
|
||||
highlight SpecialKey guifg=#1050a0 guibg=bg
|
||||
highlight NonText guifg=#002090 guibg=#d0d0d0
|
||||
highlight Directory guifg=#a030a0 guibg=bg
|
||||
highlight ErrorMsg guifg=fg guibg=#f0b090
|
||||
highlight MoreMsg guifg=#489000 guibg=bg
|
||||
highlight Title guifg=#a030a0 guibg=bg
|
||||
highlight WarningMsg guifg=#b02000 guibg=bg
|
||||
highlight WildMenu guifg=fg guibg=#d0d090
|
||||
highlight Folded guifg=fg guibg=#b0e0b0
|
||||
highlight FoldColumn guifg=fg guibg=#90e090
|
||||
highlight DiffAdd guifg=fg guibg=#b0b0e0
|
||||
highlight DiffChange guifg=fg guibg=#e0b0e0
|
||||
highlight DiffDelete guifg=#002090 guibg=#d0d0d0
|
||||
highlight DiffText guifg=fg guibg=#c0e080
|
||||
highlight SignColumn guifg=fg guibg=#90e090
|
||||
highlight IncSearch guifg=#f0f0f0 guibg=#806060
|
||||
highlight StatusLineNC guifg=fg guibg=#c0c0c0
|
||||
highlight VertSplit guifg=fg guibg=#c0c0c0
|
||||
highlight Underlined guifg=#6a5acd guibg=bg gui=underline
|
||||
highlight Ignore guifg=bg guibg=bg
|
||||
" NOTE THIS IS IN THE WARM SECTION
|
||||
if v:version >= 700
|
||||
highlight SpellBad guifg=NONE guibg=NONE guisp=#c03000
|
||||
highlight SpellCap guifg=NONE guibg=NONE guisp=#2060a8
|
||||
highlight SpellRare guifg=NONE guibg=NONE guisp=#a030a0
|
||||
highlight SpellLocal guifg=NONE guibg=NONE guisp=#007068
|
||||
highlight Pmenu guifg=fg guibg=#e0b0e0
|
||||
highlight PmenuSel guifg=#f0f0f0 guibg=#806060
|
||||
highlight PmenuSbar guifg=fg guibg=#c0c0c0
|
||||
highlight PmenuThumb guifg=fg guibg=#c0e080
|
||||
highlight TabLine guifg=fg guibg=#c0c0c0 gui=underline
|
||||
highlight TabLineFill guifg=fg guibg=#c0c0c0 gui=underline
|
||||
highlight TabLineSel guifg=fg guibg=bg
|
||||
highlight CursorColumn guifg=NONE guibg=#f0b090
|
||||
highlight CursorLine guifg=NONE guibg=NONE gui=underline
|
||||
highlight MatchParen guifg=NONE guibg=#c0e080
|
||||
endif
|
||||
|
||||
" LIGHT COLOR DEFINE END
|
||||
" }}}2
|
||||
elseif s:style=='cool'
|
||||
" Cool style for gui here {{{2
|
||||
" DARK COLOR DEFINE START
|
||||
|
||||
highlight Normal guifg=#d0d0d0 guibg=#202020
|
||||
highlight Comment guifg=#d0d090 guibg=bg
|
||||
highlight Constant guifg=#80c0e0 guibg=bg
|
||||
highlight Number guifg=#e0c060 guibg=bg
|
||||
highlight Identifier guifg=#f0c0f0 guibg=bg
|
||||
if s:statement_different_from_type==1
|
||||
highlight Statement guifg=#98a8f0 guibg=bg
|
||||
else
|
||||
highlight Statement guifg=#c0d8f8 guibg=bg
|
||||
endif
|
||||
highlight PreProc guifg=#60f080 guibg=bg
|
||||
highlight Type guifg=#b0d0f0 guibg=bg
|
||||
highlight Special guifg=#e0c060 guibg=bg
|
||||
highlight Error guifg=#f08060 guibg=bg
|
||||
if s:inversed_todo==1
|
||||
highlight Todo guifg=#d0d090 guibg=#000080
|
||||
else
|
||||
highlight Todo guifg=#800000 guibg=#d0d090
|
||||
endif
|
||||
highlight Search guifg=#e0e0e0 guibg=#800000
|
||||
highlight Visual guifg=#000000 guibg=#a6caf0
|
||||
highlight Cursor guifg=#000000 guibg=#00f000
|
||||
" NOTE THIS IS IN THE COOL SECTION
|
||||
" highlight CursorIM guifg=#000000 guibg=#f000f0
|
||||
highlight StatusLine guifg=#000000 guibg=#a6caf0
|
||||
highlight LineNr guifg=#b0b0b0 guibg=bg
|
||||
highlight Question guifg=#000000 guibg=#d0d090
|
||||
highlight ModeMsg guifg=fg guibg=#000080
|
||||
highlight VisualNOS guifg=fg guibg=#000080
|
||||
highlight SpecialKey guifg=#b0d0f0 guibg=bg
|
||||
highlight NonText guifg=#6080f0 guibg=#101010
|
||||
highlight Directory guifg=#80c0e0 guibg=bg
|
||||
highlight ErrorMsg guifg=#d0d090 guibg=#800000
|
||||
highlight MoreMsg guifg=#c0e080 guibg=bg
|
||||
highlight Title guifg=#f0c0f0 guibg=bg
|
||||
highlight WarningMsg guifg=#f08060 guibg=bg
|
||||
highlight WildMenu guifg=#000000 guibg=#d0d090
|
||||
highlight Folded guifg=#d0d0d0 guibg=#004000
|
||||
highlight FoldColumn guifg=#e0e0e0 guibg=#008000
|
||||
highlight DiffAdd guifg=fg guibg=#000080
|
||||
highlight DiffChange guifg=fg guibg=#800080
|
||||
highlight DiffDelete guifg=#6080f0 guibg=#202020
|
||||
highlight DiffText guifg=#000000 guibg=#c0e080
|
||||
highlight SignColumn guifg=#e0e0e0 guibg=#008000
|
||||
highlight IncSearch guifg=#000000 guibg=#d0d0d0
|
||||
highlight StatusLineNC guifg=#000000 guibg=#c0c0c0
|
||||
highlight VertSplit guifg=#000000 guibg=#c0c0c0
|
||||
highlight Underlined guifg=#80a0ff guibg=bg gui=underline
|
||||
highlight Ignore guifg=#000000 guibg=bg
|
||||
" NOTE THIS IS IN THE COOL SECTION
|
||||
if v:version >= 700
|
||||
highlight SpellBad guifg=NONE guibg=NONE guisp=#f08060
|
||||
highlight SpellCap guifg=NONE guibg=NONE guisp=#6080f0
|
||||
highlight SpellRare guifg=NONE guibg=NONE guisp=#f0c0f0
|
||||
highlight SpellLocal guifg=NONE guibg=NONE guisp=#c0d8f8
|
||||
highlight Pmenu guifg=fg guibg=#800080
|
||||
highlight PmenuSel guifg=#000000 guibg=#d0d0d0
|
||||
highlight PmenuSbar guifg=fg guibg=#000080
|
||||
highlight PmenuThumb guifg=fg guibg=#008000
|
||||
highlight TabLine guifg=fg guibg=#008000 gui=underline
|
||||
highlight TabLineFill guifg=fg guibg=#008000 gui=underline
|
||||
highlight TabLineSel guifg=fg guibg=bg
|
||||
highlight CursorColumn guifg=NONE guibg=#800000
|
||||
highlight CursorLine guifg=NONE guibg=NONE gui=underline
|
||||
highlight MatchParen guifg=NONE guibg=#800080
|
||||
endif
|
||||
|
||||
" DARK COLOR DEFINE END
|
||||
" }}}2
|
||||
elseif s:style=='defdark'
|
||||
highlight Normal guifg=#f0f0f0 guibg=#000000
|
||||
endif
|
||||
|
||||
" Take NT gui for example, If you want to use a console font such as
|
||||
" Lucida_Console with font size larger than 14, the font looks already thick,
|
||||
" and the bold font for that will be too thick, you may not want it be bolded.
|
||||
" The following code does this.
|
||||
"
|
||||
" All of the bold font may be disabled, since continuously switching between
|
||||
" bold and plain font hurts consistency and will inevitably fatigue your eye!
|
||||
|
||||
" Maximum 20 parameters for vim script function
|
||||
"
|
||||
MultiHi gui=NONE ModeMsg Search Cursor Special Comment Constant Number LineNr Question PreProc Statement Type Todo Error Identifier Normal
|
||||
|
||||
MultiHi gui=NONE VisualNOS SpecialKey NonText Directory ErrorMsg MoreMsg Title WarningMsg WildMenu Folded FoldColumn DiffAdd DiffChange DiffDelete DiffText SignColumn
|
||||
|
||||
" Vim 7 added stuffs
|
||||
if v:version >= 700
|
||||
MultiHi gui=NONE Ignore PmenuSel PmenuSel PmenuSbar PmenuThumb TabLine TabLineFill TabLineSel
|
||||
|
||||
" the gui=undercurl guisp could only support in Vim 7
|
||||
MultiHi gui=undercurl SpellBad SpellCap SpellRare SpellLocal
|
||||
if s:style=="cool" || s:style=="warm"
|
||||
MultiHi gui=underline TabLine TabLineFill Underlined CursorLine
|
||||
else
|
||||
MultiHi gui=underline TabLine Underlined
|
||||
endif
|
||||
endif
|
||||
|
||||
" For reversed stuffs
|
||||
MultiHi gui=NONE IncSearch StatusLine StatusLineNC VertSplit Visual
|
||||
|
||||
if s:style=="cool" || s:style=="warm"
|
||||
if s:fontface=="mixed"
|
||||
MultiHi gui=bold IncSearch StatusLine StatusLineNC VertSplit Visual
|
||||
endif
|
||||
else
|
||||
if s:fontface=="mixed"
|
||||
hi StatusLine gui=bold,reverse
|
||||
else
|
||||
hi StatusLine gui=reverse
|
||||
endif
|
||||
MultiHi gui=reverse IncSearch StatusLineNC VertSplit Visual
|
||||
endif
|
||||
|
||||
" Enable the bold style
|
||||
if s:fontface=="mixed"
|
||||
MultiHi gui=bold Question DiffText Statement Type MoreMsg ModeMsg NonText Title VisualNOS DiffDelete TabLineSel
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
" Color Term:
|
||||
|
||||
" It's not quite possible to support 'cool' and 'warm' simultaneously, since
|
||||
" we cannot expect a terminal to have more than 16 color names.
|
||||
"
|
||||
|
||||
" I assume Vim will never go to cterm mode when has("gui_running") returns 1,
|
||||
" Please enlighten me if I am wrong.
|
||||
"
|
||||
if !has('gui_running')
|
||||
" cterm settings {{{1
|
||||
if s:cterm_style=='cool'
|
||||
|
||||
highlight Normal ctermfg=LightGrey ctermbg=Black
|
||||
highlight Search ctermfg=White ctermbg=DarkRed
|
||||
highlight Visual ctermfg=Black ctermbg=DarkCyan
|
||||
highlight Cursor ctermfg=Black ctermbg=Green
|
||||
highlight Special ctermfg=Yellow ctermbg=Black
|
||||
highlight Comment ctermfg=DarkYellow ctermbg=Black
|
||||
highlight Constant ctermfg=Blue ctermbg=Black
|
||||
highlight Number ctermfg=Yellow ctermbg=Black
|
||||
highlight StatusLine ctermfg=Black ctermbg=DarkCyan
|
||||
highlight LineNr ctermfg=DarkGrey ctermbg=Black
|
||||
highlight Question ctermfg=Black ctermbg=DarkYellow
|
||||
highlight PreProc ctermfg=Green ctermbg=Black
|
||||
highlight Statement ctermfg=Cyan ctermbg=Black
|
||||
highlight Type ctermfg=Cyan ctermbg=Black
|
||||
if s:inversed_todo==0
|
||||
highlight Todo ctermfg=DarkRed ctermbg=DarkYellow
|
||||
else
|
||||
highlight Todo ctermfg=DarkYellow ctermbg=DarkBlue
|
||||
endif
|
||||
highlight Error ctermfg=Red ctermbg=Black
|
||||
highlight Identifier ctermfg=Magenta ctermbg=Black
|
||||
highlight Folded ctermfg=White ctermbg=DarkGreen
|
||||
highlight ModeMsg ctermfg=Grey ctermbg=DarkBlue
|
||||
highlight VisualNOS ctermfg=Grey ctermbg=DarkBlue
|
||||
highlight SpecialKey ctermfg=Cyan ctermbg=Black
|
||||
highlight NonText ctermfg=Blue ctermbg=Black
|
||||
highlight Directory ctermfg=Blue ctermbg=Black
|
||||
highlight ErrorMsg ctermfg=DarkYellow ctermbg=DarkRed
|
||||
highlight MoreMsg ctermfg=Green ctermbg=Black
|
||||
highlight Title ctermfg=Magenta ctermbg=Black
|
||||
highlight WarningMsg ctermfg=Red ctermbg=Black
|
||||
highlight WildMenu ctermfg=Black ctermbg=DarkYellow
|
||||
highlight FoldColumn ctermfg=White ctermbg=DarkGreen
|
||||
highlight SignColumn ctermfg=White ctermbg=DarkGreen
|
||||
highlight DiffText ctermfg=Black ctermbg=DarkYellow
|
||||
highlight DiffDelete ctermfg=Blue ctermbg=Black
|
||||
|
||||
if v:version >= 700
|
||||
highlight SpellBad ctermfg=NONE ctermbg=DarkRed
|
||||
highlight SpellCap ctermfg=NONE ctermbg=DarkBlue
|
||||
highlight SpellRare ctermfg=NONE ctermbg=DarkMagenta
|
||||
highlight SpellLocal ctermfg=NONE ctermbg=DarkGreen
|
||||
highlight Pmenu ctermfg=fg ctermbg=DarkMagenta
|
||||
highlight PmenuSel ctermfg=bg ctermbg=fg
|
||||
highlight PmenuSbar ctermfg=fg ctermbg=DarkBlue
|
||||
highlight PmenuThumb ctermfg=fg ctermbg=DarkGreen
|
||||
highlight TabLine ctermfg=fg ctermbg=DarkGreen cterm=underline
|
||||
highlight TabLineFill ctermfg=fg ctermbg=DarkGreen cterm=underline
|
||||
highlight TabLineSel ctermfg=fg ctermbg=bg
|
||||
highlight CursorColumn ctermfg=NONE ctermbg=DarkRed
|
||||
highlight CursorLine ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
highlight MatchParen ctermfg=NONE ctermbg=DarkMagenta
|
||||
endif
|
||||
if &t_Co==8
|
||||
" 8 colour terminal support, this assumes 16 colour is available through
|
||||
" setting the 'bold' attribute, will get bright foreground colour.
|
||||
" However, the bright background color is not available for 8-color terms.
|
||||
"
|
||||
" You can manually set t_Co=16 in your .vimrc to see if your terminal
|
||||
" supports 16 colours,
|
||||
MultiHi cterm=none DiffText Visual Cursor Comment Todo StatusLine Question DiffChange ModeMsg VisualNOS ErrorMsg WildMenu DiffAdd Folded DiffDelete Normal PmenuThumb
|
||||
MultiHi cterm=bold Search Special Constant Number LineNr PreProc Statement Type Error Identifier SpecialKey NonText MoreMsg Title WarningMsg FoldColumn SignColumn Directory DiffDelete
|
||||
|
||||
else
|
||||
" Background > 7 is only available with 16 or more colors
|
||||
|
||||
" Only use the s:fontface option when there is 16-colour(or more)
|
||||
" terminal support
|
||||
|
||||
MultiHi cterm=none WarningMsg Search Visual Cursor Special Comment Constant Number LineNr PreProc Todo Error Identifier Folded SpecialKey Directory ErrorMsg Normal PmenuThumb
|
||||
MultiHi cterm=none WildMenu FoldColumn SignColumn DiffAdd DiffChange Question StatusLine DiffText
|
||||
MultiHi cterm=reverse IncSearch StatusLineNC VertSplit
|
||||
|
||||
" Well, well, bold font with color 0-7 is not possible.
|
||||
" So, the Question, StatusLine, DiffText cannot act as expected.
|
||||
|
||||
call s:multi_hi("cterm=".((s:fontface=="plain") ? "none" : "bold"), "Statement", "Type", "MoreMsg", "ModeMsg", "NonText", "Title", "VisualNOS", "DiffDelete", "TabLineSel")
|
||||
|
||||
endif
|
||||
|
||||
elseif s:cterm_style=='defdark'
|
||||
highlight Normal ctermfg=LightGrey ctermbg=Black
|
||||
endif
|
||||
" }}}1
|
||||
endif
|
||||
|
||||
|
||||
" Term:
|
||||
" For console with only 4 colours (term, not cterm), we'll use the default.
|
||||
" ...
|
||||
" The default colorscheme is good enough for terms with no more than 4 colours
|
||||
"
|
||||
|
||||
|
||||
" Links:
|
||||
"
|
||||
if (s:style=='cool') || (s:style == 'warm')
|
||||
" COLOR LINKS DEFINE START
|
||||
|
||||
highlight link String Constant
|
||||
" Character must be different from strings because in many languages
|
||||
" (especially C, C++) a 'char' variable is scalar while 'string' is pointer,
|
||||
" mistaken a 'char' for a 'string' will cause disaster!
|
||||
highlight link Character Number
|
||||
highlight link SpecialChar LineNr
|
||||
highlight link Tag Identifier
|
||||
" The following are not standard hi links,
|
||||
" these are used by DrChip
|
||||
highlight link Warning MoreMsg
|
||||
highlight link Notice Constant
|
||||
" these are used by Calendar
|
||||
highlight link CalToday PreProc
|
||||
" these are used by TagList
|
||||
highlight link MyTagListTagName IncSearch
|
||||
highlight link MyTagListTagScope Constant
|
||||
|
||||
" COLOR LINKS DEFINE END
|
||||
endif
|
||||
|
||||
|
||||
" Clean:
|
||||
"
|
||||
delcommand InitOpt
|
||||
delcommand MultiHi
|
||||
|
||||
" vim:et:nosta:sw=2:ts=8:
|
||||
" vim600:fdm=marker:fdl=1:
|
||||
603
.vim/doc/ps_color.txt
Normal file
603
.vim/doc/ps_color.txt
Normal file
File diff suppressed because it is too large
Load diff
28
.vim/doc/tags
Normal file
28
.vim/doc/tags
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
ps_color.txt ps_color.txt /*ps_color.txt*
|
||||
ps_colour ps_color.txt /*ps_colour*
|
||||
psc ps_color.txt /*psc*
|
||||
psc-about-background ps_color.txt /*psc-about-background*
|
||||
psc-change-background ps_color.txt /*psc-change-background*
|
||||
psc-contents ps_color.txt /*psc-contents*
|
||||
psc-cterm ps_color.txt /*psc-cterm*
|
||||
psc-cterm-color-table ps_color.txt /*psc-cterm-color-table*
|
||||
psc-cterm-incompatible ps_color.txt /*psc-cterm-incompatible*
|
||||
psc-cterm-nt ps_color.txt /*psc-cterm-nt*
|
||||
psc-cterm-others ps_color.txt /*psc-cterm-others*
|
||||
psc-cterm-xterm ps_color.txt /*psc-cterm-xterm*
|
||||
psc-faq ps_color.txt /*psc-faq*
|
||||
psc-faq-ffothers ps_color.txt /*psc-faq-ffothers*
|
||||
psc-features ps_color.txt /*psc-features*
|
||||
psc-options ps_color.txt /*psc-options*
|
||||
psc-overview ps_color.txt /*psc-overview*
|
||||
psc-release-notes ps_color.txt /*psc-release-notes*
|
||||
psc-tips ps_color.txt /*psc-tips*
|
||||
psc-todo ps_color.txt /*psc-todo*
|
||||
psc-usage ps_color.txt /*psc-usage*
|
||||
psc_cterm_style ps_color.txt /*psc_cterm_style*
|
||||
psc_fontface ps_color.txt /*psc_fontface*
|
||||
psc_inversed_todo ps_color.txt /*psc_inversed_todo*
|
||||
psc_statement_different_from_type ps_color.txt /*psc_statement_different_from_type*
|
||||
psc_style ps_color.txt /*psc_style*
|
||||
psc_use_default_for_cterm ps_color.txt /*psc_use_default_for_cterm*
|
||||
pscolor ps_color.txt /*pscolor*
|
||||
211
.vim/supertab.vim
Normal file
211
.vim/supertab.vim
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
" Author: Gergely Kontra <kgergely@mcl.hu>
|
||||
" You may direct issues regarding version 0.4+ to
|
||||
" Eric Van Dewoestine (ervandew@yahoo.com).
|
||||
" Version: 0.41
|
||||
" Description:
|
||||
" Use your tab key to do all your completion in insert mode!
|
||||
" The script remembers the last completion type, and applies that.
|
||||
" Eg.: You want to enter /usr/local/lib/povray3/
|
||||
" You type (in insert mode):
|
||||
" /u<C-x><C-f>/l<Tab><Tab><Tab>/p<Tab>/i<Tab>
|
||||
" You can also manipulate the completion type used by changing g:complType
|
||||
" variable.
|
||||
" You can cycle forward and backward with the <Tab> and <S-Tab> keys
|
||||
" (<S-Tab> will not work in the console version)
|
||||
" Note: you must press <Tab> once to be able to cycle back
|
||||
" History:
|
||||
" 0.41 Fixed couple bugs introduced in last version (Eric Van Dewoestine).
|
||||
" 0.4 Added the following functionality (Eric Van Dewoestine)
|
||||
" - support for vim 7 omni, user, and spelling completion modes
|
||||
" (should be backwards compatible with vim 6.x).
|
||||
" - command :SuperTabHelp which opens a window with available
|
||||
" completion types that the user can choose from.
|
||||
" - variable g:SuperTabRetainCompletionType setting for determining if
|
||||
" and for how long to retain completion type.
|
||||
" 0.32 Corrected tab-insertion/completing decidion (thx to: Lorenz Wegener)
|
||||
" 0.31 Added <S-Tab> for backward cycling. (req by: Peter Chun)
|
||||
" 0.3 Back to the roots. Autocompletion is another story...
|
||||
" Now the prompt appears, when showmode is on
|
||||
|
||||
if !exists('complType') "Integration with other completion functions...
|
||||
|
||||
" This variable determines if, and for how long, the current completion type
|
||||
" is retained. The possible values include:
|
||||
" 0 - The current completion type is only retained for the current completion.
|
||||
" Once you have chosen a completion result or exited the completion
|
||||
" mode, the default completion type is restored.
|
||||
" 1 - The current completion type is saved for the duration of your vim
|
||||
" session or until you enter a different completion mode.
|
||||
" (SuperTab default).
|
||||
" 2 - The current completion type is saved until you exit insert mode (via
|
||||
" ESC). Once you exit insert mode the default completion type is
|
||||
" restored.
|
||||
if !exists("g:SuperTabRetainCompletionType")
|
||||
let g:SuperTabRetainCompletionType = 1
|
||||
endif
|
||||
|
||||
" This variable is used to set the default completion type.
|
||||
" There is no need to escape this value as that will be done for you when
|
||||
" the type is set.
|
||||
" Ex. let g:SuperTabDefaultCompletionType = "<C-X><C-U>"
|
||||
if !exists("g:SuperTabDefaultCompletionType")
|
||||
let g:SuperTabDefaultCompletionType = "<C-P>"
|
||||
endif
|
||||
|
||||
" construct the help text.
|
||||
let s:tabHelp =
|
||||
\ "Hit <CR> or CTRL-] on the completion type you wish to swith to.\n" .
|
||||
\ "Use :help ins-completion for more information.\n" .
|
||||
\ "\n" .
|
||||
\ "|<C-N>| - Keywords in 'complete' searching down.\n" .
|
||||
\ "|<C-P>| - Keywords in 'complete' searching up (SuperTab default).\n" .
|
||||
\ "|<C-X><C-L>| - Whole lines.\n" .
|
||||
\ "|<C-X><C-N>| - Keywords in current file.\n" .
|
||||
\ "|<C-X><C-K>| - Keywords in 'dictionary'.\n" .
|
||||
\ "|<C-X><C-T>| - Keywords in 'thesaurus', thesaurus-style.\n" .
|
||||
\ "|<C-X><C-I>| - Keywords in the current and included files.\n" .
|
||||
\ "|<C-X><C-]>| - Tags.\n" .
|
||||
\ "|<C-X><C-F>| - File names.\n" .
|
||||
\ "|<C-X><C-D>| - Definitions or macros.\n" .
|
||||
\ "|<C-X><C-V>| - Vim command-line."
|
||||
if v:version >= 700
|
||||
let s:tabHelp = s:tabHelp . "\n" .
|
||||
\ "|<C-X><C-U>| - User defined completion.\n" .
|
||||
\ "|<C-X><C-O>| - Occult completion.\n" .
|
||||
\ "|<C-X>s| - Spelling suggestions."
|
||||
endif
|
||||
|
||||
" set the available completion types and modes.
|
||||
let s:types =
|
||||
\ "\<C-E>\<C-Y>\<C-L>\<C-N>\<C-K>\<C-T>\<C-I>\<C-]>\<C-F>\<C-D>\<C-V>\<C-N>\<C-P>"
|
||||
let s:modes = '/^E/^Y/^L/^N/^K/^T/^I/^]/^F/^D/^V/^P'
|
||||
if v:version >= 700
|
||||
let s:types = s:types . "\<C-U>\<C-O>\<C-N>\<C-P>s"
|
||||
let s:modes = s:modes . '/^U/^O/s'
|
||||
endif
|
||||
let s:types = s:types . "np"
|
||||
let s:modes = s:modes . '/n/p'
|
||||
|
||||
" Globally available function that user's can use to create mappings to
|
||||
" quickly switch completion modes. Useful when a user wants to restore the
|
||||
" default or switch to another mode without having to kick off a completion
|
||||
" of that type or use SuperTabHelp.
|
||||
" Example mapping to restore SuperTab default:
|
||||
" nmap <F6> :call SetSuperTabCompletionType("<C-P>")<cr>
|
||||
fu! SuperTabSetCompletionType (type)
|
||||
exec "let g:complType = \"" . escape(a:type, '<') . "\""
|
||||
endf
|
||||
|
||||
call SuperTabSetCompletionType(g:SuperTabDefaultCompletionType)
|
||||
|
||||
im <C-X> <C-r>=CtrlXPP()<CR>
|
||||
|
||||
" Setup mechanism to restore orignial completion type upon leaving insert
|
||||
" mode if g:SuperTabDefaultCompletionType == 2
|
||||
if g:SuperTabRetainCompletionType == 2
|
||||
" pre vim 7, must map <esc>
|
||||
if v:version < 700
|
||||
im <silent> <ESC>
|
||||
\ <ESC>:call SuperTabSetCompletionType(g:SuperTabDefaultCompletionType)<cr>
|
||||
|
||||
" since vim 7, we can use InsertLeave autocmd.
|
||||
else
|
||||
augroup supertab
|
||||
autocmd InsertLeave *
|
||||
\ call SuperTabSetCompletionType(g:SuperTabDefaultCompletionType)
|
||||
augroup END
|
||||
endif
|
||||
endif
|
||||
|
||||
fu! CtrlXPP()
|
||||
if &smd
|
||||
echo '' | echo '-- ^X++ mode (' . s:modes . ')'
|
||||
endif
|
||||
let complType=nr2char(getchar())
|
||||
if stridx(s:types, complType) != -1
|
||||
if stridx("\<C-E>\<C-Y>",complType)!=-1 " no memory, just scroll...
|
||||
return "\<C-x>".complType
|
||||
elseif stridx('np',complType)!=-1
|
||||
let complType=nr2char(char2nr(complType)-96) " char2nr('n')-char2nr("\<C-n")
|
||||
else
|
||||
let complType="\<C-x>".complType
|
||||
endif
|
||||
|
||||
if g:SuperTabRetainCompletionType
|
||||
let g:complType = complType
|
||||
endif
|
||||
|
||||
return complType
|
||||
else
|
||||
echohl "Unknown mode"
|
||||
return complType
|
||||
endif
|
||||
endf
|
||||
|
||||
" From the doc |insert.txt| improved
|
||||
im <Tab> <C-n>
|
||||
inore <S-Tab> <C-p>
|
||||
|
||||
" This way after hitting <Tab>, hitting it once more will go to next match
|
||||
" (because in XIM mode <C-n> and <C-p> mappings are ignored)
|
||||
" and wont start a brand new completion
|
||||
" The side effect, that in the beginning of line <C-n> and <C-p> inserts a
|
||||
" <Tab>, but I hope it may not be a problem...
|
||||
ino <C-n> <C-R>=<SID>SuperTab('n')<CR>
|
||||
ino <C-p> <C-R>=<SID>SuperTab('p')<CR>
|
||||
|
||||
fu! <SID>SuperTab(command)
|
||||
if (strpart(getline('.'),col('.')-2,1)=~'^\s\?$')
|
||||
return "\<Tab>"
|
||||
else
|
||||
" exception: if in <c-p> mode, then <c-n> should move up the list, and
|
||||
" <c-p> down the list.
|
||||
if a:command == 'p' && g:complType == "\<C-P>"
|
||||
return "\<C-N>"
|
||||
endif
|
||||
return g:complType
|
||||
endif
|
||||
endf
|
||||
|
||||
fu! <SID>SuperTabHelp()
|
||||
if bufwinnr("SuperTabHelp") == -1
|
||||
botright split SuperTabHelp
|
||||
|
||||
setlocal noswapfile
|
||||
setlocal buftype=nowrite
|
||||
setlocal bufhidden=delete
|
||||
|
||||
let saved = @"
|
||||
let @" = s:tabHelp
|
||||
silent put
|
||||
call cursor(1,1)
|
||||
silent 1,delete
|
||||
call cursor(4,1)
|
||||
let @" = saved
|
||||
exec "resize " . line('$')
|
||||
|
||||
syntax match Special "|.\{-}|"
|
||||
|
||||
setlocal readonly
|
||||
setlocal nomodifiable
|
||||
|
||||
nmap <silent> <buffer> <cr> :call <SID>SetCompletionType()<cr>
|
||||
nmap <silent> <buffer> <c-]> :call <SID>SetCompletionType()<cr>
|
||||
else
|
||||
exec bufwinnr("SuperTabHelp") . "winc w"
|
||||
endif
|
||||
endf
|
||||
|
||||
fu! s:SetCompletionType ()
|
||||
let chosen = substitute(getline('.'), '.*|\(.*\)|.*', '\1', '')
|
||||
if chosen != getline('.')
|
||||
call SuperTabSetCompletionType(chosen)
|
||||
close
|
||||
winc p
|
||||
endif
|
||||
endf
|
||||
|
||||
if !exists(":SuperTabHelp")
|
||||
command SuperTabHelp :call <SID>SuperTabHelp()
|
||||
endif
|
||||
en
|
||||
23
.vim/syntax/motd.vim
Normal file
23
.vim/syntax/motd.vim
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
" Vim syntax file
|
||||
" Language: MotD Public
|
||||
" Maintainer: David Bushong <david@bushong.net>
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match motdSig "\(\s\s\+\|\t\)--\?.\+$\|\s--\?\w\+\s*$"
|
||||
syn match motdThread "^\s\+\\[_-]"
|
||||
syn match motdDate "^\d\+/\d\+\s"
|
||||
syn match motdLink "https\?://\S\+"
|
||||
|
||||
hi link motdSig String
|
||||
hi link motdThread Type
|
||||
hi link motdDate Number
|
||||
hi link motdLink Underlined
|
||||
|
||||
let b:current_syntax = "motd"
|
||||
41
.vimrc
Normal file
41
.vimrc
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
syntax on
|
||||
"colorscheme slate
|
||||
"colorscheme dante
|
||||
colorscheme barak
|
||||
set ts=4
|
||||
set nocompatible
|
||||
set smartcase
|
||||
|
||||
"Sources
|
||||
source ~/.vim/supertab.vim
|
||||
source ~/.vim/charm.vim
|
||||
"source ~/.vim/syntax/motd.vim
|
||||
|
||||
au BufNewFile,BufRead motd.public,/tmp/motd.public.r.* setf motd
|
||||
"Highlighting features
|
||||
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
|
||||
let python_highlight_all = 1
|
||||
|
||||
set t_Co=16
|
||||
set t_Sf=ESC[3%dm
|
||||
set t_Sb=ESC[4%dm
|
||||
|
||||
"Remappings
|
||||
nnoremap gn :tabnew<CR>
|
||||
nnoremap gc :tabclose<CR>
|
||||
nnoremap j gj
|
||||
nnoremap k gk
|
||||
vnoremap j gj
|
||||
vnoremap k gk
|
||||
nnoremap <Down> gj
|
||||
nnoremap <Up> gk
|
||||
vnoremap <Down> gj
|
||||
vnoremap <Up> gk
|
||||
inoremap <Down> <C-o>gj
|
||||
inoremap <Up> <C-o>gk
|
||||
|
||||
if !exists(":W")
|
||||
command W :w
|
||||
endif
|
||||
|
||||
inoremap ;a <esc>
|
||||
26
.zprofile
Normal file
26
.zprofile
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# $FreeBSD: src/share/skel/dot.profile,v 1.19.2.2 2002/07/13 16:29:10 mp Exp $
|
||||
#
|
||||
# .profile - Bourne Shell startup script for login shells
|
||||
#
|
||||
# see also sh(1), environ(7).
|
||||
#
|
||||
|
||||
# remove /usr/games and /usr/X11R6/bin if you want
|
||||
PATH=$HOME/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin; export PATH
|
||||
|
||||
# Setting TERM is normally done through /etc/ttys. Do only override
|
||||
# if you're sure that you'll never log in via telnet or xterm or a
|
||||
# serial line.
|
||||
# Use cons25l1 for iso-* fonts
|
||||
# TERM=cons25; export TERM
|
||||
|
||||
BLOCKSIZE=K; export BLOCKSIZE
|
||||
EDITOR=vim; export EDITOR
|
||||
PAGER=less; export PAGER
|
||||
|
||||
# set ENV to a file invoked each time sh is started for interactive use.
|
||||
ENV=$HOME/.zshrc; export ENV
|
||||
|
||||
#alias ls='ls -FG'
|
||||
#alias la='ls -FGal'
|
||||
#source ~/.bashrc
|
||||
11
.zshenv
Normal file
11
.zshenv
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
export NOBEEP="YES" # Stop that infernal beeping
|
||||
export CLICOLOR="YES" # Show colors
|
||||
export LSCOLORS="ExGxFxdxCxDxDxhbadExEx" # Look like bash
|
||||
bindkey '\e[1~' beginning-of-line # Home key
|
||||
bindkey '\e[4~' end-of-line # End key
|
||||
bindkey '\e[H' beginning-of-line # Home key (alternate)
|
||||
bindkey '\e[F' end-of-line # End key (alternate)
|
||||
bindkey '\e[3~' forward-delete-char # Delete key
|
||||
bindkey '\e[6~' end-of-history # Page down key
|
||||
bindkey '\e[2~' redisplay # Insert key
|
||||
bindkey '\e[5~' insert-last-word # Page up key
|
||||
38
.zshrc
Normal file
38
.zshrc
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#complist
|
||||
autoload -U compinit
|
||||
compinit
|
||||
setopt extended_glob
|
||||
bindkey -v
|
||||
ZLS_COLORS=$LS_COLORS
|
||||
|
||||
|
||||
setopt prompt_subst
|
||||
|
||||
|
||||
###
|
||||
# See if we can use colors.
|
||||
|
||||
autoload colors zsh/terminfo
|
||||
if [[ "$terminfo[colors]" -ge 8 ]]; then
|
||||
colors
|
||||
fi
|
||||
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
|
||||
eval PR_LIGHT_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
|
||||
eval PR_$color='%{$fg[${(L)color}]%}'
|
||||
(( count = $count + 1 ))
|
||||
done
|
||||
PR_NO_COLOUR="%{$terminfo[sgr0]%}"
|
||||
|
||||
###
|
||||
# Decide whether to set a screen title
|
||||
if [[ "$TERM" == "screen" ]]; then
|
||||
PR_STITLE=$'%{\ekzsh\e\\%}'
|
||||
else
|
||||
PR_STITLE=''
|
||||
fi
|
||||
|
||||
PROMPT='$PR_STITLE$PR_LIGHT_BLUE($PR_LIGHT_YELLOW%D{%H:%M}|%!$PR_BLUE%)[%(!.$PR_RED.$PR_GREEN)%n@%m$PR_LIGHT_CYAN %~$PR_BLUE]$PR_NO_COLOUR%(!.#.$) '
|
||||
#source .zshprompt
|
||||
|
||||
source ~/.bash_aliases
|
||||
source ~/.zshenv
|
||||
16
bin/ansiabuse
Executable file
16
bin/ansiabuse
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/python
|
||||
import random
|
||||
import sys
|
||||
import commands
|
||||
colors = ["red", "green", "yellow", "blue", "magenta", "cyan", "white"]
|
||||
for line in sys.stdin:
|
||||
echostring = ""
|
||||
line = line.rstrip();
|
||||
for x in line:
|
||||
if x == '\\':
|
||||
x = '\\\\'
|
||||
colorname = colors[random.randint(0,6)]
|
||||
echostring += "$(color lt" + colorname +")" + x
|
||||
echostring += "$(color off)"
|
||||
o = commands.getoutput('echo "' + echostring + '"')
|
||||
print o.rstrip()
|
||||
4
bin/baraksetup
Executable file
4
bin/baraksetup
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
cd ~
|
||||
tar -czf baraksetup.tar.gz bin/ .vim/ .vimrc .bashrc .bash_aliases .bash_logout .profile .muttrc .screenrc .procmailrc
|
||||
chmod 600 baraksetup.tar.gz
|
||||
7
bin/build/Makefile
Normal file
7
bin/build/Makefile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
all:
|
||||
gcc -o ./gettermsize ./src/gettermsize/gettermsize.c
|
||||
gcc -o ./wye ./src/wye/wye.c
|
||||
|
||||
install:
|
||||
cp ./wye ~/bin
|
||||
cp ./gettermsize ~/bin
|
||||
15
bin/build/src/gettermsize/gettermsize.c
Normal file
15
bin/build/src/gettermsize/gettermsize.c
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
struct winsize size;
|
||||
ioctl(STDIN_FILENO, TIOCGWINSZ, (char *) &size);
|
||||
printf("%d x %d\n", size.ws_col, size.ws_row);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
59
bin/build/src/wye/wye.1
Normal file
59
bin/build/src/wye/wye.1
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
.\" $Id: wye.1,v 1.1 1999-05-03 10:04:59-07 mconst Exp mconst $
|
||||
.TH WYE 1
|
||||
.fi
|
||||
.SH NAME
|
||||
wye \- another pipe fitting
|
||||
.SH SYNOPSIS
|
||||
\fC`\fIsubcommand\fP | wye`\fR (note the backquotes!)
|
||||
.SH DESCRIPTION
|
||||
The \fCwye\fR utility is used to create systems of pipes and fifos
|
||||
(named pipes) more complicated than standard shell syntax allows.
|
||||
A single invocation of \fCwye\fR has the following effect: a temporary
|
||||
fifo is created; the name of this fifo is printed on standard output;
|
||||
and \fCwye\fR exits, leaving a child process in the background to copy
|
||||
any data received on standard input to the fifo. The net effect of
|
||||
this is that you can use the expression \fC`\fIsubcommand\fP | wye`\fR
|
||||
anywhere on a command line that you would use a filename, and the output of
|
||||
\fIsubcommand\fP will be piped appropriately to create the illusion that
|
||||
\fC`\fIsubcommand\fP | wye`\fR is a file, containing the output of
|
||||
\fIsubcommand\fR.
|
||||
.SH EXAMPLES
|
||||
Since \fCwye\fR is a simple command, I have given it a simple
|
||||
description; however, some examples are certainly in order.
|
||||
To print all lines of the standard input which contain the name
|
||||
of a file in the current directory:
|
||||
.nf
|
||||
|
||||
\fCfgrep \-f `ls | wye`\fR
|
||||
|
||||
.fi
|
||||
To show which users log on or off in the next minute:
|
||||
.nf
|
||||
|
||||
\fCdiff \-h `who | wye` `sleep 60; who | wye`\fR
|
||||
|
||||
.fi
|
||||
To change the names of all the files in the current directory to lowercase:
|
||||
.nf
|
||||
|
||||
\fCpaste `ls | wye` `ls | tr A\-Z a\-z | wye` | xargs \-n2 mv\fR
|
||||
.fi
|
||||
.SH FILES
|
||||
\fC/tmp/wye.??????\fR temporary fifos
|
||||
.SH BUGS
|
||||
The background \fCwye\fR process has a (hardcoded) one-hour timeout: if the
|
||||
fifo is not opened for reading by another process in that time, then the
|
||||
background \fCwye\fR process will terminate silently. Note that this will
|
||||
probably never happen unless the user has made a mistake and forgotten to
|
||||
use the fifo for anything.
|
||||
.PP
|
||||
There is no equivalent of \fCmkstemp\fR(\fC3\fR) for fifos, so we
|
||||
must provide the same functionality ourselves with \fCmktemp\fR(\fC3\fR)
|
||||
and \fCmkfifo\fR(\fC2\fR), repeating the calls if
|
||||
.SM EEXIST
|
||||
is returned.
|
||||
.SH AUTHOR
|
||||
Michael Constant (mconst@csua.berkeley.edu).
|
||||
.SH "SEE ALSO"
|
||||
\fCmktemp\fR(\fC3\fR), \fCmkstemp\fR(\fC3\fR), \fCmkfifo\fR(\fC2\fR),
|
||||
\fCtee\fR(\fC1\fR)
|
||||
72
bin/build/src/wye/wye.c
Normal file
72
bin/build/src/wye/wye.c
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/* wye.c, written by Michael Constant (mconst@csua.berkeley.edu) and placed
|
||||
* in the public domain. $Id: wye.c,v 1.1 1999-05-03 10:04:59-07 mconst $ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define TEMPMASK "/tmp/wye.XXXXXX" /* the name of our tempfile */
|
||||
#define TIMEOUT 3600 /* time we wait for the fifo to open */
|
||||
|
||||
void cleanup(int sig);
|
||||
|
||||
char tempfile[]=TEMPMASK;
|
||||
|
||||
int main()
|
||||
{
|
||||
int ch;
|
||||
FILE *fp;
|
||||
|
||||
/* create the fifo. if we get EEXIST, then someone else created a
|
||||
* file with our intended name right before we did; we should pick
|
||||
* a new name and try again. see the source to mkstemp(3). */
|
||||
while (mkfifo(mktemp(tempfile), 0600) == -1) {
|
||||
if (errno != EEXIST) {
|
||||
perror("wye: couldn't create fifo");
|
||||
exit(1);
|
||||
}
|
||||
strcpy(tempfile, TEMPMASK);
|
||||
}
|
||||
|
||||
/* remove our tempfile if we die */
|
||||
signal(SIGHUP, cleanup);
|
||||
signal(SIGINT, cleanup);
|
||||
signal(SIGTERM, cleanup);
|
||||
signal(SIGALRM, cleanup);
|
||||
|
||||
/* fork a child to do the work */
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
perror("wye: couldn't fork");
|
||||
exit(1);
|
||||
|
||||
case 0:
|
||||
fclose(stdout); /* this is necessary for `cmd | wye` */
|
||||
alarm(TIMEOUT); /* this is if the fifo never opens */
|
||||
|
||||
/* this will block until someone else opens the fifo */
|
||||
if ((fp = fopen(tempfile, "w")) == NULL) {
|
||||
perror("wye: couldn't open fifo");
|
||||
exit(1); /* not as if anyone cares */
|
||||
}
|
||||
|
||||
alarm(0); /* cancel the alarm */
|
||||
unlink(tempfile); /* so it disappears when we're done */
|
||||
while ((ch = getchar()) != EOF) putc(ch, fp);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* output the name of the fifo */
|
||||
printf("%s\n", tempfile);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void cleanup(int sig)
|
||||
{
|
||||
unlink(tempfile);
|
||||
exit(2);
|
||||
}
|
||||
13
bin/callout
Executable file
13
bin/callout
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
x = readline()
|
||||
x = x.strip
|
||||
(x.length() + 4).times {print "*"}
|
||||
print "\n"
|
||||
print "* "
|
||||
print x
|
||||
print " *\n"
|
||||
|
||||
(x.length() + 4).times {print "*"}
|
||||
print "\n"
|
||||
|
||||
34
bin/contract
Executable file
34
bin/contract
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
|
||||
loadfile = sys.stdin
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
print "No command to run"
|
||||
sys.exit(1)
|
||||
|
||||
if len(sys.argv) == 3:
|
||||
if sys.argv[2] != "-":
|
||||
loadfile = open(sys.argv[2])
|
||||
|
||||
def add(x, y):
|
||||
return x + y
|
||||
|
||||
def sub(x, y):
|
||||
return x - y
|
||||
|
||||
def mult(x, y):
|
||||
return x * y
|
||||
|
||||
def div(x,y):
|
||||
return x / y;
|
||||
|
||||
lis = []
|
||||
for line in loadfile:
|
||||
if line.strip() <> "":
|
||||
x = float(line)
|
||||
lis.append(x)
|
||||
|
||||
print reduce(eval(sys.argv[1]), lis)
|
||||
|
||||
10
bin/createindex
Executable file
10
bin/createindex
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "<center><h1>"
|
||||
#echo `basename \`pwd\``
|
||||
pwd | xargs basename | xargs echo
|
||||
echo "</h1></center>"
|
||||
for file in *
|
||||
do
|
||||
echo "<a href='./${file}'>${file}</a><br>"
|
||||
done
|
||||
6
bin/createtextimage
Executable file
6
bin/createtextimage
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
#This is a hack for now, as Debian has an older version of ImageMagick. The better (>= IM 6.8.5) way is below
|
||||
#perl -pe 's/\n/\\n/' | convert -background lightblue -fill blue label:@- $*
|
||||
#convert -background lightblue -fill blue label:@- $*
|
||||
#convert -background none -box lightblue -font Courier -fill blue -pointsize 14 text:- -trim +repage -bordercolor lightblue -border 3 -background lightblue -flatten png:-
|
||||
convert -background none -box white -font Courier -fill black -strokewidth 2 -pointsize 16 text:- -trim +repage -bordercolor white -border 3 -background white -flatten png:-
|
||||
BIN
bin/gettermsize
Executable file
BIN
bin/gettermsize
Executable file
Binary file not shown.
19
bin/gnuplottoppm
Executable file
19
bin/gnuplottoppm
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
|
||||
$x = 0.6;
|
||||
$y = 0.6;
|
||||
$color = 1;
|
||||
$gnuplot = "/usr/bin/gnuplot";
|
||||
|
||||
open (GNUPLOT, "|$gnuplot");
|
||||
print GNUPLOT <<gnuplot_Commands_Done;
|
||||
|
||||
|
||||
set term pbm color small
|
||||
set title "Anoncon Thread Growth"
|
||||
set xlabel "Time (minutes)"
|
||||
set ylabel "Posts"
|
||||
set output "$ARGV[1]"
|
||||
plot "$ARGV[0]" title "" $color
|
||||
gnuplot_Commands_Done
|
||||
8
bin/grepsonnet
Executable file
8
bin/grepsonnet
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
#$G = `echo "($1 * 17) + 16" | bc`
|
||||
X=$((($1 * 17) + 16))
|
||||
head -n $X /home/michener/shakespeare/poetry/sonnets | tail -n 17
|
||||
X=$((($1 * 17) + 16))
|
||||
#Y=$((($1 * 17) - 1))
|
||||
#echo "sed -n $Y,$Xp /home/barak/shakespeare/poetry/sonnets"
|
||||
#sed -n $Y,$Xp sonnets
|
||||
7
bin/hosttest
Executable file
7
bin/hosttest
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
host $1.com
|
||||
host $1.net
|
||||
host $1.org
|
||||
host $1.cc
|
||||
|
||||
12
bin/htmlify
Executable file
12
bin/htmlify
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
concat = '<font face="courier new" size="-1"><br>'
|
||||
thisline = ""
|
||||
import sys
|
||||
for line in sys.stdin:
|
||||
thisline = line.expandtabs(7)
|
||||
thisline = thisline.replace("&", "&").replace("<","<").replace(">",">")
|
||||
thisline = thisline.replace("\n", "<br>")
|
||||
thisline = thisline.replace(" "," ")
|
||||
concat = concat + thisline # + "<br>"
|
||||
print concat + "</font>"
|
||||
46
bin/jytecheck
Executable file
46
bin/jytecheck
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/ruby
|
||||
require 'net/http'
|
||||
require 'getoptlong'
|
||||
|
||||
class JyteEntry
|
||||
def initialize(vfor, vagainst, title)
|
||||
@vfor = vfor
|
||||
@vagainst = vagainst
|
||||
@title = title
|
||||
end
|
||||
def print
|
||||
printf "[\033[32m#@vfor\033[0m "
|
||||
printf "\033[31m#@vagainst\033[0m]\t"
|
||||
printf "#@title\n"
|
||||
end
|
||||
end
|
||||
|
||||
opts = GetoptLong.new(
|
||||
["--number", "-n", GetoptLong::REQUIRED_ARGUMENT]
|
||||
)
|
||||
|
||||
donum = 10
|
||||
|
||||
opts.each do |opt, arg|
|
||||
if opt == "-n" or opt == "--number"
|
||||
donum = arg.to_i
|
||||
end
|
||||
end
|
||||
donuma = (donum / 10.0).ceil
|
||||
|
||||
|
||||
jytes = Array.new()
|
||||
|
||||
1.upto(donuma) do |num|
|
||||
response = Net::HTTP.start("jyte.com").post("/claims", "page=#{num}")
|
||||
|
||||
titles = (response.body.scan(%r{a class=\"claim_title\"\n\s*href=\"http:(.*?)\">\n\s*(.*?)\n\s*</a>}m))
|
||||
votesfor = (response.body.scan(%r{votes_left_text_\d*\" style=\"color:#fff;\">(.*?)</span>}m))
|
||||
votesagainst = (response.body.scan(%r{votes_right_text_\d*\" style=\"color:#fff;\">(.*?)</span>}m))
|
||||
0.upto(9) do |i|
|
||||
jytes.push(JyteEntry.new(votesfor[i][0],votesagainst[i][0],titles[i][1]))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
0.upto(donum - 1) {|x| jytes[x].print}
|
||||
2
bin/lessaccesslog
Executable file
2
bin/lessaccesslog
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
cat $1 | cut -d ] -f 2 | cut -d \" -f 2 | cut -d " " -f 2 | sort | uniq -c | sort -n | less
|
||||
21
bin/mailheaders
Executable file
21
bin/mailheaders
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/perl
|
||||
if ($#ARGV == 0) {
|
||||
$ARGV[1] = "michener\@csua.berkeley.edu";
|
||||
}
|
||||
print <<FOO;
|
||||
EHLO localhost
|
||||
MAIL FROM: rootcow\@csua.berkeley.edu
|
||||
RCPT TO: $ARGV[1]
|
||||
DATA
|
||||
From: RootCow\@csua.BERKELEY.edu
|
||||
To: $ARGV[1]
|
||||
Subject: $ARGV[0]
|
||||
|
||||
FOO
|
||||
while (<STDIN>) {
|
||||
print;
|
||||
}
|
||||
print ".";
|
||||
print "\n";
|
||||
print "QUIT";
|
||||
print "\n";
|
||||
184
bin/motdedit
Executable file
184
bin/motdedit
Executable file
|
|
@ -0,0 +1,184 @@
|
|||
#!/usr/local/bin/perl
|
||||
#
|
||||
# DESC:
|
||||
# Program is used to sychronize write access to public motd file.
|
||||
# Program acquires advisory exclusive lock, then brings up editor
|
||||
# to edit file. On return from editor, motd file will be unlocked.
|
||||
# If program cannot acquire exclusive lock, it prints out the current
|
||||
# user holding exclusive lock.
|
||||
#
|
||||
# WRITTEN BY:
|
||||
# Andrew Choi
|
||||
# Fixed by:
|
||||
# Ben Scott
|
||||
# Arvin Hsu
|
||||
|
||||
use strict;
|
||||
use Fcntl ':flock';
|
||||
use Errno;
|
||||
use Getopt::Std;
|
||||
use File::Copy;
|
||||
|
||||
my $motd = "/etc/motd.public";
|
||||
my $motdbackup = "/tmp/motd.public.b.$>.$$"; # EUID + PID
|
||||
my $motdcurrent = "/tmp/motd.public.r.$>.$$"; # EUID + PID
|
||||
my $motdtemp = "/tmp/motd.public.t.$>.$$"; # EUID + PID
|
||||
my $motdmerged = "/tmp/motd.public.m.$>.$$"; # EUID + PID
|
||||
|
||||
$motd = "/csua/tmp/motd.kinney" if (getpwuid($<))[0] eq 'kinney';
|
||||
my $editor = $ENV{MOTDEDITOR};
|
||||
$editor ||= $ENV{VISUAL};
|
||||
$editor ||= $ENV{EDITOR};
|
||||
$editor ||= "/usr/bin/ed";
|
||||
|
||||
my %opt;
|
||||
|
||||
$opt{t} = 600;
|
||||
getopts("mnst:h?",\%opt);
|
||||
&Usage if $opt{h};
|
||||
|
||||
## Set environment vars for vi users
|
||||
## Thanks, jon.
|
||||
|
||||
$ENV{NEXINIT} ||= $ENV{EXINIT};
|
||||
unless ( $ENV{NEXINIT} ) {
|
||||
unless (open (EXRC,"$ENV{HOME}/.nexrc")) {
|
||||
unless (open (EXRC,"$ENV{HOME}/.exrc")) {
|
||||
$ENV{NEXINIT} = "set nolock";
|
||||
}
|
||||
}
|
||||
unless ($ENV{NEXINIT}) {
|
||||
($ENV{NEXINIT} = join ("",<EXRC>)) && close EXRC;
|
||||
}
|
||||
}
|
||||
$ENV{NEXINIT} .= "\nset nolock\n";
|
||||
|
||||
# Set alarm for being locked too damn long
|
||||
$SIG{ALRM} = \&Unlock;
|
||||
alarm $opt{t};
|
||||
|
||||
# Open file as append so that lock can be used on it
|
||||
open(M, "$motd") || die "open $motd: $!";
|
||||
|
||||
# Lock file. If success, execute edit command and exit
|
||||
flock(M, LOCK_EX|LOCK_NB);
|
||||
if ($!{EWOULDBLOCK}) {
|
||||
if ($opt{n}) {
|
||||
print "Motd currently locked. Editing anyways.";
|
||||
&Edit;
|
||||
}
|
||||
else {
|
||||
flock (M, LOCK_UN);
|
||||
print "Motd currently locked\nWait to acquire lock [y/N] ";
|
||||
chomp(my $ans = <>);
|
||||
if ($ans =~ /^y$/i) {
|
||||
flock(M, LOCK_EX);
|
||||
&Edit;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
&Edit;
|
||||
}
|
||||
|
||||
close M;
|
||||
system "/csua/bin/mtd";
|
||||
exit 0;
|
||||
|
||||
sub Unlock {
|
||||
flock(M, LOCK_UN);
|
||||
print
|
||||
"\r*** MOTD GOD PRONOUNCES: *** \r\n*** You have locked the motd for too long, you idle hoser... *** \r\n*** Your lock has been removed. *** \r\n";
|
||||
}
|
||||
|
||||
sub Usage {
|
||||
print STDERR
|
||||
"$0 Edit /etc/motd.public with locking and merge.
|
||||
|
||||
Usage: $0 [-m] [-s] [-t n]
|
||||
-t n Set timeout for releasing lock to n seconds (default $opt{t})
|
||||
-m Turns auto-merging off.
|
||||
-s If merge fails, will stomp over other changes.
|
||||
-n Does not wait for lock before allowing edit.
|
||||
(the other person may overwrite your post)
|
||||
";
|
||||
exit 2;
|
||||
}
|
||||
|
||||
sub Edit {
|
||||
alarm $opt{t};
|
||||
print "";
|
||||
#check if merge option is desired
|
||||
if (!$opt{m}) {
|
||||
copy($motd,$motdbackup);
|
||||
copy($motd,$motdcurrent);
|
||||
my $lastmodtime = (stat($motd))[9];
|
||||
system("$editor $motdcurrent");
|
||||
my $currmodtime = (stat($motd))[9];
|
||||
if ($currmodtime > $lastmodtime) {
|
||||
&Merge;
|
||||
}
|
||||
else {
|
||||
copy($motdcurrent,$motd);
|
||||
}
|
||||
unlink </tmp/motd.public.*>;
|
||||
}
|
||||
else {
|
||||
system("$editor $motd");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Attempts to auto-merge using "merge, diff -c | patch, diff | patch"
|
||||
# If auto-merge fails, allows manual merge
|
||||
# Saves final version as $motd
|
||||
sub Merge {
|
||||
copy($motd,$motdmerged);
|
||||
system("merge -p -q -L \"Other Changes Below\" -L \"Original MOTD\" -L \"Your Changes Above\" $motd $motdbackup $motdcurrent > $motdtemp");
|
||||
|
||||
# Check to see if merge failed. if fail, try diff -c | patch
|
||||
if (($? >> 8) > 0) {
|
||||
system("diff -c $motdbackup $motdcurrent | patch -s -f $motdmerged 2> /dev/null");
|
||||
|
||||
# Check to see if diff -c | patch, if fail, try diff | patch
|
||||
if (($? >> 8) > 0) {
|
||||
system("diff $motdbackup $motdcurrent | patch -s -f $motdmerged 2> /dev/null");
|
||||
|
||||
# If everything has failed, put the merge notation in, and let the user edit.
|
||||
if (($? >> 8) > 0) {
|
||||
if ($opt{s}) {
|
||||
copy($motdcurrent,$motdmerged);
|
||||
}
|
||||
else {
|
||||
print "CONCURRENT CHANGES\r\nAll merge & patch attempts have failed.\r\nMerge Manually? [y/n]";
|
||||
chomp(my $answ = <>);
|
||||
if ($answ =~ /^y$/i) {
|
||||
copy($motdtemp,$motdcurrent);
|
||||
copy($motd,$motdbackup);
|
||||
my $lastmodtime = (stat($motd))[9];
|
||||
system("$editor $motdcurrent");
|
||||
my $currmodtime = (stat($motd))[9];
|
||||
if ($currmodtime > $lastmodtime) {
|
||||
&Merge;
|
||||
}
|
||||
else {
|
||||
copy($motdcurrent,$motdmerged);
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "Stomp on other people's changes? [y/n]";
|
||||
chomp(my $answ = <>);
|
||||
if ($answ =~ /^y$/i) {
|
||||
copy($motdcurrent,$motdmerged);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Merge was successful, copy it over.
|
||||
copy($motdtemp,$motdmerged);
|
||||
}
|
||||
copy($motdmerged,$motd);
|
||||
}
|
||||
|
||||
21
bin/movingaverage
Executable file
21
bin/movingaverage
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
$averageto = $ARGV[0];
|
||||
for ($i = 0; $i < $averageto; $i++) {
|
||||
$temp[$i] = 0;
|
||||
}
|
||||
|
||||
while (<STDIN>) {
|
||||
chomp;
|
||||
$x = 0;
|
||||
for ($i = 0; $i < $averageto; $i++) {
|
||||
$x += $temp[$i];
|
||||
}
|
||||
$x = $x + $_;
|
||||
$x = $x / ($averageto + 1);
|
||||
print "$x\n";
|
||||
for ($i = 0; $i < $averageto - 1; $i++) {
|
||||
$temp[$i] = $temp[($i + 1)];
|
||||
}
|
||||
$temp[($averageto -1)] = $_;
|
||||
}
|
||||
8
bin/noblanks
Executable file
8
bin/noblanks
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
while (<STDIN>) {
|
||||
chomp($_);
|
||||
if ($_){
|
||||
print "$_\n";
|
||||
}
|
||||
}
|
||||
119
bin/orly
Executable file
119
bin/orly
Executable file
|
|
@ -0,0 +1,119 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
#
|
||||
# Globals
|
||||
#
|
||||
use vars qw/$deftext %opt /;
|
||||
|
||||
#
|
||||
# Command line options processing
|
||||
#
|
||||
sub init()
|
||||
{
|
||||
use Getopt::Std;
|
||||
my $opt_string = 'hdoynsi';
|
||||
getopts( "$opt_string", \%opt ) or usage();
|
||||
usage() if $opt{h};
|
||||
}
|
||||
|
||||
#
|
||||
# Message about this program and how to use it
|
||||
#
|
||||
sub usage()
|
||||
{
|
||||
print STDERR << "EOF";
|
||||
|
||||
orly -- Print an O RLY owl
|
||||
|
||||
usage: $0 [-hdoyn] [<MESSAGE>]
|
||||
|
||||
-h : this (help) message
|
||||
-o, -d : print the "O RLY" owl
|
||||
-y : print the "YA RLY" owl
|
||||
-n : print the "NO WAI!" owl
|
||||
-s : Print "SRSLY" as a question, statement or
|
||||
exclamation, respectively for the above.
|
||||
-i : take MESSAGE from STDIN
|
||||
|
||||
EOF
|
||||
exit;
|
||||
}
|
||||
|
||||
sub printorly() {
|
||||
$deftext = "O RLY?";
|
||||
print << "EOO"
|
||||
___
|
||||
{o,o}
|
||||
|)__)
|
||||
-"-"-
|
||||
EOO
|
||||
}
|
||||
|
||||
sub printyarly() {
|
||||
$deftext = "YA RLY";
|
||||
print << "EOO"
|
||||
___
|
||||
{o.o}
|
||||
|)_(|
|
||||
-"-"-
|
||||
EOO
|
||||
}
|
||||
|
||||
sub printnowai() {
|
||||
$deftext = "NO WAI!";
|
||||
print << "EOO"
|
||||
___
|
||||
{o,o}
|
||||
(__(|
|
||||
-"-"-
|
||||
EOO
|
||||
}
|
||||
|
||||
$givenstatement = "";
|
||||
for ($i=0; $i<($#ARGV + 1); $i++)
|
||||
{
|
||||
if (substr($ARGV[$i],0,1) ne "-")
|
||||
{
|
||||
$up = uc($ARGV[$i]);
|
||||
$givenstatement = "$givenstatement$up ";
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
if ($opt{i}) {
|
||||
while (<STDIN>) {
|
||||
$givenstatement = $givenstatement.uc($_);
|
||||
}
|
||||
chomp($givenstatement);
|
||||
}
|
||||
if ($opt{y}) {
|
||||
printyarly();
|
||||
$deftext = "SRSLY" if ($opt{s});
|
||||
}
|
||||
elsif ($opt{n}) {
|
||||
printnowai();
|
||||
$deftext = "SRSLY!" if ($opt{s});
|
||||
}
|
||||
elsif ($opt{d} || $opt {o}) {
|
||||
printorly();
|
||||
$deftext = "SRSLY?" if ($opt{s});
|
||||
}
|
||||
elsif ($opt{s}) {
|
||||
printyarly();
|
||||
$deftext = "SRSLY";
|
||||
}
|
||||
else {
|
||||
printorly();
|
||||
}
|
||||
|
||||
if ($givenstatement)
|
||||
{
|
||||
print "$givenstatement\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "$deftext\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
3
bin/ownerof
Executable file
3
bin/ownerof
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
X=`ls -al $1 | awk '{print $3 ":" $4}'`
|
||||
echo $X
|
||||
8
bin/planout
Executable file
8
bin/planout
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
cat ~/.plan_real
|
||||
echo ""
|
||||
echo "Politburo Meeting .plan:"
|
||||
sed -n '/^*/p' ~/.csua.plan
|
||||
wc ~/.csua.plan
|
||||
echo ""
|
||||
~/bin/randsonnet
|
||||
2
bin/port25cow
Executable file
2
bin/port25cow
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
cowsay $1 | mailheaders $1 $2
|
||||
24
bin/ps_warriors
Executable file
24
bin/ps_warriors
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
$cnt = ($ARGV[0] eq "-n" && $ARGV[1] =~ /^\d+$/) ? $ARGV[1] : 20;
|
||||
|
||||
opendir(PROC, "/proc");
|
||||
while ($_ = readdir(PROC)) {
|
||||
next if (/curproc/);
|
||||
$id = (stat("/proc/$_"))[4];
|
||||
next unless defined $id;
|
||||
$procs{$id}++;
|
||||
}
|
||||
closedir(PROC);
|
||||
|
||||
$procs{$<}--;
|
||||
@ids = reverse sort { $procs{$a} <=> $procs{$b} } keys(%procs);
|
||||
|
||||
format STDOUT =
|
||||
@>>> @<<<<<<<
|
||||
$procs{$id}, (getpwuid($id))[0]
|
||||
.
|
||||
|
||||
for $id (($cnt) ? @ids[0..($cnt-1)] : @ids) {
|
||||
write;
|
||||
}
|
||||
7
bin/randsonnet
Executable file
7
bin/randsonnet
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
import random
|
||||
import commands
|
||||
x = random.randint(1,154)
|
||||
o = commands.getoutput("~/bin/grepsonnet %d" % x)
|
||||
print "Random Shakespeare Sonnet:"
|
||||
print o
|
||||
195
bin/rcpt
Executable file
195
bin/rcpt
Executable file
|
|
@ -0,0 +1,195 @@
|
|||
#! /usr/bin/perl -w
|
||||
#
|
||||
# This script connects to a mail server and issues MAIL and RCPT
|
||||
# commands. It's a good way to check whether an address exists --
|
||||
# many modern mail servers actually respond usefully to RCPT, even
|
||||
# if they ignore VRFY and EXPN. It's also convenient for testing
|
||||
# whether a server allows relaying.
|
||||
#
|
||||
# usage: rcpt [options] email-address [mailserver]
|
||||
# rcpt [options] -n [hostname] [mailserver]
|
||||
#
|
||||
# -n
|
||||
# nonexistent: Make up an email address that probably doesn't
|
||||
# exist at the specified hostname. For example,
|
||||
# "rcpt -n foobar.com" will use an address like
|
||||
# <vsMAWCGul96-nonexistent@foobar.com>. If you don't
|
||||
# specify a hostname, it'll make up a local address.
|
||||
# (If you specify an email address instead of a hostname,
|
||||
# it's treated as if you just gave the hostname part.)
|
||||
#
|
||||
# -v
|
||||
# verbose: Show the entire SMTP exchange.
|
||||
#
|
||||
# -f ADDR
|
||||
# from: Specify the address you're sending mail from.
|
||||
# By default, the script uses its best guess at your
|
||||
# email address, constructed from your username and
|
||||
# the local host name.
|
||||
#
|
||||
# -h HOSTNAME
|
||||
# helo: Specify the hostname to send in the HELO command.
|
||||
# By default, the script uses its best guess at the
|
||||
# fully-qualified domain name of the local host.
|
||||
#
|
||||
# By default, the script connects to the first MX listed for the
|
||||
# email address you're testing. If that's not what you want, you
|
||||
# can specify a mail server explicitly; you can even give a mail
|
||||
# server of the form "mx:hostname", which means the first MX listed
|
||||
# for "hostname".
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# rcpt user@foobar.com
|
||||
# Connect to the first MX for foobar.com, and try the
|
||||
# address <user@foobar.com>.
|
||||
#
|
||||
# rcpt user@foobar.com mail.baz.com
|
||||
# Connect to mail.baz.com, and try the address <user@foobar.com>.
|
||||
#
|
||||
# rcpt user@foobar.com mx:baz.com
|
||||
# Connect to the first MX for baz.com, and try the address
|
||||
# <user@foobar.com>.
|
||||
#
|
||||
# rcpt user
|
||||
# Connect to localhost, and try the address <user>.
|
||||
#
|
||||
# rcpt -n foobar.com
|
||||
# Connect to the first MX for foobar.com, and try an
|
||||
# address like <vsMAWCGul96-nonexistent@foobar.com>.
|
||||
#
|
||||
# rcpt -n
|
||||
# Connect to localhost, and try an address like
|
||||
# <vsMAWCGul96-nonexistent>.
|
||||
#
|
||||
# The script outputs the name of the server it connects to, followed
|
||||
# by the response to the RCPT command. It returns success if the
|
||||
# server accepts the address.
|
||||
#
|
||||
# $Id: rcpt,v 1.3 2006-10-12 01:37:51-07 mconst Exp mconst $
|
||||
|
||||
|
||||
use IO::Socket;
|
||||
use Email::Address;
|
||||
use Net::DNS;
|
||||
use Net::SMTP;
|
||||
use Sys::Hostname::Long;
|
||||
use Getopt::Std;
|
||||
use String::Random;
|
||||
|
||||
$0 =~ s|.*/||;
|
||||
|
||||
|
||||
# Return the first MX for the specified host.
|
||||
sub get_mx {
|
||||
my ($host) = @_;
|
||||
|
||||
my @mx = mx($host) or die "$0: can't find MX for $host\n";
|
||||
return $mx[0]->exchange;
|
||||
}
|
||||
|
||||
|
||||
sub Net::SMTP::debug_print {
|
||||
my ($self, $dir, @text) = @_;
|
||||
return unless $self =~ /GLOB/;
|
||||
|
||||
$arrows = $dir ? ">>> " : "";
|
||||
print $arrows, @text;
|
||||
}
|
||||
|
||||
|
||||
getopts "nvf:h:", \my %options;
|
||||
my $verbose = $options{v};
|
||||
my $nonexistent = $options{n};
|
||||
my $helo_hostname = $options{h} || hostname_long;
|
||||
|
||||
my $from_address = $options{f};
|
||||
if (!defined($from_address)) {
|
||||
my $my_username = $ENV{USER} || getpwuid $<
|
||||
|| die "$0: can't find local username\n";
|
||||
|
||||
$from_address = "$my_username\@" . hostname_long;
|
||||
}
|
||||
|
||||
|
||||
my ($address, $server) = @ARGV;
|
||||
@ARGV == 1 || @ARGV == 2 || (@ARGV == 0 && $nonexistent)
|
||||
or die "usage: $0 email-address [mailserver]\n";
|
||||
|
||||
if ($nonexistent) {
|
||||
my $nonexistent_user = String::Random::random_regex '[a-z]\w{10}'
|
||||
. "-nonexistent";
|
||||
|
||||
if (!defined($address)) {
|
||||
# The user didn't give us anything. Make up a local address.
|
||||
|
||||
$address = $nonexistent_user;
|
||||
} elsif ($address =~ /\@/) {
|
||||
# The user gave us an entire email address -- we'll assume
|
||||
# they want us to replace the user part with a made-up
|
||||
# nonexistent username.
|
||||
|
||||
$address = "$nonexistent_user\@$'";
|
||||
} else {
|
||||
# The user gave us a hostname. Make up an address at that
|
||||
# host.
|
||||
|
||||
$address = "$nonexistent_user\@$address";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!defined($server)) {
|
||||
# The user didn't specify what mail server to connect to; try to
|
||||
# figure it out from the address.
|
||||
|
||||
my @addr_objects = Email::Address->parse($address);
|
||||
|
||||
if (@addr_objects) {
|
||||
# We found an address. Look up the MX for that host.
|
||||
|
||||
die "$0: we only handle one address at a time for now\n"
|
||||
if @addr_objects > 1;
|
||||
my $addr_object = $addr_objects[0];
|
||||
|
||||
$server = get_mx($addr_object->host);
|
||||
} else {
|
||||
# We couldn't parse the address, so assume it's local.
|
||||
# Local delivery is potentially a lot more complicated than
|
||||
# this, but let's ignore that for now.
|
||||
|
||||
$server = "localhost";
|
||||
}
|
||||
} elsif ($server =~ /^mx:/i) {
|
||||
# The user has explicitly requested that we look up the MX for
|
||||
# a particular host, and use that as our server.
|
||||
|
||||
$server = get_mx($');
|
||||
}
|
||||
|
||||
|
||||
print "Connecting to $server...\n" if $verbose;
|
||||
my $exit_code = 0;
|
||||
|
||||
my $smtp = Net::SMTP->new($server, Hello => $helo_hostname,
|
||||
ExactAddresses => 1, Debug => $verbose)
|
||||
or die "$0: can't connect to $server\n";
|
||||
|
||||
if ($smtp->mail($from_address)) {
|
||||
# The server accepted our MAIL command; go ahead and try the RCPT.
|
||||
|
||||
$smtp->to($address) or $exit_code = 1;
|
||||
$output = "$server: " . $smtp->code . " " . $smtp->message;
|
||||
} else {
|
||||
# The server rejected out MAIL command. We're done here.
|
||||
|
||||
$exit_code = 2;
|
||||
$output = "server rejected our From address of <$from_address>:\n"
|
||||
. "$server: " . $smtp->code . " " . $smtp->message;
|
||||
}
|
||||
|
||||
$smtp->quit;
|
||||
|
||||
print $output unless $verbose;
|
||||
|
||||
exit $exit_code;
|
||||
4
bin/shakegrep
Executable file
4
bin/shakegrep
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
#echo $2
|
||||
#agrep -n -i -d '$$' -t -r "$*" ~/shakespeare | sed '/\/.*\/[A-Za-z]*:/ s/:\s*/:\n/'
|
||||
agrep -i -d '$$' -t -r "$1" /home/michener/shakespeare/**/*$2* | sed '/\/.*\/[A-Za-z0-9]*:/ s/:\s*/:\n/'
|
||||
18
bin/showansicol
Executable file
18
bin/showansicol
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
############################################################
|
||||
# Nico Golde nico@ngolde.de Homepage: http://www.ngolde.de
|
||||
# Letzte Änderung: Mon Feb 16 16:24:41 CET 2004
|
||||
############################################################
|
||||
|
||||
for attr in 0 1 4 5 7 ; do
|
||||
echo "----------------------------------------------------------------"
|
||||
printf "ESC[%s;Foreground;Background - \n" $attr
|
||||
for fore in 30 31 32 33 34 35 36 37; do
|
||||
for back in 40 41 42 43 44 45 46 47; do
|
||||
printf '\033[%s;%s;%sm %02s;%02s ' $attr $fore $back $fore $back
|
||||
done
|
||||
printf '\n'
|
||||
done
|
||||
printf '\033[0m'
|
||||
done
|
||||
|
||||
3
bin/splitquerystring
Executable file
3
bin/splitquerystring
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo $QUERY_STRING | sed 's/%20/ /g' | sed 's/&/\n/g'
|
||||
2
bin/streamvideo
Executable file
2
bin/streamvideo
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
pv /home/michener/src/videostream/testscript.txt $1 | nc -l -p 49300
|
||||
346
bin/tfc
Executable file
346
bin/tfc
Executable file
|
|
@ -0,0 +1,346 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
TFCStrings = { 'he' => [
|
||||
[
|
||||
"a superhumanly strong",
|
||||
"an underprivileged",
|
||||
"a globe-trotting",
|
||||
"an impetuous",
|
||||
"a shy",
|
||||
"a suave",
|
||||
"a notorious",
|
||||
"a one-legged",
|
||||
"an all-American",
|
||||
"a short-sighted",
|
||||
"an otherworldly",
|
||||
"a hate-fuelled",
|
||||
"a scrappy",
|
||||
"an unconventional",
|
||||
"a jaded",
|
||||
"a leather-clad",
|
||||
"a fiendish",
|
||||
"a Nobel prize-winning",
|
||||
"a suicidal",
|
||||
"a maverick",
|
||||
"a bookish",
|
||||
"an old-fashioned",
|
||||
"a witless",
|
||||
"a lounge-singing",
|
||||
"a war-weary",
|
||||
"a scarfaced",
|
||||
"a gun-slinging",
|
||||
"an obese",
|
||||
"a time-tossed",
|
||||
"a benighted",
|
||||
"an uncontrollable",
|
||||
"an immortal",
|
||||
"an oversexed",
|
||||
"a world-famous",
|
||||
"an ungodly",
|
||||
"a fast talking",
|
||||
"a deeply religious",
|
||||
"a lonely",
|
||||
"a sword-wielding",
|
||||
"a genetically engineered",
|
||||
],[
|
||||
"white trash",
|
||||
"zombie",
|
||||
"shark-wrestling",
|
||||
"playboy",
|
||||
"guitar-strumming",
|
||||
"Jewish",
|
||||
"sweet-toothed",
|
||||
"bohemian",
|
||||
"crooked",
|
||||
"chivalrous",
|
||||
"moralistic",
|
||||
"amnesiac",
|
||||
"devious",
|
||||
"drug-addicted",
|
||||
"voodoo",
|
||||
"Catholic",
|
||||
"overambitious",
|
||||
"coffee-fuelled",
|
||||
"pirate",
|
||||
"misogynist",
|
||||
"skateboarding",
|
||||
"arachnophobic",
|
||||
"Amish",
|
||||
"small-town",
|
||||
"Republican",
|
||||
"one-eyed",
|
||||
"gay",
|
||||
"guerilla",
|
||||
"vegetarian",
|
||||
"dishevelled",
|
||||
"alcoholic",
|
||||
"flyboy",
|
||||
"ninja",
|
||||
"albino",
|
||||
"hunchbacked",
|
||||
"neurotic",
|
||||
"umbrella-wielding",
|
||||
"native American",
|
||||
"soccer-playing",
|
||||
"day-dreaming",
|
||||
],[
|
||||
"grifter",
|
||||
"stage actor",
|
||||
"paramedic",
|
||||
"gentleman spy",
|
||||
"jungle king",
|
||||
"hairdresser",
|
||||
"photographer",
|
||||
"ex-con",
|
||||
"vagrant",
|
||||
"filmmaker",
|
||||
"werewolf",
|
||||
"senator",
|
||||
"romance novelist",
|
||||
"shaman",
|
||||
"cop",
|
||||
"rock star",
|
||||
"farmboy",
|
||||
"cat burglar",
|
||||
"cowboy",
|
||||
"cyborg",
|
||||
"inventor",
|
||||
"assassin",
|
||||
"boxer",
|
||||
"dog-catcher",
|
||||
"master criminal",
|
||||
"gangster",
|
||||
"firefighter",
|
||||
"househusband",
|
||||
"dwarf",
|
||||
"librarian",
|
||||
"paranormal investigator",
|
||||
"Green Beret",
|
||||
"waffle chef",
|
||||
"vampire hunter",
|
||||
"messiah",
|
||||
"astronaut",
|
||||
"sorceror",
|
||||
"card shark",
|
||||
"matador",
|
||||
"barbarian",
|
||||
],[
|
||||
"with a robot buddy named Sparky.",
|
||||
"whom everyone believes is mad.",
|
||||
"gone bad.",
|
||||
"with a mysterious suitcase handcuffed to his arm.",
|
||||
"living undercover at Ringling Bros. Circus.",
|
||||
"searching for his wife's true killer.",
|
||||
"who dotes on his loving old ma.",
|
||||
"looking for 'the Big One.'",
|
||||
"who knows the secret of the alien invasion.",
|
||||
"on the edge.",
|
||||
"on a mission from God.",
|
||||
"with a secret.",
|
||||
"in drag.",
|
||||
"",
|
||||
"plagued by the memory of his family's brutal murder.",
|
||||
"looking for a cure to the poison coursing through his veins.",
|
||||
"moving from town to town,
|
||||
helping folk in trouble.",
|
||||
"who must take medication to keep him sane.",
|
||||
"who hangs with the wrong crowd.",
|
||||
"possessed of the uncanny powers of an insect.",
|
||||
"with a winning smile and a way with the ladies.",
|
||||
"fleeing from a secret government programme.",
|
||||
"from the 'hood.",
|
||||
"haunted by an iconic dead American confidante.",
|
||||
"with a passion for fast cars.",
|
||||
"trapped in a world he never made.",
|
||||
"in a wheelchair.",
|
||||
"on the hunt for the last specimen of a great and near-mythical creature.",
|
||||
"on the run.",
|
||||
"for the 21st century.",
|
||||
"who hides his scarred face behind a mask.",
|
||||
"on the wrong side of the law.",
|
||||
"with no name.",
|
||||
"from the Mississippi delta.",
|
||||
"with acid for blood.",
|
||||
"with nothing left to lose.",
|
||||
"haunted by memories of 'Nam.",
|
||||
"on a search for his missing sister.",
|
||||
"on his last day in the job.",
|
||||
"from a doomed world.",
|
||||
"who believes he can never love again.",
|
||||
]
|
||||
], 'she' => [
|
||||
[
|
||||
"a radical",
|
||||
"a green-fingered",
|
||||
"a tortured",
|
||||
"a time-travelling",
|
||||
"a vivacious",
|
||||
"a scantily clad",
|
||||
"a mistrustful",
|
||||
"a violent",
|
||||
"a transdimensional",
|
||||
"a strong-willed",
|
||||
"a ditzy",
|
||||
"a man-hating",
|
||||
"a high-kicking",
|
||||
"a blind",
|
||||
"an elegant",
|
||||
"a supernatural",
|
||||
"a foxy",
|
||||
"a bloodthirsty",
|
||||
"a cynical",
|
||||
"a beautiful",
|
||||
"a plucky",
|
||||
"a sarcastic",
|
||||
"a psychotic",
|
||||
"a hard-bitten",
|
||||
"a manipulative",
|
||||
"an orphaned",
|
||||
"a cosmopolitan",
|
||||
"a chain-smoking",
|
||||
"a cold-hearted",
|
||||
"a warm-hearted",
|
||||
"a sharp-shooting",
|
||||
"an enchanted",
|
||||
"a wealthy",
|
||||
"a pregnant",
|
||||
"a mentally unstable",
|
||||
"a virginal",
|
||||
"a brilliant",
|
||||
"a disco-crazy",
|
||||
"a provocative",
|
||||
"an artistic"
|
||||
],[
|
||||
"tempestuous",
|
||||
"Buddhist",
|
||||
"foul-mouthed",
|
||||
"nymphomaniac",
|
||||
"green-skinned",
|
||||
"impetuous",
|
||||
"African-American",
|
||||
"punk",
|
||||
"hypochondriac",
|
||||
"junkie",
|
||||
"blonde",
|
||||
"goth",
|
||||
"insomniac",
|
||||
"gypsy",
|
||||
"mutant",
|
||||
"renegade",
|
||||
"tomboy",
|
||||
"French-Canadian",
|
||||
"motormouth",
|
||||
"belly-dancing",
|
||||
"communist",
|
||||
"hip-hop",
|
||||
"thirtysomething",
|
||||
"cigar-chomping",
|
||||
"extravagent",
|
||||
"out-of-work",
|
||||
"Bolivian",
|
||||
"mute",
|
||||
"cat-loving",
|
||||
"snooty",
|
||||
"wisecracking",
|
||||
"red-headed",
|
||||
"winged",
|
||||
"kleptomaniac",
|
||||
"antique-collecting",
|
||||
"psychic",
|
||||
"gold-digging",
|
||||
"bisexual",
|
||||
"paranoid",
|
||||
"streetsmart"
|
||||
],[
|
||||
"archaeologist",
|
||||
"pearl diver",
|
||||
"mechanic",
|
||||
"detective",
|
||||
"hooker",
|
||||
"femme fatale",
|
||||
"former first lady",
|
||||
"barmaid",
|
||||
"fairy princess",
|
||||
"magician's assistant",
|
||||
"schoolgirl",
|
||||
"college professor",
|
||||
"angel",
|
||||
"bounty hunter",
|
||||
"opera singer",
|
||||
"cab driver",
|
||||
"soap star",
|
||||
"doctor",
|
||||
"politician",
|
||||
"lawyer",
|
||||
"nun",
|
||||
"snake charmer",
|
||||
"journalist",
|
||||
"bodyguard",
|
||||
"vampire",
|
||||
"stripper",
|
||||
"Valkyrie",
|
||||
"wrestler",
|
||||
"mermaid",
|
||||
"single mother",
|
||||
"safe cracker",
|
||||
"traffic cop",
|
||||
"research scientist",
|
||||
"queen of the dead",
|
||||
"Hell's Angel",
|
||||
"museum curator",
|
||||
"advertising executive",
|
||||
"widow",
|
||||
"mercenary",
|
||||
"socialite"
|
||||
],[
|
||||
"on her way to prison for a murder she didn't commit.",
|
||||
"trying to make a difference in a man's world.",
|
||||
"with the soul of a mighty warrior.",
|
||||
"looking for love in all the wrong places.",
|
||||
"with an MBA from Harvard.",
|
||||
"who hides her beauty behind a pair of thick-framed spectacles.",
|
||||
"with the power to see death.",
|
||||
"descended from a line of powerful witches.",
|
||||
"from a family of eight older brothers.",
|
||||
"with a flame-thrower.",
|
||||
"with her own daytime radio talk show.",
|
||||
"living on borrowed time.",
|
||||
"who can talk to animals.",
|
||||
"prone to fits of savage,
|
||||
blood-crazed rage.",
|
||||
"who don't take no shit from nobody.",
|
||||
"with a knack for trouble.",
|
||||
"who believes she is the reincarnation of an ancient Egyptian queen.",
|
||||
"fleeing from a Satanic cult.",
|
||||
"on the trail of a serial killer.",
|
||||
"with a birthmark shaped like Liberty's torch.",
|
||||
"in the witness protection scheme.",
|
||||
"from out of town.",
|
||||
"from aristocratic European stock.",
|
||||
"living homeless in New York's sewers.",
|
||||
"with only herself to blame.",
|
||||
"from beyond the grave.",
|
||||
"married to the Mob.",
|
||||
"from the wrong side of the tracks.",
|
||||
"from a secret island of warrior women.",
|
||||
"from Mars.",
|
||||
"with someone else's memories.",
|
||||
"from a different time and place.",
|
||||
"operating on the wrong side of the law.",
|
||||
"who inherited a spooky stately manor from her late maiden aunt.",
|
||||
"who dreams of becoming Elvis.",
|
||||
"with a song in her heart and a spring in her step.",
|
||||
"in the wrong place at the wrong time.",
|
||||
"with an incredible destiny.",
|
||||
"with the power to bend men's minds.",
|
||||
"with an evil twin sister."
|
||||
]
|
||||
] }
|
||||
|
||||
def descr(gender)
|
||||
(0..3).to_a.map { |n|
|
||||
TFCStrings[gender][n][rand(TFCStrings[gender][n].size)]
|
||||
}.join(' ').sub(/ $/, '.')
|
||||
end
|
||||
|
||||
puts("He's " + descr('he') + " She's " + descr('she') + ' They fight crime!')
|
||||
35
bin/theyfightcrime
Executable file
35
bin/theyfightcrime
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# They Fight Crime!
|
||||
#
|
||||
# taken from the Javascript at
|
||||
# http://home.epix.net/~mhryvnak/theyfightcrime.html
|
||||
# and translated into python by B. Michener
|
||||
#
|
||||
|
||||
import random
|
||||
|
||||
#init a;
|
||||
a = [0, 1, 2, 3, 4, 5, 6, 7]
|
||||
for i in range(0,8):
|
||||
a[i] = random.randint(0,39)
|
||||
|
||||
he1 = ["a superhumanly strong","an underprivileged","a globe-trotting","an impetuous","a shy","a suave","a notorious","a one-legged","an all-American","a short-sighted","an otherworldly","a hate-fuelled","a scrappy","an unconventional","a jaded","a leather-clad","a fiendish","a Nobel prize-winning","a suicidal","a maverick","a bookish","an old-fashioned","a witless","a lounge-singing","a war-weary","a scarfaced","a gun-slinging","an obese","a time-tossed","a benighted","an uncontrollable","an immortal","an oversexed","a world-famous","an ungodly","a fast talking","a deeply religious","a lonely","a sword-wielding","a genetically engineered"]
|
||||
|
||||
he2 = ["white trash","zombie","shark-wrestling","playboy","guitar-strumming","Jewish","sweet-toothed","bohemian","crooked","chivalrous","moralistic","amnesiac","devious","drug-addicted","voodoo","Catholic","overambitious","coffee-fuelled","pirate","misogynist","skateboarding","arachnophobic","Amish","small-town","Republican","one-eyed","gay","guerilla","vegetarian","dishevelled","alcoholic","flyboy","ninja","albino","hunchbacked","neurotic","umbrella-wielding","native American","soccer-playing","day-dreaming"]
|
||||
|
||||
he3 = ["grifter","stage actor","paramedic","gentleman spy","jungle king","hairdresser","photographer","ex-con","vagrant","filmmaker","werewolf","senator","romance novelist","shaman","cop","rock star","farmboy","cat burglar","cowboy","cyborg","inventor","assassin","boxer","dog-catcher","master criminal","gangster","firefighter","househusband","dwarf","librarian","paranormal investigator","Green Beret","waffle chef","vampire hunter","messiah","astronaut","sorceror","card sharp","matador","barbarian"]
|
||||
|
||||
he4 = ["with a robot buddy named Sparky.","whom everyone believes is mad.","gone bad.","with a mysterious suitcase handcuffed to his arm.","living undercover at Ringling Bros. Circus.","searching for his wife's true killer.","who dotes on his loving old ma.","looking for 'the Big One.'","who knows the secret of the alien invasion.","on the edge.","on a mission from God.","with a secret.","in drag.","","plagued by the memory of his family's brutal murder.","looking for a cure to the poison coursing through his veins.","moving from town to town, helping folk in trouble.","who must take medication to keep him sane.","who hangs with the wrong crowd.","possessed of the uncanny powers of an insect.","with a winning smile and a way with the ladies.","fleeing from a secret government programme.","from the 'hood.","haunted by an iconic dead American confidante","with a passion for fast cars.","trapped in a world he never made.","in a wheelchair.","on the hunt for the last specimen of a great and near-mythical creature.","on the run.","for the 21st century.","who hides his scarred face behind a mask.","on the wrong side of the law.","with no name.","from the Mississippi delta.","with acid for blood.","with nothing left to lose.","haunted by memories of 'Nam.","on a search for his missing sister.","on his last day in the job.","from a doomed world.","who believes he can never love again."]
|
||||
|
||||
she1 = ["a radical","a green-fingered","a tortured","a time-travelling","a vivacious","a scantily clad","a mistrustful","a violent","a transdimensional","a strong-willed","a ditzy","a man-hating","a high-kicking","a blind","an elegant","a supernatural","a foxy","a bloodthirsty","a cynical","a beautiful","a plucky","a sarcastic","a psychotic","a hard-bitten","a manipulative","an orphaned","a cosmopolitan","a chain-smoking","a cold-hearted","a warm-hearted","a sharp-shooting","an enchanted","a wealthy","a pregnant","a mentally unstable","a virginal","a brilliant","a disco-crazy","a provocative","an artistic"]
|
||||
|
||||
she2 = ["tempestuous","Buddhist","foul-mouthed","nymphomaniac","green-skinned","impetuous","African-American","punk","hypochondriac","junkie","blonde","goth","insomniac","gypsy","mutant","renegade","tomboy","French-Canadian","motormouth","belly-dancing","communist","hip-hop","thirtysomething","cigar-chomping","extravagent","out-of-work","Bolivian","mute","cat-loving","snooty","wisecracking","red-headed","winged","kleptomaniac","antique-collecting","psychic","gold-digging","bisexual","paranoid","streetsmart"]
|
||||
|
||||
she3 = ["archaeologist","pearl diver","mechanic","detective","hooker","femme fatale","former first lady","barmaid","fairy princess","magician's assistant","schoolgirl","college professor","angel","bounty hunter","opera singer","cab driver","soap star","doctor","politician","lawyer","nun","snake charmer","journalist","bodyguard","vampire","stripper","Valkyrie","wrestler","mermaid","single mother","safe cracker","traffic cop","research scientist","queen of the dead","Hell's Angel","museum curator","advertising executive","widow","mercenary","socialite"]
|
||||
|
||||
she4 = ["on her way to prison for a murder she didn't commit.","trying to make a difference in a man's world.","with the soul of a mighty warrior.","looking for love in all the wrong places.","with an MBA from Harvard.","who hides her beauty behind a pair of thick-framed spectacles.","with the power to see death.","descended from a line of powerful witches.","from a family of eight older brothers.","with a flame-thrower.","with her own daytime radio talk show.","living on borrowed time.","who can talk to animals.","prone to fits of savage, blood-crazed rage.","who don't take no shit from nobody.","with a knack for trouble.","who believes she is the reincarnation of an ancient Egyptian queen.","fleeing from a Satanic cult.","on the trail of a serial killer.","with a birthmark shaped like Liberty's torch.","in the witness protection scheme.","from out of town.","from aristocratic European stock.","living homeless in New York's sewers.","with only herself to blame.","from beyond the grave","married to the Mob.","from the wrong side of the tracks.","from a secret island of warrior women.","from Mars.","with someone else's memories.","from a different time and place.","operating on the wrong side of the law.","who inherited a spooky stately manor from her late maiden aunt.","who dreams of becoming Elvis.","with a song in her heart and a spring in her step.","in the wrong place at the wrong time.","with an incredible destiny.","with the power to bend men's minds.","with an evil twin sister."]
|
||||
|
||||
print "He's " + he1[a[0]] + " " + he2[a[1]] + " " + he3[a[2]] + " " + he4[a[3]],
|
||||
print "She's " + she1[a[4]] + " " + she2[a[5]] + " " + she3[a[6]] + " " + she4[a[7]],
|
||||
print "They fight crime!"
|
||||
87
bin/touchhtml
Executable file
87
bin/touchhtml
Executable file
|
|
@ -0,0 +1,87 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Globals
|
||||
#
|
||||
use vars qw/$deftext %opt /;
|
||||
|
||||
#
|
||||
# Command line options processing
|
||||
#
|
||||
sub init()
|
||||
{
|
||||
use Getopt::Std;
|
||||
my $opt_string = 'hpci:o:t:j:';
|
||||
getopts( "$opt_string", \%opt ) or usage();
|
||||
usage() if $opt{h};
|
||||
}
|
||||
|
||||
#
|
||||
# Message about this program and how to use it
|
||||
#
|
||||
sub usage()
|
||||
{
|
||||
print STDERR << "EOF";
|
||||
|
||||
touchhtml -- Create a barebones HTML file
|
||||
|
||||
usage: $0 [-hpc][-i <FILE>][-o <FILE>][-t <TITLE>]
|
||||
|
||||
-h : This (help) message
|
||||
-p : Add <pre> tags
|
||||
-c : Print "Content-type" at the start (for CGI)
|
||||
-i FILE : Read body from given filename
|
||||
-o FILE : Output to given filename
|
||||
-t TITLE : Set the HTML <TITLE> field to given title
|
||||
-j FILE : Include this JavaScript filename in the body
|
||||
|
||||
EOF
|
||||
exit;
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
|
||||
if (!$opt{o}) {
|
||||
open(FILEH, ">-");
|
||||
}
|
||||
else
|
||||
{
|
||||
open(FILEH, ">$opt{o}") || die "Cannot open file for writing!";
|
||||
}
|
||||
|
||||
if ($opt{c}) {
|
||||
print "Content-type: text/html\n\n";
|
||||
}
|
||||
|
||||
print FILEH <<FOO;
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>$opt{t}</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
FOO
|
||||
print FILEH "<pre>\n" if $opt{p};
|
||||
if ($opt{i})
|
||||
{
|
||||
open (INFILE, "<$opt{i}") || die "Cannot open file for reading!";
|
||||
while (<INFILE>)
|
||||
{
|
||||
print FILEH;
|
||||
}
|
||||
close(INFILE);
|
||||
}
|
||||
elsif (!(-t STDIN))
|
||||
{
|
||||
while (<STDIN>)
|
||||
{
|
||||
print FILEH;
|
||||
}
|
||||
}
|
||||
print FILEH "</pre>\n" if $opt{p};
|
||||
print FILEH "<script src='$opt{j}'>\n</script>\n" if $opt{j};
|
||||
print FILEH <<FOO;
|
||||
</BODY>
|
||||
</HTML>
|
||||
FOO
|
||||
|
||||
close(FILEH);
|
||||
73
bin/unborkify
Executable file
73
bin/unborkify
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
#!/usr/local/bin/perl
|
||||
|
||||
use Getopt::Std;
|
||||
getopts('u');
|
||||
|
||||
$user = (getpwuid($<))[0];
|
||||
|
||||
%maps = (
|
||||
'a' => "\340\341\342\343\344\345",
|
||||
'c' => "\242\347",
|
||||
'd' => "\360",
|
||||
'e' => "\350\351\352\353",
|
||||
'i' => "\354\355\356\357",
|
||||
'n' => "\361",
|
||||
'o' => "\272\362\363\364\365\366\370",
|
||||
'p' => "\376",
|
||||
'q' => "\266",
|
||||
'u' => "\265\371\372\373\374",
|
||||
'x' => "\244\327",
|
||||
'y' => "\375",
|
||||
'A' => "\300\301\302\303\304\305",
|
||||
'B' => "\337",
|
||||
'C' => "\307\251",
|
||||
'D' => "\320",
|
||||
'E' => "\310\311\312\313",
|
||||
'I' => "\314\315\316\317",
|
||||
'L' => "\243",
|
||||
'N' => "\321",
|
||||
'O' => "\322\323\324\325\326",
|
||||
'P' => "\336",
|
||||
'R' => "\256",
|
||||
'U' => "\331\332\333\334",
|
||||
'Y' => "\245\335",
|
||||
'!' => "\241",
|
||||
'>' => "\273",
|
||||
'<' => "\253",
|
||||
'"' => "\250",
|
||||
'+' => "\367",
|
||||
'|' => "\246",
|
||||
',' => "\270",
|
||||
'?' => "\277",
|
||||
'0' => "\330",
|
||||
'2' => "\262",
|
||||
'3' => "\263"
|
||||
);
|
||||
|
||||
$| = 1;
|
||||
|
||||
while (<>) {
|
||||
CHAR: for $i (0..(length($_) - 1)) {
|
||||
$c = substr($_,$i,1);
|
||||
|
||||
# if ($c eq 'A' && substr($_,$i+1,1) eq 'E') {
|
||||
# print "\306";
|
||||
# $skip = 1; next;
|
||||
# } elsif ($c eq 'a' && substr($_,$i+1,1) eq 'e') {
|
||||
# print "\346";
|
||||
# $skip = 1; next;
|
||||
# } else {
|
||||
# print((defined $maps{$c}) ?
|
||||
# substr($maps{$c}, int rand(length($maps{$c})), 1) : $c);
|
||||
# }
|
||||
|
||||
for $x (keys %maps) {
|
||||
if ($maps{$x} =~ /\Q$c/) {
|
||||
print $x;
|
||||
next CHAR;
|
||||
}
|
||||
}
|
||||
|
||||
print $c;
|
||||
}
|
||||
}
|
||||
8
bin/vee
Executable file
8
bin/vee
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/perl
|
||||
open(OUTPIPE, "$ARGV[0]") || die;
|
||||
while(<STDIN>)
|
||||
{
|
||||
print STDOUT $_;
|
||||
print OUTPIPE $_;
|
||||
}
|
||||
close(OUTPIPE);
|
||||
120
bin/wd
Executable file
120
bin/wd
Executable file
|
|
@ -0,0 +1,120 @@
|
|||
#! /usr/bin/perl -w
|
||||
#
|
||||
# wd - what doing? get/set your twitter.com status
|
||||
# version 1.07, 2007-01-09
|
||||
#
|
||||
# Copyright (c) 2007, Andrew J. Cosgriff, http://polydistortion.net/
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
#
|
||||
# * The names of its contributors may not be used to endorse or
|
||||
# promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##########
|
||||
#
|
||||
# Configuration:
|
||||
#
|
||||
# set your username (e-mail address) and password here.
|
||||
#
|
||||
# note that you'll need to put a backslash \ in front of the @-sign in your
|
||||
# e-mail address.
|
||||
#
|
||||
my $username = "";
|
||||
my $password = "";
|
||||
##########
|
||||
use strict;
|
||||
use JSON;
|
||||
use LWP;
|
||||
use Getopt::Std;
|
||||
use DateTime::Format::Strptime;
|
||||
|
||||
my $ua = LWP::UserAgent->new;
|
||||
$ua->credentials('twitter.com:80','Twitter API',$username,$password);
|
||||
|
||||
my %opts = ();
|
||||
getopts('pvs', \%opts);
|
||||
|
||||
if (defined $opts{'p'}) {
|
||||
$ua->env_proxy;
|
||||
}
|
||||
|
||||
if ((! defined $opts{'s'}) and ($#ARGV > 0)) {
|
||||
print "[warning] hmm, are you sure you didn't mean to add a -s to that?\n\n";
|
||||
}
|
||||
|
||||
if (defined $opts{'s'}) {
|
||||
if ($#ARGV < 0) {
|
||||
print "well, what are you doing?\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $response = $ua->post('http://twitter.com/statuses/update.json',
|
||||
[ "status" => join(' ',@ARGV) ]);
|
||||
|
||||
die "Wrong content-type (",$response->content_type,") received - was expecting application/json\n"
|
||||
unless $response->content_type =~ m/^application\/json/;
|
||||
|
||||
my $status = jsonToObj($response->content);
|
||||
my %user = %{$status};
|
||||
if (defined $opts{'v'}) {
|
||||
print "status set to: ",$user{'text'},"\n";
|
||||
}
|
||||
} else {
|
||||
my $response = $ua->get('http://twitter.com/statuses/friends.json');
|
||||
|
||||
die "Can't get Twitter status: ", $response->status_line
|
||||
unless $response->is_success;
|
||||
|
||||
die "Wrong content-type (",$response->content_type,") received - was expecting application/json\n"
|
||||
unless $response->content_type =~ m/^application\/json/;
|
||||
|
||||
my $status = jsonToObj($response->content);
|
||||
my $strp = new DateTime::Format::Strptime(
|
||||
pattern => '%a %b %d %T %z %Y',
|
||||
locale => 'en_AU',
|
||||
time_zone => 'Australia/Melbourne',
|
||||
);
|
||||
my %stati=();
|
||||
foreach my $userobj (@{$status}) {
|
||||
my %user=%{$userobj};
|
||||
next if ((($#ARGV >= 0) and
|
||||
($user{screen_name} !~ m/$ARGV[0]/))
|
||||
or (! defined $user{status}));
|
||||
|
||||
$stati{$user{screen_name}}{"text"} = $user{status}->{text};
|
||||
$stati{$user{screen_name}}{"rel"} = $user{status}->{relative_created_at};
|
||||
$stati{$user{screen_name}}{"date"} = DateTime::Format::Strptime::strftime("%s",$strp->parse_datetime($user{status}->{created_at}));
|
||||
}
|
||||
|
||||
foreach my $user (sort {$stati{$a}{"date"} cmp $stati{$b}{"date"};} keys %stati) {
|
||||
print "$user ",$stati{$user}{text}," (",$stati{$user}{"rel"},")\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BIN
bin/wye
Executable file
BIN
bin/wye
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue