Skip to content

Instantly share code, notes, and snippets.


Alexey Palazhchenko AlekSi

View GitHub Profile
View .go
package main
import (
type (
Int int
String string
acolyer /
Last active Nov 18, 2022
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
hgfischer /
Last active Jan 17, 2023
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
nevir /
Last active Dec 15, 2015
README-driven project metadata

Package Name (1.2.3)

Short package description; useful for quick one-liners when displaying information about it on various sites/contexts.

Normal Readme Stuff

Blah, blah blah. The order of readme sections doesn't matter: organize it however you like.

scottjacobsen / git+clone+ssh+agent+forward+sudo
Created Dec 14, 2012
Git clone using ssh agent forwarding and sudo
View git+clone+ssh+agent+forward+sudo
SSH agent forwarding is great. It allows you to ssh from one server to
another all the while using the ssh-agent running on your local
workstation. The benefit is you don't need to generate ssh key pairs
on the servers you are connecting to in order to hop around.
When you ssh to a remote machine the remote machine talks to your
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK
environment variable.
So you the remote server you can do something like:
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

jimweirich /
Created Dec 12, 2011
Description of a Refactoring Kata

Refactoring Kata

Here's an interesting refactoring challenge.

Refactor the tangle.c program described at with the goal of making it more readable and maintainable.

Some suggested guidelines and constraints. Of course, you can do

AlekSi / update.rb
Created Aug 21, 2011
Update all gems, packages, fetch all code, etc.
View update.rb
#! /usr/bin/env ruby
STDOUT.sync = true
STDERR.sync = true
def run(cmd, *ok_statuses)
puts "\n=========> #{cmd}"
unless ([0] + ok_statuses).include?($?)
puts "Exit status: #{$?}"
AlekSi / gist:1154108
Created Aug 18, 2011
MongoDB benchmark for Graylog2
View gist:1154108
count = 10000
size = 100 // megabytes
hosts = ['host1', 'host2', 'host3', 'host4', 'host5']
facilities = ['Server', 'Client', 'Proxy']
chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz '.split('');
speed = 1500.0; // messages per second
start = new Date().getTime() - 24*60*60*1000;
coordt /
Created Apr 8, 2011
Check locally installed packages against one or more package indexes for updates and list them.
#!/usr/bin/env python
Use pip to get a list of local packages to check against one or more package
indexes for updated versions.
import pip
import sys, xmlrpclib
from cStringIO import StringIO
from distutils.version import StrictVersion, LooseVersion