Skip to content

Instantly share code, notes, and snippets.

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

Michael Shuler mshuler

💭
ヽ(´ー`)ノ
View GitHub Profile
@mshuler
mshuler / cassandra_build_server_setup-trusty.sh
Last active August 29, 2015 14:07
Configure an Ubuntu Trusty 14.04 server for Cassandra and Driver build/test environment
#!/bin/sh
if [ $(id -ru) -ne 0 ]; then
echo "$0 must be run as root or with sudo"
exit 1
fi
RELEASE=$( lsb_release --short --codename )
CHECK="true"
if [ "$CHECK" = "true" ]; then
#!/bin/sh
#
# Update all the git repositories under a directory.
#
################
# ToDo: handle multiple remotes?
################
#
# If script is placed in your $PATH, then hardcode REPODIR,
#!/bin/sh
#
# stop manually started cassandra service, remove dtest cruft,
# and wipe data and logs
#
# set user or leave commented out for current user from env
#USER=cassandra
# kill all CassandraDaemons
while pgrep -f CassandraDaemon; do
@mshuler
mshuler / upgrade.sh
Created March 28, 2014 00:01
debian testing daily upgrade
#!/bin/sh
yesno()
{
while true; do
read -p "=====> Would you like to $message [Y/n]? " yn
case $yn in
''|[Yy]* ) answer="yes"; break;;
* ) answer="no"; exit;;
esac
@mshuler
mshuler / lxc-ubuntu.sh
Created March 12, 2014 16:35
Script to generate LXC containers for EC2
#!/bin/bash
#
# Template script for generating ubuntu container for LXC with the same
# ubuntu relase as the host
#
# This script is based on lxc-debian for EC2 (Daniil Kulchenko <[email protected]>)
# wich itself is based on lxc-debian (Daniel Lezcano <[email protected]>)
#
@mshuler
mshuler / star2000_etime_mod.py
Created March 8, 2014 13:58
Star2000 CSV etime Timestamp Modification
#!/usr/bin/env python
# vim: ai ts=4 sw=4 sts=4 et
#
# http://www.star.bnl.gov/
# http://crd-legacy.lbl.gov/~kewu/fastbit/data/samples.html
#
# star2000 etime column date format examples:
# 20000625.0617250018
# 20000625.061728999
# 20000625.062128

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

#! /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:
./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)
@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