Skip to content

Instantly share code, notes, and snippets.

@lucasmazza
lucasmazza / script.md
Created August 17, 2011 17:49
Redis 2.2 Install on Ubuntu 10.04

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz
$ tar xvfz redis-2.2.2.tar.gz 
$ cd redis-2.2.2/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
@fredrick
fredrick / README.md
Created November 22, 2011 18:17
Graylog2 Upstart Jobs

#Graylog2 Upstart

A basic set of Upstart jobs to get Graylog2 up and running quickly. Assumes MongoDB and Graylog2 installed in /opt/. Tested on Ubuntu Server 10.04 LTS, MongoDB 2.0.0, graylog2-server-0.9.5p1, and graylog2-web-interface-0.9.5p2.

#Usage

Place job definitions in /etc/init/ and then use service [job] [command] to start/stop/restart/status the services manually. On boot, the services flow into each other, only starting if dependent services have started. For more on controlling jobs or Upstart in general (a replacement for System-V init), see the cookbook.

#Author

@jalberto
jalberto / list_bootstrap.rb
Created April 16, 2012 22:33
simple-navigation render for twiter bootstrap nav-list
class ListBootstrap < SimpleNavigation::Renderer::Base
def render(item_container)
list = item_container.items.inject([]) do |list, item|
if item.html_options[:opts]
if item.html_options[:opts][:nav_header]
list << li_header(item)
elsif item.html_options[:opts][:icon]
list << li_icon(item)
end
else
@AndyA
AndyA / bbc-svn-million
Created November 1, 2012 15:43
BBC FM svn commit 1,000,000.
------------------------------------------------------------------------
r1000000 | **** REDACTED ****
MMMMMMMMMMMMMMMMMMMMMMMM ~MMMMMMMMMMMMMMMMMMMMMMMM NMMMMMMMMMMMMMMMMMMMMMMM7
MMMMMMIIIIIINMMMMMMMMMMM ~MMMMMMIIIIIIMMMMMMMMMMMM NMMMMMMMMMM~ ?MMMMMMMM7
MMMMMM ,MMMMMMMM ~MMMMMM ZMMMMMMMM NMMMMMM. MMMMM7
MMMMMM MMMM ZMMMMMMM ~MMMMMM MMMM MMMMMMMM NMMMMM MMMMMMM? MMMMM7
MMMMMM MMMMZ :MMMMMMM ~MMMMMM MMMM NMMMMMMM NMMMM MMMMMMMMMMMMMMMM7
MMMMMM MMM= MMMMMMMM ~MMMMMM MMM. MMMMMMMM NMMM MMMMMMMMMMMMMMMMM7
MMMMMM +MMMMMMMM ~MMMMMM ZMMMMMMMM NMMM MMMMMMMMMMMMMMMMM7
@HHRy
HHRy / gist:6389485
Created August 30, 2013 12:48
Letter to MP

Dear Mr Lazarowicz,

I’ve recently came across the news that the UK Border Agency are trailing some new signage in centers in Glasgow and London - these signs targeting the most vulnerable asylum seekers telling to go home are, to me, disgusting.

On every chair back, and every wall, and hanging from the ceiling are signs which read “Ask about going home”, “Is life here hard? Going home is simple.” and “This plane can take you home, we can book the tickets”.

These people are here because they’re facing persecution at home and are seeking shelter and freedom here. These signs are a repulsive throwback to some of the more dark chapters of recent European history and have no place in a compassionate, modern democracy.

I urge you to please do what you can to end this demeaning practice.

I'm writing in response to events that have recently come to light involving a sexual assault at a tech conference. Background information can be found [here][1], [here][2], and [here][3] as well as on twitter and google.


I've been watching this from the sidelines, and I've been wrestling with several questions that I can't seem to shake and that I really don't have answers to.

I wear many hats, both in the tech community and others. I'm a coder, a speaker, a user group organizer, a conference organizer, and even a boss. Each of those roles colors how I see this, but there's one role that is overpowering in my reaction.

See, I'm a Dad. A dad of two beautiful and innocent girls who are 3 and 2. They have their whole lives in front of them and so the questions I'm struggling with are:

@paulirish
paulirish / gist:3098860
Created July 12, 2012 15:26
Open Conference Expectations

Open Conference Expectations

This document lays out some baseline expectations between conference speakers and conference presenters. The general goal is to maximize the value the conference provides to its attendees and community and to let speakers know what they might reasonably expect from a conference.

We believe that all speakers should reasonably expect these things, not just speakers who are known to draw large crowds, because no one is a rockstar but more people should have the chance to be one. We believe that conferences are better -- and, dare we say, more diverse -- when the people speaking are not just the people who can afford to get themselves there, either because their company paid or they foot the bill themselves. Basically, this isn't a rock show rider, it's some ideas that should help get the voices of lesser known folks heard.

These expectations should serve as a starting point for discussion between speaker and organizer. They are not a list of demands; they are a list of rea

def generate_RSA(bits=2048):
'''
Generate an RSA keypair with an exponent of 65537 in PEM format
param: bits The key length in bits
Return private key and public key
'''
from Crypto.PublicKey import RSA
new_key = RSA.generate(bits, e=65537)
public_key = new_key.publickey().exportKey("PEM")
private_key = new_key.exportKey("PEM")
@extraordinaire
extraordinaire / reconnecting_pdo.php
Last active June 27, 2023 11:12
Reconnectable PDO
<?php
class ReconnectingPDO
{
protected $dsn, $username, $password, $pdo, $driver_options;
public function __construct($dsn, $username = "", $password = "", $driver_options = array())
{
$this->dsn = $dsn;
$this->username = $username;
$this->password = $password;
{
"Africa/Abidjan": "+00:00",
"Africa/Accra": "+00:00",
"Africa/Addis_Ababa": "+03:00",
"Africa/Algiers": "+01:00",
"Africa/Asmara": "+03:00",
"Africa/Asmera": "+03:00",
"Africa/Bamako": "+00:00",
"Africa/Bangui": "+01:00",
"Africa/Banjul": "+00:00",