Skip to content

Instantly share code, notes, and snippets.

View cnf's full-sized avatar

Frank Rosquin cnf

View GitHub Profile
@cnf
cnf / lnm.md
Last active August 29, 2015 14:05
Logging & Metrics

Logging

  • cAdvisor - Container Advisor, stats for docker host / containers, Influxdb output
  • docker syslog - Multiple Docker containers logging to a single syslog

Dispatchers

Keybase proof

I hereby claim:

  • I am cnf on github.
  • I am cnf (https://keybase.io/cnf) on keybase.
  • I have a public key whose fingerprint is 2BF3 DEDC C538 A25F 11B8 93B1 B212 68FB BD8D 25C3

To claim this, I am signing this object:

@cnf
cnf / golang.md
Last active October 1, 2015 09:04
Golang notes and tricks
@cnf
cnf / gist:2732047
Created May 19, 2012 19:15
Apple UI request regarding resizing of text areas [rdar://11490741]
Summary:
We need a container to hold accessories. For example project panels in code editors. But one that doesn't resize the valuable real estate of a window when activated.
Steps to Reproduce:
Open an editor like chocolatapp or textmate 2 beta, and resize it so the text area is about 700px wide (half the screen real estate on f.e. a 13" MBA) or about 84 columns. Toggle the project drawer (or equivalent). When this was done with a drawer, the area of the window containing the text, your _code_, stayed unaltered. With navigator style panels that area gets resized.
Expected Results:
No action, for whatever reason, should ever resize/move the text area of a text/code editor (or the actualy valuable screen real estate of an app). The actual active part of the app that contains the data you are focusing on (the holy area) should always be in a predictable place for the user.
Actual Results:
@cnf
cnf / gist:2793683
Created May 26, 2012 12:01
API signing
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib2
import json
API_URL = 'http://127.0.0.1:5000/api/rest'
DEVICE_ID = '36263EED-7ACA-45AB-9537-DE86D88773ED'
API_TOKEN = 'JmGQAOAAWkpBTvoFxHQM12tfTKfSJhH3YgwE1uHOfTpZHfhkpl3iovExjfBAeSP'
def get_token():
@cnf
cnf / screenshotter.py
Created July 19, 2012 18:59
Make screenshots of areas in selenium
#!/usr/bin/env python
from PIL import Image
import StringIO
def screenshot(browser, element, filename='screenshot.png'):
"""docstring for screenshot"""
elem = browser.find_element_by_css_selector(element)
loc = elem.location
size = elem.size
screenshot = browser.get_screenshot_as_base64()
@cnf
cnf / logstash_per_index.json
Created December 18, 2012 13:05
ElasticSearch template for LogStash usage
{
"template" : "logstash*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index.cache.field.type" : "soft",
"index.cache.field.max_size": 50000,
"index.cache.field.expire": "10m",
"index.refresh_interval" : "5s",
"index.store.compress.stored" : true,