Skip to content

Commit

Permalink
remove unused stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
claytron committed Jun 12, 2018
1 parent 7c872f5 commit a7f1a02
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 303 deletions.
2 changes: 0 additions & 2 deletions .bash_profile
Expand Up @@ -4,5 +4,3 @@ source ~/.commonprofile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
2 changes: 0 additions & 2 deletions .bashrc
Expand Up @@ -59,6 +59,4 @@ PS1="$PR_IMPOSTER\n\d \A | \w\n\h\$ "
# load up server specific extras
source ~/.bash_extras

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

[ -f ~/.fzf.bash ] && source ~/.fzf.bash
40 changes: 2 additions & 38 deletions .commonenv
@@ -1,5 +1,3 @@
#!/usr/bin/env bash
UNAME=$(uname)
source ~/.commonfuncs

# let's set a proper PATH
Expand All @@ -11,42 +9,25 @@ new_path=""
expected_path=(
"$HOME/.dotfiles"
./bin
"$HOME/bin/$MACHTYPE-$OSTYPE"
"$HOME/bin"
"$HOME/bin/git_achievements"
"$HOME/.rbenv/shims"
"$HOME/.rbenv/versions/2.3.3/bin"
"$HOME/.rbenv/versions/2.2.6/bin"
"$HOME/.rvm/bin"
"$HOME/.gem/ruby/1.8/bin"
"$HOME/.cargo/bin"
"$HOME/Documents/android-sdk-mac-x86_64-20140321/tools"
"$HOME/Documents/android-sdk-mac-x86_64-20140321/platform-tools"
"$HOME/node_modules/jshint/bin"
/usr/local/texlive/2015/bin/x86_64-darwin
/usr/share/elasticsearch/bin
/opt/php53/bin
/opt/local/apache2/bin
/opt/python/bin
/opt/local/bin
/opt/local/sbin
/opt/local/lib/postgresql94/bin
/opt/local/lib/postgresql93/bin
/opt/local/lib/postgresql91/bin
/opt/local/lib/postgresql90/bin
/opt/local/lib/postgresql83/bin
/usr/local/opt/mysql@5.6/bin
/opt/local/lib/postgresql95/bin
/usr/local/opt/mysql@5.7/bin
/opt/local/lib/mysql56/bin
/opt/local/lib/mysql55/bin
/opt/local/lib/mysql57/bin
/opt/local/lib/mysql5/bin
/opt/local/lib/mysql4/bin
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin
/opt/local/libexec/qt5/bin
/usr/local/opt/qt/bin
/usr/local/opt/node@6/bin
/fuck/bin
/sw/bin
/sw/sbin
/usr/bin/perlbin/site
Expand Down Expand Up @@ -143,23 +124,6 @@ export PYTHONSTARTUP=$HOME/.pystartup
# You should see a version number and NOT 'editline'
[ -d "/opt/local" ] && export RUBY_CONFIGURE_OPTS="--with-readline-dir=/opt/local"

# set up some more OS X specific stuff
if [ "$UNAME" = "Darwin" ]; then
# Figure out the major and minor version of OS X
os_majorversion=$(sw_vers | awk '/ProductVersion/ {print $2}' | cut -f2 -d'.')
os_minorversion=$(sw_vers | awk '/ProductVersion/ {print $2}' | cut -f3 -d'.')

# to not tar up resource forks, you'll need this
if [ "$os_majorversion" -ge 5 ]; then
# Leopard version (and beyond??)
export COPYFILE_DISABLE="True"
elif [ "$os_majorversion" -eq 4 ] && [ "$os_minorversion" -ge 6 ]; then
# Tiger version
export COPY_EXTENDED_ATTRIBUTES_DISABLE="True"
fi

fi

# colors!!!
###########

Expand Down
42 changes: 0 additions & 42 deletions .commonfuncs
Expand Up @@ -85,28 +85,6 @@ checkPath() {
which $1 &>/dev/null
}

isiPhone() {
if checkPath sw_vers; then
[ $(sw_vers | awk '/ProductName/ {print $2}') = "iPhone" ] && return 0
fi
return 1
}

# a little function to print the full path to a file.
fullpath() {
local fullpath
fullpath=$(pwd)/$1
echo -n "\"$fullpath\""

# on OS X copy it to the clipboard too :)
if checkPath pbcopy && [ $UNAME = "Darwin" ]; then
echo -n "\"$fullpath\"" | pbcopy
fi

# on linux use xclip to copy to the clipboard
checkPath xclip && echo -n "\"$fullpath\"" | xclip
}

weShouldUpdate() {
local time_to_update
local time_marker
Expand Down Expand Up @@ -138,26 +116,6 @@ weShouldUpdate() {
return 1
}

search_movies() {
local movies
movies=`/Applications/Plex\ Media\ Server.app/Contents/MacOS/Plex\ Media\ Scanner -l -c 1 | awk -F: '{print $2}'`
echo $movies | grep -i $1
}

tmh() {
[[ -z "$1" ]] && echo 'project name is required' && return 1
local location
export T_PROJ=$1
[[ -z "$2" ]] && location=local || location="$2"
if [[ -n "$3" ]]; then
export T_BUILD="$3"
fi
if [[ -n "$4" ]]; then
export T_PREFIX="$4"
fi
teamocil --here $location
}

# Git stash + fzf = awesome
stache() {
which fzf &>/dev/null || (echo "fzf is not installed. Install it and try again"; return)
Expand Down
122 changes: 0 additions & 122 deletions .commonrc
Expand Up @@ -152,14 +152,6 @@ alias rum='ru default@mailcatcher'
# bundler
alias be='bundle exec'

# Zeus.
alias z='zeus'
alias zss='z start'
alias zs='z server Puma -p 3001'
alias zc='z console'
alias zr='z rake'
alias zt='z test'

# Vagrant ssh commands
alias vssh="vagrant ssh"

Expand All @@ -170,11 +162,6 @@ vsbe() {
vagrant ssh -c "cd /vagrant && bundle exec $*"
}

# I have a folder of custom made fortunes...
if checkPath fortune && [ -d /opt/local/share/games/fortune/comedy ]; then
alias laugh='echo; fortune comedy ;echo'
fi

# make cp and move ask before replacing files
alias cp='cp -iv'
alias mv='mv -i'
Expand Down Expand Up @@ -208,7 +195,6 @@ alias lsdot='lsd .*'
alias df='df -h'

# tar aliases. ignore OS X meta files
# NOTE: on OS X tar is freaked out by resource forks. see .zshenv for the fix.
alias targzc='tar --exclude=".DS_Store" --exclude="*pyc" -zcvf'
alias tarbzc='tar --exclude=".DS_Store" --exclude="*pyc" -jcvf'
alias targzx='tar -zxvf'
Expand Down Expand Up @@ -240,11 +226,6 @@ elif checkPath xdg-open; then
alias open=xdg-open
fi

# etckeeper aliases
alias etck="sudo etckeeper"
alias etckv="etck vcs"
alias etcks="etckv status"

# Shortened commands
alias g=git
alias s=svn
Expand Down Expand Up @@ -297,106 +278,3 @@ fi
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

## Functions

# start up a buildout given a myriad of ways to try
function bfg() {
ACTION="start"
# Any argument causes a shutdown
[[ -n "$1" ]] && ACTION="stop"

instance=
instance_names=(instance client)
# Devine an instance executable, sometimes called "client", and sometimes with a number
for i in "${instance_names[@]}"
do
if [[ -x "bin/$i" ]]; then
instance=$i
break
elif [[ -x "bin/${i}1" ]]; then
instance="${i}1"
break
fi
done

zeo=
zeo_names=(zeo zeoserver)
# Devine a zeo executable, most of the time either zeoserver or zeo
for i in "${zeo_names[@]}"
do
if [[ -x "bin/$i" ]]; then
zeo=$i
break
fi
done

# start or stop a supervisor based install
if [ -x bin/supervisord ]; then
if [[ $ACTION == "start" ]]; then
bin/supervisord
# XXX: instance shouldn't be set, but seems to be anyway...
if [ -x "bin/$instance" ]; then
"bin/$instance" fg
fi
else
bin/supervisorctl shutdown
fi
# use the old control script
elif [ -x bin/control ]; then
if [[ $ACTION == "start" ]]; then
bin/control fg
else
bin/control stop
fi
# use the new control script
elif [ -x scripts/control ]; then
if [[ $ACTION == "start" ]]; then
scripts/control fg
else
scripts/control stop
fi
# no script, just use the executables directly
elif [ -n "$zeo" ] && [ -n "$instance" ]; then
if [[ $ACTION == "start" ]]; then
"bin/$zeo" start
"bin/$instance" fg
else
"bin/$zeo" stop
fi
# no zeoserver, just use the instance
elif [[ $ACTION == "start" ]] && [ -n "$instance" ]; then
"bin/$instance" fg
else
print "Couldn't find a start script. Is this a third party buildout?"
fi
}

# launch a VMWare vm in the background
#
# Set $VM_LIBRARY and $VM_VMRUN to alternate locations if
# necessary
export VM_LIBRARY="$HOME/Documents/Virtual Machines.localized"
if [ -e "/Library/Application Support/VMWare Fusion/vmrun" ]; then
export VM_VMRUN="/Library/Application Support/VMware Fusion/vmrun"
else
export VM_VMRUN="/Applications/VMware Fusion.app/Contents/Library/vmrun"
fi
function noguivm() {
local vmx_name
local vm_location
# the vmx filename will be based on the first arg given
vmx_name="$1.vmwarevm/$1.vmx"
# We will default to FreeBSD since that is the one used most
[ -z "$1" ] && vmx_name="FreeBSD.vmwarevm/FreeBSD.vmx"
vm_location="$VM_LIBRARY/$vmx_name"
# If that file exists, let's start up the VM
# XXX: couldn't get the test to work...
if [[ -e $vm_location ]]; then
print "Starting $vm_location"
# XXX: This is silly, wtf.
eval "'$VM_VMRUN'" -T fusion start "'$vm_location'" nogui
else
print "VM not available: $vm_location"
fi
}
31 changes: 3 additions & 28 deletions .zshrc
Expand Up @@ -7,19 +7,8 @@ hash -d P=$HOME/work/projects
hash -d PP=$HOME/work/presentation
hash -d D=$HOME/Documents
[ -d "$HOME/Sites" ] && hash -d S=$HOME/Sites
[ -d /usr/local/etc/rc.d ] && hash -d R=/usr/local/etc/rc.d
[ -d /var/db/zope ] && hash -d Z=/var/db/zope
[ -d /data ] && hash -d Z=/data

# OS X specific settings
if [ $UNAME = "Darwin" ]; then
# Set up global aliases for copy / pasting in tmux
if checkPath reattach-to-user-namespace && [ -n "$TMUX" ]; then
alias -g pbcopy="reattach-to-user-namespace pbcopy"
alias -g pbpaste="reattach-to-user-namespace pbpaste"
fi
fi

# set up common aliases between shells
source $HOME/.commonrc

Expand Down Expand Up @@ -183,22 +172,10 @@ export HISTFILE HISTSIZE SAVEHIST
export TMOUT=900
function TRAPALRM() { histappend }

## old style completions
# supervisor
if checkPath supervisorctl; then
# set up completions for supervisor
compctl -s "$(supervisorctl status >/dev/null 2>&1 | awk -F' ' '{print $1}')" supervisorctl
# custom completions
if [ -d '/usr/share/games/fortunes' ]; then
compctl -s '$(\ls /usr/share/games/fortunes | grep .dat | sed "s/.dat//")' fortune makeMeLaugh lulz
fi
# zope
compctl -s 'fg kill start logreopen reload shell status wait help logtail restart show stop' zeoserver zeoctl
compctl -s 'fg kill start logreopen reload shell status wait help logtail restart show stop run adduser test debug' instance zopectl

# gitify completion
compctl -s 'fetch gitify help h push update up' gitify

# noguivm completions
compctl -s '$(\ls -d $VM_LIBRARY/*.vmwarevm | sed -e "s|$VM_LIBRARY/||" -e "s/.vmwarevm//")' noguivm
compctl -s '$(\ls /opt/local/share/games/fortune | grep .dat | sed "s/.dat//")' fortune makeMeLaugh lulz

## Completions
autoload -U compinit
Expand Down Expand Up @@ -250,6 +227,4 @@ if [ -z $MY_ZSH_PLUGINS_LOADED ] && is-at-least 4.3; then
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=white,bold,bg=blue'
fi

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

0 comments on commit a7f1a02

Please sign in to comment.