Skip to content

Instantly share code, notes, and snippets.

@orip
orip / log_http_headers.py
Last active February 19, 2024 13:42 — forked from phrawzty/2serv.py
simple python http server to dump request headers
#!/usr/bin/env python3
import http
import http.server
import socketserver
import sys
def _log(s):
print(s)

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

@orip
orip / mysqldump2sqlite3.sh
Created September 23, 2012 15:23 — forked from orenhe/mysqldump2sqlite3.sh
Convert a mysql database dump into something sqlite3 understands.
#!/bin/sh
# ================================================================
#
# Convert a mysql database dump into something sqlite3 understands.
#
# Adapted from
# http://stackoverflow.com/questions/489277/script-to-convert-mysql-dump-sql-file-into-format-that-can-be-imported-into-sqlit
#
# (c) 2010 Martin Czygan <martin.czygan@gmail.com>