Welcome to Sock Darning! Have a sock with a thinning heel or a toe hole you want to fix? Share your damage maps, yarn blend questions, and stitch experiments with other darning-minded visitors. Reading along is welcome too, so pull up a chair and join the conversation.

Automatic fetch all git repositories. A thing that you might want to add to your cron. Also some nice bash aliases for dockers.

  • Thread starter Thread starter Austin Songer, CISSP
  • Start date Start date
A

Austin Songer, CISSP

Guest
.bash_aliases

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
Show hidden characters

#!/bin/bash
function aprint() { awk "{print \$${1:-1}}"; }
alias dockerstart='docker ps -a --format="{{.ID}}" |xargs -ir docker start {}'
alias dockerrmi="docker images | grep none | aprint 3 | xargs -I[] -r docker rmi []"
alias dockerrm="docker ps | grep Exited | aprint 1 | xargs -I[] -r docker rm []"
alias dockerrmall="docker ps -a | tail -n -1 | grep -v Up | aprint 1 | xargs -I[] -r docker rm []"
function ___date() { echo -n "[`date --rfc-3339=seconds `] "; }
function dockerkill() { docker ps | grep $1 | aprint 1 | xargs -I[] -r docker stop []; }
function dockerdel() { docker images | grep $1 | aprint 3 | xargs -I[] -r docker rmi []; }
function untilfail() { while $@; do :; done }
function untilsuccess() { while ( ___date && ! $@ ) ; do sleep 1s ; done }
function killtests() { jps | grep --perl-regexp "(RemoteTestRunner|surefire)" | aprint 1 | xargs -I[] -r kill -9 [];}
function buildnow() { git merge develop && mvn validate && mvn clean install -o -DskipTests=true -Dmaven.javadoc.skip=true -Ddockerfile.skip=true && git push; }
.bashrc

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
Show hidden characters

export GPG_TTY=$(tty)
source <(kubectl completion bash)
export GIT_PROMPT_THEME=Single_line_Ubuntu
source ~/git/.bash-git-prompt/gitprompt.sh
.gitconfig

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
Show hidden characters

[push]
default = simple
[core]
editor = vim
[commit]
gpgsign = true
autofetch.sh

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
Show hidden characters

#!/bin/bash
pushd ~/git
. ~/.bash_aliases
function gitprune() {
git remote update --prune
git fetch -p --all
git fetch origin develop:develop
git fetch origin master:master
git branch -vv | grep -v "*" | grep ": gone]" | aprint 1 | xargs -r -i git branch -d {}
merged=$(git branch --merged | grep -v "*" | grep -v "master" )
if [ ! -z "$merged" ]; then
echo "$merged" | tee /tmp/merged-branches_$(basename `pwd`)
fi
git gc --auto
}
for f in *; do
if [[ -d $f ]]; then
# $f is a directory
pushd $f
gitprune &
popd
fi
done
popd
dockerrmi
 
Top