Skip to content

Instantly share code, notes, and snippets.

sudo su
easy_install supervisor
echo_supervisord_conf > /etc/supervisord.conf
mkdir /etc/supervisord
echo '[include]
files=/etc/supervisord/*' >> /etc/supervisord.conf
# verify it installed correctly with a test
echo '[program:filewatcher]
@boaf
boaf / indices.py
Created December 5, 2017 23:06
SQLAlchemy snippets
from sqlalchemy import Column, Integer, String, Index
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Person(Base):
__tablename__ = 'person'
id = Column(Integer, primary_key=True, autoincrement=True)
first_name = Column(String(64), index=True) # A single-column index
@boaf
boaf / temp-sign.sh
Created October 12, 2016 17:39
Temporarily imports key to sign without changing existing pubring
#!/usr/bin/env bash
#
# Copyright (c) <year> <copyright holders>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
@boaf
boaf / ubuntu-setup-with-nginx-mariadb-php-fpm.md
Last active October 20, 2016 21:13
Setting up Ubuntu 16.04 — Nginx, MariaDB, PHP-FPM

Setting up Ubuntu 16.04 — Nginx, MariaDB, PHP-FPM

1. Update

sudo apt-get update

2. Install Nginx

Keybase proof

I hereby claim:

  • I am boaf on github.
  • I am boaf (https://keybase.io/boaf) on keybase.
  • I have a public key whose fingerprint is 07D7 5E97 F711 FF04 3AF7 F9E3 B2AD 55C7 3D1B 81B7

To claim this, I am signing this object:

@boaf
boaf / Makefile
Created November 20, 2014 05:53
Frontend build system utilizing Make and node.js
PROJECT_NAME = my-rad-project
COFFEE_SRC = coffee
JS_DEST = js
BIN = ./node_modules/.bin
COFFEE_FILES = $(wildcard $(COFFEE_SRC)/*.coffee)
JS_FILES = $(COFFEE_FILES:$(COFFEE_SRC)/%.coffee=$(JS_DEST)/%.js)
MAP_FILES = $(JS_FILES:%.js=%.js.map)
{
"cmd": ["java", "-jar", "${packages}/Google Closure/compiler.jar", "--js",
"$file", "--js_output_file",
"${file_path}/${file_base_name}.min.js", "--compilation_level",
"WHITESPACE_ONLY"],
"file_regex": "^(.*):([0-9]+):() ERROR - (.*)",
"selector": "source.js"
}