Skip to content

Instantly share code, notes, and snippets.

View rlyon's full-sized avatar
⬇️
Deprecated. See @ctxswitch

Rob Lyon rlyon

⬇️
Deprecated. See @ctxswitch
View GitHub Profile
{
"vscode": {
"extensions": [
"dasfranck.jellybeans",
"dracula-theme.theme-dracula",
"karyfoundation.theme-karyfoundation-themes",
"Pendrica.chef",
"sdras.night-owl",
"sidneys1.gitconfig",
"teabyii.ayu",
@rlyon
rlyon / puppetinit.sh
Last active August 29, 2015 14:14
Initialize full stack puppet for development
#!/bin/bash
# Puppet setup
curl https://packagecloud.io/install/repositories/rlyon/omnibus-puppet/script.rpm | bash
yum -y install puppet
yum -y install git
PUPPET_GEM=/opt/puppet/embedded/bin/gem
$PUPPET_GEM install r10k --no-rdoc --no-ri
$PUPPET_GEM install sinatra --no-rdoc --no-ri
$PUPPET_GEM install webrick --no-rdoc --no-ri
@rlyon
rlyon / puppet-standalone-setup.sh
Last active August 29, 2015 14:08
Puppet Stuff
#!/bin/sh
MAJOR=$(cat /etc/redhat-release | sed 's/^.*\ \([5-7]\).*$/\1/')
yum -y localinstall http://yum.puppetlabs.com/puppetlabs-release-el-$MAJOR.noarch.rpm
yum -y install puppet rubygem-puppet-lint
yum -y install git
# Make sure puppet is configured correctly
cat > /etc/puppet/puppet.conf << 'EOF'
@rlyon
rlyon / execnode-pass1.sh
Last active August 29, 2015 14:04
Simple gridengine install
#!/bin/sh
###
### Download and install the EPEL repositories and some extra
### dependencies.
###
cd
if ! [[ -f epel-release-6-8.noarch.rpm ]] ; then
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum -y localinstall epel-release-6-8.noarch.rpm
fi
@rlyon
rlyon / Vagrantfile.snippet
Last active August 29, 2015 13:57
Fix vagrant hang due to DNS resolver issue
#
# ... Other configs
#
config.vm.network :private_network, ip: "33.33.33.10"
# In certain cases, vagrant will hang for a long time and then
# error out. For some reason that I haven't bothered looking in
# to, I have to explicitly turn on the the vbox dns resolver.
#
config.vm.provider :virtualbox do |vb|
#!/bin/sh
# DIR=$(python -c "import os; print os.path.dirname(os.path.realpath('${0}'))")
cd $HOME/chef/databags/shutter
echo "Processing in $PWD"
if [ $# -ne 1 ] ; then
echo "You didn't specify the list to convert and upload."
echo "USAGE: upload.sh myfirewall"
exit 1
@rlyon
rlyon / git-pullall.sh
Created January 25, 2014 08:20
Fetch and merge all repositories in a folder.
#!/bin/bash
function header() {
printf "\e[0;36m$1\e[0m\n"
}
function error() {
printf " \e[1;31m!!! $1\e[0m\n"
}
@rlyon
rlyon / xe-patch.sh
Created January 21, 2014 21:17
Update XenServer hosts with CLI. Installs multiple patches
#!/bin/sh
# Put the host into maintainance mode, copy all the xsupdate patches in, ssh
# to the system and run this. This should be easy to convert into a single
# one stop script for updating all members in a pool.
# Assumes that the hostname amd the name-label are the same. If not
# it will not work.
HOST=$(hostname | cut -d'.' -f1)
UUID=$(xe host-list | grep -B1 $HOST | grep uuid | awk -F': ' '{print $2}')
@rlyon
rlyon / autobayes.sh
Last active January 4, 2016 00:39
Get a list of nex files, parse the file to get the optimal number of chains and runs to calculate the maximum number of processors to run with and submit to a PBS controlled batch system.
#!/bin/sh
# Check to see if we have the filelist specified
if [ $# -ne 1 ] ; then
echo "Usage: $0 [filelist]"
exit 1
fi
# Does the filelist exist?
if [ ! -f "$1" ] ; then
echo "File: $1 does not exist"
@rlyon
rlyon / bofh_cleaning.sh
Last active January 3, 2016 23:29
Fake directory cleaning script. Scare users, have a few laughs. Just add 'source /path/to/bofh_cleaning.sh' to the users bashrc file.
#!/bin/bash
trap "touch $HOME/.bofh_interupted" SIGINT
echo "####################################################"
echo "# This is the home directory cleaning process. #"
echo "####################################################"
echo
###