-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell_aliases
50 lines (39 loc) · 2.29 KB
/
shell_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
#!/usr/bin/env ${SHELL}
[[ $(ls --color=always 2>/dev/null) ]] && alias ls='ls --color=always'
[[ $(type vim) ]] && alias vi='vim'
if [ ${IS_MAC} -eq 0 ]; then
# mdfind in macOS 13 has started barfing up nonsense with every usage.
# https://www.reddit.com/r/MacOS/comments/zq36l1/whats_up_with_mdfind_warning_on_console
if [[ $(type mdfind) && $(mdfind -name Typora kind:application 2>/dev/null) ]]; then
alias typora="open -a typora"
fi
fi
# nginx
alias nginx_start='sudo launchctl load -w /Library/LaunchDaemons/org.macports.nginx.plist'
alias nginx_stop='sudo launchctl unload -w /Library/LaunchDaemons/org.macports.nginx.plist'
alias nginx_restart='nginx_stop; nginx_start;'
# php-fpm
alias fpm_start='sudo launchctl load -w /Library/LaunchDaemons/org.macports.php55-fpm.plist'
alias fpm_stop='sudo launchctl unload -w /Library/LaunchDaemons/org.macports.php55-fpm.plist'
alias fpm_restart='fpm_stop; fpm_start;'
# postgresql
alias pg_start='sudo -u postgres /opt/local/lib/postgresql94/bin/pg_ctl start -D /opt/local/var/db/postgresql94/defaultdb -l /tmp/postgresql.log'
alias pg_stop='sudo -u postgres /opt/local/lib/postgresql94/bin/pg_ctl stop -D /opt/local/var/db/postgresql94/defaultdb'
alias dpostgres='docker run --rm -it -p 5432:5432 -e POSTGRES_PASSWORD=123456 -e POSTGRES_USER=root postgres:alpine'
# Run Dockerized MySQL that can be connected to from a host client
alias dmysql='docker run --rm -it -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_ROOT_PASSWORD="" -e MYSQL_ROOT_HOST="%" mysql/mysql-server:5.7 --explicit_defaults_for_timestamp --log-error'
alias dmysql8='docker run --rm -it -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_ROOT_PASSWORD="" -e MYSQL_ROOT_HOST="%" mysql/mysql-server:8.0'
# https://twitter.com/jsumners79/status/1209636970911162370
alias poke_xcode_tools='sudo rm -rf $(xcode-select -print-path) && xcode-select --install)'
alias tmux='TERM=screen-256color-bce tmux -2'
[[ $(type tmux) ]] && alias screen='tmux'
[[ $(type bat) ]] && alias cat='bat'
# flush dns cache
[[ $(type dscacheutil) ]] && alias flushcache='sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say cache flushed'
if [[ "${SHELL:(-3)}" == "zsh" ]]; then
alias gulp='nocorrect gulp'
alias help='man zshbuiltins'
fi
if [ -f ~/.local_aliases ]; then
source ~/.local_aliases
fi