sshlog.sh logs all your SSH sessions to the specified destination directory so you can search/recall them later.
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 | |
# | |
# Helper script to quickly fix merge conflicts. | |
# | |
# [email protected] | |
# 2014-02-05 | |
# | |
# |
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
class DirtyBase(object): | |
def __init__(self, *a, **k): | |
super(DirtyBase, self).__init__(*a, **k) | |
self.dirty = False | |
def __setitem__(self, *a, **k): | |
self.mark_dirty() | |
super(DirtyBase, self).__setitem__(*a, **k) |
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 | |
# Get last argument as the base filename | |
file=${!#} | |
if [ "$file" == "--version" ]; then | |
python --version | |
exit $? | |
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
import sys | |
import csv | |
tsvin = csv.reader(sys.stdin, dialect=csv.excel_tab) | |
csvout = csv.writer(sys.stdout, dialect=csv.excel) | |
for row in tsvin: | |
# Force all fields to be string-based (Excel specific) | |
for i, val in enumerate(row): | |
row[i] = '="%s"' % val | |
csvout.writerow(row) |
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/python | |
""" | |
Report branches or commits that are not yet merged into master. | |
""" | |
import subprocess | |
from os.path import basename | |
# Merge/environment branches. These will be excluded from the | |
# "unmerged branches" list. | |
EXCLUDE_BRANCHES = ['staging', 'uat', 'production', 'master'] |
Code now located at:
https://github.com/dansimau/pystringattr
Following instructions to set up Wordpress (from http://www.hiphop-php.com/wp/?p=113):
# /usr/bin/hhvm --mode server --user www-data --config /etc/hhvm.hdf
/home/sgolemon/dev/hiphop-php/src/runtime/vm/translator/asm-x64.cpp:79 (makeExecable): mprotect @(nil) 32768 bytes failed (Cannot allocate memory)
/home/sgolemon/dev/hiphop-php/src/runtime/vm/translator/asm-x64.cpp:79 (makeExecable): mprotect @(nil) 32768 bytes failed (Cannot allocate memory)
Aborted (core dumped)
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 os | |
import re | |
import sys | |
# Crazy URL regexp from Gruber | |
# http://daringfireball.net/2010/07/improved_regex_for_matching_urls | |
r = re.compile(r'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?]))') | |
# grep -r | |
for parent, dnames, fnames in os.walk(sys.argv[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
require("md5") | |
local testname = "lua md5 sum hash test (binary)" | |
function test() | |
-- Create object hash | |
local object_key_plain = [[ | |
"0.0.0.0", | |
80, | |
"www.example.com", |