mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
changed some files.
This commit is contained in:
parent
90c28b786a
commit
d6be37aa32
5 changed files with 252 additions and 14 deletions
|
|
@ -16,11 +16,32 @@ alias please='sudo'
|
|||
alias history='fc -l 1'
|
||||
|
||||
# List direcory contents
|
||||
alias lsa='ls -lah'
|
||||
alias l='ls -la'
|
||||
alias ll='ls -l'
|
||||
alias la='ls -lA'
|
||||
alias sl=ls # often screw this up
|
||||
alias ls='gls --color=tty -hF'
|
||||
alias ll='gls --color=tty -lhFa'
|
||||
alias l='gls --color=tty -lhF'
|
||||
alias ss='open -a /System/Library/Frameworks/ScreenSaver.framework//Versions/A/Resources/ScreenSaverEngine.app'
|
||||
alias node="ssh rever@andrewfree.com"
|
||||
alias irc="ssh -t root@andrewfree.com screen -r"
|
||||
alias gfr="git fetch && git rebase remotes/origin/master"
|
||||
|
||||
|
||||
alias afind='ack-grep -il'
|
||||
|
||||
# Open in textmate
|
||||
alias o='subl $1'
|
||||
alias zshconfig='subl ~/.zshrc'
|
||||
alias ohmyzsh='subl ~/.oh-my-zsh'
|
||||
alias ft='open -g /opt/local/bin/ft.app/' # Launch terminal window of top finder window
|
||||
alias oo='open .'
|
||||
alias rm='/opt/local/bin/MacRm'
|
||||
alias rrm='/bin/rm'
|
||||
alias bp='bpython-2.7'
|
||||
|
||||
|
||||
alias ipx="curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'"
|
||||
alias mnode="sshfs root@andrewfree.com:/ /Users/rever/nodessh/"
|
||||
alias mtech="echo vjW5zWfXLMBDxnj9gJ7F | sshfs andrew@69.194.130.58:/home/andrew/ /Users/rever/techssh/"
|
||||
alias audio_pause="sudo pkill -STOP coreaudiod"
|
||||
alias audio_play="sudo pkill -CONT coreaudiod"
|
||||
# defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 40
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
function zsh_stats() {
|
||||
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
|
||||
op=$(history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 )
|
||||
echo "$op"
|
||||
}
|
||||
|
||||
function uninstall_oh_my_zsh() {
|
||||
|
|
@ -15,3 +16,111 @@ function take() {
|
|||
cd $1
|
||||
}
|
||||
|
||||
|
||||
per(){
|
||||
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
|
||||
*2^(8-i));if(k)printf("%0o ",k);print}'
|
||||
}
|
||||
|
||||
flush(){
|
||||
#Script to unload and reload mDNS as it is a bit crappy
|
||||
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
|
||||
echo "mDNS unloaded"
|
||||
sleep 5
|
||||
sudo launchctl load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
|
||||
echo "mDNS loaded"
|
||||
sleep 5
|
||||
echo "Hopefully you can get on with browsing again"
|
||||
}
|
||||
|
||||
|
||||
dt() {
|
||||
result=$(defaults read com.apple.finder CreateDesktop)
|
||||
if [[ "$result" == 1 ]]
|
||||
then
|
||||
defaults write com.apple.finder CreateDesktop 0
|
||||
echo Hide desktop
|
||||
fi
|
||||
|
||||
if [[ "$result" == 0 ]]
|
||||
then
|
||||
defaults write com.apple.finder CreateDesktop 1
|
||||
echo Show desktop
|
||||
|
||||
fi
|
||||
killall Finder
|
||||
}
|
||||
work(){
|
||||
echo 'vjW5zWfXLMBDxnj9gJ7F\n'
|
||||
ssh andrew@69.194.130.58
|
||||
}
|
||||
|
||||
|
||||
|
||||
vis() {
|
||||
|
||||
|
||||
# check if hidden files are visible and store result in a variable
|
||||
isVisible=$(defaults read com.apple.finder AppleShowAllFiles)
|
||||
if [ "$isVisible" = "FALSE" ]
|
||||
then
|
||||
echo Hidden Viewing On
|
||||
defaults write com.apple.finder AppleShowAllFiles TRUE
|
||||
else
|
||||
echo Hidden Videwing Off
|
||||
defaults write com.apple.finder AppleShowAllFiles FALSE
|
||||
fi
|
||||
# force changes by restarting Finder
|
||||
killall Finder
|
||||
}
|
||||
|
||||
dl(){
|
||||
python ~/Desktop/musicdl.py `pbpaste`
|
||||
}
|
||||
|
||||
webserv(){
|
||||
python -m SimpleHTTPServer
|
||||
}
|
||||
|
||||
lsext()
|
||||
{
|
||||
find \( ! -name . -prune \) -type f -iname '*.'${1}'' -exec ls $LS_OPTIONS -hF {} \; ;
|
||||
}
|
||||
|
||||
rpass() {
|
||||
cat /dev/urandom | LC_CTYPE=C tr -dc A-Za-z0-9_\!\@\#\$\%\^\&\*\(\)-+= | head -c ${1:-12}
|
||||
}
|
||||
|
||||
genpass() {
|
||||
local l=$1
|
||||
[ "$l" == "" ] && l=8
|
||||
LC_CTYPE=C tr -dc A-Za-z0-9_\!\@\#\$\%\^\&\*\(\)-+= < /dev/urandom | head -c ${l} | xargs
|
||||
}
|
||||
|
||||
downloads() {
|
||||
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' |more
|
||||
}
|
||||
hide(){
|
||||
chflags hidden $1
|
||||
}
|
||||
unhide(){
|
||||
chflags nohidden $1
|
||||
}
|
||||
connected(){
|
||||
lsof -i | grep ESTABLISHED
|
||||
}
|
||||
look(){
|
||||
qlmanage -p "$1"
|
||||
}
|
||||
|
||||
|
||||
mach()
|
||||
{
|
||||
echo -e "\nMachine information:" ; uname -a
|
||||
echo -e "\nUsers logged on:" ; w -h
|
||||
echo -e "\nCurrent date :" ; date
|
||||
echo -e "\nMachine status :" ; uptime
|
||||
echo -e "\nFilesystem status :"; df -h
|
||||
echo -e "\nMemory status :" ; top -l 1 | grep ^PhysMem
|
||||
echo -e "\nIP Information: "; curl ifconfig.me
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# ls colors
|
||||
autoload colors; colors;
|
||||
export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||
#export LS_COLORS
|
||||
export LS_COLORS="Gxfxcxdxbxegedabagacad"
|
||||
export LS_OPTIONS="Gxfxcxdxbxegedabagacad"
|
||||
|
||||
# Enable ls colors
|
||||
if [ "$DISABLE_LS_COLORS" != "true" ]
|
||||
|
|
@ -10,9 +10,10 @@ then
|
|||
if [[ "$(uname -s)" == "NetBSD" ]]; then
|
||||
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
||||
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
||||
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
||||
gls --color -d . &>/dev/null 2>&1
|
||||
else
|
||||
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
||||
alias lsc='ls -G'
|
||||
#ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue