Skip to content

Instantly share code, notes, and snippets.

View ericcholis's full-sized avatar

Eric Cholis ericcholis

View GitHub Profile
@ericcholis
ericcholis / dnsmasq OS X.md
Last active October 19, 2023 16:21 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@ericcholis
ericcholis / keybase.md
Last active September 14, 2018 12:45
keybase.md

Keybase proof

I hereby claim:

  • I am ericcholis on github.
  • I am ericcholis (https://keybase.io/ericcholis) on keybase.
  • I have a public key ASB_grT_1En2_YeHVYzs13CEliX3TcFB56WBtfw3A2nRSAo

To claim this, I am signing this object:

@ericcholis
ericcholis / object-watch.js
Created October 27, 2011 13:02 — forked from eligrey/object-watch.js
Cross-browser object.watch and unwatch. Modified for use with MooTools and MooTools More
// Cross-browser object.watch and object.unwatch
// Requires Mootools 1.4 or greater
// object.watch
(function(){
if (!Object.prototype.watch) {
Object.implement('watch',function(prop,handler){
var oldval = this[prop], newval = oldval,
getter = function () {
return newval;
Verifying my Blockstack ID is secured with the address 17mGoUU32HVtJzHf6ujL4a9NyoThxuGg2U https://explorer.blockstack.org/address/17mGoUU32HVtJzHf6ujL4a9NyoThxuGg2U
@ericcholis
ericcholis / nginx_install.sh
Last active January 27, 2017 23:49
Install nginx from source with nginScript
# nginx 1.9.5
# ubuntu trusty 14.04
apt-get update
apt-get upgrade
apt-get install build-essential mercurial libpcre3 libpcre3-dev libssl-dev
wget http://nginx.org/download/nginx-1.9.5.tar.gz
tar -xzvf nginx-1.9.5.tar.gz
@ericcholis
ericcholis / gist:8606045
Created January 24, 2014 20:46
jQuery Sortable
<!doctype html>
<head>
<meta charset="utf-8">
<title>jQuery Sortable</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">
</head>
@ericcholis
ericcholis / media.php
Last active December 24, 2015 00:29
Lithium CSV Media Handler
<?php
Media::type('csv', 'text/plain', array(
'encode' => function($data) {
ob_start();
$out = fopen('php://output', 'w');
foreach ($data as $record) {
fputcsv($out, $record);
}
fclose($out);
<?php
use lithium\action\Dispatcher;
use lithium\storage\Session;
use lithium\security\validation\RequestToken;
use lithium\action\Response;
Dispatcher::applyFilter('run', function($self, $params, $chain) {
$request = $params['request'];
@ericcholis
ericcholis / openssl.pp
Created July 31, 2013 16:02
Puppet Open SSL Self Signed Certificate
$location = "Mountain View"
$country = "US"
$state = "CA"
$organization = "Google"
$unit = "Search"
$commonname = "www.example.com"
$keyname = "www_example_com"
$subject = "/C=${country}/ST=${state}/L=${location}/O=${organization}/OU=${unit}/CN=${commonname}"
$createcertificate = "openssl req -new -newkey rsa:2048 -x509 -days 365 -nodes -out ${keyname}.crt -keyout ${keyname}.key -subj \"${subject}\""
import os, sys
import datetime
import base64
import cloudservers
import cloudlb
import urllib2
#import paramiko
from time import sleep