Skip to content

Instantly share code, notes, and snippets.

View mheiges's full-sized avatar

Mark Heiges mheiges

View GitHub Profile
#/bin/sh
ansible-playbook \
-i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory \
--private-key=.vagrant/machines/default/virtualbox/private_key \
-u vagrant \
--ssh-common-args='-o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
"$@"
Action Red Hat/Fedora Debian/Ubuntu
Install a package(s) by name yum install apt-get install
Remove a package(s) by name yum remove/erase apt-get autoremove
Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par. yum search

Using Tomcat8 instance on ebrc-webdev 0.0.6

Start the Tomcat8 instance

sudo instance_manager enable Tomcat8

$ instance_manager manage Tomcat8 list
OK - Listed applications for virtual host localhost
/:running:0:/usr/local/tomcat_instances/shared/webapps/ROOT
#!/bin/bash
# Throttle bandwidth on OS X Yosemite. Based on
# https://mop.koeln/blog/2015/06/01/Limiting-bandwidth-on-Mac-OS-X-yosemite/
CMD_WITH_ARGS="$0 $*"
ANCHOR_NAME=custom_rules
while getopts :p:b: arg; do
case $arg in
p)
@mheiges
mheiges / ca.apenwarr.Sshuttle.plist
Last active March 18, 2016 06:16
Shuttle configuration
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>debug</key>
<false/>
<key>servers</key>
<array>
<dict>
<key>autoHosts</key>
@mheiges
mheiges / vcssh
Last active October 13, 2016 10:36
wrapper for Vagrant ssh that manages a ControlMaster for instant ssh connections
#!/bin/bash
# ssh to vagrant hosts can be slow due to Ruby overhead of running
# 'vagrant ssh' and ssh overhead to setup the network connection.
#
# This wrapper uses that slow setup routine once to create a reusable ssh
# ControlMaster socket. Subsequent connections invoke the ssh executable
# directly (bypassing Ruby) and connect over the ControlMaster socket
# (bypassing the connection setup) so are almost instantaneous.
#
@mheiges
mheiges / workflow-software-sysadmin-init.sh
Last active March 28, 2018 15:56
Install sysadmin environment for EuPathDB BRC workflow software
#!/bin/sh
set -e
# Usage: workflow-software-sysadmin-init.sh [/path/to/workflow-software]
# were [/path/to/workflow-software] is where to install the sysadmin
# directory. Defaults to $HOME.
#
# This script nitializes and bootstraps the `${wfs_dir}/sysadmin`
# directory with required infrastructure. The end result is an
# environment where the workpuppet script can be run to maintain
@mheiges
mheiges / downloadOracleJdk
Created June 3, 2015 19:38
Download Oracle JDK RPM files
#!/usr/bin/perl
# Scrape Oracle JDK web pages for RPM links. Download those RPM files.
# Deletes downloaded files that do not pass rpm checksum (e.g. incomplete downloads).
# Skips downloading files already on the local filesystem.
use strict;
use sigtrap qw(handler exit_handler normal-signals error-signals);
@mheiges
mheiges / make_admin_bin.sh
Last active August 29, 2015 14:04
Link executables into $admin_path/bin/ for cluster/workflow software management
#!/bin/sh
set -u -e
admin_path=$1;
if [ -d "$admin_path/bin" ]; then
mv "$admin_path/bin" "$admin_path/bin.bak"
fi
mkdir "$admin_path/bin"
@mheiges
mheiges / isjobfailed
Created May 2, 2012 15:50
Groovy script to skip build if other job is failed
/**
Checks the last build status of a sentinel job and if worse than expected,
aborts the job running this script.
Example usage. Use this script in a pre-scm build step (using pre-scm plugin) for
qa.eupathdb.org . Configure the qa.eupathdb.org job to use the integrate.eupathdb.org
job as a sentinel_job. If the last build of integrate.eupathdb.org is worse than
expected when a qa.eupathdb.org build is started then abort the qa.eupathdb.org
build so it doesn't pick up the bad code that failed the sentinel job.