Skip to content

Instantly share code, notes, and snippets.

View brandongalbraith's full-sized avatar

B brandongalbraith

  • North America
View GitHub Profile
@stas
stas / vsftpd.conf
Created February 26, 2010 14:46
VSFTPD.CONF for virtual users with write/read/delete permissions
###
# VSFTPD.CONF for virtual users with write/read/delete permissions
###
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
@ecarter
ecarter / major_us_city_dma_codes.py
Created May 25, 2010 16:18
Major US Cities with Latitude/Longitude and DMA Codes
# Major US Cities with DMA Codes
major_cities = [
{'city': 'Anchorage', 'dma_code': 743, 'latitude': 61.2180556, 'longitude': -149.9002778, 'region': 'AK', 'slug': 'anchorage-ak'},
{'city': 'Fairbanks', 'dma_code': 745, 'latitude': 64.837777799999998, 'longitude': -147.7163889, 'region': 'AK', 'slug': 'fairbanks-ak'},
{'city': 'Juneau', 'dma_code': 747, 'latitude': 58.301944399999996, 'longitude': -134.4197222, 'region': 'AK', 'slug': 'juneau-ak'},
{'city': 'Birmingham', 'dma_code': 630, 'latitude': 33.520660800000002, 'longitude': -86.802490000000006, 'region': 'AL', 'slug': 'birmingham-al'},
{'city': 'Dothan', 'dma_code': 606, 'latitude': 31.223231299999998, 'longitude': -85.3904888, 'region': 'AL', 'slug': 'dothan-al'},
{'city': 'Decatur', 'dma_code': 691, 'latitude': 34.605925300000003, 'longitude': -86.983341699999997, 'region': 'AL', 'slug': 'decatur-al'},
{'city': 'Florence', 'dma_code': 691, 'latitude': 34.799810000000001, 'longitude': -87.677250999999998, 'region': 'AL', 'slug': 'florence-al'},
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
MY_NAME = 'Yossef Mendelssohn'
CHECKIN_REQUEST_URL = 'http://www.southwest.com/flight/retrieveCheckinDoc.html'
prompt = false
conf = ARGV[0]
@seedifferently
seedifferently / Amazon_SES.py
Created February 1, 2011 19:34
Simple example email wrapper for Boto's SES
"""
Example code for sending emails using boto's SES module. Its main purpose is to
show how easy it is to build multipart text/html emails.
Unfortunately, at this time Amazon's SES doesn't seem to allow you to add
attachments to messages, but if it does in the future it would probably look
like the code that I've commented out below the exception.
The SES module of the Boto package isn't quite finalized yet, but I currently
have this code running using Harry Marr's implementation which is available at:
@btompkins
btompkins / Fabric-UserSetup.py
Created February 7, 2011 18:15
Simple fabric function to create a new user
def new_user(admin_username, admin_password):
env.user = 'root'
# Create the admin group and add it to the sudoers file
admin_group = 'admin'
runcmd('addgroup {group}'.format(group=admin_group))
runcmd('echo "%{group} ALL=(ALL) ALL" >> /etc/sudoers'.format(
group=admin_group))
# Create the new admin user (default group=username); add to admin group
@nojimage
nojimage / org.macports.zabbix_agent.plist
Created April 6, 2011 07:18
auto startup zabbix agent on Mac OS X (macports)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.macports.zabbix_agent</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/share/zabbix/zabbix_agentd.init</string>
@robballou
robballou / gist:929564
Created April 19, 2011 20:31
Example python of how to add DNS entries to Amazon's Route 53 with the boto library
from boto.route53.connection import Route53Connection
# your amazon keys
key = ""
access = ""
if __name__ == '__main__':
zones = {}
route53 = Route53Connection(key, access)
@liamf
liamf / autoscale_sample
Created May 6, 2011 12:05
Demonstrates using patched boto to create an autoscaling group of servers, scaled up/down by CPU Utilisation
#################################################################################
# Import modules
#################################################################################
import os
import time
import sys
import socket
import string
@numan
numan / autoscaling_boto.py
Created July 17, 2011 00:42
Example of setting up AWS auto scaling using boto API
"""
The MIT License (MIT)
Copyright (c) 2011 Numan Sachwani
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
@msmith
msmith / couchdb-ec2-install.sh
Created August 25, 2011 17:26
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"