Skip to content

Instantly share code, notes, and snippets.

View looselycoupled's full-sized avatar

Allen Leis looselycoupled

  • United States
View GitHub Profile
@looselycoupled
looselycoupled / cheese-deployment.yml
Created March 29, 2019 18:58
Traefik Demo Assets
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: stilton
labels:
app: cheese
cheese: stilton
spec:
replicas: 2
"""
Timing utility functions and helpers
"""
##########################################################################
## Imports
##########################################################################
import time
# The following will split a CSV (file.csv) into multiple parts of 1 million lines each
# with each part having its own header.
#
# PREFIX denotes the filename to use for the parts. A number will be added to the end.
tail -n +2 file.csv |
split -d -l 1000000 - --filter='sh -c "{ head -n1 file.csv; cat; } > $FILE"' PREFIX
@looselycoupled
looselycoupled / setup_notes.sh
Last active November 2, 2016 16:52
Sample HDFS/Spark/Anaconda/Java Setup on Ubuntu 14.04
# basic steps to install Anaconda Python3, HDFS, Spark on Ubuntu 14.04
#
# NOTE: Some commands are interactive such that this file SHOULD NOT be executed directly
# but is only provided for reference.
#
sudo su -
# install oracle's Java 8
add-apt-repository ppa:webupd8team/java -y
@looselycoupled
looselycoupled / jupyter.conf
Created October 7, 2016 20:10
Jupyter/Pyspark Upstart script
# /etc/init/jupyter.conf
description "jupyter"
start on runlevel [2345]
stop on runlevel [016]
respawn limit 10 5
chdir /home/pingthings
setuid pingthings
setgid pingthings
@looselycoupled
looselycoupled / boto3_hands_on.md
Created October 26, 2015 20:25 — forked from iMilnb/boto3_hands_on.md
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@looselycoupled
looselycoupled / userdata.sh
Created September 29, 2015 19:09
EC2 User Data for puppet agent
#!/bin/bash
# This is the USERDATA bash script for provisioning a new EC2 server
# that should try to configure itself with a puppet master.
#
# NOTE: This script was made/tested with Puppet v3.8
#
# NOTE: EC2_HOSTNAME is the FQDN for the puppet master and should
# be changed for each environment
#
#!/usr/bin/env python
"""
Template answer for REST Workshop
"""
##########################################################################
## Imports
##########################################################################
import os
import json
@looselycoupled
looselycoupled / xbus-502-rss-template.py
Last active March 17, 2023 22:29
xbus-502-rss-template
#!/usr/bin/env python
"""
Template for RSS exercise
"""
##########################################################################
## Imports
##########################################################################
import os
import re
# pdb-demo
# Trivial file to demonstrate basic debugging techniques
#
# Author: Allen Leis <[email protected]>
# Created: Wed Sep 16 21:50:05 2015 -0400
#
# Copyright (C) 2015 georgetown.edu
# For license information, see LICENSE.txt
#
# ID: pdb-demo.py [] [email protected] $