Skip to content

Instantly share code, notes, and snippets.

View RJ's full-sized avatar
💤

Richard Jones RJ

💤
View GitHub Profile
node.default['java']['install_flavor'] = 'oracle' # ugh
node.default['java']['jdk_version'] = '7'
node.default['java']['accept_license_agreement'] = true
node.default['java']['oracle']['accept_oracle_download_terms'] = true
## Mission: install oracle's java, because cassandra prefers it.
##
## Problem: esl-erlang depends on "default-jre-headless" (openjdk)
## but that conflicts with oracle's java packages, so we can't
## just remove openjdk, as it takes esl-erlang with it.
gulp.task('flatten-js', function() {
return gulp.src(['app/*.js', './app/**/*.js'])
.pipe(flatten())
.pipe(gulp.dest('./build/js-app'))
});
function bundleEntryPoint(entryfile) {
process.env.NODE_PATH = ( process.env.NODE_PATH ?
process.env.NODE_PATH + ':' : '')
+ './build/js-app/'
@RJ
RJ / ldap-config.txt
Created May 12, 2014 15:43
Setting up LDAP server for testing our ldap auth against
as root:
apt-get install slapd ldap-utils cpu
edit, /etc/cpu/cpu.conf replace these lines:
LDAP_URI = ldap://localhost
BIND_DN = cn=admin,dc=nodomain
BIND_PASS = irccloud
USER_BASE = dc=nodomain

Keybase proof

I hereby claim:

  • I am RJ on github.
  • I am RJ (https://keybase.io/RJ) on keybase.
  • I have the public key with fingerprint 0EDD ED5C 68CB 98A2 222D  F327 1CB6 5397 9D96 56FD

To claim this, I am signing this object:

@RJ
RJ / 6pinger.py
Created November 19, 2013 18:10
Send an empty icmp6 echo packet from python, having bound to a specific source ipv6 address
#!/usr/bin/env python
import socket
import sys
## ipv6.google.com:
PING_TARGET = '2604:8300:100:200b:6667:3:0:4d1f'
source_ip = sys.argv[1]
addresses = [addr for addr in socket.getaddrinfo(source_ip, None) if socket.AF_INET6 == addr[0]]
src_address = addresses[0][-1][0]
@RJ
RJ / Makefile-erlang.mk
Last active November 2, 2019 07:29
Makefile fragment that generates makefile targets to call make with a given target on all apps/* subdirs. Useful for erlang projects using erlang.mk that have apps/{app1,app2,app3..} structure (which rebar doesn't mind). Eg: call "make app" and it will call "make -C apps/app1 app; make -C apps/app2 app; ..." for you.
APPDIRS := $(wildcard apps/*)
## Example hack to filter one out:
## APPDIRS := $(filter-out apps/fooapp, $(APPDIRS))
define PROXY_TARGET
$(1):
$(foreach appdir,$(APPDIRS),$(MAKE) -C $(appdir) $(1) ;)
endef
@RJ
RJ / haproxy.cfg
Created August 21, 2013 13:30
haproxy websockets config snippet
## GENERATED BY CHEF, DONT EDIT DIRECTLY
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 10000
user haproxy
daemon
defaults
log global
@RJ
RJ / .slate
Created January 8, 2013 10:36
bit of my .slate config file
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Shows app icons and background apps, spreads icons in the same place.
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
config windowHintsBackgroundColor 50;53;58;0.6
@RJ
RJ / apache2-proxy-graphite.conf
Created December 21, 2012 01:23
Apache2 conf snippit to proxy and rewrite URLs for graphite. https://graphite-admin.example.com ---> https://admin.example.com/graphite Used on a dashboard page that includes graphs from various other domains, and it was annoying typing basic-auth passwords all the time.
SSLProxyEngine on
# Graphite URLs that are buried in JS that we can't easily rewrite, we issue an http redirect
# - /content/js/ext/resources/images/default/s.gif
# - /render
RewriteEngine On
RewriteCond %{HTTP_HOST} ^admin\.example\.com [NC]
RewriteRule ^/content/js/ext/resources/images/default/s.gif https://graphite-admin.example.com/content/js/ext/resources/images/default/s.gif [L,R]
RewriteRule ^/render https://graphite-admin.example.com/render [L,R]
@RJ
RJ / rabbit_boot_system.erl
Created November 8, 2012 22:38
RabbitMQ boot_step system
%% Boot system extracted from rabbitmq-server source code
%% The RabbitMQ license banner follows:
%%
%% The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at http://www.mozilla.org/MPL/
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See