Skip to content

Instantly share code, notes, and snippets.

ryanobjc /
Created Sep 6, 2012
package up graphite using fpm
apt-get install python-setuptools python-django-tagging python-pysqlite2 python-memcache python-ldap python-django python-cairo-dev
View martini-mgo.go
package main
import (
type Wish struct {
View mailgun-sample.php
class Mailgun {
function post($headers, $url, $data){
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
jasonberanek /
Last active Jan 29, 2018
Enabling VNC support in the VMware ESXi 5.x Firewall

VMware ESXi includes a built in VNC server that can be used to access a VMs console for manipulation via automated tools (e.g., veewee) or by users on platforms where the vSphere Client is not supported. In ESXi 5.x, the built-in firewall does not allow VNC traffic to be received by the VNC server, even when an individual VM is configured to support this configuration. To complete this activity, the firewall has to be modified to allow the appropriate ports.

The below script can be run via the ESXi command line to setup the firewall rules necessary to run VNC. A few items to note:

  • Scripts assumes the firewall rules file is the default provided as by 5.0.0 update 2 build 914586 and/or 5.1.0 build 799733 (may work in other versions)
  • In order to persist settings after a reboot, it is necessary to copy the firewall settings to either a specific datastore mapped to the host, or the local persistent storage linked under the /store directory. Further, the either the /etc/rc.local (ESXi 5.0) or `/etc/rc.local
nmussat / find.repo.biggest.files
Created Jan 4, 2010
Find biggest files from a Git repository
View find.repo.biggest.files
# Find biggest files from a Git repository
# See
LINES=`git verify-pack -v .git/objects/pack/pack-*.idx | grep blob | sort -k 3 -n | tail -${MAX_FILES}`
for LINE in $LINES
mattpascoe / dhcpparse.awk
Last active Nov 29, 2018
An AWK script to parse ISC dhcpd configuration files into output to load into OpenNetAdmin
View dhcpparse.awk
#!/usr/bin/awk -f
# Author: Matt Pascoe -
# This awk script is used to extract relavant information from a dhcpd.conf
# config file and build output with appropriate fields. This can be
# used to bootstrap a new database from existing site data.
# As usual, inspect the output for accuracy.
# Also you will get three types of output, subnet,pool,host. You must
# add the subnet information first, then pool, then host.
jonaslejon / Mailgun PHP API with curl
Last active Jul 31, 2021
Send mail with Mailgun API version 2 and PHP. Should also work with version 3 of the Mailgun API
View Mailgun PHP API with curl
define("DOMAIN", "");
define("MAILGUN_API", "XXX123"); // Mailgun Private API Key
function br2nl($string) {
return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);
function mg_send($to, $subject, $message) {
$ch = curl_init();
movitto / lvm-parser.rb
Created Mar 30, 2016
LVM Parser & Block Reader
View lvm-parser.rb
# LVM Parser & Block Reader
# Copyright (C) 2016 Red Hat Inc
require 'optparse'
require 'ostruct'
require 'binary_struct'
### constants
jhamrick /
Last active Mar 18, 2022
Generate SSL certificates with IP SAN
#!/usr/bin/env bash
# Generate a set of TLS credentials that can be used to run development mode.
# Based on script by Ash Wilson (@smashwilson)
# usage: sh ./ NAME HOSTNAME IP
set -o errexit
ryboe / .travis.yml
Last active Apr 6, 2022
Example .travis.yml for Golang
View .travis.yml
# use the latest ubuntu environment (18.04) available on travis
dist: bionic
language: go
# You don't need to test on very old versions of the Go compiler. It's the user's
# responsibility to keep their compiler up to date.
- 1.16.x