Skip to content

Instantly share code, notes, and snippets.

{
“variables”: {
"from": "# from https://www.bryanandrews.org/howto-aws-ami-creation-with-puppet/"
“access_key”: “AAjdifg84hjghjdf”,
“secret_key”: “WefwasGJDShish4seoghswSRJGOwt”,
“cloudcfg_url”: “https://raw.githubusercontent.com/bandrews/ami-automation/master/cloud.cfg”,
“puppet_url”: “https://puppet.example.com:8140/packages/current/install.bash”
},
“builders”: [{
“type”: “amazon-ebs”,
# from https://www.bryanandrews.org/howto-aws-ami-creation-with-puppet/
#
disable_root: 0
ssh_pwauth: 1
manage_etc_hosts: false
locale_configfile: /etc/sysconfig/i18n
mount_default_fields: [~, ~, ‘auto’, ‘defaults,nofail’, ‘0’, ‘2’]
resize_rootfs_tmp: /dev
ssh_deletekeys: 0
ssh_genkeytypes: ~
@kettlewell
kettlewell / gist:e401237ce00c3e6eef11237302bbdade
Created July 25, 2016 09:54 — forked from analytically/gist:1a6bdcfa711474d7ba24
Ubuntu 14.04 AWS EC2 cloud-init (Kernel 3.18+NTP+ixgbevf+Docker+Route53) - to be used with ami-870a2fb7 and newer instance types (eg. t2, m3, c3, r3)
#!/bin/bash
set -e
sudo rm -f /etc/update-motd.d/10-help-text
sudo rm -f /etc/update-motd.d/51-cloudguest
sudo rm -f /etc/update-motd.d/91-release-upgrade
echo -e "[sysinfo]\nexclude_sysinfo_plugins = LandscapeLink" | sudo tee /etc/landscape/client.conf
echo deb https://get.docker.com/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
@kettlewell
kettlewell / vmdk2ami.sh
Created July 20, 2016 11:52
script that takes VMDK images, and converts them into an AMI in a fairly sane manner
#!/bin/bash
# This script takes a VMDK or raw Image file and converts it to a AMI on
# Amazon Web Services
#
# The workflow is as follows
# 1) Import Image as a AWS Volume
# This creates an upload task
# 2) Start the upload and conversion. This actually uploads to an S3 bucket, before converting to a raw
# format and creating a volume from it.
@kettlewell
kettlewell / sbt-dynamic-scalac-options.scala
Last active May 19, 2016 11:27
SBT 0.10 dynamic scalac options
object StandardBuild {
lazy val standardSettings: Seq[Project.Setting[_]] =
Defaults.defaultSettings ++ compilerSettings
lazy val scalacBaseOptions = SettingKey[Seq[String]]("scalac-base-options", "Options for the Scala Compiler in all modes")
lazy val scalacSnapshotOptions = SettingKey[Seq[String]]("scalac-snapshot-options", "Options for the Scala Compiler in Development Mode")
lazy val scalacReleaseOptions = SettingKey[Seq[String]]("scalac-release-options", "Options for the Scala Compiler in Release Build")
lazy val compilerSettings: Seq[Project.Setting[_]] = Seq(
scalacSnapshotOptions := Seq("-Xcheckinit"),
@kettlewell
kettlewell / backend-architectures.md
Created October 13, 2015 11:10 — forked from ngocphamm/backend-architectures.md
Backend Architectures
@kettlewell
kettlewell / copy_db.sql
Last active August 29, 2015 14:11 — forked from swrobel/copy_db.sql
DELIMITER $$
DROP PROCEDURE IF EXISTS `CopyDB` $$
CREATE PROCEDURE `CopyDB` (sourceDB VARCHAR(64),targetDB VARCHAR(64))
TheStoredProcedure:BEGIN
DECLARE found_count,ndx,ndx_last INT;
DECLARE sqlcmd VARCHAR(1024);
SELECT COUNT(1) INTO found_count
FROM information_schema.tables