Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Dai bunsenmcdubbs

View GitHub Profile
@bunsenmcdubbs
bunsenmcdubbs / install-hbase-standalone.md
Last active Feb 19, 2021
Installing HBase v2.3.4 Standalone
View install-hbase-standalone.md
@bunsenmcdubbs
bunsenmcdubbs / easy_postgres_docker.md
Last active Feb 7, 2021
Easiest way to spin up a dev/throwaway Postgres instance (Docker)
View easy_postgres_docker.md

Introduction

This quick guide will spin up a Postgres 12 container accessible from localhost:9432. This is NOT a durable setup and data is very likely to be lost after the database is shutdown. For demo purposes only.

Prerequisites

  • Docker

Instructions

In one shell, run

$ docker run -e POSTGRES_PASSWORD=postgres --publish 9432:5432 --name demo-pg12 postgres:12
View identity_export.go
type UserID int64
func export(customerID string) map[UserID]UserID {
graph := fetchGraph(customerID)
for src, _ := range graph {
find(graph, src) // Since this function mutates the graph, we don't need to store the results separately
}
return graph
}
@bunsenmcdubbs
bunsenmcdubbs / attendee_order.md
Last active Apr 8, 2016
HackGT EventBriter Design Docs
View attendee_order.md

Attendee Create Order

  1. Attendee navigates to event page
  2. TODO System checks for and removed expired ticket reservations
  3. System shows event view with available tickets
  4. Attendee selects ticket(s) from page
  5. System warns/prevents selecting unavailable tickets
  6. Attendee starts checkout process
  7. TODO System marks selected tickets as reserved
  8. System shows ticket information screen (collect attendee info)
@bunsenmcdubbs
bunsenmcdubbs / internet
Last active Aug 29, 2015
Forwarding network access through a usb tether to the Beaglebone Black. Adapted from http://robotic-controls.com/learn/beaglebone/beaglebone-internet-over-usb-only
View internet
#!/bin/bash
# run this on the computer first
ifconfig eth1 192.168.7.1
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
@bunsenmcdubbs
bunsenmcdubbs / xaccel.py
Created Jan 6, 2014
Short MPU6050 Test code in python, example for website full code in my BeagleCar Repo https://github.com/BunsenMcDubbs/BeagleCar/blob/master/src/test/xaccel.py
View xaccel.py
from Adafruit_I2C import Adafruit_I2C
from time import sleep
# initialize i2c connection to MPU6050
# i2c address is 0x68
i2c = Adafruit_I2C(0x68)
# wake up the device (out of sleep mode)
# bit 6 on register 0x6B set to 0
i2c.write8(0x6B, 0)
View MPU6050 I2C Fun on BeagleBone
root@beaglebone:~# i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --