Skip to content

Instantly share code, notes, and snippets.

View merlijntishauser's full-sized avatar
💭
TBD ftw, sometimes pushing

Merlijn Tishauser merlijntishauser

💭
TBD ftw, sometimes pushing
View GitHub Profile
@merlijntishauser
merlijntishauser / gist:3fc662d6464d020c7017c1b10f0026ce
Created January 14, 2019 08:08
clear installed pip packages
quickly clear all installed pip packages
```bash
pip freeze | xargs pip uninstall -y
```

Keybase proof

I hereby claim:

  • I am merlijntishauser on github.
  • I am merlijntishauser (https://keybase.io/merlijntishauser) on keybase.
  • I have a public key whose fingerprint is 27AB 4E21 8E4D AF01 F189 1797 DF0F 2D9E 1A32 0CBC

To claim this, I am signing this object:

# You can't use /usr/bin on OS X, as it is protected by the system, even for administrators.
sudo ln -s /Applications/VMware\ Fusion.app/Contents/Library/vmrun /usr/local/bin/vmrun
for i in {1..100}; do openssl rand -base64 12; done
# Install dgoss
curl -L https://raw.githubusercontent.com/aelsabbahy/goss/master/extras/dgoss/dgoss -o /usr/local/bin/dgoss
chmod +rx /usr/local/bin/dgoss
# Download goss to your preferred location
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.1/goss-linux-amd64 -o ~/Downloads/goss-linux-amd64
# Set your GOSS_PATH to the above location
export GOSS_PATH=~/Downloads/goss-linux-amd64
@merlijntishauser
merlijntishauser / notes.md
Last active February 9, 2018 14:05
Python3 venv

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@merlijntishauser
merlijntishauser / gist:024a5e35c004e28e9d4edd77281f1192
Created December 1, 2017 09:42
Get all branches in a git repo and show info
# get all branches
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
# fetch/pull them all
git fetch --all
git pull -all
# pretty print all branches with age
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'

Keybase proof

I hereby claim:

  • I am merlijntishauser on github.
  • I am merlijntishauser (https://keybase.io/merlijntishauser) on keybase.
  • I have a public key whose fingerprint is 2115 84C8 978C 41BB 349A 46F2 0723 E34B 94C6 B8F3

To claim this, I am signing this object:

# Display Symfony2 logging with different coloring for different error levels
tail -f var/logs/*.log | gawk '
/ERROR/ { print "\033[31m" $0 "\033[39;0m"; next; fflush();}
/CRITICAL/ { print "\033[41;33;1m" $0 "\033[39;0m"; next; fflush();}
/DEBUG/ { print "\033[34;1m" $0 "\033[39;0m"; next; fflush();}
/INFO/ { print "\033[32;1m" $0 "\033[39;0m"; next; fflush();}
$0; fflush();
'
# the nice way
docker rm $(docker ps -a | grep Exited | awk '{print $1}')
docker rmi $(docker images -q --filter "dangling=true")
# YOLO!
docker rm -f $(docker ps -a -q)