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
| ps aux | grep [S]trip | awk '{print $2}' | xargs kill -9 |
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
| # Credit http://stackoverflow.com/a/2514279 | |
| # List old branches | |
| for branch in `git branch -r | grep -v HEAD | grep -v "origin/master"`; | |
| do | |
| echo -e `git show --format="%ci %cr %ae %an" $branch | head -n 1` \\t$branch; | |
| done | sort -r | |
| # Delete local remotes/origin/... branches not on the remote | |
| git remote prune origin |
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 rrepr(exclude=None, only=None): | |
| """Just use ``def repr_attr`` to customize repr display for particular | |
| class attribute. | |
| You can exclude attributes: | |
| >>> __repr__ = rrepr(exclude=('attrname', )) | |
| Or show only what you need: |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| 7 | |
| / \ | |
| 3 9 | |
| / \ | |
| 1 2 | |
| LCA = lowest common ancestor = common ancestor that is farthest down the tree | |
| LCA(above tree, 1, 2) = 3 |
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
| perl -e '(map { print "\\x$_" } unpack("(H2)*", pack("C", 1))); print "\n"' |
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
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import subprocess | |
| import ConfigParser as configparser | |
| import cStringIO | |
| JENKINS_URL = 'http://jenkins/job' | |
| JENKINS_USER = 'jenkins' | |
| JENKINS_TOKEN = '<token>' |
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
| #!/usr/bin/env python | |
| import os | |
| top = os.path.join( | |
| os.path.dirname(os.path.realpath(__file__)), | |
| 'sphinx' | |
| ) | |
| for root, dirs, files in os.walk(top): | |
| for name in files: |