irongit

A combination of vim and bash that I find useful

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