-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_aliases
More file actions
127 lines (99 loc) · 3.96 KB
/
.bash_aliases
File metadata and controls
127 lines (99 loc) · 3.96 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# ---- macOS related Aliases ------------------------------------------------------
if [[ "$(uname)" == "Darwin" ]]; then
alias ls='ls -G';
# brew upgrade
alias bup='brew update; brew upgrade; brew upgrade --cask; brew autoremove; brew cleanup'
# gem update
alias gup='gem update --system; gem update' #; gem cleanup'
# Mac Apps installed from the Mac Appstore
alias mac='mas upgrade'
# Get macOS Software Updates, update Homebrew and their installed packages and update Ruby Gems and cleanup all
alias update='sudo softwareupdate -i -a; mac; bup: gup'
# all installed bottles
alias brewl='brew leaves'
# delete all .DS_Store files from the file system
alias delds='find ./ -iname .DS_Store -delete'
# Show/hide hidden files in Finder
alias show='defaults write com.apple.Finder AppleShowAllFiles -bool true && killall Finder'
alias hide='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'
# Disable Spotlight
alias spotoff='sudo mdutil -a -i off'
# Enable Spotlight
alias spoton='sudo mdutil -a -i on'
# my fancy little media visualizing tool ;)
alias media2html='ruby ~/Projekte/Ruby/media2html/media2html.rb'
# format a USB stick; to find out N: diskutil list
alias formatusb='echo "⚠️ Run with caution! Example: diskutil list -> diskutil eraseDisk FAT32 UNTITLED MBRFormat /dev/diskN"'
# Start redis server NOT as background service
alias redis='redis-server /opt/homebrew/etc/redis.conf'
# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
alias stfu="osascript -e 'set volume output muted true'"
alias pumpitup="osascript -e 'set volume output volume 100'"
# Lock the screen (when going AFK)
#alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
alias afk='pmset displaysleepnow'
fi
# Reload bashrc file
alias bashreload='source ~/.bashrc && echo Bash config reloaded'
# Easier navigation: .., ..., ...., ....., ......
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# Shortcuts
alias g="git"
alias h="history"
alias j="jobs"
alias o="open"
alias oo="open ."
# Directory listings
alias ll='ls -lah'
# grep modifications
alias grep='grep --color=auto'
alias grepp='grep -P --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Get week number
alias week='date +%V'
# Edit hosts file via vim
alias hosts='vim /etc/hosts'
# Print disk usage human readable
alias d='du -sh'
# Displays drives and space human readable
alias drives='df -h'
# Clear screen
alias c='clear'
alias cl='clear;ls;pwd'
# SSH helper
alias sshclear='rm ~/.ssh/multiplex/* -f && echo SSH connection cache cleared;'
alias sshlist='echo Currently open ssh connections && echo && l ~/.ssh/multiplex/'
# Limits ping to five ECHO_REQUEST packets
alias ping='ping -c 5'
# Git shortcuts
alias gs='git status -sb'
alias gc='git commit -m'
alias ga='git add .'
alias gl='git log --oneline --decorate --graph --all'
# ---- Docker stuff ---------------------------------------------------------------------
# Clean stopped containers
alias cco="docker ps -a | grep \"Exited\" | awk '{print $1}' | xargs -r docker rm"
# clean unused images to reclaim disk space
docker-clean-images() {
echo "Removing all dangling Docker images..."
docker images -f "dangling=true" -q | xargs -r docker rmi
}
alias cimg='docker-clean-images'
alias dps='docker ps -a'
alias di='docker images'
alias drmi='docker rmi'
alias drm='docker rm'
alias dcompstop='docker-compose stop'
alias dcompup='docker-compose up -d'
alias dcomprm='docker-compose rm --all'
alias drvol='docker system prune --volumes -f'
# dev aliases
alias be='bundle exec'
alias rspecd='be rspec --format d'