Skip to content

Instantly share code, notes, and snippets.

iloveitaly /
Created Dec 16, 2011
Visual Representation of MySQL Table in OmniGraffle
#! /usr/bin/pythonw
# Modified by Michael Bianco <> on June 26, 2009
# Written by Thomas Pan at January 21, 2007
# mysql2graffle for Omnigraffle 5 is based on
# MyDBGraffle for OmniGraffle 4 which is based on Paul Davis' work at
# Requires:
# OmniGraffle 5
Problematic /
Created Feb 10, 2012
Installing pygit2 on Ubuntu 11.10
# this will install everything as root, so take that into account before you run it
# need cmake, python development headers, ZLib and OpenSSL
sudo apt-get install cmake python2.7-dev zlib1g-dev libssl-dev
mkdir libgit && cd libgit
git clone git://
cd libgit2
Watson1978 / AppDelegate.rb
Created Jul 26, 2012
MacRuby : Mountain Lion + Notification
View AppDelegate.rb
# AppDelegate.rb
# notify
# Created by watson on 2012/07/26.
module Notification
def send(title, text)
abeluck /
Last active Jun 27, 2022 — forked from KenMacD/
GPG Offline Master Key w/ smartcard
ndarville /
Created Aug 24, 2012
Generating a properly secure SECRET_KEY in Django
Two things are wrong with Django's default `SECRET_KEY` system:
1. It is not random but pseudo-random
2. It saves and displays the SECRET_KEY in ``
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`
rothgar / main.yml
Last active Jun 1, 2022
Generate /etc/hosts with Ansible
View main.yml
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
nocturnalgeek / MailinatorAliases
Last active May 30, 2022
A list of alternate domains that point to
View MailinatorAliases
jonasrosland /
Last active Aug 23, 2020
Use Docker Swarm with a data persistence layer

Use Docker Swarm with a data persistence layer

Create a Docker Swarm discovery token

curl -X POST

Export the correct environment variables

jamesramsay /
Last active Jun 12, 2022
Gmail: delete old emails automatically

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted
gbaman /
Last active Jun 25, 2022
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details -

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i