-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
64 lines (50 loc) · 1.99 KB
/
.bash_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
# Bash aliases for Ubuntu Server
alias eb="vim ~/.bash_aliases"
alias rb="cd ~/ && . .bashrc"
alias sb="cat ~/.bash_aliases"
# Project
alias cded="cd ~/ed && source edenv/bin/activate"
alias cdp="cd ~/project && source projectenv/bin/activate && export DJANGO_SETTINGS_MODULE=portfolio.settings.production"
# Git
alias gs="git status"
alias gl="git log"
# Django
alias pym="python manage.py"
alias mkg="pym makemigrations"
alias mg="pym migrate"
alias cst="pym collectstatic"
alias psy="pym shell"
alias updateapp="cdp && mg && cst --noinput"
# System
alias sudosystemctl="sudo systemctl"
alias systemctlstatus="sudosystemctl status"
alias sudojournalctl="sudo journalctl"
# Postgres
alias psg="sudo -u postgres psql"
# Change directory
alias cdsysd="cd /etc/systemd/"
alias cdsys="cdsysd && cd system/"
alias cdh="cd ~/.ssh"
alias esh='eval "$(ssh-agent -s)" && ssh-add ~/.ssh/ed_github'
# Gunicorn
alias startapp="sudosystemctl start gunicorn.socket && sudosystemctl enable gunicorn.socket"
alias restartapp="sudosystemctl restart gunicorn && sudosystemctl daemon-reload && sudo systemctl restart gunicorn.socket gunicorn.service"
alias gunicornstatus="systemctlstatus gunicorn"
alias gunicornfile="file /run/gunicorn.sock"
alias gunicornsocket="systemctlstatus gunicorn.socket"
alias gunicornjournalsocket="sudojournalctl -u gunicorn.socket"
alias gunicornjournal="sudojournalctl -u gunicorn"
alias editgunicornservice="sudo vim /etc/systemd/system/gunicorn.service"
alias editgunicornsocket="sudo vim /etc/systemd/system/gunicorn.socket"
# Nginx
alias editnginx="sudo vim /etc/nginx/sites-available/project"
alias restartnginx="sudo nginx -t && sudo systemctl restart nginx"
alias reloadnginx="sudo nginx -s reload"
alias nginxstatus="systemctlstatus nginx"
# Logs
alias nginxlog="sudo tail -F /var/log/nginx/error.log"
alias nginxjournal="sudojournalctl -u nginx"
alias nginxaccess="sudo less /var/log/nginx/access.log"
alias nginxerror="sudo less /var/log/nginx/error.log"
# Python
alias pyclean="pyclean --verbose ."