Skip to content

Instantly share code, notes, and snippets.

Brian Zambrano brianz

Block or report user

Report or block brianz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brianz
brianz / install-docker.sh
Last active Jan 8, 2020
Install docker on Amazon Linux
View install-docker.sh
#!/bin/bash
#
# steps taken verbatim from:
# http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html#install_docker
#
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
# log out and log in to pickup the added group
@brianz
brianz / __init__.py
Last active Jul 31, 2019
SQLAchemy helpers and mixins
View __init__.py
import contextlib
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import NullPool
from sqlalchemy_utils import database_exists, create_database
@brianz
brianz / built-nginx-ubuntu-14.04.sh
Last active Mar 27, 2019
Build and install nginx on ubuntu 14.04
View built-nginx-ubuntu-14.04.sh
#!/bin/bash
#
# This builds and installs a newer version of nginx on Ubuntu 14 with the same build/configure arguments
# as the apt version
#
./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin \
--conf-path=/etc/nginx/nginx.conf \
View install-docker-ubuntu.sh
#!/bin/bash
curl -fsSL https://yum.dockerproject.org/gpg | sudo apt-key add -
sudo apt-get install -y \
apt-transport-https \
software-properties-common \
ca-certificates
sudo add-apt-repository \
View keybase.md

Keybase proof

I hereby claim:

  • I am brianz on github.
  • I am bezeee (https://keybase.io/bezeee) on keybase.
  • I have a public key ASCpJjqPvAj3vPeinmHfxBil0mv7oRErQ6VkLU_ToS-OZQo

To claim this, I am signing this object:

@brianz
brianz / sqlalchemy_init.py
Created Aug 31, 2018
A set of helpers to work with SQLAlchemy setup, connections, transactions, etc.
View sqlalchemy_init.py
import contextlib
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import (
NullPool,
QueuePool,
StaticPool,
@brianz
brianz / uwsgi.ini
Created Sep 15, 2016
wsgi setup for calculator_service demo
View uwsgi.ini
[uwsgi]
http=0.0.0.0:8888
wsgi-file=wsgi_handler.py
processes=1
threads=1
py-auto-reload=3
View actions.py
import servant.fields
from servant.exceptions import ActionError
from servant.exceptions import ServantException
from servant.service.actions import Action
class AddAction(Action):
number1 = servant.fields.IntField(
required=True,
View setup.py
from setuptools import setup, find_packages
setup(
name = 'calculator_service',
packages=find_packages(),
version = '1.0',
description = 'Example application with Servant',
author='Brian Zambrano',
author_email='brianz@gmail.com',
classifiers=[
View service.py
from servant.service.base import Service
import actions
class CalculatorService(Service):
name = 'calculator_service'
version = 1
You can’t perform that action at this time.