Browse Source

Added several commands

R. Alex Matevish 4 years ago
parent
commit
4f337386ab
4 changed files with 32 additions and 2 deletions
  1. 1 1
      docker.sh
  2. 16 0
      git.sh
  3. 14 0
      main.sh
  4. 1 1
      pgp.sh

+ 1 - 1
docker.sh

@@ -17,7 +17,7 @@ if command_exists docker; then
         docker container ls | grep $1 | awk '{print $1}' | xargs
     }
 
-
+    alias docker-prune='docker system prune -a'
     alias dco='docker container'
     alias dci='docker image'
     alias dcv='docker volume'

+ 16 - 0
git.sh

@@ -28,4 +28,20 @@ if command_exists git; then
     alias gbdm='git-delete-merged'
     alias glatest='git checkout master && git pull && git fetch && git-delete-merged'
 
+    function wip () {
+        GIT_ROOT=`git rev-parse --show-toplevel`
+        LAST_MESSAGE=`git log -1 --pretty=%B | cat`
+        if [[ $LAST_MESSAGE == "WIP"* ]]; then
+            if prompt_user "Reset HEAD~? (Previous message: $LAST_MESSAGE)"; then
+                git reset HEAD~;
+            fi
+        else
+            CHANGED_FILES=`git diff --name-only HEAD $GIT_ROOT`
+            if prompt_user "Commit the following files to a WIP commit? \n$CHANGED_FILES\n"; then
+                git add $GIT_ROOT && git commit -m WIP;
+            fi
+
+        fi
+    }
+
 fi

+ 14 - 0
main.sh

@@ -5,6 +5,7 @@
 ##############################################################################
 
 alias ..='cd ..'
+alias h='cd ~'
 alias isodate='date -u +"%Y-%m-%dT%H:%M:%SZ"'
 alias tsp="ts '[%Y-%m-%dT%H:%M:%S:%SZ]'"  # prepend an iso timestamp (requires moreutils)
 alias as_super='sudo $(fc -ln -1)'  # Rerun last command w/ sudo
@@ -15,6 +16,16 @@ alias become_death=become_root
 alias killit="kill -9 `ps aux | grep -i "$1" | grep -v "grep" | awk '{ print $2}'`"  # Send SIGKILL to named process
 alias top_commands="cut -f1 -d\" \" .bash_history | sort | uniq -c | sort -nr | head -n 30"
 alias get_url="grep -Eo \"(http|https)://[\da-z./?A-Z0-9\D=_-]*\""
+alias awk1="awk '{print \$1}'"
+alias awk2="awk '{print \$2}'"
+alias awk3="awk '{print \$3}'"
+alias awklast="rev | awk1 | rev"
+
+
+function killit {
+    ps aux | grep -i "$1" | grep -v "grep" | awk '{ print $2}' | xargs kill -9
+}
+
 export ROME=$PATH:$PYTHONPATH:$CLASSPATH:$ORACLEPATH:$FOOPATH:$LOLPATH:$YOLOPATH:$(which python)
 
 function gpid() {
@@ -120,3 +131,6 @@ function nmap_scan_port() {
 }
 
 
+function md5dir {
+    find -s "$1" -type f -exec md5 {} \; | md5
+}

+ 1 - 1
pgp.sh

@@ -16,7 +16,7 @@ function pgp-decrypt()
 
 function gpg-stash-mount()
 {
-    (cd ~/.configs/gpg-stash && ./run.sh -d)
+    (cd ~/.configs/gpg-stash && ./run.sh -r && ./run.sh -d)
 }
 
 function gpg-stash-unmount()