This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file describes all subnets on our WAN. The name 'vpc' is a bit | |
# misleading since it also refers to non-VPC subnets (e.g. office network, | |
# physical data centre etc.) | |
# and also defines the IPSec tunnels between the various locations. | |
# For the sake of this document, "VPC" is used to refer to any location. | |
# | |
# VPC's are configured by a separate stack template than the IPSec tunnels, | |
# but both template types read this file to know what to do. | |
# | |
# The rule is that each VPC can have EITHER incoming OR outgoing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: http://osxdaily.com/2012/03/30/lock-mac-desktop-command-line/ | |
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
aws ec2 describe-regions --query 'Regions[*].RegionName' --output text | \ | |
tr '\t' '\n' | \ | |
while read REGION | |
do | |
aws ec2 describe-availability-zones --region $REGION \ | |
--query 'AvailabilityZones[*].{ZoneName:ZoneName,Region:RegionName}' \ | |
--output text | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# aligns the '=>' to be accepted by our puppet-lint. The indentation is very | |
# specific to our source so will have to be adjusted to other files. | |
# The "29" in the awk printf is the length of the longest plugin name, so all | |
# other entries are aligned with it. You can get it using "wc -c <<<(longest-plugin-name)" | |
java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar \ | |
-s http://localhost list-plugins | \ | |
tr -d '()' | \ # get rid of versions in parenthesis, perhaps available upgrades | |
sort | \ | |
awk '{ printf " \047%s\047%*s=> {\n version => \047%s\047,\n },\n", $1, 29-length($1), "", $NF }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Pivot the root partition to a tmpfs mount point so that the root volume can | |
# be re-partitioned. | |
# | |
############################################################################## | |
set -x | |
set -e | |
# Prevent selinux from interfering |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# create custom fact to identify the role of this server | |
mkdir -p /etc/facter/facts.d/ | |
echo "server_role=puppetmaster" >> /etc/facter/facts.d/server_role.txt | |
# make sure everything is up to date | |
wget http://apt.puppetlabs.com/puppetlabs-release-raring.deb | |
dpkg -i puppetlabs-release-raring.deb | |
apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# treeps -- show ps(1) as process hierarchy -- v1.0 [email protected] 07/08/14 | |
my %p; # Global array of pid info | |
sub PrintLineage($$) { # Print proc lineage | |
my ($pid, $indent) = @_; | |
printf("%s |_ %-8d %s\n", $indent, $pid, $p{$pid}{cmd}); # print | |
foreach my $kpid (sort {$a<=>$b} @{ $p{$pid}{kids} } ) { # loop thru kids | |
PrintLineage($kpid, " $indent"); # Recurse into kids | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"builders": [ | |
{ | |
"boot_wait": "2s", | |
"disk_size": 40960, | |
"guest_os_type": "darwin12-64", | |
"iso_checksum_type": "none", | |
"iso_url": "{{user `iso_url`}}", | |
"shutdown_command": "echo '{{user `username`}}'|sudo -S shutdown -h now", | |
"skip_compaction": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import sys | |
import yaml | |
import json | |
import importlib | |
import getopt | |
from troposphere import Template | |
sys.path.append(os.path.dirname(os.path.realpath(__file__ + "/.."))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
adapter: mysql2 | |
encoding: utf8 | |
database: my_database | |
username: root | |
roles: | |
- admin | |
- developer | |
- guest | |
password: |