This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def kill_child_processes(signum, frame): | |
| """ | |
| SIGTERM override function | |
| Kill running processes childrens and grandchildren before exiting | |
| """ | |
| pid = os.getpid() | |
| kill_processes_recursive(pid) | |
| sys.exit() | |
| def kill_processes_recursive(pid, level=0, maxlvl=2): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "encoding/binary" | |
| "errors" | |
| "fmt" | |
| "io" | |
| "os" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi | |
| local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
| PROMPT='$USERNAME@sculpin %{${fg_bold[blue]}%}:%{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' | |
| RPS1="${return_code}" | |
| ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| #Usage: k8s_delete deployment -dev | |
| #Deletes all deployments containing "-dev". Usage with caution | |
| func k8s_delete() { | |
| for p in $(kubectl get $1 | grep -v NAME | cut -f1 -d' ' | grep $2); do | |
| kubectl delete $1 $p; | |
| done | |
| } |