Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
iloveitaly / mysql2graffle.py
Created Dec 16, 2011
Visual Representation of MySQL Table in OmniGraffle
View mysql2graffle.py
#! /usr/bin/pythonw
#
# Modified by Michael Bianco <info@cliffsidedev.com> 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 http://www.visualdistortion.org
#
# Requires:
#
# OmniGraffle 5
@Problematic
Problematic / install_pygit.sh
Created Feb 10, 2012
Installing pygit2 on Ubuntu 11.10
View install_pygit.sh
# 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://github.com/libgit2/libgit2.git
cd libgit2
@Watson1978
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
module_function
def send(title, text)
@abeluck
abeluck / gpg-offline-master.md
Last active Jun 27, 2022 — forked from KenMacD/cmd.md
GPG Offline Master Key w/ smartcard
View gpg-offline-master.md
@ndarville
ndarville / secret-key-gen.py
Created Aug 24, 2012
Generating a properly secure SECRET_KEY in Django
View secret-key-gen.py
"""
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 `settings.py`
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`
@rothgar
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 http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- 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
nocturnalgeek / MailinatorAliases
Last active May 30, 2022
A list of alternate domains that point to @mailinator.com
View MailinatorAliases
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@jonasrosland
jonasrosland / docker-swarm-data-persistence.md
Last active Aug 23, 2020
Use Docker Swarm with a data persistence layer
View docker-swarm-data-persistence.md

Use Docker Swarm with a data persistence layer

Create a Docker Swarm discovery token

curl -X POST https://discovery.hub.docker.com/v1/clusters
YOURSWARMTOKEN

Export the correct environment variables

@jamesramsay
jamesramsay / README.md
Last active Jun 12, 2022
Gmail: delete old emails automatically
View README.md

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

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

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

More details - http://blog.gbaman.info/?p=791

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