Skip to content

Instantly share code, notes, and snippets.

View fikovnik's full-sized avatar

Filip Krikava fikovnik

View GitHub Profile
@fikovnik
fikovnik / ether_wake.template
Last active August 29, 2015 14:08
Hacked MAAS ether_wake.template to allow to power on / off over WOL in the case the cluster controller has multiple interfaces
# -*- mode: shell-script -*-
#
# Control node power through WOL, via `wakeonlan` or `etherwake`.
#
mac_address={{mac_address}}
power_change={{power_change}}
ip_address={{node_ip_address}}
#if [ -n "${ip_address}" ]
@fikovnik
fikovnik / node.py
Created October 30, 2014 15:40
Updated node.py:1110 file to add node_ip_address as the ip_address seams to be disappearing and it is easier to hack maasserver package (can be refreshed by apache restart)
# Try to pass the IP address correspond to the mac address
if 'ip_address' not in power_params:
ip_address_list = self.ip_address_of_mac_address(power_params['mac_address'])
if len(ip_address_list) > 0:
power_params['ip_address'] = ip_address_list[0]
power_params['node_ip_address'] = ip_address_list[0]
@fikovnik
fikovnik / single-node-hdp-2.2-ambari-cluster
Last active August 29, 2015 14:16
Single node Ambari cluster based on HDP 2.2
{
"configurations" : [
{
"nagios-env" : {
"nagios_contact": "me@my-awesome-domain.example"
}
}
],
"host_groups" : [
{
@fikovnik
fikovnik / gist:9f40f9f6c9acdd79a060
Created June 3, 2015 12:33
Docker log related to #835 of weaveworks/weave
DEBU[1745] Calling POST /containers/{name:.*}/start
INFO[1745] POST /v1.15/containers/c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1/start
DEBU[1745] Warning: client and server don't have the same version (client: 1.3.1, server: 1.6.2)
INFO[1745] +job start(c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1)
DEBU[1745] activateDeviceIfNeeded(c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1)
DEBU[1745] libdevmapper(6): ioctl/libdm-iface.c:1750 (4) dm info docker-253:1-134574-c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1 OF [16384] (*1)
DEBU[1745] libdevmapper(6): ioctl/libdm-iface.c:1750 (4) dm create docker-253:1-134574-c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1 OF [16384] (*1)
DEBU[1745] libdevmapper(6): libdm-common.c:1348 (4) docker-253:1-134574-c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1: Stacking NODE_ADD (252,4) 0:0 0600 [verify_udev]
DEBU[1745] libdevmapper(6): ioctl/libdm-ifa
for i in .dot-files/*; do f=${i#.dot-files/dot}; if [ -f ~/$f ]; then echo "$f: exists"; else ln -s ".dot-files/dot$f" $f; fi done
@fikovnik
fikovnik / style.py
Created June 14, 2011 21:20
Styling Poster in OmniGraffle using color scheme from Adobe Kuler
#!/usr/bin/env python
import sys
import os
import logging
from itertools import permutations
from appscript import *
from kuler import *
public Object execute(ExecutionEvent event) throws ExecutionException {
InputDialog dlg = new InputDialog(
HandlerUtil.getActiveShellChecked(event), "Title",
"Enter text", "Initial value", null);
if (dlg.open() == Window.OK) {
// User clicked OK; run perl
String input = dlg.getValue();
// TODO:do something with value
}
return null;
@fikovnik
fikovnik / gist:3902390
Created October 16, 2012 22:14
ClassAnalyzer output (without generics)
package java.util;
public class ArrayList extends java.util.AbstractList implements List, RandomAccess, Cloneable, Serializable {
// Fields
private static final long serialVersionUID;
private transient Object[] elementData;
private int size;
private static final int MAX_ARRAY_SIZE;
@fikovnik
fikovnik / gist:3902457
Created October 16, 2012 22:26
ClassAnalyzer template
package tp2;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ClassAnalyzer {
public static void analyzeClass(String className)
throws ClassNotFoundException {
@fikovnik
fikovnik / gist:3902612
Created October 16, 2012 22:59
ArrayGrowTest
package tp2;
/*
* Cay S. Horstmann & Gary Cornell, Core Java
* Published By Sun Microsystems Press/Prentice-Hall
* Copyright (C) 1997 Sun Microsystems Inc.
* All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for NON-COMMERCIAL purposes