Skip to content

Instantly share code, notes, and snippets.

View teknogeek0's full-sized avatar
💭
☁️☁️☁️☁️☁️☁️☁️☁️

Chris Munns teknogeek0

💭
☁️☁️☁️☁️☁️☁️☁️☁️
View GitHub Profile
@teknogeek0
teknogeek0 / fun with chef compression
Created September 26, 2011 16:49
fun with chef compression
[root@XXXXXXXX.com:/var/lib/couchdb ]ll --si
total 1.5G
-rw-r--r-- 1 couchdb couchdb 1.5G Sep 26 12:44 chef.couch
[root@XXXXXXXX.com:/var/lib/couchdb ]curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_compact
{"ok":true}
[root@XXXXXXXX.com:/var/lib/couchdb ]ll --si
total 1.1M
-rw-r--r-- 1 couchdb couchdb 1.1M Sep 26 12:45 chef.couch
@teknogeek0
teknogeek0 / gist:3200591
Created July 29, 2012 17:54 — forked from danparsons/gist:3195652
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@teknogeek0
teknogeek0 / block_world_iptables.sh
Created September 30, 2012 19:52
block ips from around the world.
IPTABLES="/sbin/iptables"
### block all Asian/APNIC IPs (includes NZ, AU)
$IPTABLES -A bad_stuff -s 58.0.0.0/8 -j DROP
$IPTABLES -A bad_stuff -s 59.0.0.0/8 -j DROP
$IPTABLES -A bad_stuff -s 60.0.0.0/8 -j DROP
$IPTABLES -A bad_stuff -s 61.0.0.0/8 -j DROP
$IPTABLES -A bad_stuff -s 110.0.0.0/8 -j DROP
$IPTABLES -A bad_stuff -s 111.0.0.0/8 -j DROP
$IPTABLES -A bad_stuff -s 112.0.0.0/8 -j DROP
@teknogeek0
teknogeek0 / block_world_iptables.sh
Last active December 10, 2015 14:38
A really basic way to block out most of the world from annoying a host of yours. Now with pingdom added.
#!/bin/sh
#################################################################
##
## START VARIABLES
##
IPTABLES="/sbin/iptables"
INET_IFACE="eth0"
LO_IFACE="lo"
@teknogeek0
teknogeek0 / gist:4548131
Created January 16, 2013 15:48
slightly cleaned up bees with machine guns cloudformation template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Create a spot-priced AutoScaling group and a Bees With Machine Guns controller; execute the load test against the AutoScaling group and store the results in S3. Run /home/ec2-user/run-bees to execute load tests manually.",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String"
},
"BeesControllerInstanceType": {
"Description": "Type of EC2 instance to launch",
@teknogeek0
teknogeek0 / instancelist.py
Created January 30, 2013 16:44
simple boto script to list instances and some information about them.
#!/usr/bin/env python
import boto
import os
ACCESS_KEY="<YOUR ACCESS KEY>"
SECRET_KEY="<YOUR SECRET KEY>"
ec2 = boto.connect_ec2(ACCESS_KEY, SECRET_KEY)

This gist contains everything you need to install StatsD and Graphite on CentOS 6.3. Unless I forgot something. If I did, shoot a reminder email to noah at one more bug dot com. tl;dr womm.

I (mostly) followed the steps shown in the EZUnix wiki

And I also referred back to this gist by Michael Grace

@teknogeek0
teknogeek0 / gist:6690813
Created September 24, 2013 20:33
ebsraider
#!/bin/bash
# made by Chris Munns
host_info=`ec2-describe-instances | grep $HOSTNAME`
host_id=`echo $host_info | awk '{print $2}'`
host_zone=`echo $host_info | awk '{print $11}'`
SCHEDULER=deadline
MDADMCOM=/sbin/mdadm
volNum=$1
volSize=$2
template node[:deploy][:current_path]"/wp-config.php" do
How do I fix the above? I want to combine the node attributes with the file at the end.
Thanks,
-munns
#!/usr/bin/env ruby
require 'aws-sdk'
client = AWS::SimpleWorkflow.new(:region => "us-west-2")
puts "looking for a domain"
mydomain = client.domains['ReInvent2014']
if mydomain.exists?
if mydomain.workflow_types['EIPMapper','1.0'].exists?