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
function load_env(){ | |
if [ -f $1 ] | |
then | |
export $(cat $1 | sed 's/#.*//g' | xargs) | |
else | |
echo "Can't find file" | |
fi | |
} |
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
git rev-list --objects --all \ | |
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \ | |
| sed -n 's/^blob //p' \ | |
| sort --numeric-sort --key=2 \ | |
| cut -c 1-12,41- \ | |
| numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest |
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
* Screen into the Docker VM | |
$ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty | |
$ umount /var/lib/docker/overlay2 | |
* Remove /var/lib/docker | |
$ rm -rf /var/lib/docker | |
* Restart Docker via the widget |
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 results(a_list, columns): | |
for row in a_list: | |
yield {k: v for k, v in izip(row, columns)} | |
my_generator = results(result, columns) |
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
''' | |
Borg kind of singleton | |
Supraclass for add monostate (all objects share state) properties a class | |
''' | |
class BorgObj(object): | |
_shared_state = {} | |
def __new__(cls, *a, **k): |
NewerOlder