Skip to content

Instantly share code, notes, and snippets.

View superstructor's full-sized avatar
🎯
Focusing

Isaac Johnston superstructor

🎯
Focusing
View GitHub Profile

See .

@mikekelly
mikekelly / 0_README.txt
Created March 29, 2011 23:19
a sketch of application/halo+json & application/halo+xml
I've added a control element with these properties/attributes:
method ; method to use for generated request e.g. POST/PUT/DELETE
content-type ; (optional) content-type of the request body generated by the template (defaults to application/hal+xml)
schema ; contains schema for data submitted to template
template ; (optional) A string or object representing the template or form for the request.
template-href ; (optional) Contains a URI which links to a resource where the template or form can be fetched.
template-type ; (optional) URI used to identify the template format in use (defaults to mustache).
@creationix
creationix / formatStackTrace.js
Created September 21, 2011 22:29
Beginning of an event-source hook for system-wide stack handling hooks.
// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
@richp10
richp10 / gist:1c367d3c67aec762788e
Created May 10, 2014 10:19
Secure iptables configuration for coreos ??
// This systemd runs iptables-restore on boot:
[Unit]
Description=Packet Filtering Framework
DefaultDependencies=no
After=systemd-sysctl.service
Before=sysinit.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/iptables-restore /opt/docker/scripts/iptables/iptables.rules
@ghoseb
ghoseb / clj_spec_playground.clj
Last active March 30, 2019 22:35
Examples of Clojure's new clojure.spec library
(ns clj-spec-playground
(:require [clojure.string :as str]
[clojure.spec :as s]
[clojure.test.check.generators :as gen]))
;;; examples of clojure.spec being used like a gradual/dependently typed system.
(defn make-user
"Create a map of inputs after splitting name."
([name email]
@tancnle
tancnle / setup_mosh_centos.sh
Last active December 5, 2019 03:01
Setup mosh on Centos 6.x
#!/bin/sh
# Update latest epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6-8.noarch.rpm
# Download and build mosh
sudo yum -y install rpm-build rpmdevtools protobuf-compiler protobuf-devel libutempter-devel zlib-devel ncurses-devel openssh-clients perl-IO-Tty openssl-devel gcc gcc-c++
rpmdev-setuptree
cd ~/rpmbuild/SOURCES
@mfikes
mfikes / macros.md
Last active July 6, 2020 02:51
Posts about Bootstrapped ClojureScript Macros

We've learned a bit about how ClojureScript's macro system works in bootstrapped mode over the past half year.

Here is a collection of posts I've made on the subject.

But first, it's probably worth reading https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#macros

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"

@mmoulton
mmoulton / README.md
Last active November 7, 2020 18:19
Docker Container Stats Collection Using Collectd

Docker stats collection for collectd

This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec plugin.

This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.

Usage

This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec plugin in collectd to execute the collectd-docker.sh script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.

/*
* Property prefix hacks
*/
/* IE6 only - any combination of these characters */
_ - £ ¬ ¦
/* IE6/7 only - any combination of these characters */