This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
gcloud docker -a | |
docker pull us.gcr.io/lexical-cider-93918/oao-postgres:_build.72c78d4 | |
docker run -id --name=oao-postgres-data us.gcr.io/lexical-cider-93918/oao-postgres:_build.72c78d4 tail -F /dev/null | |
sleep 20 | |
docker run -d --name=oao-postgres-service --volumes-from=oao-postgres-data us.gcr.io/lexical-cider-93918/oao-postgres:_build.72c78d4 | |
docker pull us.gcr.io/lexical-cider-93918/dbadmin:_build.f00437d | |
docker run -id --name=dbadmin-data us.gcr.io/lexical-cider-93918/dbadmin:_build.f00437d script tail -F /dev/null | |
sleep 20 | |
docker run -d --name=dbadmin-service --volumes-from=dbadmin-data --link oao-postgres-service:postgres us.gcr.io/lexical-cider-93918/dbadmin:_build.f00437d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git clone git@github.com:OAODEV/k8s-resources.git | |
kubectl replace --force -f k8s-resources/warehouse/postgres.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#coding: utf-8 | |
import random | |
from AppKit import NSPasteboard, NSArray | |
def namer(): | |
adjectives = ("aliased", | |
"angelic", | |
"anonymous", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def status_post(message, nickname, color): | |
token = os.getenv('STATUSTOKEN') | |
payload = { | |
'status': message, | |
'color': color, | |
'token': token | |
} | |
url = 'http://status.pedicel.xyz:5007' | |
headers = {'content-type': "application/json"} | |
url = '/'.join([url, nickname]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
last="2016-02-23" | |
first="2015-12-31" | |
i=1 | |
while [[ $last > $first ]]; do | |
this=$(date -I -d "$last - 3 days") | |
printf -v j "%02d" $i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $(docker-machine status default) != 'Running' ]; then | |
echo "start docker VM now [y/n]?" | |
read -n 1 start | |
if [ "$start" = "n" ]; then | |
: | |
else | |
docker-machine start default | |
eval $(docker-machine env default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3-alpine | |
# install requirements for psycopg2 | |
RUN apk update && apk add -u \ | |
postgresql-dev \ | |
gcc \ | |
python3-dev \ | |
musl-dev | |
RUN pip3 install psycopg2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python | |
>>> import sys | |
>>> v = 'some value for this variable' | |
>>> x = open('/path/to/somefile', 'w') | |
>>> sys.stdout = x | |
>>> print(v) | |
>>> x.close() | |
$ cat /path/to/somefile | |
some value for this variable | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple tables in D3</title> | |
<meta charset="utf-8"> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script src="https://cdn.jsdelivr.net/npm/d3-jetpack@2.0.15/build/d3-jetpack.min.js"></script> | |
<style type="text/css"> | |
body { font-family: 'Helvetica Neue', Helvetica; font-weight: 300; padding: 20px;} | |
th { text-align: left; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sqlite3 | |
import unittest | |
import frontmatter | |
from frontmatter import YAMLHandler | |
class SQLHandler(YAMLHandler): | |
""" Subclass of YAMLHandler that uses SQL comment indicators `/* <comment> */` as frontmatter |