Add some useful functions
This commit is contained in:
parent
cecf6d5dee
commit
80f4385fc3
1
Makefile
1
Makefile
|
@ -17,6 +17,7 @@ install-zsh:
|
|||
ln -s `pwd`/zsh/zsh_plugins.txt ~/.zsh_plugins.txt
|
||||
ln -s `pwd`/zsh/aliases.zsh ~/.aliases.zsh
|
||||
ln -s `pwd`/zsh/variables.zsh ~/.variables.zsh
|
||||
ln -s `pwd`/zsh/functions.zsh ~/.functions.zsh
|
||||
|
||||
install-mbsync:
|
||||
rm -f ~/.mbsyncrc
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
cdgopath ()
|
||||
{
|
||||
cd $GOPATH
|
||||
}
|
||||
# Connect to ssh without recording host-key
|
||||
sshtmp ()
|
||||
{
|
||||
ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "$@"
|
||||
}
|
||||
|
||||
# Do an SCP without recording, or prompting for host keys.
|
||||
scptmp ()
|
||||
{
|
||||
scp -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "$@"
|
||||
}
|
||||
|
||||
|
||||
# Recursively delete python related unwanted files
|
||||
nukepy ()
|
||||
{
|
||||
find . -regextype posix-egrep -regex '.*\.pyc|.*\.pyo|.*~' -delete;
|
||||
}
|
||||
|
||||
# Recursively delete latex related unwanted files
|
||||
nuketex ()
|
||||
{
|
||||
find . -regextype posix-egrep -regex '.*\.aux|.*\.log|.*\.idx|.*\.toc|.*\.thm|.*\.bbl|.*\.blg|.*\.out|.*\.lol|.*\.lot|.*\.lof|.*~' -delete;
|
||||
}
|
||||
|
||||
# Check running process
|
||||
pp ()
|
||||
{
|
||||
ps aux | awk '!/awk/ && $0~var' var=${1:-".*"} ;
|
||||
}
|
||||
|
||||
# For pypath
|
||||
pypath ()
|
||||
{
|
||||
output=$(pypath.py $*);
|
||||
if [ $1 = 'show' ]; then
|
||||
echo $output;
|
||||
else
|
||||
eval $output;
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue