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
import sys | |
def add_to__all__(func_or_class): | |
""""Use decorator to avoid retyping function/class names into __all__ module level variable.""" | |
all_list = sys.modules[func_or_class.__module__].__dict__.setdefault('__all__', []) | |
if func_or_class.__name__ not in all_list: | |
all_list.append(func_or_class.__name__) | |
return func_or_class |
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
curl --silent http://your.jenkins/cc.xml | grep -o '<Project[^>]*/>' | grep -o 'name="[^"]*"' | cut -f2 -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
#!/bin/sh | |
DOMAIN=$1; | |
echo -n | openssl s_client -connect $DOMAIN:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/$DOMAIN.cert && open /tmp/$DOMAIN.cert | |
# Notes: | |
# 1. After you ran this script, simple refresh your stubborn browser. i.e. Chrome. | |
# 2. When you are done, don't forget to delete /tmp/$DOMAIN.cert file. |
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 | |
# Number of arguments should be at least 1 | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 centos-version-number" | |
exit 1 | |
fi | |
VERSION=$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
browser: { | |
mozilla: /firefox/.test(navigator.userAgent.toLowerCase()), | |
webkit: /webkit/.test(navigator.userAgent.toLowerCase()), | |
chrome: /chrome/.test(navigator.userAgent.toLowerCase()), | |
safari: /safari/.test(navigator.userAgent.toLowerCase()) && !/chrome/.test(navigator.userAgent.toLowerCase()), | |
opera: /opera/.test(navigator.userAgent.toLowerCase()), | |
msie: /msie/.test(navigator.userAgent.toLowerCase()) | |
} |
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
StatHatEmbed=new function(){function d(){var a=document.getElementsByTagName("script");return a[a.length-1]}function e(a,b){var d=document.createElement("script"),c="//www.stathat.com/embed/"+a+"/"+b.s1;b.dev&&(c="//localhost:8081/embed/"+a+"/"+b.s1);b.s2&&(c+="/"+b.s2);b.s3&&(c+="/"+b.s3);c+="?w="+b.w+"&h="+b.h+"&tf="+b.tf;b.style&&(c+="&style="+b.style);b.dev&&(c+="&dev=1");b.title&&(c+="&title="+b.title);d.src=c;d.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(d)} | |
function f(a){return[a.s1,a.s2,a.s3,a.w,a.h,a.tf,a.style].join("_")}this.render_graph=function(a){DIV_ID="statd_embed_graph_"+f(a);d().insertAdjacentHTML("AfterEnd","<div id='"+DIV_ID+"' style='display:none'></div>");e("graph",a)};this.render_data=function(a){DIV_ID="statd_embed_data_"+f(a);d().insertAdjacentHTML("AfterEnd","<div id='"+DIV_ID+"' style='display:none'></div>");e("data",a)};this.render_table=function(a){DIV_ID="statd_embed_table_"+f(a);d().insertAdjacentHTML("AfterEnd","<div id='"+DIV_ID+ | |
"' style='displ |
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 | |
# | |
# Setup multiple Pythons for On the Plates | |
# | |
# VARIABLES | |
PYTHON27_VERSION='2.7.4' | |
PYTHON27_NAME="CPython-$PYTHON27_VERSION" | |
PYTHON27_BIN="~/.pythonz/pythons/$PYTHON27_NAME/bin/python" |
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
# say | |
alias say="say -v Vicki" | |
# Don't check mail | |
unset MAILCHECK | |
# | |
# Fancy bash functions | |
# | |
function ifconfig_line { |
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
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm |
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
begin; | |
insert into table select * from only table where id between 1 and 10000000; | |
delete from only table where id between 1 and 10000000; | |
commit; | |
begin; | |
insert into table select * from only table where id between 10000001 and 20000000; | |
delete from only table where id between 10000001 and 20000000; | |
commit; |