- pgx_list_dbs: Lists the names of databases in an .sql file dumped using pg_dumpall.
- pgx_extract_db: Extracts a single database from a sql file dumped with pg_dumpall and outputs its content to stdout.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding=utf-8 | |
import sys | |
import os | |
from pprint import pprint | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "qa.settings") | |
from django.contrib.contenttypes.models import ContentType | |
# Output utf-8 on the command line, why is this buggy on my box? | |
reload(sys) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ========================================================= | |
# celerybeat - Starts the Celery periodic task scheduler. | |
# ========================================================= | |
# | |
# :Usage: /etc/init.d/celerybeat {start|stop|force-reload|restart|try-restart|status} | |
# :Configuration file: /etc/default/celerybeat or /etc/default/celeryd | |
# | |
# See http://docs.celeryq.org/en/latest/cookbook/daemonizing.html#init-script-celerybeat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stdbuf -o0 python manage.py runserver 127.0.0.1:8001 2>&1 | stdbuf -o0 sed "s/Quit the server with CONTROL-C\./__THETIME__/g" | stdbuf -o0 grep -v -E '("GET )|("POST )|(0 errors found)|(, using settings )|(Development server is running at)|(Validating models\.\.\.)' | awk '{ gsub("__THETIME__", "SERVER RELOADED AT " strftime("%Y-%m-%d %H:%M:%S" "\n======================================") ,$0); print $0; fflush(); }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i [INPUT_FILE] -an -pix_fmt yuv420p -vcodec mjpeg -f mov -y [OUTPUT_NAME].mov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Bootstrap packages. | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa-stable" . "https://stable.melpa.org/packages/")) | |
(add-to-list 'package-archives | |
'("melpa" . "https://melpa.org/packages/")) | |
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")) | |
(package-initialize) | |
(if (not (package-installed-p 'use-package)) | |
(progn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
import gc | |
import inspect | |
import ctypes | |
from collections import defaultdict | |
from django.core.management.base import BaseCommand | |
from django.db.models.signals import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from itertools import izip | |
from math import exp, sqrt | |
from random import random | |
from pprint import pprint | |
""" | |
Working through http://neuralnetworksanddeeplearning.com and | |
implementing it in no-library python. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rtmidi.midiutil import open_midiport | |
NOTEON = 144 | |
NOTEOFF = 128 | |
BASE = 65 | |
SCALE = [1, 2, 1, 1, 2, 2, 1, 2] | |
NOTE = BASE | |
STEP = 0 | |
TOPBASE = BASE + 24 |
Info: https://www.nginx.com/resources/admin-guide/nginx-https-upstreams/
Source: http://nategood.com/client-side-certificate-authentication-in-ngi
This is SSL, so you'll need an cert-key pair for you/the server, the api users/the client and a CA pair. You will be the CA in this case (usually a role played by VeriSign, thawte, GoDaddy, etc.), signing your client's certs. There are plenty of tutorials out there on creating and signing certificates, so I'll leave the details on this to someone else and just quickly show a sample here to give a complete tutorial. NOTE: This is just a quick sample of creating certs and not intended for production.