I hereby claim:
- I am maedoc on github.
- I am wdmn (https://keybase.io/wdmn) on keybase.
- I have a public key ASAlgMiYnoaAeHqMFi9Uoez85hYBYb5Qwp-RlkvImJEXJwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
mkdir -p /tmp/cerb_1 | |
sshfs $host_dir /tmp/cerb_1 | |
mkdir -p /tmp/cerb_2 | |
encfs /tmp/cerb_{1,2} | |
for d in $@ | |
do |
#!/bin/bash | |
function setup_db() { | |
docker run -d --name gcpg postgres | |
echo "waiting for db to spin up..." | |
sleep 2 | |
docker exec gcpg psql -U postgres -c 'CREATE DATABASE gcdb;' | |
docker exec gcpg psql -U postgres -c "CREATE ROLE gcu WITH PASSWORD 'foo';" | |
docker exec gcpg psql -U postgres -c "ALTER ROLE gcu WITH LOGIN;" | |
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres | \ |
CMDSTAN ?= ~/Downloads/cmdstan-2.17.0 | |
nsim ?= 1 | |
./%: %.stan prelude.stan | |
$(CMDSTAN)/bin/stanc --o=$*.hpp $*.stan | |
here=$(shell pwd); cd $(CMDSTAN); make $$here/$@; cd $$here | |
sim.csv: sim.data.R ./sim | |
./sim sample algorithm=fixed_param num_samples=$(nsim) data file=sim.data.R output file=sim.csv |
import re | |
def lines(fname='awssg.py'): | |
with open(fname,'r') as fd: | |
for line in fd.readlines(): | |
if "f'" in line: | |
yield line | |
def fmt_str(line): | |
ex = r'f\'(.*)\'' |
from .models import Thing | |
import time | |
all_ids = [] | |
size = 10000 | |
num_items = Thing.objects.count() | |
qs = Thing.objects.order_by('id') | |
last_id = qs.first().id | |
count = 0 |
import boto | |
import requests | |
import json | |
import os.path | |
# keep the list of cidr/ip addrs we used in the past | |
known_fname = os.path.expanduser('~/.awssg') | |
# aws credentials | |
creds = { |
from numpy import * | |
import numpy as np | |
from numpy.random import randn, rand | |
def spmat(A): | |
n = A.shape[0] | |
m = A != 0 # non-zero mask | |
a = A[m] # non-zero elements | |
r, c = argwhere(m).T # non-zero row & col indices |
import os | |
import sys | |
import subprocess | |
# gcc $(python3-config --cflags) -fPIC -c $file | |
# gcc -shared $(python3-config --ldflags) utils.o -o utils.so | |
def flags(): | |
proc = subprocess.Popen(['python3-config', '--cflags'], stdout=subprocess.PIPE) | |
cflags = proc.stdout.read().decode('ascii') |
#!/bin/bash | |
apt-get update | |
apt-get install -y apt-transport-https ca-certificates curl python-software-properties | |
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - | |
echo "deb [arch=amd64] https://download.docker.com/linux/debian wheezy stable" >> /etc/apt/sources.list | |
echo "deb http://ftp.debian.org/debian/ wheezy-backports main" >> /etc/apt/sources.list | |
apt-get update |