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
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 / __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 / 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,
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 \
@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 \
@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 service.py
from servant.service.base import Service
import actions
class CalculatorService(Service):
name = 'calculator_service'
version = 1
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=[
@brianz
brianz / tech-scratch-pad.md
Last active Aug 11, 2016
brianz's tech scratch pad
View tech-scratch-pad.md

Sum column using awk

cat count.txt | awk '{sum+=$1} END {print sum}'

List open ports

linux: netstat -lnptu
mac: netstat -a -p tcp
You can’t perform that action at this time.