Skip to content

Instantly share code, notes, and snippets.

View rosscdh's full-sized avatar

Ross Crawford-d'Heureuse rosscdh

  • Sydney
View GitHub Profile
version: '3.3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.3.1
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
version: '2'
services:
redis:
restart: always
image: sameersbn/redis:4.0.9-1
command:
- --loglevel warning
volumes:
- $PWD/data/redis:/var/lib/redis:rw
### Keybase proof
I hereby claim:
* I am rosscdh on github.
* I am rosscrawford (https://keybase.io/rosscrawford) on keybase.
* I have a public key ASCjtuo71_eDBMUML7tCOdB7hzuTN2pO9QvbgRn2QEXEZgo
To claim this, I am signing this object:
version: '3'
services:
zookeeper:
image: confluent/zookeeper:latest
ports:
- "2181:2181"
# volumes:
# - ./config/kafka/zk.properties:/etc/kafka/zookeeper.properties
[alias]
addremove = !git r && git add . --all
aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort
all = add . --all
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
br = branch -av
brname = !git branch | grep "^*" | awk '{ print $2 }'
brdel = branch -D
ci = commit
changes = "!f() { git log --pretty=format:'* %s' $1..$2; }; f"
@rosscdh
rosscdh / Makefile
Last active May 28, 2021 11:28
docker makefile
.PHONY: all build login push run
NAME := rosscdh/my-project
TAG := $$(git log -1 --pretty=%h)
VERSION := ${NAME}:${TAG}
LATEST := ${NAME}:latest
BUILD_REPO_ORIGIN=$$(git config --get remote.origin.url)
BUILD_COMMIT_SHA1:=$$(git rev-parse --short HEAD)
BUILD_COMMIT_DATE:=$$(git log -1 --date=short --pretty=format:%ct)
@rosscdh
rosscdh / salt-with-docker.txt
Last active March 10, 2021 14:05
salt with docker
# Start salt-master
docker run -d --name salt-master --hostname salt saltstack/salt:latest salt-master
# Start a minion
docker run --link salt-master --name minion01 saltstack/salt:latest salt-minion
docker run --link salt-master --name minion02 saltstack/salt:latest salt-minion
# List keys
docker exec -it salt-master salt-key -L
@rosscdh
rosscdh / json_field.py
Last active June 23, 2025 16:44
PeeWee JSONField
import peewee as pw
class JSONField(pw.TextField):
"""
Class to "fake" a JSON field with a text field. Not efficient but works nicely
"""
def db_value(self, value):
"""Convert the python value for storage in the database."""
return value if value is None else json.dumps(value)
@rosscdh
rosscdh / SaltyBiscuit.py
Last active November 10, 2016 15:48
Salt Wrapper
#import requests
from universalclient import Client
class SaltyBiscuit(object):
url = 'http://192.168.99.100:8000/'
salt = None
token = None
def __init__(self, *args, **kwargs):
<!DOCTYPE html>
<html>
<head>
<title>{{ COMPANY_NAME }}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
/* CLIENT-SPECIFIC STYLES */
body, table, td, a{-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;} /* Prevent WebKit and Windows mobile changing default text sizes */