Skip to content

Instantly share code, notes, and snippets.

View developerinlondon's full-sized avatar
🙂
BizOps

DevOps Extraordinaire! developerinlondon

🙂
BizOps
View GitHub Profile

shortcut for getting out of frozen ssh:

Enter~. 
@developerinlondon
developerinlondon / docker.md
Last active April 11, 2025 18:01
Docker saving and loading images

Here's how to save and load docker images:

Example scenario: To save a docker image from a docker repository and save it as a tar file locally.

  1. Save the image as a tarball

docker save repositoryname:tag > repotag.tar

  1. Zip the image

Deploying Deis on AWS

These instructions will get you up and running with Deis and CoreOS in a AWS VPC. There already exists a CloudFormation script to get up and running in AWS. But if you want to get down and dirty, this document will help walk you through the steps. Some of the AWS steps have the equivilent AWS CLI commands to get up and running without need for the AWS web interface.

AWS

Since we will be running CoreOS and Deis inside a VPC we need some AWS setup first. We need a single subnet VPC, some security groups, and instances of CoreOS.

VPC

This is a quick guide on installing HTTPie for Mac OS X systems. This is also useful if you want the python package management utility pip. An installed copy of Homebrew is a prerequisite.

HTTPie

# install the python package provided with homebrew
brew install python

# install HTTPie with the pip utility
pip install httpie
- hosts: all
vars:
ec2_access_key: "AKIA-----------A"
ec2_secret_key: "i-------------/--------A"
remote_user: ec2-user
sudo: yes
tasks:
- name: "make sure package perl-switch is installed for the monitoring scripts"
yum: name=perl-Switch state=present
when: ansible_os_family == "RedHat"
packer build packer.json 2>&1 | sudo tee output.txt
tail -2 output.txt | head -2 | awk 'match($0, /ami-.*/) { print substr($0, RSTART, RLENGTH) }' > sudo ami.txt
class sethostname {
file { "/etc/hostname":
ensure => present,
owner => root,
group => root,
mode => 644,
content => "$::fqdn\n",
notify => Exec["set-hostname"],
}
exec { "set-hostname":
@developerinlondon
developerinlondon / PackerPolicy.json
Created February 26, 2016 13:49 — forked from MattSurabian/PackerPolicy.json
Minimum IAM policy required by AWS for Packer to do its thing. https://github.com/mitchellh/packer Permissions are broken out by API functionality and a resource array has been defined with a wild card for each group. For tighter security resource level permissions can be applied per this documentation: http://aws.typepad.com/aws/2013/07/resourc…
{
"Statement": [
{
"Sid": "PackerSecurityGroupAccess",
"Action": [
"ec2:CreateSecurityGroup",
"ec2:DeleteSecurityGroup",
"ec2:DescribeSecurityGroups",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress"
@developerinlondon
developerinlondon / how to install ansible
Created April 27, 2016 15:04
steps to install ansible from source
For anyone who finds this and wants to run a version of ansible that is not full of bugs (which are not edge case bugs i might add) here are the steps you should use on ubuntu. This is specific to trusty, but should be usable with other ubuntu versions by replacing the download URL:
# Make sure we are up to date
/usr/bin/apt-get update
# Download working ansible deb package
wget https://launchpad.net/~ansible/+archive/ubuntu/ansible/+build/8129693/+files/ansible_1.9.4-1ppa~trusty_all.deb -O /tmp/ansible.deb
# Manually install deps
apt-get install -y python-support \