Skip to content

Instantly share code, notes, and snippets.

View mmm's full-sized avatar

Mark Mims mmm

View GitHub Profile
######### CREATE A SERVICE #################
configure
service
add “SMTPS_587_TCP”
ip-type 6
port-begin 587
port-end 587
end
finished
### Keybase proof
I hereby claim:
* I am mmm on github.
* I am m_3 (https://keybase.io/m_3) on keybase.
* I have a public key whose fingerprint is 0D9E DC5F 633B 05D4 7633 42C3 76D4 635F B2A3 4D75
To claim this, I am signing this object:
@mmm
mmm / install
Created September 7, 2011 13:44
sun java on ubuntu
#!/bin/bash
RELEASE_CODE=`lsb_release -a | awk '/Codename/ { print $2 }'`
add-apt-repository "deb http://archive.canonical.com/ ${RELEASE_CODE} partner"
apt-get update
apt-get -y install -qq --no-install-recommends debconf-utils
echo "sun-java6-plugin shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive apt-get -y install -qq sun-java6-jdk
@mmm
mmm / gist:1375100
Created November 18, 2011 00:31
step-by-step hadoop with juju
# install juju
$ sudo apt-get install juju charm-tools
configure your EC2 account...
$ juju
$ vi .juju/environments.yaml
add EC2 access/secret keys
@mmm
mmm / gist:1402781
Created November 29, 2011 00:31
erb templates for juju
# Generated by juju
<% active_backends.each do |server_name, server_info| %>
backend <%= server_name %> {
.host = "<%= server_info[:address] %>";
.port = "<%= server_info[:port] %>";
}
<% end %>
director baz round-robin {
@mmm
mmm / gist:1402941
Created November 29, 2011 01:33
templating with bash/cheetah
# cheetah from the command line...
Template file:
hawk:~ $ cat junk.file
This is a file
With a $stupid_variable to expand
and maybe a common one like $HOME
@mmm
mmm / gist:1406018
Last active September 28, 2015 07:28
decent-sized juju stack
#!/bin/bash
echo "deploying stack"
deploy_ha_mysql() {
juju deploy mysql masterdb
juju deploy mysql slavedb -n2
juju add-relation masterdb:master slavedb:slave
}
@mmm
mmm / gist:1903456
Created February 24, 2012 20:16
poor man's state machine
#
# move the following into lib/state_machine.rb or something?
# Also, the state transitions are not really atomic...
# works fine for now, but should fix eventually
#
%w(
new
validating
valid
invalid
@mmm
mmm / gist:2050525
Created March 16, 2012 15:25
juju rails stack
#!/bin/bash
juju_root=$HOME
juju_env=${1:-"-ecanonical"}
###
echo "deploying stack"
juju bootstrap $juju_env
@mmm
mmm / gist:5878432
Created June 27, 2013 17:23
some simple juju commands to deploy hadoop and ganglia
#!/bin/bash
# hadoop
juju deploy hadoop hadoop-master
juju deploy hadoop hadoop-slave -n12
juju add-relation hadoop-master:namenode hadoop-slave:datanode
juju add-relation hadoop-master:jobtracker hadoop-slave:tasktracker
# instrument hadoop-slave
juju deploy ganglia-node