Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# YAML config for these Ansible roles: | |
# https://github.com/LaneCommunityCollege/aspects_logstash | |
# https://github.com/LaneCommunityCollege/aspects_logstash_forwarder | |
# | |
# Since it's just straight config blocks, you should be able to just copy and paste what you need if you don't use | |
# those Ansible roles. | |
# | |
# End result is multiline logs combined into one, and dates are parsed correctly. | |
aspects_logstash_rules: |
function setjava { | |
local vmdir=/Library/Java/JavaVirtualMachines | |
local ver=${1?Usage: setjava <version>} | |
export JAVA_HOME=`/usr/libexec/java_home -v $ver` | |
PATH=$(echo $PATH | tr ':' '\n' | grep -v $vmdir | tr '\n' ':') | |
export PATH=$JAVA_HOME/bin:$PATH | |
java -version | |
} |
#!/bin/bash | |
# Start/stop an EC2 instance for use as an ssh tunnel | |
# requires the aws package locally -- sudo apt-get install awscli | |
# | |
# usage: ./tunnel.sh start (spin up EC2 and create the tunnel) | |
# ./tunnel.sh stop (terminate the EC2 instance to save money) | |
# ./tunnel.sh resume (in case your tunnel is interrupted but the EC2 instance is still running) | |
# CHANGE THE PARAMETERS BELOW |
#!/bin/sh | |
# Cleanup docker files: untagged containers and images. | |
# | |
# Use `docker-cleanup -n` for a dry run to see what would be deleted. | |
untagged_containers() { | |
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1. | |
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6). | |
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470 | |
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}' |
#!/bin/bash | |
# | |
# Copies certain kinds of known files and directories from a given Jenkins master directory | |
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em. | |
# | |
set -ex | |
if [ $# -ne 2 ]; then | |
echo usage: $0 root_dir jenkins_master |
# While GNU coreutil's ls is generally more featureful (including colorization | |
# based on file extensions, SI size formats, ISO date and time formats, | |
# semantic version sort, etc.), OS X's fork of FreeBSD ls allows viewing HFS+ | |
# extended attributes and access control lists through the -@ and -e flags, | |
# respectively. | |
# | |
# This script provides a shim to allow BSD ls to be invoked with GNU-style | |
# flags and .dircolor files, and a function that shadows ls, invoking coreutils | |
# ls by default but automatically switching to the shim when the -@ and/or -e | |
# flags are detected. |
""" | |
An IPython magic function to pretty-print objects with syntax highlighting. | |
See, "Defining your own magics": | |
http://ipython.org/ipython-doc/stable/interactive/reference.html#defining-your-own-magics | |
For more on Pygments: | |
http://pygments.org/docs/quickstart/ | |
Usage |
#!/bin/bash | |
# High-performance, native SSH implementation for Jenkins SSH slaves. Jenkins' | |
# standard turn-key SSH slave implementation uses an embedded, "pure Java" | |
# implementation of SSH (https://github.com/jenkinsci/trilead-ssh2). | |
# That standard implementation combines all of the convenience of a pure Java | |
# implementation with all of the "performance" of a pure Java implementation :P | |
# If your distributed build process generates large build artifacts like ISOs, | |
# VM images, Vagrant boxes, etc, then you will see a substantial benefit from |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: <service name> | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: <service description> | |
### END INIT INFO |