irongit

A combination of vim and bash that I find useful

docker names and dsh

huncholanehuncholaneauthored
parent 97b08eacommit ac0e206196be726aca5671065bdacada0260c57eBrowse files

5 files changed, +36 -4

+0-0.ghost.sh.swp

Binary file changed.

+0-0.ghost.vimrc.swp

Binary file changed.

+35-0gfuncs.sh
@@ -161,3 +161,38 @@ function updatesetupversion () {
161161 echo $update
162162 sed -i "s/$num/$update/g" setup.py
163163 }
164+function psand () {
165+ local start=`pwd`
166+ for i in $(seq 1 5);do
167+ if test -f sandbox.py;then
168+ python sandbox.py
169+ break
170+ else
171+ cd ..
172+ fi
173+ done
174+ cd $start
175+}
176+function venv () {
177+ pm venv venv
178+ vsource
179+ pi --upgrade pip
180+ pi -U autopep8
181+}
182+function rust () {
183+ local base=`echo $1 | cut -d\. -f1`
184+ rustc $1 && ./$base && rm $base.exe $base.pdb
185+}
186+function forward () {
187+ while true; do
188+ ssh -N -R $2:localhost:$3 $1
189+ done
190+}
191+function dnames () {
192+ docker ps --format '{{.Names}}'
193+}
194+function dsh () {
195+ local container=$(dnames | grep $1 | head -1)
196+ echo "Connecting to $container"
197+ docker exec -it $container sh
198+}
+0-4ghost.sh
@@ -18,12 +18,8 @@ alias clip=clip.exe
1818 alias Bash='vim ~/.bashrc'
1919 alias Source='source ~/.bashrc'
2020 alias ghook='~/.ghost/ghook/startproject.sh'
21-alias venv='python -m venv venv'
2221 alias Gsecret='vim ~/.ghost/secret.sh'
2322 alias postgres='docker run -p 5432:5432 --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v postgres -d postgres:15'
24-alias psql='docker exec -it postgres psql -U postgres'
25-alias redis='docker run -p 6379:6379 --name redis -v redis -d redis:5'
26-alias redis-cli='docker exec -it redis redis-cli'
2723 alias pm='python -m'
2824 alias pi='python -m pip install'
2925 alias djp='django-admin startproject'
+1-0ghost.vimrc
@@ -20,6 +20,7 @@ imap <A-,> <Esc>A,<cr>
2020 map ,, A,<cr>
2121 map <F8> :w<cr>
2222 map <F10> :wqall<cr>
23+imap <F10> :wqall<cr>
2324 map <F9> :w<cr>:! python3 %<cr>
2425 map <F7> :w<cr>:! python3 main.py<cr>
2526 imap <F7> <Esc><F7>