Skip to content

Instantly share code, notes, and snippets.

View josephbolus's full-sized avatar

Joseph Bolus josephbolus

View GitHub Profile
#!/bin/bash
cd
#
# fix locales
#
echo "en_US.UTF-8 UTF-8" > /var/lib/locales/supported.d/local
dpkg-reconfigure locales

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain

# Yes. We love Python!
def start_provider(provider_id, gateway_port, admin_port ):
docker_client = docker.Client(base_url='unix://var/run/docker.sock',
version='1.6',
timeout=100)
# start a docker container for consuming gateway data at gateway_port
start_command = 'python software/remote_server.py ' + provider_id
remote_server = docker_client.create_container('flux7/labs', # docker image
command=start_command, # start command contains the keyspace parameter, keyspace is the provider_id
@josephbolus
josephbolus / docker_create_treeio.sh
Created November 9, 2015 13:46 — forked from funkotron/docker_create_treeio.sh
Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance.
#!/bin/bash
# Description: Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance
# Also requires postgresql client tools http://www.postgresql.org/download/linux/ubuntu/
# Run chmod +x to make this file executable then run it: ./docker_create_treeio.sh
# Author: Adam Awan
# Email: adam@tree.io
# Set the port to forward for Tree.io
TREEIO_PORT="80"
@josephbolus
josephbolus / app.js
Created February 1, 2017 19:58 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@josephbolus
josephbolus / .gitconfig
Last active February 22, 2017 19:52 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = FIRST LASTNAME
email = username@email.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@josephbolus
josephbolus / docker-compose.yml
Created May 8, 2017 22:19 — forked from ihadgraft/docker-compose.yml
Getting started with docker-compose and the dukewebservices images
version: "2"
services:
data:
image: busybox:latest
volumes:
- ./persistent/html:/var/www/html:cached
- ./persistent/mail:/var/mail:cached
- ./persistent/sql-data:/var/lib/mysql
- ./persistent/backup:/var/backup
- ./persistent/logs/apache:/var/apache2/logs
@josephbolus
josephbolus / harden.sh
Created May 11, 2017 20:53 — forked from jumanjiman/harden.sh
hardening script for an alpine docker container
#!/bin/sh
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
#
# find: /proc/tty/driver: Permission denied
@josephbolus
josephbolus / Makefile
Created August 21, 2017 21:04 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config
configfile=config.env
ifdef cnf
configfile=$(cnf)
endif
include $(configfile)
export $(shell sed 's/=.*//' $(configfile))
# import deploy config
deployfile=deploy.env
@josephbolus
josephbolus / boxstarter.ps1
Created September 14, 2017 07:44 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
#
# Learn more: http://boxstarter.org/Learn/WebLauncher
#---- TEMPORARY ---