Skip to content

Instantly share code, notes, and snippets.

View jmvrbanac's full-sized avatar

John Vrbanac jmvrbanac

View GitHub Profile
@jmvrbanac
jmvrbanac / barbican-api-paste.ini
Last active November 17, 2015 20:21
Gunicorn Barbican Config
[composite:main]
use = egg:Paste#urlmap
/: barbican_version
/v1: barbican_api
[pipeline:barbican_version]
pipeline = versionapp
[pipeline:barbican_api]
pipeline = unauthenticated-context apiapp
@jmvrbanac
jmvrbanac / postactivate
Last active September 2, 2016 01:51
Custom pip index per virtualenv (using virtualenvwrapper)
#!/bin/bash
# This hook is sourced after every virtualenv is activated.
# This belongs in $WORKON_HOME/postactivate
VIRTUAL_ENV_NAME=${VIRTUAL_ENV##*/}
if [[ $VIRTUAL_ENV_NAME == *"custom_prefix_"* ]]
then
export PIP_INDEX_URL="https://pypi.python.org/simple"
else
# Put this line in postdeactivate as well
@jmvrbanac
jmvrbanac / kernel_builder.sh
Created July 4, 2015 23:43
Ath10k Kernel Builder
#!/bin/sh
apt-get update
apt-get install -y vim git libncurses5-dev gcc make screen kernel-package python-pip python-dev libffi-dev htop
apt-get build-dep -y linux-image-3.19.0-21-generic
# Download custom ath10k kernel fork
git clone https://github.com/kvalo/ath.git ath
cd ath
# Checkout 4.1.0-rc7
@jmvrbanac
jmvrbanac / main.rs
Created February 24, 2015 00:50
Playing with bitflags in rust
#[macro_use]
extern crate bitflags;
mod something;
fn main() {
let e1 = something::FLAG_A | something::FLAG_C;
let e2 = something::FLAG_B | something::FLAG_C;
assert!((e1 | e2) == something::FLAG_ABC); // union
assert!((e1 & e2) == something::FLAG_C); // intersection
@jmvrbanac
jmvrbanac / setting_up_postgres_for_barbican.md
Last active August 29, 2015 14:15
Setting up a Postgres Docker container to run with Barbican
  1. Execute
sudo docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=CHANGEME -d postgres
  1. Execute psql -h localhost -U postgres

  2. Within the psql shell execute the following lines

CREATE USER barbican WITH PASSWORD 'ALLTHEPASS';
@jmvrbanac
jmvrbanac / setup_dev_barbican_keystone_endpoint.sh
Last active August 29, 2015 14:08
Add the Barbican service user and endpoint to a dev keystone
#!/bin/bash
get_id () {
echo `$@ | awk '/ id / { print $4 }'`
}
export OS_SERVICE_TOKEN="ADMIN_TOKEN"
export OS_SERVICE_ENDPOINT="http://localhost:35357/v2.0"
SERVICE_ID=$(get_id keystone service-create --name=barbican --type="key-manager" --description="Key_Management_Service")
@jmvrbanac
jmvrbanac / keybase.md
Last active August 29, 2015 14:07
Keybase Verify

Keybase proof

I hereby claim:

  • I am jmvrbanac on github.
  • I am jmvrbanac (https://keybase.io/jmvrbanac) on keybase.
  • I have a public key whose fingerprint is F600 EECD C4B2 924A 594D 533D 757C 935C 3017 42A4

To claim this, I am signing this object:

@jmvrbanac
jmvrbanac / requests.md
Last active August 29, 2015 14:07
Barbican Request (cheatsheet for workshop)

Get Authentication Token:

POST http://workshop-ord-auth.cloudkeep.io/v2.0/tokens
Content-Type: application/json
Accept: application/json

Body:

@jmvrbanac
jmvrbanac / copy_key_to_servers.sh
Created July 29, 2014 15:20
Copy ssh pub key to a list of servers
#!/bin/bash
pub_key=~/.ssh/id_rsa.pub
while read server
do
echo "Copying to $server"
ssh-copy-id -i $pub_key root@$server
done <servers.txt
@jmvrbanac
jmvrbanac / clean_docker.sh
Created July 22, 2014 21:22
Cleanup all non-running docker images
#!/bin/bash
sudo docker rm `sudo docker ps --no-trunc -a -q`
sudo docker rmi $(sudo docker images | awk '$1!~/centos/ && NR>1 {print $3}')