Skip to content

Instantly share code, notes, and snippets.

View mulka's full-sized avatar

Kyle Mulka mulka

View GitHub Profile
@mulka
mulka / create_db.py
Created April 2, 2020 05:04
Uses the RDS Data API to create a database inside an Amazon Aurora Serverless cluster
import sys
import boto3
client = boto3.client('rds-data')
cluster_name = sys.argv[1]
db_name = sys.argv[2]
sql = 'CREATE DATABASE ' + db_name
@mulka
mulka / go.py
Created August 2, 2019 04:29
Dash buttons controlling hue bulbs
import datetime
import sys
from scapy.all import *
import requests
last_probe = {}
button_names = {
'mac_address': 'human readable name'
{
"id": "6f1f0ea4554abc81",
"url": "https://api.twitter.com/1.1/geo/id/6f1f0ea4554abc81.json",
"place_type": "city",
"name": "Madison",
"full_name": "Madison, AL",
"country_code": "US",
"country": "United States",
"contained_within": [
{
{
"id": "012609e600de68c2",
"url": "https://api.twitter.com/1.1/geo/id/012609e600de68c2.json",
"place_type": "city",
"name": "Lexington",
"full_name": "Lexington, KY",
"country_code": "US",
"country": "United States",
"contained_within": [
{
{
"id": "149da10c51d8fe05",
"url": "https://api.twitter.com/1.1/geo/id/149da10c51d8fe05.json",
"place_type": "city",
"name": "Albany",
"full_name": "Albany, GA",
"country_code": "US",
"country": "United States",
"contained_within": [
{
{
"id": "01cabc1c56598004",
"url": "https://api.twitter.com/1.1/geo/id/01cabc1c56598004.json",
"place_type": "city",
"name": "Springfield",
"full_name": "Springfield, MO",
"country_code": "US",
"country": "United States",
"contained_within": [
{
@mulka
mulka / itunes.html
Last active December 22, 2015 16:58 — forked from mike-ward/README.md
Found a directive called ngSrc. http://docs.angularjs.org/api/ng.directive:ngSrc
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.1/pure-min.css">
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<style type="text/css">
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git cat-file -p 6d5aaae49d6 > 3
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git cat-file -p 79a47534655 > 4
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ diff 3 4
1,2c1,2
< tree 55288e6604870867c94081896f6a1f5f54a841ac
< parent 832a0a889c65d8e13fac67c9a585f9c1d7e48bcb
---
> tree d6004320c1781da6bbdd0fe154ead4457eab53c2
> parent c4a69a4a60aed89af38e4864b47763489342e131
4c4
@mulka
mulka / gist:5784212
Created June 14, 2013 18:38
identical git commits having different hashes?
This doesn't make any sense to me. I thought two identical diffs would have identical commit ids in git. But, this does not appear to be the case, as I have made two commits which are otherwise the same. I did this by rebasing two branches off the same branch. I feel like the intermediate commits should have been the same, but then I saw a fork in my tree. See below:
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git show 6d5aaae49d6 > 1
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git show 79a47534655 > 2
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ diff 1 2
1c1
< commit 6d5aaae49d66d9cfa95c5340ef8562f876694758
---
> commit 79a47534655e4afbfebbcb354adeb59943ca7edc
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$
@mulka
mulka / update_throughput.py
Created May 7, 2013 19:46
Here's a little script I wrote to increase the throughput of a DynamoDB table by doubling it, then waiting, then doubling, until it gets to where you want it to be.
#!/usr/bin/env python
import sys
import time
import boto
conn = boto.connect_dynamodb()
table = conn.get_table('table_name')