Skip to content

Instantly share code, notes, and snippets.

View gmcintire's full-sized avatar
:shipit:

Graham McIntire gmcintire

:shipit:
View GitHub Profile
defmodule GenServerTpl do
@moduledoc """
A GenServer template for a "singleton" process.
"""
use GenServer
# Initialization
def start_link(opts \\ []) do
GenServer.start_link(__MODULE__, opts, [name: __MODULE__])
end
# Networking
MAC (?:%{CISCOMAC:UNWANTED}|%{WINDOWSMAC:UNWANTED}|%{COMMONMAC:UNWANTED})
CISCOMAC (?:(?:[A-Fa-f0-9]{4}\.){2}[A-Fa-f0-9]{4})
WINDOWSMAC (?:(?:[A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2})
COMMONMAC (?:(?:[A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2})
IPV6 ((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-
f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|
(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.
(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4})
{1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|
Scottish Regions
Speyside: Low peat, high with nutty/fruit flavors. (Apple, pear, honey, vanilla, and spice)
Speyside Distilleries: The Glenlivet, The Macallan, The Balvenie, Aberlour, Tomintoul, Glen Moray.
Highlands: Fruitcake and oaky smoke flavors
@gmcintire
gmcintire / pymultimonaprs.service
Created November 14, 2015 15:08
pymultimonaprs systemd script
[Unit]
Description=pymultimonaprs
[Service]
Type=simple
ExecStart=/usr/local/bin/pymultimonaprs --syslog
ExecStop=/usr/bin/killall pymultimonaprs
[Install]
WantedBy=multi-user.target
@gmcintire
gmcintire / .tmux.conf
Created October 3, 2014 15:55
.tmux.conf
# Ring the bell if any background window rang a bell
set -g bell-action any
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# Keep your finger on ctrl, or don't
bind-key ^D detach-client
# Create splits and vertical splits
@gmcintire
gmcintire / keybase.md
Created September 17, 2014 20:27
keybase.md

Keybase proof

I hereby claim:

  • I am gmcintire on github.
  • I am gmcintire (https://keybase.io/gmcintire) on keybase.
  • I have a public key whose fingerprint is 4A50 2296 C394 0DC5 96E1 26B5 0A7B 07F6 F910 0CD7

To claim this, I am signing this object:

Account::Application.routes.draw do
###### ARCHWAY USER ROUTES ######
# Users
devise_for :users,:path => ':api_version/users', :controllers => {:sessions => 'sessions',
:registrations => 'users',
:passwords => 'passwords',
:confirmations => 'confirmations'}
@gmcintire
gmcintire / README.md
Last active December 19, 2015 01:39 — forked from ngauthier/README.md
#!/bin/sh
NGINX_VERSION=1.3.8
TMP_PATH=/tmp
# Fetch and extract Nginx
cd $TMP_PATH
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
tar xvfz nginx-$NGINX_VERSION.tar.gz
cd nginx-$NGINX_VERSION
#!/bin/bash
# Sends the length of each resque queue to Librato Metrics.
# Run it on a cron job and you'll have an idea of how backed up (or not) your queues are.
API_EMAIL="[email protected]"
API_TOKEN="1234..."
body=""
i=0