Skip to content

Instantly share code, notes, and snippets.

Avatar
🎸
Working from home

Jose Diaz-Gonzalez josegonzalez

🎸
Working from home
View GitHub Profile
@josegonzalez
josegonzalez / access.lua
Created Dec 3, 2012
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
View access.lua
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
@josegonzalez
josegonzalez / nginx_release.sh
Last active Oct 11, 2019
Make an nginx release for ubuntu
View nginx_release.sh
#!/bin/bash
#####
# Builds a custom nginx
#
# RELEASE_TAGS="+your+tags+here"
# RELEASE_MAINTAINER="Your Name Here"
# RELEASE_MAINTAINER_EMAIL="hi@example.com"
# RELEASE_MESSAGE="Some message"
#
@josegonzalez
josegonzalez / nginx_release.sh
Created Nov 21, 2012
Make an nginx release for ubuntu
View nginx_release.sh
#!/bin/bash
#####
# Builds a custom nginx
#
# RELEASE_TAGS="+your+tags+here"
# RELEASE_MAINTAINER="Your Name Here"
# RELEASE_MAINTAINER_EMAIL="hi@example.com"
# RELEASE_MESSAGE="Some message"
#
@josegonzalez
josegonzalez / nginx-custom.rb
Created Nov 21, 2012
Customize your Nginx Installation via Homebrew
View nginx-custom.rb
require 'formula'
class NginxCustom < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.2.4.tar.gz'
sha1 'e3de0b2b82095f26e96bdb461ba36472d3e7cdda'
devel do
url 'http://nginx.org/download/nginx-1.3.8.tar.gz'
sha1 '84ff39e3f76e9f496f4e05080885e04caf472bb9'
View gist:2855592

Now that SeatGeek is crushin it, it has become apparent that we need some sort of server/service monitoring beyond simple healthchecks with pingdom.

This should be split up into multiple parts, but the idea is thus:

Metric Collection

Collect metrics from various servers, including, but not limited to:

  • disk space
  • load average
View mnml.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{Title}</title>
<link rel="shortcut icon" href="{Favicon}">
<link rel="alternate" type="application/rss+xml" href="/rss">
<style type="text/css">
body {
View .bashrc
export PATH="$(brew --prefix)/bin:$(brew --prefix php)/bin:$(brew --prefix python)/bin:/usr/local/share/python:/usr/local/lib/node_modules:/usr/local/PEAR:$PATH"
export NODE_PATH=/usr/local/lib/node_modules
export GIT_EDITOR="subl -w" # Change to whatever you want your default git editor to be
export RUBYOPT=rubygems
# a crap-ton of ssh aliases
alias update='brew update && brew outdated | xargs brew upgrade'
alias ls='ls -alh'
alias ll='ls -alh'
@josegonzalez
josegonzalez / app_controller.php
Created Feb 27, 2012
Custom response types in CakePHP. Must have debug mode to less than 2 in order for it to work properly
View app_controller.php
<?php
class AppController extends Controller {
/**
* Setup the RequestHandler component
*
* @var array
*/
var $components = array('RequestHandler');
@josegonzalez
josegonzalez / subdomain.php
Created Dec 19, 2011
subdomain component for cakephp that depends on a model
View subdomain.php
<?php
class SubdomainComponent extends Object {
var $__settings = array(
'base' => 'example.com',
'domains' => array(),
'param' => 'subdomain',
'redirect' => true,
'redirectTo' => 'http://example.com',
'model' => 'DomainPrefix',
@josegonzalez
josegonzalez / control
Created Apr 10, 2011
cakepackages control file
View control
Package: cakepackages
Source: git://github.com/josegonzalez/cakepackages.git
Type: application
Section: application
Description: An application that can be used
to index other cakephp applications and plugins
Pre-depends: CakePHP==1.3
Recommends:
Suggests:
Bugs: http://github.com/josegonzalez/cakepackages/issues