This file contains 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
tmp_containers_running=$(mktemp) # make tempfile | |
echo $tmp_containers_running # print tempfile location | |
docker ps -q >$tmp_containers_running # save ids | |
# whatever you need to do, for instance: | |
sudo systemctl restart docker # restart docker | |
docker start $(<$tmp_containers_running) # restart containers from saved ids |
This file contains 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
$ which pods | |
pods () { | |
kubectl get pod -o name | ag "^pod?/$1" | cut -c 5- | |
} | |
$ which pod | |
pod () { | |
pods $1 | head -1 | |
} |
This file contains 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
# in .bashrc/.zshrc | |
alias note="echo ' - '>>.plan" | |
alias task="echo ' · '>>.plan" | |
alias event="echo ' o '>>.plan" | |
alias n=note | |
alias t=task | |
alias e=event | |
alias planner="vim .plan" | |
alias plan="echo '\n= .plan =';cat .plan;echo" |
This file contains 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/bash | |
# monkeyoperator.sh | |
# saves precious devops time | |
# just run at random intervals | |
hosts="badhost1 | |
badhost2 | |
badhost3 | |
badhost4" |
This file contains 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
changelog() { | |
name=$(basename `git rev-parse --show-toplevel`) | |
lasttag=`git tag -l | sort -V | tail -${1-1} | head -1` | |
echo "$name - changes since $lasttag:\n" | |
git --no-pager log "$lasttag.." --pretty=format:' + %s' --reverse; | |
echo "\n"; | |
} |
This file contains 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
changelog() { | |
name=$(basename `git rev-parse --show-toplevel`) | |
lasttag=`git describe --tags --abbrev=0` | |
echo "$name - changes since $lasttag:\n" | |
git --no-pager log "$lasttag.." --pretty=format:' + %s' --reverse; | |
echo "\n"; | |
} |
This file contains 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
> obj = {Infinity:Infinity, NaN:'and beyond'} | |
{ Infinity: Infinity, NaN: 'and beyond' } | |
> obj[1/0] | |
Infinity | |
> obj[0/0] | |
'and beyond' |
This file contains 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
function lazyQACheck(){ | |
$("a").each(function(){ | |
if( $(this).attr("title") === undefined || $(this).attr("title") === "" ) { | |
console.warn("QA: <A> tag with TEXT \"" + $(this).text() + "\" has no TITLE attribute"); | |
} | |
if( $(this).attr("href") && $(this).attr("target") === undefined && !!(1+$(this).attr("href").indexOf("//")) ) { | |
console.warn("QA: <A> tag with external HREF "+$(this).attr("href")+" has no TARGET attribute"); | |
} | |
}); | |
$("img").each(function(){ |