Monthly Archives: October 2013

A Quick Way to Test Rest Web Services

Image

Photo “Seagulls on the American River” courtesy of Vince Mig.

Testing a Rest API

When I think of rest, it’s usually the type that requires a bed or comfortable couch. But these days I am spending more time verifying intermediate components of a larger system that take advantage of the synchronous behavior known as a restful web service than working on web GUI interfaces.

Continue reading

My Customizations in ZSH

I have added the following as oh-my-zsh custom plugins. I did this because I like to sync my customizations between computers, but I don’t want them all to be active on every computer. I can tailor that with my .zshrc
plugins=(git ruby gem mvn rvm sublime safepaste autojump ushare pipe directory hardware ackgrep  command-not-found)

directory.plugin.zsh – this is supposed to be mostly directory stuff, but I added in my autojump statistics, disk space, and tar/zip commands. Seemed relevant to me.

alias as='autojump -s'
alias po='popd'
alias pu='pushd'
alias home='cd ~/'

alias md='mkdir -p'
alias mkdir='mkdir -p'
alias RF='rm -rf '
alias path='echo -e ${PATH//:/\\n}'

alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias lsa='ls -a'
alias ll='ls -l'
alias lla='ls -la'
alias la='ls -a'
alias lf='ls *(.)' #just files
alias ld='ls *(/)' #just directories
alias df='df -kTh'
alias du='du -kh'
alias tj='tar -xvjpf '
alias t='tar xvfz '
alias tz='tar -xvzpf '
alias tb='tar -xvfj '

ackgrep.plugin.zsh – I called it ackgrep (my favorite seach tool), but I use it for searching just about anything that would otherwise be annoying.

alias a='ack-grep '
alias apage='ack-grep --pager=less -r'
alias ainvert='ack-grep -v '
alias ag='which '
agg() { ack-grep -H $* $ZSH_CUSTOM }

alias f='find . |grep -v svn |grep '
alias findjar='find . -type f -name  *.jar |xargs -n1 -i -t  jar tvf {} |grep '

alias h='history'
alias hg='history|grep -v grep|grep ' 
alias hgg='history|grep '

alias pg='ps -eaf|grep -v grep|grep ' 
alias pgg='ps -eaf|grep '

alias lg='lla|grep '

pipe.plugin.zsh – I found these in a customization, either on the internet or on a VM that somebody created for me (probably from Steve G). I can’t even remember I have them, but when I do it’s easy living.

alias -g DN=/dev/null
alias -g EG='|& egrep'
alias -g EH='|& head'
alias -g EL='|& less'
alias -g ELS='|& less -S'
alias -g ETL='|& tail -20'
alias -g ET='|& tail'
alias -g F=' | fmt -'
alias -g G='| egrep'
alias -g H='| head'
alias -g HL='|& head -20'
alias -g LL="2>&1 | less"
alias -g L="| less"
alias -g LS='| less -S'
alias -g MM='| most'
alias -g M='| more'
alias -g NE="2> /dev/null"
alias -g NS='| sort -n'
alias -g NUL="> /dev/null 2>&1"
alias -g PIPE='|'
alias -g R=' > /c/aaa/tee.txt '
alias -g RNS='| sort -nr'
alias -g Sk="*~(*.bz2|*.gz|*.tgz|*.zip|*.z)"
alias -g S='| sort'
alias -g TL='| tail -20'
alias -g T='| tail'
alias -g TF='| tail -f '
alias -g TFN='| tail -f -n '
alias -g US='| sort -u'
alias -g VM=/var/log/messages
alias -g X0G='| xargs -0 egrep'
alias -g X0='| xargs -0'
alias -g XG='| xargs egrep'
alias -g X='| xargs'

ruby.plugin.zsh – some of these are in the standard ruby plugin. I wanted more because rvm doesn’t cooperate as much as it should on my zsh.

alias sgem='sudo gem'

# Find ruby file
alias rfind='find . -name "*.rb" | xargs grep -n'

# #RVM & Ruby
alias rvm_login='/bin/zsh --login'
alias rl='rvm_login && rvm use 2.0.0'
alias ru='rvm gemset use '
alias rv='rvm use '
alias gg='gem list|grep '
alias bu='bundle update'

# Add RVM to PATH for scripting
export PATH=$PATH:$HOME/.rvm/bin

#yard
alias yd='yardoc features/**/*.feature features/**/*.rb lib/**/*.rb'

hardware.plugin.zsh – this is just to help me with my laptop annoyances. Like that stupid touchpad that my wrist rests on while I type.

getID() {
	xinput list|grep "Synaptics TouchPad"|awk '{print $6 }'|cut -d'=' -f2
}

alias laptopprimary='xrandr --output LVDS --primary'alias tpf='xinput set-prop `getID` "Device Enabled" 0'
alias tpn='xinput set-prop `getID` "Device Enabled" 1'

References: