Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bgulla's full-sized avatar
🦃
fast and loose is still fast.

Brandon bgulla

🦃
fast and loose is still fast.
  • Rancher Federal
  • Virginia
View GitHub Profile
<?php
/**
Creates the sqlite database file
*/
function createDB(){
try{
//$db = getDBObject();
$db = new SQLite3('db/prax0rs.db') or die('Unable to open database');
/**
* This is a quick tutorial on how to learn dates for CS631. I am not trying to aid in your project but provide some more
* insight on how I like to use the Java Date Object.
*
* NOTE: I just realized that it seems like he wants us to use DateFormatter & Gregorian Calendar, so don't use SimpleDateFormat but the
* concepts behind it should be similar.
*
*/
public void learnDates() throws Exception{
@bgulla
bgulla / ec2_notes
Last active August 29, 2015 14:04
EC2
# Adding EPEL Repo
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
# CDH/Mesos Install
curl -sSfL http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm --output /tmp/cdh.rpm
curl -sSfL http://archive.cloudera.com/cdh4/redhat/6/x86_64/cdh/RPM-GPG-KEY-cloudera --output /tmp/cdh.key
sudo rpm --import /tmp/cdh.key
sudo yum localinstall -y -q /tmp/cdh.rpm
sudo rpm -Uvh http://repos.mesosphere.io/el/6/noarch/RPMS/mesosphere-el-repo-6-2.noarch.rpm
@bgulla
bgulla / hadoop_conf_parser.py
Created October 1, 2014 21:02
Simple Hadoop Configuration Parser. For when you don't have enough time to scroll.
#!/usr/bin/python
from xml.dom import minidom
def getNodeText(node):
nodelist = node.childNodes
result = []
for node in nodelist:
#!/usr/bin/python
import os.path, time, sys
if len(sys.argv) < 2:
print "Error: No file argument provided"
exit()
file = sys.argv[1]
print "last modified: %s" % time.ctime(os.path.getmtime(file))
curl -XPOST -H "Content-Type: application/json" -d @$1 http://localhost:8080/v2/apps
curl -XPOST -H "Content-Type: application/json" -d @$1 http://localhost:8080/v2/apps
{
"id": "dynamic-chronos",
"cmd": "./chronos --http_port $PORT0",
"cpus": 0.2,
"disk": 0.0,
"instances": 1,
"mem": 128.0,
@bgulla
bgulla / myriad_feb12.txt
Created February 12, 2015 18:23
MYRIAD NOTES 2/12
In progress:
- authentication with master
Ideas:
- unit tests
- user facing web page with REST data
@bgulla
bgulla / marathon-runner.py
Created February 23, 2015 21:22
Python marathon client for submitting jobs.
#!/usr/bin/python
#curl -X POST -H "Content-Type: application/json" localhost:8080/v2/apps -d@Docker2.json
import httplib,urllib
import os
import json
class MarathonClient(object):
cpus = 1
memory = 1
influxdb:
image: tutum/influxdb
ports:
- "8086:8086"
- "8083:8083"
- "8090:8090"
- "8099:8099"
environment:
- PRE_CREATE_DB=db1