Skip to content

Instantly share code, notes, and snippets.

Everett Toews etoews

Block or report user

Report or block etoews

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@etoews
etoews / peppernuts.md
Last active Dec 27, 2016
A recipe for peppernuts
View peppernuts.md

Initial ingredients:

  • 1 cup white sugar
  • 1 cup Rogers Golden Syrup
  • 1 cup margarine
  • 1/2 tsp. cloves
  • 1 tsp. ginger
  • 1 tsp. aniseed
  • 1/2 tsp. mace

Mix all these ingredients in a heavy pot; boil for 2 min. Let cool until lukewarm.

@etoews
etoews / requirements-diff.py
Created Dec 7, 2016
Short script to find the intersection of your requirements and test requirements
View requirements-diff.py
#!/usr/bin/env python
requirements = set()
test_requirements = set()
with open('requirements.txt') as f:
for line in f:
requirements.add(line.split('==')[0])
with open('tests/test-requirements.txt') as f:
View dockerize.sh
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
service ssh restart
apt-get -y update
apt-get -y install fail2ban
@etoews
etoews / couchbase.sh
Last active Jun 13, 2016
Couchbase on Carina with Docker Swarm using an overlay network
View couchbase.sh
$ docker-compose up -d
Creating couchbase_db_1
$ docker-compose scale db=2
WARNING: The "db" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
Creating and starting couchbase_db_2 ... done
$ docker run -it --rm \
--net couchbase_backend \
arungupta/couchbase \
View carina-contest.md

Sign up for Carina

In the Carina Control Panel (the other tab), sign up for Carina.

⭐️ You only get one chance to enter your email address and password so be exact! ⭐️

Create your cluster

Click Add Cluster and name it mycluster

@etoews
etoews / with-overlay-network.sh
Last active May 12, 2016
How Docker Swarm handles rescheduling of a container with and without an overlay network
View with-overlay-network.sh
# with overlay network
$ docker network create backend
7496954c6896b2c141902e7c17955289e3f49a0edf51ef0c1ca79dd7f40200a1
$ docker run -d --name redis --net backend -p "6379:6379" -e reschedule:on-node-failure redis
5ecdae84a93ced4406ba2b46e8709069c8651e1a59558a479521d9eb4c00b12e
$ docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
@etoews
etoews / migrate-data-to-new-cluster.sh
Created May 11, 2016
Example of copy data to a new cluster from an from old cluster. https://getcarina.com/docs/tutorials/migrate-cluster/
View migrate-data-to-new-cluster.sh
$ eval $(carina env old)
$ export DOCKER_CERT_PATH_OLD=$DOCKER_CERT_PATH
$ export DOCKER_HOST_OLD=$DOCKER_HOST
$ export DOCKER_VERSION_OLD=$DOCKER_VERSION
$ eval $(carina env new)
$ docker create --name old-swarm-data --volume /etc/docker cirros
@etoews
etoews / openstackclient.sh
Created May 4, 2016
Configure the OpenStack Client to work on the Rackspace public cloud
View openstackclient.sh
pip install python-openstackclient
openstack complete > .osc.bash_completion
echo "source $HOME/.osc.bash_completion" >> $HOME/.profile
source $HOME/.profile
cat <<EOF > $HOME/rackspace.env
export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
export OS_REGION_NAME=IAD
View docker-compose.yml
version: '2'
services:
elasticsearch:
container_name: elasticsearch
image: elasticsearch:2.3
restart: unless-stopped
networks:
- logging
expose:
@etoews
etoews / A_README.md
Created Apr 22, 2016
Authenticating the jclouds Java SDK with OpenStack or Rackspace and listing servers in all regions
View A_README.md

List Servers with OpenStack or Rackspace

Make a directory and copy all of the files below into it then run the following commands.

mvn dependency:copy-dependencies "-DoutputDirectory=./lib"

javac -classpath ".:lib/*" ListServersRackspace.java
java -classpath ".:lib/*" ListServersRackspace $RS_USERNAME $RS_API_KEY
You can’t perform that action at this time.