Skip to content

Instantly share code, notes, and snippets.

View benileo's full-sized avatar

Ben Irving benileo

  • Nelson, BC Canada
  • 11:28 (UTC -07:00)
View GitHub Profile
@benileo
benileo / mongod.service
Last active March 1, 2021 04:57
Systemd Service Script for Mongod On Ubuntu 15.04, 15.10, 16.04 Xenial
[Unit]
Description=High-performance, schema-free document-oriented database
Documentation=man:mongod(1)
After=network.target
[Service]
Type=forking
User=mongodb
Group=mongodb
@benileo
benileo / environment.sh
Last active June 2, 2016 05:21
Ubuntu Development Environment
#!/bin/bash
function run_as_root {
sudo -u root $@
}
function apt_install {
run_as_root apt-get install -y --no-install-recommends $@
}
@benileo
benileo / linux
Last active October 23, 2018 09:12
# Handy Linux Commands I never want to forget ;)
# add your user to the suduers file
username ALL=(ALL) NOPASSWD:ALL
# Set the root user password for mysql, this allows logging in with no password
mysqladmin -u root -proot password ''
# Create the letsencrypt (certbot) test environment
cd letsencrypt
@benileo
benileo / Vagrantfile
Created March 24, 2017 03:45
Docker swarm setup multiple VMs on localhost using vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.define "n1" do |n1|
@benileo
benileo / Vagrantfile
Last active March 24, 2017 03:47
Docker swarm setup multiple VMs on localhost using vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.define "n1" do |n1|
@benileo
benileo / contributions.go
Last active April 22, 2017 02:57
My github contributions
package main
import (
"encoding/json"
"fmt"
"html/template"
"io/ioutil"
"net/http"
"os"
"sort"
version: '3.1'
networks:
snet:
driver: overlay
volumes:
certs:
html:
vhosts:
services:
uwsgimti:
deploy:
replicas: 1
placement:
constraints:
- node.hostname == blackberry
environment:
VIRTUAL_HOST: "morethaniron.com,www.morethaniron.com"
services:
ddagent:
deploy:
mode: global
image: datadog/docker-dd-agent:latest-alpine
environment:
DD_API_KEY_FILE: /run/secrets/dd_api_key
secrets:
- source: dd_api_key
target: dd_api_key
@benileo
benileo / bootstrap.sh
Created June 11, 2017 18:32
Bootstrap
#!/bin/bash
# scripts cant be started any other way. IE. not -x or -e
DOCKER_FINGERPRINT="9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
DOCKER_APT_REPOSITORY="https://download.docker.com/linux/ubuntu"
APT_DEPS="awscli mysql-client"
# This is templated from vault.
cat > /home/jammin/.ssh/id_ecdsa <<- EOF
-----BEGIN EC PRIVATE KEY-----