Skip to content

Instantly share code, notes, and snippets.

View mushkevych's full-sized avatar

Dan Mushkevych mushkevych

  • Portland, OR, USA
View GitHub Profile
@mushkevych
mushkevych / ordered_set.py
Last active December 20, 2015 07:19
OrderedSet
from collections import OrderedDict
class OrderedSet(OrderedDict):
def pop(self):
""" Returns and removes last element of the set """
if not self:
raise KeyError('dictionary is empty')
key = next(reversed(self))
@mushkevych
mushkevych / common.json
Last active December 21, 2015 07:38
Puppet + Hiera + Jenkins Gist
{
"ntp::restrict" : true,
"ntp::autoupdate" : true,
"ntp::enable" : true,
"ntp::servers" : [
"0.centos.pool.ntp.org iburst",
"1.centos.pool.ntp.org iburst",
"2.centos.pool.ntp.org iburst"
]
}
#!/bin/sh
# Variables
USER="admin"
PASS="password"
# Assert Root User
SCRIPTUSER=`whoami`
if [ "$SCRIPTUSER" != "root" ]
then
@mushkevych
mushkevych / Dockerfile
Last active December 30, 2015 07:39
Docker CDH 4.5
FROM ubuntu:precise
MAINTAINER Bohdan Mushkevych
# Installing Oracle JDK
RUN apt-get -y install python-software-properties ;\
add-apt-repository ppa:webupd8team/java ;\
apt-get update && apt-get -y upgrade ;\
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections ;\
apt-get -y install oracle-java7-installer && apt-get clean ;\
update-alternatives --display java ;\
@mushkevych
mushkevych / EventLoggerTx.java
Last active August 29, 2015 13:56
CSV with Log4j2
import org.apache.logging.log4j.EventLogger;
import org.apache.logging.log4j.message.StructuredDataMessage;
import java.util.ArrayList;
import java.util.List;
/**
* @author Bohdan Mushkevych
* wraps Class holds List<StructuredDataMessage> and flushes it to the EventLogger
*/
@mushkevych
mushkevych / data_repo.yaml
Last active November 2, 2016 03:44
sdpl_snippets
!DataRepository
db: mydb
host: host.the_company.xyz
kwargs: {}
name: repo_a
password: the_password
port: '6789'
user: the_user
@mushkevych
mushkevych / example.mdal
Last active April 23, 2018 17:15
mdal example
base_model = LOAD "https://github.com/tensorflow/models/tree/master/official/resnet"
my_model = EXTEND base_model REUSE 5 LAYERS
TRAIN my_model WITH "dfs://mycompany.com/datasets/mymodel"
input = INPUT "pubsub://subscriptions/myproject/raw-feed" IN FORMAT json SCALE FOR my_model
output = OUTPUT "pubsub://publishers/myproject/prognosis" IN FORMAT json
EXECUTE my_model ON input INTO output