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/sh | |
# Usage: gio url [code] | |
# Use github's url shortener | |
set -e | |
RAWURL=`echo "$1" | sed 's%[^:]*://%%;s%^/%%'` | |
SUBDOM="${RAWURL%github.com*}" | |
URLPATH="${RAWURL#*github.com}" | |
case "$SUBDOM" in | |
# *.github.com domains not yet supported by git.io: api ca.wiki cloud enterprise jobs pages wiki |
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
mkdir -p ~/macports | |
pushd ~/macports >/dev/null | |
svn co https://svn.macosforge.org/repository/macports/users/pixilla/dports/databases/mysql55 | |
cd mysql55 | |
sudo port install | |
sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config55 mysql | |
popd >/dev/null |
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/sh | |
# Data destructive, hardware-safeish performance testing | |
set -ex | |
### CONFIGURE ### | |
DRIVES='sda sdb sdc sdd' | |
VOLS='sda1 sdb1 sdc1 sdd1' | |
SCHEDULERS='noop deadline cfq' | |
FSES='btrfs ext2 ext3 ext4 jfs nilfs2 ntfs reiserfs vfat xfs' |
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
ldapsearch ... | awk '/^ /{x=$0;gsub(" ","",x);print x};!/^ /{if(length($0)==78){printf$0}else{print}}' | |
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/sh | |
set -e | |
# Get a list of groups a user is a member of on one line, space-seperated | |
# Single-quote group names with spaces, otherwise print the rest | |
SPACE_CHAR='-' | |
TMP=`mktemp` | |
ldapsearch -H ldap://domain.local -b OU=Everything,DC=domain,DC=local -LLL -x -z0 -D 'CN=gitolite,OU=Engineering,OU=Everything,DC=domain,DC=local' -y /var/lib/git/gitolite_ad_passwd "(sAMAccountName=$1)" userAccountControl memberOf > "$TMP" |
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
# bourne shell functions below take 1 argument, the file_to_hash. | |
# prints hex digest on stdout | |
md5() { | |
perl -MDigest::MD5=md5_hex -le'print md5_hex(<> or die)' "$1" | |
# ruby -rdigest/md5 -e"puts Digest::MD5.file'/dev/null'" | |
# python -sBc "import hashlib;print hashlib.md5(open('$1','rb').read()).hexdigest()" | |
# md5 "$1"|cut -d' ' -f4 # mac | |
# md5sum "$1"|cut -d' ' -f1 # linux | |
# openssl md5 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat |
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/sh -e | |
COMMAND="`which gist`" | |
type() { | |
PARSED_ARGUMENTS="$PARSED_ARGUMENTS -t $1" | |
} | |
private() { | |
PARSED_ARGUMENTS="$PARSED_ARGUMENTS -p" |
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
# .git/config | |
[remote "<remote_name>"] | |
url = <remote_url> | |
fetch = <remote_branch_name>:<local_branch_name> | |
pushurl = no-push | |
tagopt = --no-tags | |
[branch "<local_branch_name>"] | |
remote = <remote_name> | |
merge = <remote_branch_name> |
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/sh -e | |
DESCRIPTION="JRuby Nailgun Server" | |
ARGS="--ng-server" | |
# ARGS="$ARGS -Xcompat.version=1.8" | |
ARGS="$ARGS -Xcompat.version=1.9" | |
ARGS="$ARGS -Xmn512m -Xms2048m -Xmx2048m" # heap and stack | |
ARGS="$ARGS -J-Djruby.thread.pooling=true" # Enable thread pooling | |
ARGS="$ARGS -J-Djruby.objectspace.enabled=false" # Disable ObjectSpace |
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/sh | |
find ~/.rvm -type d -print0 | xargs -0L1 chmod 0755 | |
find ~/.rvm -type f -print0 | xargs -0L1 chmod 0644 | |
find ~/.rvm -type f -print0 | xargs -0L1 file | grep ' exec' | cut -d: -f1 | tee /dev/stderr | xargs -L1 chmod 0755 |