Skip to content

Instantly share code, notes, and snippets.

View mrsimonemms's full-sized avatar
🐝
Tinkerin'

Simon Emms mrsimonemms

🐝
Tinkerin'
View GitHub Profile
@mrsimonemms
mrsimonemms / docker-compose.yml
Created April 13, 2017 15:24
Docker Compose Swarm
###
# run command: docker stack deploy -c docker-compose.yml dockercoins
###
version: "3"
services:
rng:
image: riggerthegeek/rng
ports:
@mrsimonemms
mrsimonemms / domain.sh
Created April 12, 2017 13:37 — forked from leanderjanssen/domain.sh
Create Registry Server certificate
#!/bin/bash
# Retrieve public and private ip of instance
PUBLIC_HOSTNAME=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
# Generate openssl config for self-signed certificate with SANs
cat << EOF > ~/domain.cnf
[ ca ]
@mrsimonemms
mrsimonemms / cert.sh
Created April 12, 2017 10:11 — forked from leanderjanssen/cert.sh
Create Docker certificates
#!/bin/bash
# Retrieve public and private ip of instance
PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
mkdir ~/docker-ca
chmod 0700 ~/docker-ca
cd ~/docker-ca || exit 1
@mrsimonemms
mrsimonemms / docker-labels.md
Created April 12, 2017 08:36 — forked from leanderjanssen/docker-labels.md
Example of a Dockerfile with LABEL and ARG

Example of using LABEL and ARG in a Dockerfile

Dockerfile

FROM ubuntu:14.04
RUN apt-get -y update
RUN apt-get -y install vim
RUN apt-get -y install curl
ARG GIT_COMMIT=unknown
LABEL git-commit=$GIT_COMMIT
@mrsimonemms
mrsimonemms / dropbox.sh
Created November 1, 2016 11:54
CLI Save to Dropbox
## Add to crontab -e with "/bin/bash /root/DropboxBackup.sh"
## Taken from http://davehope.co.uk/Blog/backup-your-linux-vps-to-dropbox/
#!/bin/bash
DROPBOX_USER="Your Dropbox username"
DROPBOX_PASS="Your Dropbox password"
DROPBOX_DIR="Directory in your dropbox account to store the backups, e.g. /backups"
BACKUP_SRC="/home /var/www /var/git /etc /root"
BACKUP_DST="/tmp"
MYSQL_SERVER="127.0.0.1"
@mrsimonemms
mrsimonemms / replaceEnvvars.ts
Created August 16, 2016 11:07
Envvar replace
/**
* Replace Env Vars
*
* Looks for a matching environment variable and
* puts it into the object
*/
"use strict";
@mrsimonemms
mrsimonemms / Dockerfile
Last active August 11, 2016 07:51
SPA hosting script
########################################
# Docker #
# #
# An Nginx container that enables the #
# application to run #
########################################
# Run with
# docker build -t nginx/server .
# docker run -it --rm --name web -p 7777:9999 nginx/server
@mrsimonemms
mrsimonemms / app.js
Created July 20, 2016 20:01
supertest
import restify from "restify";
const app = restify.createServer({
name: 'MyApp',
});
app.listen(8080);
export {app};
@mrsimonemms
mrsimonemms / 2015-01-01-template.txt
Created June 4, 2016 16:32
Running AngularJS on Jekyll
---
title: Template
comments: true
tags:
- tag1
- tag2
---
This is my template file
@mrsimonemms
mrsimonemms / index.js
Last active June 4, 2016 16:30
How clever are developers
// Get the kettle
var kettle = Kettle.getKettle();
// Check we have enough water
while (kettle.cupsOfWater() < 1) {
// No - add water until there's enough
kettle.addWater();
}
// Boil the kettle