Skip to content

Instantly share code, notes, and snippets.

View gnilchee's full-sized avatar

Greg Nilchee gnilchee

  • Evernote
  • Woodinville, WA
View GitHub Profile
@gnilchee
gnilchee / haproxy.cfg
Created October 4, 2016 04:13
simple configuration with strict https, rate limiting and redispatch
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
tune.ssl.default-dh-param 2048
user haproxy
group haproxy
pidfile /var/run/haproxy.pid
stats socket /tmp/haproxy.stats level admin
defaults
@gnilchee
gnilchee / dictionary_practice.py
Last active August 29, 2016 17:01
dictionary extraction practice
#!/usr/bin/env python3
env = {
'dev': {
'web_ext': {
'services': ['httpd', 'redis', 'tripwire'],
'servers': ['web1.ext.dev.domain.com', 'web2.ext.dev.domain.com'],
'type': 'ssh',
},
'web_int': {
@gnilchee
gnilchee / http_server_wildcard.go
Created July 4, 2016 23:11
HTTP server with registered subdomain and wildcard
package main
import (
"github.com/kataras/iris"
)
func main() {
// setting up atlas object
atlas := iris.New()
// catch wildcard subdomains
@gnilchee
gnilchee / http_server_simple.go
Created July 4, 2016 06:00
HTTP server with single subdomain and naked domain (no wildcards)
package main
import (
"github.com/kataras/iris"
)
func main() {
api := iris.New()
//your subdomain
@gnilchee
gnilchee / json_to_pretty.go
Created July 3, 2016 22:39
Pretty JSON output using golang
package main
import (
"bytes"
"encoding/json"
"log"
"os"
"fmt"
)
@gnilchee
gnilchee / docker-compose.yml
Created April 9, 2016 03:06
Rocket.Chat docker-compose example
mongo:
image: mongo
volumes:
- ./data/runtime/db:/data/db
- ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128
nginx:
image: nginx
volumes:
@gnilchee
gnilchee / quality_events.bash
Created March 18, 2016 00:41
getopts for bash example with 4 inputs expected
#!/usr/bin/env bash
set -e
usage() {
echo "Usage: $0 -q {high|low} -e {event_ID}" >&2
exit 1
}
if [ $# -ne 4 ]; then
usage
@gnilchee
gnilchee / simpletransition.html
Created March 12, 2016 05:14
Simple Transition Example with the prefixfree lib cdn
<!DOCTYPE html>
<html>
<head>
<title>Circle Transition Animation</title>
<style>
.circle {
width: 200px;
height: 200px;
@gnilchee
gnilchee / index.js
Created March 9, 2016 02:45
Hello Greg example using Express.js
var express = require('express');
var app = express();
app.get('/', function(req, res){
//res.send('Hello Greg!');
res.json({firstName: 'Greg'});
});
var server = app.listen(3000, function() {
console.log('listening on port 3000');
@gnilchee
gnilchee / capitalizeme.go
Last active February 28, 2016 01:11
Formatting mixed case string variables to capitalized words
package main
import (
"fmt"
"strings"
)
func main() {
name := "aMANDA aNyBOdY"