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
#!/bin/bash | |
if test -z "$1" | |
then | |
echo "usage: decrypt <filename>" | |
else | |
gpg -q --decrypt $1 | |
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
#!/bin/bash | |
# This script finds all the mercurial repositories in the current directory | |
# and does a "hg pull -u" to get the latest changes from all the repositories. | |
# | |
# Make sure you know what you're doing before running this ;-) | |
confirm_prompt() { | |
read -p "Are you sure you want to 'hg pull -u' every repository? " -n 1 | |
echo |
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
#!/bin/bash | |
# This script finds all the mercurial repositories in the current directory | |
# and does a "hg $@" to batch execute a mercurial command in all the repositories. | |
# | |
# Make sure you know what you're doing before running this ;-) | |
# | |
# Examples: | |
# | |
# Perform pull -u on all repositories to get the latest changes and update: |
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
"colo dawn | |
"colo ir_black | |
"colo maroloccio | |
colo darkbone | |
"set guifont=Monaco:h14 | |
set guifont=DejaVu\ Sans\ Mono\ Bold:h14 | |
"set guifont=Inconsolata\ Bold:h16 | |
set hls is ic scs | |
set gcr=n:blinkon0 |
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 | |
# Notes | |
# One can easily get the current epoch using the date command, like so: | |
# | |
# in your timezone: | |
# | |
# $ date -j +"%s" | |
# 1363104249 | |
# |
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 bash | |
###### | |
# Why is this useful? | |
# | |
# Say you have a list of ids in a database tool like SequelPro in | |
# the result of a query. It is possible to copy an entire column | |
# to the clipboard. But then you may want to pass that list of | |
# ids as a comma-separated list into an HTTP(S) API endpoint for | |
# testing. This solves that problem! |
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
#!/bin/bash | |
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ | |
yum groupinstall "Development tools" | |
yum install zlib-devel | |
yum install bzip2-devel openssl-devel ncurses-devel | |
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 | |
tar xf Python-2.7.3.tar.bz2 | |
cd Python-2.7.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
<!-- Drop this in ~/Library/Preferences/PyCharm20/tools --> | |
<!-- make sure you set the path to flake8 executable for your machine in the COMMAND option --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<toolSet name="Flake8"> | |
<tool name="Flake8 File" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="false" disabled="false" useConsole="true" synchronizeAfterRun="true"> | |
<exec> | |
<option name="COMMAND" value="/usr/local/share/python/flake8" /> | |
<option name="PARAMETERS" value="--max-line-length=120 --ignore=E301,E302,E261,E262,W404 $FileDir$/$FileName$" /> | |
<option name="WORKING_DIRECTORY" value="$FileDir$" /> |
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
import sys | |
def _helper(s, method, encoding): | |
try: | |
print 'print s.%s(\'%s\'): %s' % (method, encoding, getattr(s, method)(encoding)) | |
except UnicodeError as e: | |
print 'print s.%s(\'%s\'): %s' % (method, encoding, e) | |
def test_encodings(s): |
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
#!/bin/bash | |
HOSTS=(PUT, YOUR, HOSTS, HERE) | |
CMD="tail -f logs/api.log" | |
echo "Hit CTRL-C to stop" | |
sleep 0.5 | |
PIDS="" | |
for host in ${HOSTS[*]} | |
do |
OlderNewer