Skip to content

Instantly share code, notes, and snippets.

View fikovnik's full-sized avatar

Filip Krikava fikovnik

View GitHub Profile
#!/usr/bin/env python
# Exports a current omnigraffle canvas into a file.
#
# A file `.<DocumentName>.omnigraffle_export` placed next to the
# `<DocumentName>.omnigraffle`, can contain a directory relative to the document
# directory where the exports should be saved. If no such a file is found it
# will always prompt for a location.
import os
package tp8;
public class App {
public static void main(String[] args) {
IPlugin plugin = loadPlugin("PluginA");
plugin.printMessage();
}
@fikovnik
fikovnik / eclipse-preferences.epf
Created December 19, 2012 16:07
Eclipse preference file with Solarized Light color theme for Java/Scala editors. Tested on Eclipse Indigo. Usage: File -> Import -> General -> Preferences
/instance/org.eclipse.jdt.ui/java_bracket=101,123,131
/instance/org.eclipse.jdt.ui/java_comment_task_tag=211,54,130
/instance/org.eclipse.jdt.ui/java_default=101,123,131
/instance/org.eclipse.jdt.ui/java_doc_default=146,160,160
/instance/org.eclipse.jdt.ui/java_doc_keyword=38,139,210
/instance/org.eclipse.jdt.ui/java_doc_keyword_bold=false
/instance/org.eclipse.jdt.ui/java_doc_link=38,139,210
/instance/org.eclipse.jdt.ui/java_doc_tag=38,139,210
/instance/org.eclipse.jdt.ui/java_keyword=181,137,0
/instance/org.eclipse.jdt.ui/java_keyword_bold=false
@fikovnik
fikovnik / gist:5403229
Created April 17, 2013 10:15
Disable Chrome Print dialog using the OSX default one (http://goo.gl/0ZwVh)
defaults write com.google.Chrome NSUserKeyEquivalents -dict-add 'Print Using System Dialog...' '@p' 'Print...' '~@p'
import scala.collection.generic.CanBuildFrom
import scala.collection.TraversableLike
import scala.collection.SeqLike
import scala.collection.Seq
import Option.empty
object TraversableExtensions {
implicit class TraversableWithJoin[A, Repr <: Traversable[A]](val xs: TraversableLike[A, Repr]) extends AnyVal {
@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