Skip to content

Instantly share code, notes, and snippets.

@timfreund
timfreund / execute_tests.sh
Created July 13, 2014 18:26
fig config and glue for kallithea ci
#!/usr/bin/env bash
set -x
here=`dirname $0`
env
python ${here}/fig-config-glue.py ${here}/../test.ini
sleep 10
nosetests
@timfreund
timfreund / pseudoquery.py
Created July 25, 2014 21:36
Run a query against a raw connection from SQLAlchemy
from sqlalchemy import create_engine
class SQLKeyring:
"""A SQLKeyring object provides a tiny bit of glue between
the secure credential storage of the Python Keyring Lib and
the database connectivity of SQLAlchemy
"""
def get_connection_url(self, name):
return self.keyring.get_password('sqlkeyring', name)
#!/usr/bin/env python
import cx_Oracle
username = "user"
password = "pass"
database = "tnsname"
con = cx_Oracle.connect(username, password, database)
cur = con.cursor()
class { 'ceph':
fsid => generate('/usr/bin/uuidgen'),
mon_host => $::ipaddress_eth0,
authentication_type => 'none',
}
ceph::mon { 'a':
public_addr => $::ipaddress_eth0,
osd_pool_default_size => 1,
authentication_type => 'none',
elasticsearch:
image: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
grafana:
image: grafana/grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: secret
ports:
beat:
build: .
command: ./manage.py celery beat -l DEBUG
links:
- rabbitmq
volumes:
- .:/usr/src/app
web:
build: .
command: ./manage.py runserver 0.0.0.0:8000

Keybase proof

I hereby claim:

  • I am timfreund on github.
  • I am timfreund (https://keybase.io/timfreund) on keybase.
  • I have a public key ASAFntwXUE0GBkwyDuo79EXvuHwANi-vDdJJpr0r8EB5NQo

To claim this, I am signing this object:

@timfreund
timfreund / openshift-via-cloud-init.sh
Created February 21, 2017 01:55
openshift via docker on centos 7
#!/bin/bash
# install docker
yum install -y docker
systemctl enable docker
systemctl start docker
# download openshift image
docker pull openshift/origin:v1.4.1
@timfreund
timfreund / gist:8f1f370da1a6cb0aba9ff59b53cca2a4
Created July 20, 2017 20:00
question about docker build --build-arg
# Just used default remote package mirrors
docker history 58733688722f
IMAGE CREATED CREATED BY SIZE COMMENT
58733688722f About a minute ago /bin/sh -c git clone https://github.com/fu... 1.06GB
19b893454708 7 minutes ago /bin/sh -c apt-get update && apt-get upgra... 118MB
c30daf46b0f9 16 hours ago /bin/sh -c #(nop) MAINTAINER "Tim Freund"... 0B
3bcf97f6f832 4 weeks ago /bin/sh -c #(nop) CMD ["bash"] 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ADD file:ede5a88363e3848... 79.2MB
# Set a ENV http_proxy line, saved 2 minutes on the build, but that proxy setting persists
@timfreund
timfreund / startrek.sh
Created May 3, 2018 16:40
Star Trek NG inspired white noise script
#!/usr/bin/env bash
play -c2 -n synth whitenoise band -n 100 24 band -n 300 100 gain +20 flanger