Skip to content

Instantly share code, notes, and snippets.

@reklis
reklis / mancolors.zsh
Created August 16, 2013 13:37
blue+white man colors
# save to ~/.oh-my-zsh/colors/mancolors.zsh and add 'mancolors' to your ~/.zshrc plugin load list
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;34m") \
LESS_TERMCAP_md=$(printf "\e[1;34m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
@reklis
reklis / node-w3c-log-input.js
Created September 5, 2013 20:38
Example of tailing standard w3c log files into brightcontext as an input
#!/usr/bin/env node
/*global require, console */
(function () {
'use strict';
var
bcc = require('brightcontext'),
argv = require('optimist')
@reklis
reklis / index.html
Last active December 22, 2015 11:29
A basic dashboard to view the results from the Node.js input
<body>
<div class="label">Current Real-Time Server Requests</div>
<div id="request-count">0</div>
<div class="total">Total:
<span id="total-request-count">0</span>
</div>
<div class="footnote">Powered by
<a href="http://brightcontext.com">BrightContext</a>
</div>
</body>
@reklis
reklis / install-and-run.sh
Last active December 22, 2015 11:29
A simple node script to tail web logs into a BrightContext QuantChannel Input
# download and extract the gist, then from inside the folder
chmod +x ./tail-web-logs.js
# install dependencies
npm i
# tail the web logs into the input
./tail-web-logs.js --apikey="your api key" --project="www metrics" --channel="weblogs" --input="requests" --logfile=/var/log/httpd/access_log
@reklis
reklis / web-log-processing-example.cake
Created September 6, 2013 16:32
FunnelCake definition for basic web log analysis using BrightContext
INPUT requests;
// example: { action: 'GET', path: '/', code: 200 }
OUTPUT requestmetrics;
// send out the number of requests in that window every 5 seconds
requestmetrics = GROUP requests
BY TIMEONLY
## couchdb npm registry replication
# one time
curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "create_target":true}' -H "Content-Type: application/json"
# start continuous
curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "continuous":true, "create_target":true}' -H "Content-Type: application/json"
# stop continuous
@reklis
reklis / -
Created September 11, 2014 16:22
diff --git a/package.json b/package.json
index 00e5452..adc9473 100644
--- a/package.json
+++ b/package.json
@@ -8,6 +8,7 @@
"grunt-contrib-cssmin": "0.6.1",
"grunt-contrib-watch": "0.5.3",
"grunt-contrib-uglify": "0.2.0",
+ "grunt-githooks": "^0.3.1",
"grunt-string-replace": "^0.2.7"
@reklis
reklis / keybase.md
Created September 22, 2014 19:18
keybase io verification

Keybase proof

I hereby claim:

  • I am reklis on github.
  • I am sfusco (https://keybase.io/sfusco) on keybase.
  • I have a public key whose fingerprint is AA04 107E 1C47 F932 DF9B 2B66 D204 D36A 22D8 5F63

To claim this, I am signing this object:

all: test.class test.o
test.class: test.java
javac test.java
test.o: test.c
clang test.c -o test.o
clean:
rm test.class
@reklis
reklis / -
Created October 3, 2014 13:00
bsd/dev/dtrace/dtrace.c:19734: if (!PE_parse_boot_argn("dtrace_dof_mode", &dtrace_dof_mode, sizeof (dtrace_dof_mode))) {
bsd/dev/dtrace/dtrace.c:19764: if (!PE_parse_boot_argn("dtrace_kernel_symbol_mode", &dtrace_kernel_symbol_mode, sizeof (dtrace_kernel_symbol_mode))) {
bsd/dev/dtrace/fbt.c:477: PE_parse_boot_argn("IgnoreFBTBlacklist", &gIgnoreFBTBlacklist, sizeof (gIgnoreFBTBlacklist));
bsd/dev/unix_startup.c:261: (void) PE_parse_boot_argn("ncl", &ncl, sizeof (ncl));
bsd/dev/unix_startup.c:262: (void) PE_parse_boot_argn("mbuf_pool", &mbuf_pool, sizeof (mbuf_pool));
bsd/kern/bsd_init.c:1113: if (PE_parse_boot_argn("-s", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1116: if (PE_parse_boot_argn("-b", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1119: if (PE_parse_boot_argn("-x", namep, sizeof (namep))) /* safe boot */
bsd/kern/bsd_init.c:1123: if (PE_parse_boot_argn("-vnode_cache_defeat", namep, sizeof (namep)))
bsd/kern/bsd_init.c:1127: if (PE_parse_boot_argn("-disable_aslr", namep, sizeof (namep)))