Skip to content

Instantly share code, notes, and snippets.

View godber's full-sized avatar
😺

Austin Godber godber

😺
View GitHub Profile
@godber
godber / README.md
Created June 11, 2019 01:18
Python AIOHTTP

test

@godber
godber / README.md
Last active April 8, 2019 13:55
Raspberry Pi All Sky Camera with Raspicam

Here's what I do after image acquisition.

  • Capture images with capture-loop.sh on Raspberry Pi
    • The raspberry pi is connected to my home network and is uncerimoniously thrown on the roof
    • It NFS mounts a disk inside, which is where the script lives and images get saved, so if an eagle flies off with it, I still have the data.
  • Convert the images to grayscale
  • Stretch them
  • Remove the bright ones at the beginning and end0
@godber
godber / Makefile
Created March 23, 2019 22:34
Makefile that bootstraps my Python and Kafka Talk
.PHONY: all clean data help tipcs cleandata cleantopics
help:
echo "all - do all setup, gets kafka and data and processes data"
echo "clean - deletes temp/"
echo "cleandata - deletes /tmp/kafka-logs /tmp/zookeeper"
echo "cleantopics - removes kafka topics"
echo "topics - creates kafka topics"
all: temp/kafka_2.12-2.1.1 data
@godber
godber / tmux-kafka.sh
Created March 19, 2019 02:51
Example scripting tmux - bootstrap a kafka session in
#!/usr/bin/env bash
cd temp/kafka_2.12-2.1.1/
SESSION='kafka'
tmux ls | grep -q $SESSION
if [ $? -eq 0 ]; then
tmux a -t $SESSION
@godber
godber / asset-version-spec.js
Created October 25, 2018 00:25
Teraslice Asset Version Check
'use strict';
const asset = require('../asset/asset');
const pkg = require('../package.json');
describe('asset version', () => {
it('should match package.json', () => {
expect(asset.version).toEqual(pkg.version);
});
});
>code
```python
print("hello world")
```
@godber
godber / index.js
Last active October 12, 2018 23:42
Teraslice dump_asset
'use strict';
const argv = require('yargs').argv;
const fse = require('fs-extra');
var elasticsearch = require('elasticsearch');
function saveAsset(assetName, assetVersion, binaryData) {
const newPath = `${assetName}/${assetVersion}`;
const tempFileName = `${newPath}/asset.zip`;
@godber
godber / 3dhist.py
Last active November 15, 2018 14:08
3D Histogram of an image in Python using VisPy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Generates 3D Histogram of Wallaby image and renders to screen using vispy
Requires:
vispy
scipy
numpy
@godber
godber / client.sh
Created March 30, 2018 12:36 — forked from leonklingele/client.sh
netcat – encrypt transfer with openssl
IP="127.0.0.1"
PORT="8877"
SHARED_SECRET="shared secret"
OPENSSL="/usr/local/opt/libressl/bin/openssl"
OPENSSL_CMD="$OPENSSL enc -a -A -aes-256-gcm"
while IFS= read -r MSG; do
echo "$MSG" | $OPENSSL_CMD -e -k "$SHARED_SECRET"
echo
@godber
godber / screen_capture.md
Created January 21, 2018 21:05
OS X Quicktime Screen Capture to GIF
  • Record video with OS X Quicktime Player (New Screenrecording)
brew install ffmpeg
brew install gifsicle
ffmpeg -i patrol1.mov -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=10 > patrol1a.gif

Refs: https://gist.github.com/dergachev/4627207