Skip to content

Instantly share code, notes, and snippets.

View ianblenke's full-sized avatar
🎯
Focusing

Ian Blenke ianblenke

🎯
Focusing
View GitHub Profile
@ianblenke
ianblenke / deploy.sh
Last active August 29, 2015 14:19 — forked from gmas/deploy.sh
#! /bin/bash
SHA1=$1
BUILD_NUM=$2
# Push image to Docker Registry
docker commit `docker run -d portaldev_web` $DOCKER_REPO:$SHA1
docker push $DOCKER_REPO:$SHA1
# Create Elastic Beanstalk zipped source bundle
DOCKERRUN_FILE=Dockerrun.aws.json
@ianblenke
ianblenke / gist:08d1424134626e6c175f
Created April 16, 2015 19:18
Docker command-line completion
curl -skL -X GET https://raw.githubusercontent.com/docker/docker/master/contrib/completion/bash/docker > `brew --prefix`/etc/bash_completion.d/docker
@ianblenke
ianblenke / gist:b127e483ce08dbaf6410
Created April 16, 2015 15:19
Switch boot2docker from aufs to overlayfs
echo "DOCKER_STORAGE=overlay" >> /var/lib/boot2docker/profile`
sudo btrfs filesys show
sudo btrfs filesys balance start -dusage=1 /var/lib/docker
@ianblenke
ianblenke / es_pri_allocate_unassigned.md
Last active November 18, 2021 00:14
elasticsearch trying to allocate a primary shard which is disabled

Allow routing allocations:

curl -XPUT localhost:9200/_cluster/settings -d '{
                "transient" : {
                    "cluster.routing.allocation.enable" : "all"
                }
        }'
@ianblenke
ianblenke / build_docker.sh
Created March 18, 2015 16:49
Buiding docker from source
DOCKER_BUILDTAGS=btrfs_noversion AUTO_GOPATH=1 BINPATH=. make binary
@ianblenke
ianblenke / gist:ee9bb6331ac1d47e97ad
Created March 17, 2015 13:20
"systemctl cat etcd" on a CoreOS host
$ systemctl cat etcd
# /usr/lib64/systemd/system/etcd.service
[Unit]
Description=etcd
[Service]
User=etcd
PermissionsStartOnly=true
Environment=ETCD_DATA_DIR=/var/lib/etcd
Environment=ETCD_NAME=%m
@ianblenke
ianblenke / rethinkdb.cloud-init
Created March 13, 2015 21:59
Rethink-DB CoreOS cloud-init
#cloud-config
coreos:
units:
- name: rethinkdb-create-fleet-units.service
command: start
content: |
[Unit]
After=docker.service
ConditionFileIsExecutable=/srv/rethinkdb-create-fleet-units.sh
ConditionFileNotEmpty=/srv/[email protected]
@ianblenke
ianblenke / gist:d1924b1350793c6b8204
Last active September 29, 2015 12:00
Amazon ECS on CoreOS
@ianblenke
ianblenke / add-xfleet-conflicts.sh
Created March 10, 2015 18:56
Fix fleet's naive unit count based scheduling of deis application units by resubmitting fleet units with an X-Fleet Conflicts glob
#!/bin/bash -e
tmpdir=/tmp/add-xfleet-conflicts
mkdir -p $tmpdir
fleetctl list-units -fields=unit -no-legend | grep -v -e '@\|deis' | cut -d. -f1-2 | sort | uniq | while read name ; do
max=$(fleetctl list-machines -no-legend | wc -l)
count=$(fleetctl list-units -fields=unit -no-legend | grep -e "^$name" | wc -l)
fleetctl list-units -fields=unit -no-legend | grep -e "^$name" | sort -n | while read service; do
tmpfile=$tmpdir/$service
fleetctl cat $service >| $tmpfile
if ! grep X-Fleet $tmpfile > /dev/null; then