Launch the instance and connect with ssh.
##Update the server
sudo yum update
##Install php and MySQL packages
Launch the instance and connect with ssh.
##Update the server
sudo yum update
##Install php and MySQL packages
#!/usr/bin/env python | |
import os | |
import sys | |
import argparse | |
try: | |
from boto.ec2.connection import EC2Connection | |
except ImportError: | |
sys.stderr.write('Please install boto ( http://docs.pythonboto.org/en/latest/getting_started.html )\n') | |
sys.exit(1) |
Build your dotfiles (shell, Vim config) from multiple sources with fresh.
Both of our dotfiles are built using fresh. We source Vim and other config from each other:
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
browserify = require('gulp-browserify'), | |
concat = require('gulp-concat'), | |
embedlr = require('gulp-embedlr'), | |
refresh = require('gulp-livereload'), | |
lrserver = require('tiny-lr')(), | |
express = require('express'), | |
livereload = require('connect-livereload') | |
livereloadport = 35729, |
{ | |
"keys": ["tab"], | |
"command": "expand_abbreviation_by_tab", | |
// put comma-separated syntax selectors for which | |
// you want to expandEmmet abbreviations into "operand" key | |
// instead of SCOPE_SELECTOR. | |
// Examples: source.js, text.html - source | |
"context": [ | |
{ |
local char_to_hex = function(c) | |
return string.format("%%%02X", string.byte(c)) | |
end | |
local function urlencode(url) | |
if url == nil then | |
return | |
end | |
url = url:gsub("\n", "\r\n") | |
url = url:gsub("([^%w ])", char_to_hex) |
#!/usr/bin/env ruby | |
# Extracted from traceroute gem + checking the presence of views as well | |
require_relative './config/environment.rb' | |
class Traceroute | |
def initialize(app) | |
@app = app | |
end |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
; | |
; the "monitor ROM" of an apple 1 fit in one page (256 bytes). | |
; | |
; this is my attempt to take the disassembled code, give names to the | |
; variables and routines, and try to document how it worked. | |
; | |
; | |
; an apple 1 had 8KB of RAM (more, if you hacked on the motherboard), and a | |
; peripheral chip that drove the keyboard and video. the video was run by a | |
; side processor that could treat the display as an append-only terminal that |