Skip to content

Instantly share code, notes, and snippets.

Richard Moorhead autodidacticon

Block or report user

Report or block autodidacticon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am autodidacticon on github.
  • I am richardmoorhead (https://keybase.io/richardmoorhead) on keybase.
  • I have a public key ASAJEZBGPyDeiHsgXnfCPL-9yeSqa_XqTP8XHjorep2L_Ao

To claim this, I am signing this object:

View helm.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: helm
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: helm
View keybase.md

Keybase proof

I hereby claim:

  • I am autodidacticon on github.
  • I am richardmoorhead (https://keybase.io/richardmoorhead) on keybase.
  • I have a public key ASBJOvopCcKLtMeWPgL-dtOGH98okjFBPv8KIj8Aytj0Dwo

To claim this, I am signing this object:

View atlas_setup.sh
#!/bin/bash
#install Xcode CLT
xcode-select --install
# install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install 'brew bundle'
brew tap homebrew/bundle
@autodidacticon
autodidacticon / .bashrc
Created Jan 22, 2017
EMR pyspark bashrc
View .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# set the default region for the AWS CLI
export AWS_DEFAULT_REGION=$(curl --retry 5 --silent --connect-timeout 2 http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
export JAVA_HOME=/etc/alternatives/jre
# added by Anaconda2 4.2.0 installer
export PATH="/home/hadoop/anaconda2/bin:$PATH"
View pg_index_utilization.sql
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
@autodidacticon
autodidacticon / docker-compose.yml
Last active May 19, 2017
docker - zookeeper, kafka, kafka-manager
View docker-compose.yml
zookeeper:
image: wurstmeister/zookeeper
ports:
- "32772:2181"
kafka:
image: wurstmeister/kafka:latest
ports:
- "9092"
links:
- zookeeper:zk
View to_redshift.py
# see also https://github.com/wrobstory/pgshift
import gzip
from io import StringIO, BytesIO
from functools import wraps
import boto
from sqlalchemy import MetaData
from pandas import DataFrame
from pandas.io.sql import SQLTable, pandasSQL_builder
@autodidacticon
autodidacticon / redshift.sql
Last active Jul 25, 2016
Redshift cheat sheet
View redshift.sql
-- see current table locks
select s.schema, l.lock_owner_pid, s.table from svv_table_info s, stv_locks l where l.table_id = s.table_id;
-- see current queries
select * from stv_recents where status = 'Running';
-- kill process
select pg_terminate_backend(pid);
-- table size on disk
View namespace.js
// create the root namespace and making sure we're not overwriting it
var MYAPPLICATION = MYAPPLICATION || {};
// create a general purpose namespace method
// this will allow us to create namespace a bit easier
MYAPPLICATION.createNS = function (namespace) {
var nsparts = namespace.split(".");
var parent = MYAPPLICATION;
// we want to be able to include or exclude the root namespace
You can’t perform that action at this time.