Skip to content

Instantly share code, notes, and snippets.

View orbitalmedia's full-sized avatar

OM orbitalmedia

  • Orbital Media
  • Australia
View GitHub Profile
@orbitalmedia
orbitalmedia / cf.yaml
Created July 31, 2025 21:51
privatelink-ec2
AWSTemplateFormatVersion: '2010-09-09'
Description: SSM PrivateLink Setup with VPC, Subnet, Security Group, Endpoints, IAM Role, and EC2 Instance
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsHostnames: true
EnableDnsSupport: true
apiVersion: v1
kind: ReplicationController
metadata:
name: traefik-ingress-controller
namespace: default
labels:
app: traefik-ingress-lb
spec:
replicas: 1
selector:
sudo::configs:
'admins':
'content' : "%prodadmins ALL=(ALL) NOPASSWD: ALL"
'priority' : 10
@orbitalmedia
orbitalmedia / replace-centos6x-iptables
Created September 9, 2016 08:33 — forked from aputs/replace-centos6x-iptables
replace centos 6.x iptables
# compile iptables from source and install to /usr/local
mkdir -p /tmp/iptables
wget "http://www.netfilter.org/projects/iptables/files/iptables-1.4.21.tar.bz2" -qO- | tar --strip-components=1 -C /tmp/iptables -xvj
cd /tmp/iptables
./configure
make
make install
# set alternatives
sudo alternatives --install /sbin/iptables iptables.x86_64 /usr/local/sbin/iptables 100 \
@orbitalmedia
orbitalmedia / main.go
Created June 23, 2016 08:53 — forked from danesparza/negroni-gorilla.go
Negroni with Gorilla mux subrouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
"log"
"net/http"
)
@orbitalmedia
orbitalmedia / main.go
Created June 23, 2016 06:12 — forked from Paulius-Maruska/main.go
Understanding http request routing with net/http and gorilla/mux.
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func handler(name string)func (http.ResponseWriter, *http.Request) {
dummyHandler := func (w http.ResponseWriter, r *http.Request) {
@orbitalmedia
orbitalmedia / mux_handlers.go
Created June 23, 2016 05:27 — forked from bennAH/mux_handlers.go
gorilla mux - multiple handlers
package main
import (
"fmt"
"github.com/gorilla/mux"
"net/http"
)
func main() {
r := mux.NewRouter()
@orbitalmedia
orbitalmedia / negroniGorillaMux.go
Created June 23, 2016 05:06 — forked from pagreczner/negroniGorillaMux.go
Negroni and Gorilla Mux with Middleware example - golang
package main
import (
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
)
func main() {
router := mux.NewRouter()
apiV1 := router.PathPrefix("/api/v1").Subrouter()
@orbitalmedia
orbitalmedia / nginx_codes_stat.py
Created June 12, 2016 11:06 — forked from khoden/nginx_codes_stat.py
HTTP-status code statistic from nginx access log
#! /usr/bin/env python
import argparse
import sys
import re
import time
line_nginx_full = re.compile(r"""(?P<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?P<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] ((\"(GET|POST) )(?P<url>.+)(http\/1\.1")) (?P<statuscode>\d{3}) (?P<bytessent>\d+) (["](?P<refferer>(\-)|(.+))["]) (["](?P<useragent>.+)["])""",
re.IGNORECASE)
line_nginx_onlyStatus = re.compile(r'.+HTTP\/1\.1" (?P<statuscode>\d{3})')
@orbitalmedia
orbitalmedia / gist:41ef63a7c3a1df900da875b1a24eb448
Created June 5, 2016 13:36 — forked from imkarthikk/gist:772f86858f90efa55687
Graphite, UWSGI and nginx setup on Ubuntu 14.04
# update packages
sudo apt-get update
# install python and graphite dependencies
sudo apt-get install -y python python-dev python-virtualenv libevent-dev python-pip python-cairo python-django-tagging python-twisted python-memcache python-pysqlite2
# install web server
sudo apt-get install -y nginx uwsgi uwsgi-plugin-python
# install postgresql and dependencies