Skip to content

Instantly share code, notes, and snippets.


Daniel Platt hackzilla

View GitHub Profile
hackzilla / cloud-config
Last active Aug 29, 2015
etcd + fleet, 3 node clust
View cloud-config
#generate a new token for each unique cluster from
addr: $public_ipv4:4001
peer-addr: $private_ipv4:7001
peer-election-timeout: 500
peer-heartbeat-interval: 100
View cloud-config
hostname: {{ name }}
- path: /etc/environment
permissions: 0644
content: |
COREOS_PUBLIC_IPV4={{ public_ip }}
COREOS_PRIVATE_IPV4={{ private_ip }}
View user_data
MAC=`ifconfig enp0s33 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
coreos-cloudinit --from-url="${URL}"
hackzilla / gist:75c2699eee323a608a92
Created Jul 10, 2014
CoreOS fails to switch channel from BETA to ALPHA
View gist:75c2699eee323a608a92
Jul 10 09:38:29 stats-backend-03 update_engine[828]: [0710/] Posting an Omaha request to
Jul 10 09:38:29 stats-backend-03 update_engine[828]: [0710/] Request: <?xml version="1.0" encoding="UTF-8"?>
Jul 10 09:38:29 stats-backend-03 update_engine[828]: <request protocol="3.0" version="CoreOSUpdateEngine-" updaterversion="CoreOSUpdateEngine-" installsource="scheduler" ismachine="1">
Jul 10 09:38:29 stats-backend-03 update_engine[828]: <os version="Chateau" platform="CoreOS" sp="353.0.0_x86_64"></os>
Jul 10 09:38:29 stats-backend-03 update_engine[828]: <app appid="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}" version="353.0.0" track="alpha" from_track="alpha" bootid="{d81f4999-614a-4465-b308-9d68a7286f7c}" oem="" machineid="8047bcfe70e049399f7dfd7d8a41a61c" lang="en-US" board="amd64-usr" hardware_class="" delta_okay="false" >
Jul 10 09:38:29 stats-backend-03 update_engine[828]: <pin
View Mac Dev

Installing a Web Developer setup on OS X Mavericks

Install XQuartz

A version of the X.Org X Window System that runs on OS X

Download and install

Install Brew

hackzilla / split_classes.php
Created Dec 11, 2013
Split a file with loads on classes into individual files. Uses namespace to figure out where in the file system to put them. Was useful for Microsofts bing api, and splitting files out of composer to autoload.
View split_classes.php
# ini_set('memory_limit', '256M');
$directory = '/directory/where your php files are';
$files = glob($directory.'/*.php');
foreach($files as $file)
View nginx

Create nginx conf for regular PHP sites

Create/Modify /etc/nginx/conf.d/php-fpm.conf

upstream php {
    #this should match value of "listen" directive in php-fpm pool
	server unix:/var/run/php5-fpm.sock;
#	server;
hackzilla / default.conf
Created Sep 6, 2012
Nginx Config for Symfony apps
View default.conf
server {
listen 80 default_server;
server_name _;
set $subdomain "default";
charset utf-8;
if ($host ~* "^(.+)\.(ukwm[0-9]{3}|local)$") {
set $subdomain $1;
You can’t perform that action at this time.