-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
94 lines (75 loc) · 3.48 KB
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Start a server with current dir as root
alias server="php -S localhost:1337"
# Some git commands can't be short enaugh!
X=${red}✖${reset}
alias g="git"
alias gs="echo -e '$X git s'"
alias gd="echo '$X git d'"
alias ga="echo '$X git a'"
alias gc="echo '$X git c'"
# ls mit versteckten dateien und slashes an ordnern
alias ls="ls -pa1"
# Check reboot times
alias re="last reboot"
# Clear up the terminal window
alias c="clear"
# get all ports
alias ports="sudo lsof -i -P | grep -i LISTEN"
# change owner to current user
alias access="sudo chown -R $USER "
# get all processes
alias processes="lsof -i TCP"
# Show/hide hidden files in Finder
alias showdotfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hidedotfiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# Hide/show the full path in the Finder window.
alias showfinderpath="defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES && killall Finder"
alias hidefinderpath="defaults write com.apple.finder _FXShowPosixPathInTitle -bool NO && killall Finder"
# A guest can’t open Finder and is limited to the Apps in the dock
alias startguestmode="defaults write com.apple.finder InterfaceLevel simple && killall Finder"
alias stopguestmode="defaults write com.apple.finder InterfaceLevel standard && killall Finder"
# Enable ⌘+q for Finder
alias enablefinderquit="defaults write com.apple.finder QuitMenuItem 1 && killall Finder"
alias disablefinderquit="defaults write com.apple.finder QuitMenuItem 0 && killall Finder"
# View HTTP traffic
alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
# Todo commands
alias "t"="todo.sh -d ~/todo/todo.cfg"
alias "todo"="t ls"
# Colored up cat!
# You must install Pygments first - "sudo easy_install Pygments"
#alias cat='pygmentize -O style=monokai -f console256 -g'
# ifconfig greps
alias ip4="ifconfig |grep 'inet '"
alias ip6="ifconfig |grep 'inet6 '"
alias ipall="ifconfig |grep inet"
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias ip_internal="ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'"
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -='cd -'
alias currentsize="du -sh"
alias h="history"
# Open current folder
alias o="open ."
# Apps
alias sourceTree="open -a SourceTree ./"
alias st="open -a SourceTree ./"
alias chromium_unsecure="open -a /Applications/Chromium.app --args --disable-web-security"
# Faster npm for Europeans
command -v npm > /dev/null && alias npme="npm --registry http://registry.npmjs.eu/"
# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
alias update='sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm update npm -g; npm update -g; sudo gem update --system; sudo gem update'
# Hard to remember pbcopy
alias copy_content_of_file="pbcopy <"
# My prefered way to use ntl
alias ntl="npx ntl -A"