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 | |
export ELASTICSEARCH_ENDPOINT="http://localhost:9200" | |
# Create indexes | |
# DELETE indexes consecutive tests | |
curl -XDELETE "$ELASTICSEARCH_ENDPOINT/play" | |
curl -XPUT "$ELASTICSEARCH_ENDPOINT/play" -d '{ |
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
;; joins two consecutives lines like vim's "J" | |
(defun join-lines () | |
(interactive) | |
(save-excursion | |
(end-of-line) | |
(insert-char ? 1) | |
(delete-char 1) | |
(while (looking-at "\\s +") | |
(delete-char 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
"""Verifies a password's strength by measuring its entropy. | |
Notice that this form of password strength testing does not distinguish easy to | |
guess passwords like "1111...." from supposedly good passwords like "%hF6Nz-0". | |
Some rule/points based passwords tests can and should be used together | |
with this to asset a password's strengh. | |
References: | |
- http://xkcd.com/936/ | |
- http://en.wikipedia.org/wiki/Password_strength |
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
#!/usr/bin/env python -u | |
# vim:ts=4:sts=4:sw=4:et:wrap:ai:fileencoding=utf-8: | |
"""Decorator to log a function's backtrace to a remote server. | |
Based on client/backtrace.py | |
from http://github.com/tmacam/DistributedCrawler. | |
""" |
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
#!/usr/bin/env python -u | |
# vim:ts=4:sts=4:sw=4:et:wrap:ai:fileencoding=utf-8: | |
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route('/', methods=['POST', 'GET']) |
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
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 "\n(%s)")\$ ' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 "\n(%s)")\$ ' | |
fi | |
unset color_prompt force_color_prompt |
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/sh | |
set -e | |
press_enter() { | |
set +x | |
echo "PRESS [ENTER]"; | |
read ENTER; | |
set -x | |
} |
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/sh | |
set -e | |
BRANCH=${1:?"Usage: $0 [BRANCH]"} | |
if ! ( git branch | grep -q ${BRANCH} ); then | |
echo "ERROR: Uknown branch '${BRANCH}'" > /dev/stderr | |
exit 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
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 "\n(%s)")\$ ' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 "\n(%s)")\$ ' | |
fi |
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
from inspect import getframeinfo, getouterframes, currentframe | |
def HERE(): | |
info = getframeinfo(getouterframes(currentframe())[1][0]) | |
print "\t__HERE: @%s %s:%d" % (info.function, info.filename, info.lineno) |
OlderNewer