Skip to content

Instantly share code, notes, and snippets.

View mrhillsman's full-sized avatar
🎓
Learning

Melvin Hillsman mrhillsman

🎓
Learning
View GitHub Profile
@mrhillsman
mrhillsman / 1_simple.go
Created August 15, 2022 13:15 — forked from sosedoff/1_simple.go
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@mrhillsman
mrhillsman / brian.md
Created September 6, 2021 06:34 — forked from TETYYS/brian.md
All Brian TTS characters
Character code (character) Duration (ms) Alias to Pronounced as
27 (�) 656 None Escape
33 (!) 1333 None Exclamation mark
35 (#) 409 None Hash
36 ($) 425 None Dollar
37 (%) 631 None Percent
38 (&) 329 None And
43 (+) 396 None Plus
45 (-) 706 None Dash
@mrhillsman
mrhillsman / 00_README.md
Created May 30, 2021 15:52 — forked from reagent/00_README.md
Custom HTTP Routing in Go

Custom HTTP Routing in Go

Basic Routing

Responding to requests via simple route matching is built in to Go's net/http standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe to have the default request handler invoked on each request. For example:

package main

import (
@mrhillsman
mrhillsman / reflect.py
Created January 27, 2020 23:12 — forked from 1kastner/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@mrhillsman
mrhillsman / vxlan-mesh-create.sh
Last active June 6, 2018 13:54 — forked from cloudnull/vxlan-mesh-create.sh
Create a vxlan mesh on multiple hosts for multiple bridged interfaces to create isolated user networks. The primary use-case here is tenant Isolation with OpenStack Ironic.
#!/bin/bash
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@mrhillsman
mrhillsman / ansible-bootstrap-ubuntu-16.04.yml
Created April 18, 2018 05:18 — forked from gwillem/ansible-bootstrap-ubuntu-16.04.yml
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@mrhillsman
mrhillsman / LXD_SSH_KEY.md
Created March 16, 2018 17:43 — forked from jeanlouisferey/LXD_SSH_KEY.md
How to create a LXD Container with your ssh key in it (and with ssh server in the container)
@mrhillsman
mrhillsman / dns-config.sh
Created August 17, 2016 15:50 — forked from odyssey4me/dns-config.sh
DNS resolver config producer
#!/bin/bash
INPUTFILE=${INPUTFILE:-'/etc/resolv.conf'}
DEBUG=${DEBUG:-false}
FALLBACK_NAMESERVERS_IPV4='8.8.8.8 8.8.4.4'
FALLBACK_NAMESERVERS_IPV6='2001:4860:4860::8888 2001:4860:4860::8844'
HOST_ADDRESSES_IPV4=$(ip a | awk '/inet / {print $2}' | grep -v '^127\.' | cut -d/ -f1 | paste -d' ' -s)
HOST_ADDRESSES_IPV6=$(ip a | awk '/inet6 / {print $2}' | grep -v '^::' | cut -d/ -f1 | paste -d' ' -s)
HOST_NAMESERVERS_NOLOCAL_IPV4=$(awk '/^nameserver/ {print $2}' ${INPUTFILE} | grep -v '^127\.\|^::' | grep '\.' | paste -d' ' -s)
@mrhillsman
mrhillsman / installHAProxy.sh
Created December 25, 2015 11:04 — forked from emgee3/installHAProxy.sh
Install HAProxy in Ubuntu 14.04 or 12.04
#!/usr/bin/env bash
#
# Install HAProxy
# Script works on Ubuntu 12.04 and 14.04 only
set -e
set -u
set -o pipefail
@mrhillsman
mrhillsman / gist:a38a38ff31660afdeeba
Created November 20, 2015 14:27 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt