Skip to content

Instantly share code, notes, and snippets.

View spjmurray's full-sized avatar

Simon Murray spjmurray

  • Nscale
  • Manchester UK
View GitHub Profile
neutron net-create simon
neutron subnet-create --dns-nameserver 8.8.8.8 --dns-nameserver 8.8.4.4 simon 10.0.0.0/24
neutron net-external-list
+--------------------------------------+---------+-------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+---------+-------------------------------------------------------+
| 4f70b326-b186-4053-a009-7711fc25693c | ext-net | 0ab3b221-4415-4db5-9290-8893b8ce9ccc 85.199.252.64/26 |
+--------------------------------------+---------+-------------------------------------------------------+
neutron router-create simon
neutron router-gateway-set e7b907f3-5a3c-4e78-a551-e097969e16d4 4f70b326-b186-4053-a009-7711fc25693c
neutron router-interface-add e7b907f3-5a3c-4e78-a551-e097969e16d4 5871045a-b01c-4c26-a61e-745dd0d8205a
neutron subnet-show 5871045a-b01c-4c26-a61e-745dd0d8205a
+------------------+--------------------------------------------+
| Field | Value |
+------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| cidr | 10.0.0.0/24 |
| dns_nameservers | 8.8.4.4 |
| | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 10.0.0.1 |
nova boot --flavor 2 --key_name simon --image bffe4f4c-cda2-4a80-bfd8-b06762c49d28 --nic net-id=a8b4daeb-5ace-4b3d-bb66-90d72f830712 --user-data user-data.sh --poll puppet
#!/bin/bash
PUPPET_REPO='deb http://apt.puppetlabs.com trusty main dependencies'
REPO='[email protected]:datacentred/datacentred-myrepo'
ENVDIR='/etc/puppet/environments'
PRODENV="${ENVDIR}/production"
## We need a recent version of puppet so force bleeding edge
wget -q http://apt.puppetlabs.com/pubkey.gpg -O- | apt-key add -
echo $PUPPET_REPO > /etc/apt/sources.list.d/puppetlabs.list
neutron floatingip-create ext-net
neutron floatingip-associate 8543af06-22f6-402b-a7b3-908f25e8b6e0 6272c097-6a23-4397-8031-392295187f2f
nova secgroup-add-rule 6c49300d-4c7b-4585-8796-f80798ff3523 icmp -1 -1 0.0.0.0/0
nova secgroup-add-rule 6c49300d-4c7b-4585-8796-f80798ff3523 tcp 1 65535 0.0.0.0/0
nova secgroup-add-rule 6c49300d-4c7b-4585-8796-f80798ff3523 udp 1 65535 0.0.0.0/0
@spjmurray
spjmurray / gist:cc935c59569d1bff184d
Last active August 29, 2015 14:07
S3 Bucket Creation
#!/bin/bash
token='I858I8ZG0L80D9D8EQI8'
secret='cWIxgBEzPWmZcUsmbreXfT8gJvn9PIbCsQO9Bvtr'
query=$1
date=`date -Ru`
header="PUT\n${content_md5}\n${content_type}\n${date}\n${query}"
sig=`echo -en ${header} | openssl sha1 -hmac ${secret} -binary | base64`
curl -X PUT \
@spjmurray
spjmurray / gist:4aff2edba4353ef7bc00
Last active August 29, 2015 14:07
S3 Object Creation
#!/bin/bash
token='I858I8ZG0L80D9D8EQI8'
secret='cWIxgBEzPWmZcUsmbreXfT8gJvn9PIbCsQO9Bvtr'
query=$1
object=$2
date=`date -Ru`
header="PUT\n${content_md5}\n${content_type}\n${date}\n${query}"
sig=`echo -en ${header} | openssl sha1 -hmac ${secret} -binary | base64`
#!/bin/bash
token='I858I8ZG0L80D9D8EQI8'
secret='cWIxgBEzPWmZcUsmbreXfT8gJvn9PIbCsQO9Bvtr'
query=$1
date=`date -Ru`
header="GET\n${content_md5}\n${content_type}\n${date}\n${query}"
sig=`echo -en ${header} | openssl sha1 -hmac ${secret} -binary | base64`
curl -X GET \