Skip to content

Instantly share code, notes, and snippets.

View ubiquitousthey's full-sized avatar

Heath Robinson ubiquitousthey

View GitHub Profile
@ubiquitousthey
ubiquitousthey / gist:55766936f2194a1dee53
Last active August 29, 2015 14:06
Integrity DevOps Interview Tasks

Mod Rewrite Problems

  1. There is a bug in a javascript file that is that is incorrectly routing links to /MySite/Page1 to /MySite/test/Page1
  2. Use mod_rewrite to send mobile users to a mobile site

Edting Configuration Files

  1. Take the file located at the URL below and convert it to yaml and XML and an INI file (You may create your own schema for xml and ini as long as it is valid
  2. https://s3.integrityops.net.s3.amazonaws.com/config.json?AWSAccessKeyId=AKIAIIVV32RH467E7TDQ&Expires=1414175299&Signature=o8NyGMMkIsZR59MAP1hosrJ4yvM%3D

AWS + Linux

  1. Sign up for the AWS Free Teir
#
# Author:: Joshua Timberman (<joshua@opscode.com>)
# Copyright:: Copyright (c) 2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# 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
@ubiquitousthey
ubiquitousthey / gist:2003245
Created March 8, 2012 20:28
Class to support rendering an enumeration.
enum ECGRhythms implements {
NORMAL_SINUS_RHYTHM("Normal sinus rhythm",1),
PACEMAKER("Pacemaker",2),
FREQUENT_PVCS("Frequent PVCs",3),
ATRIAL_FIBRILLATION("Atrial fibrillation", 5),
OTHER("Other", 6);
String display;
int value;
ECGRhythms(String display, int value) {
@ubiquitousthey
ubiquitousthey / gist:3659297
Created September 6, 2012 18:36
Deferred Usage with node
//Usage
DeferredPromise<MedicalRecord> mrDef = mgr.get(MedicalRecord.class, mrid);
DeferredPromise<Problem> pDef = mgr.get(Problem.class, pid);
// Implicit Error Handling (Red Bar)
Deferred.when(mrDef, pDef).then(new EmrDeferredCommand(){
@Override public void doOnSuccess(){
MedicalRecord mr = mrDef.getResult();
Problem p = pDef.getResult();
// yadda yadda yadda
@ubiquitousthey
ubiquitousthey / readline.js
Created November 12, 2015 15:56
Read Lines from file in Node.js
var fs = require('fs')
var nameFilename = 'names.txt'
function readLines(filename,fn) {
var stream = fs.createReadStream(filename, {encoding: 'utf8'})
var fileData = ''
stream.on('data', function(data) {
fileData += data;
var lines = fileData.split('\n');
lines.forEach(function(line) {
@ubiquitousthey
ubiquitousthey / clean_vhosts.py
Last active December 10, 2015 23:59
Cleanup RabbitMQ Virtual Hosts
#!/usr/bin/env python
import httplib
import base64
import json
auth = base64.encodestring('{0}:{1}'.format('guest','guest'))
headers = {'Content-type':'application/json','Authorization':'Basic {0}'.format(auth)}
def remove_vhost(vhost):
@ubiquitousthey
ubiquitousthey / gist:8138928
Last active January 1, 2016 11:38
Generate Postgres stackdriver config with multiple databases
#!/usr/bin/env python
import tempfile
import psycopg2
import psycopg2.extras
opening = """
LoadPlugin postgresql
<Plugin postgresql>
"""

Keybase proof

I hereby claim:

  • I am ubiquitousthey on github.
  • I am ubiquitousthey (https://keybase.io/ubiquitousthey) on keybase.
  • I have a public key ASBcgKxP0HKCHTrxAA5u8pgxcxtsx7Dj7yvQD7RS0tHtlgo

To claim this, I am signing this object:

Problem

You have two files - names.txt and characters.txt.

The characters.txt file contains all the characters needed to spell two names from the names.txt file.

When the correct names are found:

  • Every character from characters.txt will be used exactly once
  • There will be no unused characters
@ubiquitousthey
ubiquitousthey / reflect.py
Last active August 2, 2018 19:38 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
# Added to by Heath Robinson (2018)
from http.server import HTTPServer, SimpleHTTPRequestHandler, HTTPStatus
import argparse
import os
import hashlib