Skip to content

Instantly share code, notes, and snippets.

View max-lobur's full-sized avatar

Max Lobur max-lobur

View GitHub Profile
@max-lobur
max-lobur / keybase.md
Created May 16, 2019 13:50
keybase.io proof of my github identity

Keybase proof

I hereby claim:

  • I am max-lobur on github.
  • I am lobur (https://keybase.io/lobur) on keybase.
  • I have a public key ASBBAvBaCoxEv1vX-l3LRjcj9QLAVd1oD_0O4LP024iabwo

To claim this, I am signing this object:

#!/bin/sh
if [ -z "$1" ]; then echo NEED PATH TO requirements.txt; exit; fi
while read dependency; do
dependency_stripped="$(echo "${dependency}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
# Skip comments
if [[ $dependency_stripped == \#* ]]; then
continue
# Skip blank lines
@max-lobur
max-lobur / get_ubuntu_root.sh
Last active November 5, 2015 16:06
Ironic devstack
IMAGE=trusty-server-cloudimg-amd64
wget https://cloud-images.ubuntu.com/trusty/current/$IMAGE.tar.gz
tar -xzvf $IMAGE.tar.gz
glance image-create --name ubuntu-root --is-public True --disk-format raw --container-format bare --progress < $(IMAGE).img
@max-lobur
max-lobur / get_cirros.sh
Last active January 2, 2021 23:44
devstack tweaks
. ~/devstack/openrc admin demo
for id in $(glance image-list | grep cirros | cut -d'|' -f2); do glance image-delete id; done
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img
glance image-create --name cirros --disk-format qcow2 --container-format bare --file cirros-0.3.4-i386-disk.img --is-public=True --progress
import eventlet
import futures
import random
import sys
#eventlet.monkey_patch(os=False)
def test():
if random.choice((True, False)):
raise Exception()
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, ForeignKey, String, create_engine
from sqlalchemy.orm import relationship, sessionmaker
engine = create_engine("sqlite:///:memory:", echo="debug")
Session = sessionmaker(bind=engine)
BASE = declarative_base()
session = Session()