Skip to content

Instantly share code, notes, and snippets.

View thisismitch's full-sized avatar

Mitchell Anicas thisismitch

View GitHub Profile
@thisismitch
thisismitch / haproxy.cfg
Last active November 11, 2023 04:08
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@thisismitch
thisismitch / corridors_of_code.rb
Created November 18, 2015 05:36
Sonic Pi Songs
# Chrono Trigger Soundtrack - Corridors of Time
# plug this into http://sonic-pi.net/
# still needs synth pads
# global config
use_bpm 112
def play_legato_note(note_value, duration)
release_duration = duration
@thisismitch
thisismitch / dropbox
Last active April 21, 2022 19:12 — forked from migrs/dropbox
/etc/init.d/dropbox
#!/bin/sh
### BEGIN INIT INFO
# Provides: dropbox
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
# Short-Description: dropbox service
### END INIT INFO
@thisismitch
thisismitch / le-renew-webroot
Last active January 5, 2021 15:20
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
@thisismitch
thisismitch / kibana-4.x-default
Last active December 30, 2020 00:07
ELK Kibana4
user="kibana"
group="root"
chroot="/"
chdir="/"
nice=""
@thisismitch
thisismitch / haproxy-www.tf
Last active March 6, 2020 02:22
How To Use Terraform with DigitalOcean
resource "digitalocean_droplet" "haproxy-www" {
image = "ubuntu-14-04-x64"
name = "haproxy-www"
region = "nyc2"
size = "512mb"
private_networking = true
ssh_keys = [
"${var.ssh_fingerprint}"
]
connection {
@thisismitch
thisismitch / filebeat-index-template.json
Last active February 28, 2020 21:11
Filebeat configuration with comments removed
{
"mappings": {
"_default_": {
"_all": {
"enabled": true,
"norms": {
"enabled": false
}
},
"dynamic_templates": [
@thisismitch
thisismitch / floatip-ocf
Created October 16, 2015 21:37
FloatIP OCF Agent (for Pacemaker)
#!/bin/bash
param=$1
export DO_TOKEN=$OCF_RESKEY_do_token
IP=$OCF_RESKEY_floating_ip
ID=$(curl -s http://169.254.169.254/metadata/v1/id)
HAS_FLOATING_IP=`curl -s http://169.254.169.254/metadata/v1/floating_ip/ipv4/active`
meta_data() {
@thisismitch
thisismitch / dropbox
Last active March 26, 2018 02:13 — forked from kbrnsr/dropbox
Dropbox systemd and init files (CentOS 7)
#!/bin/sh
# To configure, add line with DROPBOX_USERS="user1 user2" to /etc/sysconfig/dropbox
# Probably should use a dropbox group in /etc/groups instead.
# Source function library.
. /etc/rc.d/init.d/functions
prog=dropboxd
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
@thisismitch
thisismitch / topbeat.yml
Created February 1, 2016 19:48
Topbeat configuration with comments removed
input:
period: 10
procs: [".*"]
stats:
system: true
proc: true
filesystem: true
output: