-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
56 lines (44 loc) · 1.52 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
#!/usr/bin/env bash
# Vlad's Aliases
# Sudo
alias sudo='sudo ' # Allow aliases to work with sudo
# Colorized commands
alias ls='ls --color=auto'
alias ll='ls -lahpF' # Ubuntu & Mac compatible
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Ansible
alias apb='ansible-playbook'
alias ave='ansible-vault edit'
# List disk usage for a file or folder in human format [defaults to the current working directory unless file/folder path specified]
alias dff='du -sh'
# Temp Dir
alias tmp='cd $(mktemp -d 2>/dev/null || mktemp -d -t "mytmpdir")'
alias tmpf='vim $(mktemp 2>/dev/null || mktemp -t "mytmpfile")'
# Generate Salt
alias genSalt='openssl rand -base64 32'
# Pass options to free
alias meminfo='free -m -l -t'
# Get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
# Get top process eating cpu
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
# Docker
alias dl='docker ps -lq'
alias dlc='docker ps'
alias dla='docker ps -a'
alias dli='docker images'
alias drm='docker system prune -f'
alias dke='docker exec -it'
alias dru='docker run -it --rm -v $(pwd):/docker ubuntu bash'
# OSX ALIASES
if [[ $(uname) == Darwin ]]; then
# Reload DNS
alias dnsflush='dscacheutil -flushcache'
alias dnsreset='sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset'
# Recursively delete `.DS_Store` files
alias cleanup="find . -type f \( -name '._*' -o -name '*.DS_*' \) -ls -delete"
fi