Made changes

This commit is contained in:
Austen Adler 2016-01-26 13:47:55 -05:00
parent 0772801384
commit 547bd1ca9e
2 changed files with 30 additions and 21 deletions

View File

@ -17,7 +17,11 @@ fi
export DISABLE_AUTO_TITLE=true
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$(readlink -e ~/bin)"
export EDITOR='vim'
function asroot(){
# For pasting in commands that start with $
$ () {
$*
}
asroot(){
# Use temporary file for added security
TEMPFILE=$(tempfile)
xauth extract $TEMPFILE $DISPLAY
@ -29,7 +33,7 @@ dsl() {
shift
done
}
function dedir(){
dedir(){
mv "$1"/* .
rmdir "$1"
if (( !? != 0 )); then
@ -56,7 +60,7 @@ alias ll='ls -AlhF'
alias la='ls -A'
alias l='ls -CF'
alias logout='sudo pkill -u $USER'
function rsh(){
rsh(){
if [ -z $1 ] ; then
echo "Valid hostnames:"
cat /home/stonewareslord/syncthing/shared/ips
@ -71,7 +75,7 @@ function rsh(){
echo "SSH to $ADDR..."
tsh $ADDR $*
}
function fixsh(){
fixsh(){
sed -i -e $1"d" ~/.ssh/known_hosts
}
alias tmux='tmux -2'
@ -79,8 +83,8 @@ alias less='less -R'
alias tree='tree -C'
alias skim="(head -5; tail -5) <"
alias cp='rsync --partial -ha --info=progress2 "$@"'
function mv() { /bin/mv -v "$@" }
function m() { mv "$@" }
mv() { /bin/mv -v "$@" }
m() { mv "$@" }
compdef _cp c m mv cp copy
alias dt='date "+%F %T"'
alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done'
@ -104,7 +108,7 @@ if test -f /etc/gentoo-release; then
echo "args: $*"
sudo zsh -c "emerge --autounmask-write -av $*"
}
function update(){
update(){
# If this is a server computer
if [ "$(hostname|cut -b1)" = "S" ] ; then
echo "You're a server. Exiting"
@ -163,22 +167,22 @@ alias -g L="2>&1|less"
#alias -g L="2>&1|vimpager"
alias -g G='|& ag'
export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x'
function ctar(){
ctar(){
tar -cf - $@|pv -WcN tar|gzip|pv -WcN gzip
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
}
function offline(){
offline(){
if [ ! -z "$@" ] ; then
sudo unshare -n -- sudo -u stonewareslord zsh -c "$@"
else
sudo unshare -n -- sudo -u stonewareslord LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh
fi
}
function smon(){
smon(){
timeout 1s pdsh -R ssh -w 10.0.1.196,10.0.1.207 "$@"
}
function dnstest(){
dnstest(){
echo "resolv.conf:"
cat /etc/resolv.conf
echo "Testing DNS:"
@ -191,7 +195,7 @@ function dnstest(){
echo "Testing DNS"
curl ifconfig.me
}
function cinitify(){
cinitify(){
mkdir $2
cd $2
git init
@ -216,7 +220,7 @@ function cinitify(){
git checkout master
fi
}
function initify(){
initify(){
git init
git remote add origin git@austenwares.com:$1/$2.git
git remote add https https://austenwares.com/gitlab/$1/$2.git
@ -232,7 +236,7 @@ function initify(){
git checkout master
fi
}
function tsh(){
tsh(){
ssh $* -X
if which ponysay >/dev/null; then
ponysay "Connection closed!"
@ -240,11 +244,11 @@ function tsh(){
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
fi
}
function mcl(){
mcl(){
mkdir -p $1
cd $1
}
function rc(){
rc(){
case $1 in
z) vim ~/.zshrc;;
v) vim ~/.vimrc;;
@ -257,7 +261,7 @@ function rc(){
*) echo "Opts:\nz v i\nuse make unmask mask accept_keywords"
esac
}
function pub-git-init(){
pub-git-init(){
# Get the project name
branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -r -e 's/^.+\///' -e 's/#.+$//' -e 's/\.git$//' | head -n1)
echo "Branch: $branch"
@ -269,7 +273,7 @@ function pub-git-init(){
git config remote.ncsu.gcrypt-participants "CCDFE3F1"
git config remote.gitlab.gcrypt-participants "CCDFE3F1"
}
function pub-git-rm(){
pub-git-rm(){
if (( $# == 0 )) ; then
git remote rm local
git remote rm ncsu
@ -280,7 +284,7 @@ function pub-git-rm(){
shift
done
}
function pub-git-push(){
pub-git-push(){
if (( $# == 0 )) ; then
git push local --all && git push local --tags
git push ncsu --all && git push ncsu --tags
@ -291,7 +295,7 @@ function pub-git-push(){
shift
done
}
function pub-git-clone(){
pub-git-clone(){
case $1 in
ncsu) remote="gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#" ;;
gitlab) remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#" ;;
@ -306,7 +310,7 @@ function pub-git-clone(){
branch=$(echo $1 | sha512sum | cut -d\ -f1)
git clone "$remote$branch" $1
}
function k(){
k(){
#More than 1 arguement
if [[ $# > 1 ]] ; then
vim $@

View File

@ -2,6 +2,8 @@
if has('conceal')
set conceallevel=2 concealcursor=i
endif
let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
let g:formatters_cpp = ['my_custom_cpp']
let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s3 -xG -S -K -N -xn -xl -n -p -H"'
let g:formatters_java = ['my_custom_java']
let g:UltiSnipsUsePythonVersion=3
@ -188,6 +190,9 @@ let g:ctrlp_custom_ignore = {
let g:airline_left_sep='▶'
let g:airline_right_sep='◀'
let g:airline#extensions#syntastic#enabled=0
let g:ycm_show_diagnostics_ui=0
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
let g:airline#extensions#whitespace#enabled=0
let g:airline#extensions#whitespace#show_message=0
let g:airline#extensions#tmuxline#enabled=1