Skip to content

Instantly share code, notes, and snippets.

View srenatus's full-sized avatar
📻
bisschen glitchig

Stephan Renatus srenatus

📻
bisschen glitchig
  • Berlin, Europe
  • 03:16 (UTC +02:00)
View GitHub Profile
@pathawks
pathawks / cdnjs.rake
Created August 9, 2014 13:47
Sync current CDNjs libraries to a YAML file in Jekyll
require 'rubygems'
require 'net/https'
require 'uri'
require 'json'
require 'yaml/store'
require 'jekyll'
desc "Update CDNjs Libraries"
task :updatecdnjs do
site = Jekyll.configuration({})
@ran488
ran488 / build.gradle
Created April 25, 2014 13:59
Running Fortify from Gradle build. These are the snippets of code you can add to your build.gradle to run the analyzer and spit out a Fortify *.fpr file. Fortify is not F/OSS, so you (your company) will need a license, so the dependencies won't be out in public repo's. You will have to add it to your company's private repo (e.g. Artifactory).
// Add a new configuration
configurations {
fortify { extendsFrom compile }
}
// pull in the fortify libs for the new configuration
dependencies {
fortify 'com.fortify:sourceanalyzer:3.90'
}
@robballou
robballou / graph.js
Created December 20, 2013 16:27
Step 2: save the graph to a file
require('fs');
require('d3');
var xmldom = require('xmldom');
var dataset = {
apples: [53245, 28479, 19697, 24037, 40245],
};
var width = 460,
height = 300,
@zts
zts / gist:8022194
Last active December 31, 2015 17:48
Use Chef to check whether a package has been installed
[root@ci cache]# chef-shell
loading configuration: none (standalone session)
Session type: standalone
Loading.done.
This is the chef-shell.
Chef Version: 11.8.2
http://www.opscode.com/chef
http://wiki.opscode.com/display/chef/Home
@NathanHowell
NathanHowell / curry.hs
Created May 31, 2013 23:36
A proof-of-concept demonstrating the use of Z3 to solve Cabal version constraints for Haskell packages
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}

Application specific host grouping in Riemann-dash

It is generally desirable to group all the hosts for a specific service into a single dashboard view. For example, all the web servers are in single view while all the database servers are in another view.

This is usually not an issue when you are sending custom metrics using Riemann client. However, there are cases where you are using something that you do not control how the metrics are being sent. i.e., Riemann-tools.

Since Riemann-tools scripts are application agnostic, in order for the dashboard view to group hosts, we must inject some application specific information into the tags field. Tags is a collection of arbitrary strings. In the case of Riemann-tools scripts you can pass in arbitrary strings on the command line.

riemann-health --host 127.0.0.1 --tag "prod" --tag "webserver"

@frodenas
frodenas / gist:3764572
Created September 21, 2012 23:58
Fog::Network OpenStack Example
$ fog
Welcome to fog interactive!
:default provides AWS, HP, OpenStack, Rackspace, VirtualBox and Vmfusion
>> quantum = Fog::Network.new(:provider => "OpenStack")
>>
?> # Create a new network:
?> quantum.networks.create(:name => "network_1")
<Fog::Network::OpenStack::Network
id="09b42312-bba6-4d52-a558-023e1de0d872",
name="network_1",
"""
usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
"""
import sys
import io
from IPython.nbformat import current
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active September 20, 2026 16:20 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.