Skip to content

Instantly share code, notes, and snippets.

View mefellows's full-sized avatar

Matt Fellows mefellows

View GitHub Profile
@mefellows
mefellows / Dockerfile
Last active January 27, 2016 17:17
Dockerizing CI environments blog post
RUN apt-get update && apt-get install -y wget
RUN wget https://github.com/jwilder/dockerize/releases/download/v0.1.0/dockerize-linux-amd64-v0.1.0.tar.gz
RUN tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.1.0.tar.gz
@mefellows
mefellows / HelloApp.js
Last active January 12, 2016 22:58
MelbJS - Metrics on the front, data at the back
import bucky from 'bucky';
class HelloApp extends React.Component {
constructor(props) {
super(props);
bucky.send('helloapp.constructor', 2432.43434);
this.state = {
filterType: 'all'
};
@mefellows
mefellows / Nginx.scala
Last active September 22, 2015 12:47
Nginx - DNSMasq, Docker, Gatling and Muxy
package au.com.onegeek.nginxperf
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class Nginx extends Simulation {
val httpConf = http
.baseURL("http://api.foo.com")
@mefellows
mefellows / tools.md
Last active August 30, 2022 22:40
Networking Tools - Cheat Sheet

*nix Networking Tools Cheat Sheet

## Network Performance

iperf (all)

Setup the server:

iperf -s
@mefellows
mefellows / docker-run.sh
Created August 6, 2015 04:52
Run arbitrary scripts that require Docker, within another Docker container
#!/usr/bin/env bash
set -e
abort()
{
echo "Docker: an error occurred. Exiting..." >&2
exit 1
}
script_path_required()
@mefellows
mefellows / packer.json
Created June 19, 2015 06:58
Restart Windows Defect - Packer Community #54
{
"builders": [
{
"type": "virtualbox-ovf",
"communicator":"winrm",
"name":"win2008updates",
"source_path": "/Users/mfellows/Downloads/output-basebox-vbox/talentsearch-api-1.0.0.ovf",
"headless": false,
"boot_wait": "1m",
"winrm_username": "vagrant",
@mefellows
mefellows / packer.json
Last active August 29, 2015 14:21
Packer - Issue 48 repro
{
"builders": [ {
"type": "virtualbox-windows-ovf",
"name": "vagrantbox",
"source_path": "/Users/mfellows/Downloads//output-virtualbox-iso/packer-virtualbox-iso-1417096689.ovf",
"guest_additions_mode": "disable",
"headless":false,
"boot_wait":"15s",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
@mefellows
mefellows / destroy.sh
Last active August 29, 2015 14:20
Machine Factories with Windows Part 3: Terraform your cloud
terraform destroy -var access_key=$AWS_ACCESS_KEY_ID -var secret_key=$AWS_SECRET_ACCESS_KEY --var ami_id=ami-12345678
@mefellows
mefellows / BundleConfig.ps1
Last active December 25, 2023 23:33
Sysprepped Windows AMI using Packer
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
foreach ($element in $xmlElement.Property)
{
if ($element.Name -eq "AutoSysprep")
{
$element.Value="Yes"
}
@mefellows
mefellows / ec2ssh.sh
Created May 1, 2015 06:32
AWS EC2 SSH onto an instance with one command, given an instance id
#!/bin/bash
INSTANCE_ID=$1
IP=$(aws ec2 --region $AWS_REGION describe-instances --instance-id $INSTANCE_ID | jq -r .Reservations[0].Instances[0].PrivateIpAddress)
KEYPAIR_NAME=$(aws ec2 --region $AWS_REGION describe-instances --instance-id $INSTANCE_ID | jq -r .Reservations[0].Instances[0].KeyName)
ssh -i ~/.ssh/$KEYPAIR_NAME.pem "ec2-user@$IP"