Skip to content

Instantly share code, notes, and snippets.

View aztecrex's full-sized avatar
🏎️
Status!

Greg Wiley aztecrex

🏎️
Status!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am aztecrex on github.
  • I am aztecrex (https://keybase.io/aztecrex) on keybase.
  • I have a public key ASB8QotXOe2-vtZlWFHD0zIP3c9LLxloQ1C1p780PxSmaAo

To claim this, I am signing this object:

@aztecrex
aztecrex / build-hackage-server.txt
Last active June 7, 2018 16:07
How to build hackage server 0.5.1 on Ubuntu in AWS
# Launch and log into a Ubuntu 16.04 instance in AWS
sudo apt-get update
sudo apt-get install -y gcc libgmp-dev libicu-dev zlib1g-dev libtinfo-dev libssl-dev
download='https://www.haskell.org/platform/download/8.2.2/haskell-platform-8.2.2-unknown-posix--core-x86_64.tar.gz'
wget "$download" -O platform.tgz
tar -xzvf platform.tgz
sudo ./install-haskell-platform.sh
@aztecrex
aztecrex / script and rules
Last active August 26, 2017 04:20
C.H.I.P. GPIO as normal user
This allows anyone in the "gpio" group to do GPIO operations
------ /etc/udev/rules.d/98-gpio-group.rules
# UDEV RULE TO CHANGE GPIO GROUP
# INITIALLY WRITTEN BY IOT_STEVE
# UPDATED BY XTACOCOREX
# THIS REQUIRES change_gpio_perms.sh TO BE INSTALLED IN /usr/local/bin/
SUBSYSTEM=="gpio", PROGRAM="/usr/local/bin/change_gpio_perms.sh"
@aztecrex
aztecrex / gist:cbbb9d597a84b2ceeec73887dc768e49
Created May 13, 2016 22:18
delete tagless images from ECR
this is not quite it...
aws ecr list-images --repository-name MyRepository --query 'imageIds?type(imageTag)!=`string`.imageDigest' --output text | while read line; do aws ecr batch-delete-image --repository-name MyRepository --image-ids imageDigest=$line; done
@aztecrex
aztecrex / developers.json
Last active January 5, 2016 01:29
identity-access-spec
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "CJ Identity and Access Service",
"description": "Services for registering and authenticating developers and apps",
"termsOfService": "http://developers.cj.com/tbd",
"contact": {
"name": "CJ Engineering",
"url": "http://developers.cj.com/"
@aztecrex
aztecrex / aws-session-functions.sh
Last active February 26, 2023 18:23
AWS Session Helper Functions
# source this for some sweet sweet aws session helpers
# invoke STS to get session creds and put them in vars where they can
# be passed into something such as a docker container. This places creds
# in the vars expected by the CLI so they will mask any set by aws configure
#
# aws-session
# docker run -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN ...
aws-session() {
eval "$(aws sts get-session-token \
@aztecrex
aztecrex / curry.js
Created October 18, 2015 21:04
Curry function, my answer to Omniscient.js Workshop task #13
var curry = function (fn) {
var me = this;
function gen(cur) {
return function () {
var next = cur.concat(Array.prototype.slice.call(arguments))
if (next.length >= fn.length) {
return fn.apply(me, next)
} else {
return gen(next)
}
@aztecrex
aztecrex / FlowSpike.hs
Last active August 29, 2015 14:19
Workflow control from event history API demo
module FlowSpike where
{-
Model a distributed workflow with event-sourced control state. In
this model, the workflow spec is run every time a decision is requred.
A single run transforms a collection of pending and completed tasks
into a maybe result and collection of tasks to start.
This spike tries to expose the control flow problem and propose
an API.
Copyright (C) Greg Wiley
Licensed under the Apache License, Version 2.0 (the "License") under
one or more contributor license agreements. See the NOTICE file
distributed with this work for information regarding copyright
ownership. You may not use this file except in compliance with the
License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
package demo;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Subscriber;
import rx.functions.Func0;
import rx.util.async.Async;