Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# This will install everything required to run a basic Postal installation.
# This should be run on a clean Ubuntu 16.04 server.
#
# Once the installation has completed you will be able to access the Postal web
# interface on port 443. It will have a self-signed certificate.
#
# * Change the MySQL & RabbitMQ passwords
# * Create your first admin user with 'postal make-user'
@jordanyaker
jordanyaker / monads.py
Created October 5, 2017 18:10
Try-Monad
# ------------------------------------------------------------
# Based on Jason DeLaat's Either monad:
# https://github.com/fnl/pymonad/blob/master/pymonad/Either.py
# ------------------------------------------------------------
from pymonad.Monad import *
class Try(Monad):
"""
Represents an operation that may either fail or succeed.
@jordanyaker
jordanyaker / gulpfile.babel.js
Created July 17, 2017 12:42
Using Gulp to pack Node.js Azure Functions
process.env.NODE_CONFIG_DIR = `${process.cwd()}/config/env`;
import gulp from 'gulp';
import requireDir from 'require-dir';
requireDir('./lib/tasks');
gulp.task('default', ['update-project', 'run-webpack'], () => {
gulp.src('host.json')
.pipe(gulp.dest('.deploy/'));
@jordanyaker
jordanyaker / deis-database.log
Last active October 26, 2016 19:55
Logger Output From Deis Database
2016-10-26T19:04:32.907006343Z STRUCTURED: time=2016-10-26T19:04:32.906835-00 pid=141
2016-10-26T19:04:33.415860651Z wal_e.worker.upload INFO MSG: begin uploading a base backup volume
2016-10-26T19:04:33.415886451Z DETAIL: Uploading to "s3://dbwal/basebackups_005/base_000000010000000000000002_00000040/tar_partitions/part_00000000.tar.lzo".
2016-10-26T19:04:33.415890951Z STRUCTURED: time=2016-10-26T19:04:33.415552-00 pid=141
2016-10-26T19:04:33.516551450Z wal_e.blobstore.s3.calling_format INFO MSG: connecting to S3 with WALE_S3_ENDPOINT (http://10.0.129.163:9000)
2016-10-26T19:04:33.516565150Z STRUCTURED: time=2016-10-26T19:04:33.516342-00 pid=141
2016-10-26T19:04:33.526507057Z boto3.resources.action INFO Calling s3:put_object with {'Body': <open file '<fdopen>', mode 'r+b' at 0x7f5c3c7c85d0>, u'Bucket': 'dbwal', 'Key': 'basebackups_005/base_000000010000000000000002_00000040/tar_partitions/part_00000000.tar.lzo'}
2016-10-26T19:04:33.555623664Z botocore.vendored.reque
@jordanyaker
jordanyaker / arm-template.json
Created September 19, 2016 16:57
Azure REST API Errors
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"newStorageAccountName": {
"type": "string",
"metadata": {
"description": "Name of the of the storage account for VM OS Disk"
}
},
@jordanyaker
jordanyaker / Notes.md
Created July 20, 2016 01:53
Notes On Polymer

Initial Thoughts

  • Polymer Elements should be able to observe when a data collection changes without multiple instances of the collection being created. For the following example:

example-list would receive notifications about changes to the data collection when elements are added or removed.

@jordanyaker
jordanyaker / .gitignore
Created June 7, 2016 13:26
Global .gitignore File
# VS Code
.vscode
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
@jordanyaker
jordanyaker / setup_folders.sh
Created February 3, 2016 21:35
Securing Websites With Nginx And Client-Side Certificate Authentication On Linux
mkdir -p /etc/ssl/ca/certs/users && \
mkdir /etc/ssl/ca/crl && \
mkdir /etc/ssl/ca/private
@jordanyaker
jordanyaker / revoke_user.sh
Created February 3, 2016 21:35
Securing Websites With Nginx And Client-Side Certificate Authentication On Linux
openssl ca -name CA_Default \
-revoke /etc/ssl/ca/certs/users/USERNAME.crt \
-keyfile /etc/ssl/ca/private/ca.key \
-cert /etc/ssl/ca/certs/ca.crt
openssl ca -name CA_Default -gencrl \
-keyfile /etc/ssl/ca/private/ca.key \
-cert /etc/ssl/ca/certs/ca.crt \
-out /etc/ssl/ca/private/ca.crl \
-crldays 1095
@jordanyaker
jordanyaker / openssl.conf
Created February 3, 2016 21:34
Securing Websites With Nginx And Client-Side Certificate Authentication On Linux
[ ca ]
default_ca = CA_default # The name of the CA configuration to be used.
# can be anything that makes sense to you.
[ CA_default ]
dir = /etc/ssl/ca # Directory where everything is kept
certs = $dir/certs # Directory where the issued certs are kept
crl_dir = $dir/crl # Directory where the issued crl are kept
database = $dir/index.txt # database index file.
#unique_subject = no # Set to 'no' to allow creation of
# several certificates with same subject.