-
Notifications
You must be signed in to change notification settings - Fork 2
/
.aliases
68 lines (58 loc) · 2.74 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
#!/usr/bin/env bash
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
else # macOS `ls`
colorflag="-G"
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
fi
# Easier navigation: .., ~, work directory.
alias ~="cd ~"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias work="cd ~/Documents/GitHub"
# Always use color output for `ls`
# -A lists everything but . and ..
# Using ${colorflag} instead of -G for GNU/macOS.
alias ls="ls -A ${colorflag}"
alias ll="ls -l"
# List all files colorized in long format.
alias la="ls -Foh"
# Order by last modified, long form no user group.
alias lt="ls -to"
# Public IP addresses
alias pubip="http https://ipinfo.io/ip"
alias loip="echo $(ipconfig getifaddr $(networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/{getline; print $2}'))"
# Print each PATH entry on a separate line
alias path='echo -e ${PATH//:/\\n}'
# 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"
# Development
alias d="deactivate"
alias makeenv="python3 -m venv env"
alias makeenv2="virtualenv env"
alias makepypy="pypy3 -m venv env"
alias mkdir="mkdir -vp"
alias workon=". ./env/bin/activate"
alias black="black --exclude env/"
alias rsync="rsync --exclude=.DS_Store --exclude=env -vaP"
alias 2to3="2to3 -nw"
alias wgetall="wget -r -np -R 'index.html*'"
alias reveal="codesign -vvvv -R='anchor apple'"
alias verify="codesign -vvvv -dv"
alias dockerip="docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'"
# Open chrome as auto-console-debug when starting from command line.
alias chrome="open -na 'Google Chrome' --args --auto-open-devtools-for-tabs"
# Only for mac
alias gitlog="git log --oneline --abbrev-commit --all --graph --decorate --color"
alias lldb="PATH=/usr/bin /usr/bin/lldb"
# Docker
alias centos="docker run -p 5901:5901 -p 6901:6901 consol/centos-xfce-vnc"
# Find short
alias finda="find -maxdepth 1"
# Global Date Format. I don't use any other date format.
alias date="date +'%Y-%m-%d_%H:%M:%S'"