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 | |
# THIS IS A WORK IN PROGRESS, might break things. | |
# Sets up LXC host configuration in AWS EC2 environments | |
# Reference: http://www.activestate.com/blog/2011/10/virtualization-ec2-cloud-using-lxc | |
# Exit NOW because we don't want to blow anything up outside our test systems | |
# (This is being drafted in a production environment.) | |
exit 1 | |
echo 'none /sys/fs/cgroup cgroup defaults 0 0' >> /etc/fstab |
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 | |
# Assumes images are broken out into 1024mb chunks, separately gzipped, | |
# stored as ./image/image.X.blob.gz, where X is an integer (0...). | |
# Decompresses and writes 6 in parallel (i.e. threading) since Gzip is slow. | |
DEVICE=$1 | |
sectionsize=1024 | |
maxthreads=5 | |
curthreads=0 |
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 | |
# A tool to find superblocks in an EXT4 volume (probably easily adapted for EXT2,3) | |
# The usecase for this tool is likely pretty narrow... | |
# I have an LVM volume on a RAID array that was incorrectly reassembled (i.e. recreated) | |
# in the wrong order (I think), and I'm trying to recover from it, but it's unrecognizable | |
# as a filesystem since the primary superblock is missing. | |
# This tool identifies all (seemingly) valid superblocks in a volume, though using them may | |
# introduce other errors if your filesystem is badly damaged. USE WITH CAUTION. | |
# The goal is to estimate how far offset the superblocks are and if disc order in the array |
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 | |
# Very simple CSV to JSON converter | |
# Supports CSV labels | |
# Usage: | |
# (without labels) | |
# csv-to-json.py ./data.csv > ./data.json | |
# like: [ [ 1, 2, 3 ] ] | |
# (with labels) | |
# csv-to-json.py -l ./data.csv > ./data.json |
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
/* CSV parser | |
* (c) Sam Briesemeister, 2012 | |
* | |
* Features: | |
* - Parses CSV through a sequential tokenizer | |
* - Supports alternative field separator and quote characters | |
* - Ignores empty lines and comments (lines starting with #) | |
* - Provides label support through lookup function | |
* | |
* Usage: |
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 | |
# usage: | |
# sudo dd-local-monitor.sh if=/dev/sda bs=24M | gzip > /mnt/external/myimage.blob.gz | |
main () { | |
echo "# dd: $@" >&2 | |
dd $@ & |
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
/* Set theory implementation, woot! | |
* (c) Sam Briesemeister, 2012 | |
* | |
* | |
* Uses Javascript objects' properties as a shortcut for determining set content. | |
* | |
* Elements must be string-like or numeric. | |
* | |
* Usage: | |
* |
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 | |
# Nginx Cache Manager (search, remove content by URL or grep) | |
# NOTE: | |
# in my nginx config, I use: | |
# proxy_cache_key $scheme://$host$uri$is_args$args@$remote_user; | |
# ... which facilitates easier searching of cache files | |
cachefiles () { | |
find /var/lib/nginx/cache -type f $@ | |
} |
NewerOlder