Skip to content

Instantly share code, notes, and snippets.

# coding: utf-8
from contextlib import contextmanager
import logging
import pandas as pd
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
@pkpinto
pkpinto / ipython.conf
Created July 23, 2015 10:12
upstart conf file to start iPython Notebook on boot
description "IPython Notebook"
start on runlevel [2345]
stop on runlevel [016]
respawn limit 10 5
setuid pdasi_01
chdir /local/home/pdasi_01/Projects
# from http://www.huyng.com/posts/sane-color-scheme-for-matplotlib/
# based on matplotlib/blob/master/lib/matplotlib/mpl-data/stylelib/ggplot.mplstyle
# get location for placement with
# print(mpl.get_configdir())
# in that directory create a subdirectory called stylelib and
# add your style sheet with the extension mplstyle
patch.linewidth: 0.5
patch.facecolor: 348ABD # blue
patch.edgecolor: EEEEEE
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite