Skip to content

Instantly share code, notes, and snippets.

@afgomez
afgomez / wikistance.rb
Created July 2, 2011 19:59
Measures distance of any wikipedia article to Philosophy. Based on http://xkcd.org/903/ alt text
# WikiStance. A Wikipedia distance meter.
# Based on the alt text of http://xkcd.org/903/
# Gets a Wikipedia URL and measure the distance of this page to the Philosophy article, clicking on links not in parens
# neither italics
#
# Author:: Alejandro Fernández (mailto:antarticonorte@gmail.com)
# Copyright:: Copyright (c) 2011 Alejandro Fernández
# License:: GPL
#
# =Usage=
@ril3y
ril3y / create_x.509_cert.py
Created August 23, 2011 12:58
Python script that will generate a x.509 certificate
#!/usr/bin/python
from OpenSSL import crypto, SSL
from socket import gethostname
from pprint import pprint
from time import gmtime, mktime
from os.path import exists, join
CERT_FILE = "myapp.crt"
KEY_FILE = "myapp.key"
@aemkei
aemkei / LICENSE.txt
Last active June 4, 2024 07:51 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Thermionix
Thermionix / grub.cfg
Last active June 7, 2021 17:47
grub2 loopback multiboot flash drive
moved to https://github.com/Thermionix/multipass-usb
@ebouchut
ebouchut / LighttpdReverseProxyURLRewriting
Last active January 27, 2021 20:35
Lighttpd reverse-proxy to that matches an URL _and_ does URL rewriting #web #server #lighttpd
#server.modules += ( "mod_rewrite")
# Workaround to have a working reverse-proxy that matches an URL does URL rewriting in Ligghtpd.
#
# Ligtthpd 1.4.28 cannot perform both matching and URL rewriting at the same time.
# Therefore we need to define 2 proxies, one does the matching and bounce the request
# to the other one, in charge of rewriting the URL before proxying the request to the target server.
#
# More about this here:
# http://redmine.lighttpd.net/issues/164#note-9
@jroper
jroper / Html5PushStatePlaceManager.java
Created May 7, 2012 12:32
GWTP HTML5 pushState place manager implementation
package com.gwtplatform.mvp.client.proxy;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.user.client.Window;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
@Singleton
public class Html5PushStatePlaceManager extends PlaceManagerImpl {
@nboire
nboire / EbeanTest.java
Created May 28, 2012 16:15
Playframework play2 EbeanTest Class to Clean Database before each test
package app;
import com.avaje.ebean.Ebean;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebean.config.ServerConfig;
import com.avaje.ebean.config.dbplatform.MySqlPlatform;
import com.avaje.ebeaninternal.api.SpiEbeanServer;
import com.avaje.ebeaninternal.server.ddl.DdlGenerator;
import org.junit.AfterClass;
import org.junit.Before;
@phred
phred / pedantically_commented_playbook.yml
Last active June 27, 2024 13:39
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@ryin
ryin / tmux_local_install.sh
Last active July 13, 2024 00:42
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
#!/bin/bash
set -o errexit
set -o nounset
if [[ ${#} -ne 1 ]]
then
echo "Usage: ${0} upstart-conf-file" >&2
exit 1
fi