Skip to content

Instantly share code, notes, and snippets.

View mshuler's full-sized avatar
💭
ヽ(´ー`)ノ

Michael Shuler mshuler

💭
ヽ(´ー`)ノ
View GitHub Profile
@mshuler
mshuler / tailirclog_espeak.sh
Created August 13, 2010 15:47
script to tail and strip irclogs for piping to espeak
#!/bin/sh
# script to tail and strip irclogs for piping to espeak:
# don't forget -t for a TTY if calling script remotely via ssh, ie:
# ssh -t host.example.com ~/bin/tailirclog_espeak.sh debian-devel | espeak
if [ ${1} ]; then
CHAN=${1}
LOG=$( find ${HOME}/irclogs/ -name \#*${1}.log )
if [[ ! -f ${LOG} ]]; then
echo; echo "cannot find logs for #${CHAN}"; echo
else
@mshuler
mshuler / wp_comments csv export
Created October 5, 2010 20:36
export wordpress commenter info
SELECT comment_author, comment_author_email, comment_content, comment_parent
INTO OUTFILE '/tmp/comment_export.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM wp_comments;
@mshuler
mshuler / github-mirror.sh
Created November 23, 2010 01:33
example github mirror from launchpad
#!/bin/sh
# OpenStack bzr to github mirror
#
# Requirements:
# git >= 1.7.0, bzr >= 2.0.0,
# git-bzr-ng, python-fastimport, patched bzr-fastimport
#####
# Set up unpackaged source:
# mkdir ~/src
@mshuler
mshuler / minimize
Created December 7, 2010 23:18
~/bin/minimize - strip all comments and blank lines - I use on conf files a lot..
#!/bin/sh
if [ $1 ]; then
if [ -f $1 ]; then
/bin/egrep -v '^(\s+#|#)|^(\s+$|$)' $1
else
echo " $1 is not a regular file"
exit 1
fi
else
echo " $0 needs a filename to strip.."
@mshuler
mshuler / fetch_certdata
Created June 23, 2012 15:40
Fetch Mozilla certdata.txt via CVS
#!/bin/sh
#wget http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 \
# -O /tmp/certdata.txt
VCS=cvs
REPODIR=~/repos/$VCS/mozilla_certdata
CVSROOT=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot"
CERTDATA="mozilla/security/nss/lib/ckfw/builtins/certdata.txt"
VCS_COMMAND="$VCS -d $CVSROOT checkout $CERTDATA"
@mshuler
mshuler / riak-updown
Created November 14, 2012 19:54
start/stop Riak dev instances
#! /bin/bash
## start/stop Riak dev instances
## http://docs.basho.com/riak/latest/tutorials/fast-track/Building-a-Development-Environment/
set -e
RIAK_HOME=$HOME/riak-1.2.1
RIAKDEVDIR=$RIAK_HOME/dev
DEVDIRS=(dev1 dev2 dev3 dev4)
@mshuler
mshuler / etc-grub.d-40_custom
Created September 10, 2013 00:31
ThinkPad BIOS Update CD via GRUB2
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
##
menuentry "ThinkPad BIOS Update CD" {
set root='(hd0,msdos1)'
echo 'Loading memdisk ...'
linux16 /boot/memdisk iso
./app/src/antlr/ExtendedCommonASTWithHiddenTokens.java: *No copyright* UNKNOWN
./app/src/antlr/TokenStreamCopyingHiddenTokenFilter.java: *No copyright* UNKNOWN
./app/src/processing/app/About.java: *No copyright* UNKNOWN
./app/src/processing/app/Base.java: GPL (v2) (with incorrect FSF address)
./app/src/processing/app/Editor.java: GPL (v2) (with incorrect FSF address)
./app/src/processing/app/EditorConsole.java: GPL (v2 or later) (with incorrect FSF address)
./app/src/processing/app/EditorHeader.java: GPL (v2 or later) (with incorrect FSF address)
./app/src/processing/app/EditorLineStatus.java: GPL (v2 or later) (with incorrect FSF address)
./app/src/processing/app/EditorState.java: GPL (v2) (with incorrect FSF address)
./app/src/processing/app/EditorStatus.java: GPL (v2 or later) (with incorrect FSF address)
#! /bin/bash
# Kill processes orphaned by Jenkins
# Work around Java's use of SIGTERM rather than SIGKILL and
# Jenkins's lack of any workaroud in the box.
# here is the relevant bug:
# https://issues.jenkins-ci.org/browse/JENKINS-17116
# Suggested usage:

This is a mini-HOWTO for setting up Linux Containers (LXC) on Ubuntu. This guide focuses on the creation of a web server with good process isolation and firewalling.

Dependencies

apt-get install lxc

Create a container