Skip to content

Instantly share code, notes, and snippets.

View jasonrm's full-sized avatar

Jason R. McNeil jasonrm

  • Arizona
  • 00:04 (UTC -07:00)
View GitHub Profile
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 85c1007261403f041d32da700583c488c079b7e1
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.9-x86_64
Xcode: 5.0.1
LLVM-GCC: N/A
@jasonrm
jasonrm / rabbitmq-server-generic-unix-3.1.5.tar.gz
Created October 11, 2013 20:49
rabbitmq_auth_backend_ldap broken in rabbitmq-server-mac-standalone-3.1.5.tar.gz?
=INFO REPORT==== 11-Oct-2013::13:07:42 ===
Starting RabbitMQ 3.1.5 on Erlang R16B02
Copyright (C) 2007-2013 GoPivotal, Inc.
Licensed under the MPL. See http://www.rabbitmq.com/
=INFO REPORT==== 11-Oct-2013::13:07:42 ===
node : rabbit@localhost
home dir : /Users/jason/srv/artfire/rabbitmq
cookie hash : fT5aWVWDf7s+0K6PDJ+dEg==
log : /Users/jason/srv/artfire/rabbitmq/rabbit@localhost.log
@jasonrm
jasonrm / _commands
Last active December 25, 2015 13:49
$ docker import http://docker-hckr-net.s3.amazonaws.com/arch-base-2013.10.15.tar.gz jasonrm/arch 2013.10.15
2404f2fd0184
$ docker images
REPOSITORY TAG ID CREATED SIZE
jasonrm/arch 2013.10.15 2404f2fd0184 29 seconds ago 609.8 MB (virtual 609.8 MB)
# Fails to start
$ docker run -i -t 2404f2fd0184 /bin/bash
2013/10/15 03:52:33 Unable to set up networking: ip failed: ip route add default via 172.17.42.1
CURRENT_DATE=$(date '+%Y.%m.%d')
# Create ZVOL
zfs create -V 1G rpool/zvol/docker-arch-base-${CURRENT_DATE}
mkfs.ext4 /dev/zvol/rpool/zvol/docker-arch-base-${CURRENT_DATE}
# Mount
mkdir -p /build/docker/arch-base
mount /dev/zvol/rpool/zvol/docker-arch-base-${CURRENT_DATE} /build/docker/arch-base
#!/bin/sh
# WARNING: Very Destructive to existing data
# Based on: https://gist.github.com/chetan/712484
set -u
set -x
set -e
@jasonrm
jasonrm / gist:7125988
Last active December 26, 2015 08:59
docker run/start
core@coreos-2 ~ $ docker run -i -t ubuntu:12.04 /bin/bash
root@3ff5566e376e:/# echo 'three' > hello
root@3ff5566e376e:/# exit
core@coreos-2 ~ $ docker ps -a
ID IMAGE COMMAND CREATED STATUS PORTS
3ff5566e376e ubuntu:12.04 /bin/bash 1 minutes ago Exit 0
core@coreos-2 ~ $ docker start 3ff5566e376e
3ff5566e376e
@jasonrm
jasonrm / salt-minion.service
Last active August 29, 2015 13:57
Wait for systemd-networkd before starting salt-minion
# /etc/systemd/system/salt-minion.service
[Unit]
Description=Salt Minion Daemon
Requires=network.target
After=network.target
[Service]
Type=forking
PIDFile=/run/salt/salt-minion.pid
ExecStart=/usr/bin/salt-minion -d
[Unit]
Description=Zettabyte File System (ZFS)
Documentation=man:zfs(8) man:zpool(8)
DefaultDependencies=no
After=cryptsetup.target
Before=local-fs.target
Conflicts=shutdown.target umount.target
[Service]
Type=oneshot
@jasonrm
jasonrm / salt.markdown
Last active August 29, 2015 14:00
Manageable salt state independence

I'm trying to determine how I might be able to keep a group of states (modules) from having direct knowledge about each other, while still allowing them to put and get configuration information on a local-to-the-minion level.

For example, my nginx related states and config should have no knowledge about logstash and where it might put a config file. Instead I want the logstash to make it known (how is the question) that it has a log file available for consumption.

Say I have a logstash process running on a machine and it's configuration looks something like the below. Right now it's going to read in just one log file, but in just a bit I want it to read in any log file that another service, managed via a role/state, might add.

/etc/logstash/agent.conf
input {
 file {
@jasonrm
jasonrm / iam.json
Last active August 29, 2015 14:01
Arq Backup Amazon S3/Glacier IAM
{
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetBucketLocation", "s3:ListAllMyBuckets"],
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": ["s3:*"],