Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseph Bolus josephbolus

View GitHub Profile
@josephbolus
josephbolus / harden.sh
Created May 11, 2017 — forked from jumanjiman/harden.sh
hardening script for an alpine docker container
View harden.sh
#!/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 / docker-compose.yml
Created May 8, 2017 — forked from ihadgraft/docker-compose.yml
Getting started with docker-compose and the dukewebservices images
View docker-compose.yml
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
View nginx_modsite
#!/bin/bash
##
# File:
# nginx_modsite
# Description:
# Provides a basic script to automate enabling and disabling websites found
# in the default configuration directories:
# /etc/nginx/sites-available and /etc/nginx/sites-enabled
# For easy access to this script, copy it into the directory:
View AWK one-liners
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
@josephbolus
josephbolus / .gitconfig
Last active Feb 22, 2017 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
View .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 / app.js
Created Feb 1, 2017 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
View app.js
'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 / docker_create_treeio.sh
Created Nov 9, 2015 — 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.
View docker_create_treeio.sh
#!/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 / 1nginx.conf
Last active Dec 8, 2020
Wordpress Nginx Config
View 1nginx.conf
# ---------------------------------------
# Main Module
# ---------------------------------------
user nginx;
# This number should be, at maximum, the number of CPU cores on your system.
worker_processes 2;
pid /var/run/nginx.pid;
# Only log critical errors
View multi-tenant-docker.py
# 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
View dokku_setup.md

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