| 1 | touch ~/.ghost/secret.sh |
| 2 | source ~/.ghost/secret.sh |
| 3 | git config --global core.autocrlf input |
| 4 | if uname -a | grep -q MINGW;then |
| 5 | alias python3=python |
| 6 | alias Python=python |
| 7 | else |
| 8 | alias python=python3 |
| 9 | fi |
| 10 | |
| 11 | alias Vim='vim ~/.vimrc' |
| 12 | alias Gvim='vim ~/.ghost/ghost.vimrc' |
| 13 | alias Gbash='vim ~/.ghost/ghost.sh' |
| 14 | alias clip=clip.exe |
| 15 | alias Bash='vim ~/.bashrc' |
| 16 | alias Source='source ~/.bashrc' |
| 17 | alias ghook='~/.ghost/ghook/startproject.sh' |
| 18 | alias venv='python -m venv venv' |
| 19 | alias Gsecret='vim ~/.ghost/secret.sh' |
| 20 | function gcom { |
| 21 | local message=$@ |
| 22 | echo "$message" |
| 23 | git add . && git commit -m "$message" |
| 24 | } |
| 25 | function vsource() { |
| 26 | local start=`pwd` |
| 27 | for i in $(seq 1 5);do |
| 28 | if ! source venv/**/activate; then |
| 29 | cd .. |
| 30 | else |
| 31 | cd $start |
| 32 | break |
| 33 | fi |
| 34 | done |
| 35 | } |
| 36 | function Gpush() { |
| 37 | local start=`pwd` |
| 38 | cd ~/.ghost |
| 39 | gcom $@ |
| 40 | git push -u origin main |
| 41 | cd $start |
| 42 | } |
| 43 | function djs() { |
| 44 | local start=`pwd` |
| 45 | for i in $(seq 1 5);do |
| 46 | if test -f manage.py;then |
| 47 | python manage.py runserver $1 |
| 48 | break |
| 49 | fi |
| 50 | done |
| 51 | } |
| 52 | function dj() { |
| 53 | local start=`pwd` |
| 54 | for i in $(seq 1 5);do |
| 55 | if test -f manage.py;then |
| 56 | python manage.py $@ |
| 57 | break |
| 58 | fi |
| 59 | done |
| 60 | } |
| 61 | function Gupdate() { |
| 62 | local start=`pwd` |
| 63 | cd ~/.ghost && git pull |
| 64 | Source |
| 65 | cd $start |
| 66 | } |
| 67 | function djp() { |
| 68 | |
| 69 | django-admin startproject $@ |
| 70 | } |
| 71 | function pi { |
| 72 | python -m pip install $@ |
| 73 | } |
| 74 | function pm { |
| 75 | python -m $@ |
| 76 | } |
| 77 | function redis { |
| 78 | docker run -p 6379:6379 --name redis -d redis:5 |
| 79 | } |
| 80 | function redis-cli { |
| 81 | docker exec -it redis redis-cli $@ |
| 82 | } |