Skip to content

Instantly share code, notes, and snippets.

View mafrosis's full-sized avatar
🍳

Matt Black mafrosis

🍳
  • MACHIN SHIN
  • Melbourne, Australia
View GitHub Profile
"""[4] Migrate complex_uuid data to user table
Revision ID: dc33b414403d
Revises: 336cf482107d
Create Date: 2017-06-21 15:24:46.691582
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
@mafrosis
mafrosis / EC2.py
Created July 17, 2012 02:46
Draft of changes to salt-cloud EC2.py
'''
The generic libcloud template used to create the connections and deploy the
cloud virtual machines
'''
# Import python libs
import os
import sys
import subprocess
IdentitiesOnly yes
Host *
Compression yes
#CompressionLevel 7
Cipher blowfish-cbc
ServerAliveInterval 600
ControlMaster auto
ControlPath /tmp/ssh-%r@%h:%p
java.lang.Exception: Cloud or AMI instance cap would be exceeded for: Linux Slave
at org.kohsuke.stapler.HttpResponses.error(HttpResponses.java:83)
at hudson.plugins.ec2.EC2Cloud.doProvision(EC2Cloud.java:342)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
#! /usr/bin/env python
from __future__ import print_function
import datetime
import uuid
import random
from faker import Faker
@mafrosis
mafrosis / rethinkdb_setup_osx.md
Last active January 30, 2018 01:31
RethinkDB Setup on OSX

RethinkDB Setup on OSX

This guide will get RethinkDB setup and running with a default configuration on OSX. There is also an option for setting RethinkDB to start at boot time on OSX, and a note on upgrading to a more recent RethinkDB version.

First Installation

Install Homebrew if you don't already have it:

Keybase proof

I hereby claim:

  • I am mafrosis on github.
  • I am mafrosis (https://keybase.io/mafrosis) on keybase.
  • I have a public key whose fingerprint is 929A 9F6E 5CA0 E607 EF88 841E 5387 4DF8 BEF7 F397

To claim this, I am signing this object:

@mafrosis
mafrosis / log
Created June 14, 2017 10:00
docker-machine create portal
mafro@takeshi:~ > docker-machine --debug create portal
Docker Machine Version: 0.12.0-rc2, build 64fa459
Found binary path at /usr/local/bin/docker-machine
Launching plugin server for driver vmwarefusion
Plugin server listening at address 127.0.0.1:50004
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
2017/03/30 11:15:35 [INFO] Packer version: 1.1.0-rc2 (7866d7df149f8ce5accb9e250c0576866d1b7333+CHANGES)
2017/03/30 11:15:35 Packer Target OS/Arch: darwin amd64
2017/03/30 11:15:35 Built with Go Version: go1.8
2017/03/30 11:15:35 Detected home directory from env var: /Users/mafro
2017/03/30 11:15:35 Using internal plugin for oneandone
2017/03/30 11:15:35 Using internal plugin for vmware-vmx
2017/03/30 11:15:35 Using internal plugin for amazon-ebssurrogate
2017/03/30 11:15:35 Using internal plugin for azure-arm
2017/03/30 11:15:35 Using internal plugin for googlecompute
2017/03/30 11:15:35 Using internal plugin for hyperv-iso
@mafrosis
mafrosis / db.py
Last active August 11, 2016 07:36
Flask-Alembic sans Flask-SqlAlchemy
from flask import g
from flask import current_app as app
from flask_alembic import Alembic
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()