Skip to content

Instantly share code, notes, and snippets.

; -*- mode: clojure; -*-
; vim: filetype=clojure
(logging/init)
(repl-server {:host "127.0.0.1" :port 55554})
(let [host "0.0.0.0"]
(tcp-server {:host host :port 55555})
(udp-server {:host host :port 55555})
[appservers:children]
datacenter-1
datacenter-2
[datacenter-1]
appservers00[1:3].datacenter-1.example.com
[datacenter-2]
appservers00[1:3].datacenter-2.example.com
execve("/usr/bin/docker", ["docker", "pull", "java:latest"], [/* 38 vars */]) = 0
brk(0) = 0x1baa000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f18e08a7000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=46557, ...}) = 0
mmap(NULL, 46557, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f18e089b000
close(3) = 0
open("/lib64/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340]\200\3112\0\0\0@\0\0\0\0\0\0\0\250/\2\0\0\0\0\0\0\0\0\0@\0008\0\t\0@\0)\0(\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0\200\3112\0\0\0@\0\200\3112\0\0\0\370\1\0\0\0\0\0\0\370\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0000\30\1\0\0\0\0\0000\30\201\3112\0\0\0000\30\201\3112\0\0\0\34\0\0\0\0\0\0\0\34\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\200\3112\0\0\0\0\0\200\3112\0\0\0\360m\1\0\0\
@agile
agile / tmux.conf
Created November 19, 2015 15:44
my tmux config - nothing very special
# unbind C-b if you prefer using screen's ^a command sequence
# set -g prefix C-a
# alt-arrow bindings to switch windows
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# get visual notifications of activity from other windows
@agile
agile / dysfunctional.clj
Created November 17, 2015 22:31
trying to understand how to fix this.. only initial state change alerts.
; Wanting to pass events by host/service, if state changed and consistent for `len-run` events
; modified changed-state macro to use runs
(defmacro stable-changed-state
"Passes on changes in state for each distinct host and service."
[len-run & children]
`(by [:host :service]
(runs ~len-run
(changed :state ~@children))))
(def send-alert #(debug "WOULD ALERT ON" %))
import java.lang.management.*;
def threadBean = ManagementFactory.getThreadMXBean();
def osBean = ManagementFactory.getOperatingSystemMXBean();
println "\n\n\n[Checking state of (master)]";
println "Current CPU Time used by Jenkins: " + threadBean.getCurrentThreadCpuTime() + "ns";
double processLoad = (osBean.getProcessCpuLoad() * 100).round(2);
@agile
agile / jvm
Created September 18, 2014 13:33
Script to switch between different Java VMs on a Debian based system
#!/usr/bin/env bash
#
# Switch between different installed Java VMs in a Debian based system
#
available=( $(update-alternatives --list java) )
if [ -n "${1}" ]; then
case "${1}" in
/*bin/java)
VM="${1}"
@agile
agile / rename_screenshots.sh
Created September 8, 2014 14:01
Stupid script to rename stupid screenshots for a stupid issue tracker
#!/bin/bash
#
# Rename screenshots into a format Jira won't complain about.. ;P
#
SCREENSHOTDIR=~/
LOCKFILE=$(dirname $0)/$(basename $0).pid
echo "LOCKFILE: ${LOCKFILE}"
if [ -e ${LOCKFILE} ]; then
@agile
agile / bleh.rb
Last active August 29, 2015 13:56
class Parent < ActiveRecord::Base
# assume there's a varchar field on the table called "name"
def name
puts "Holla from tha Parent!"
super
read_attribute(:name) || "default value!"
end
end
class Child < Parent
#!/usr/bin/env bash
### BEGIN INIT INFO
# Provides: druid_historical
# Required-Start: $local_fs $remote_fs $syslog $network
# Required-Stop: $local_fs $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts Druid historical service
# Description: start Druid historical service using start-stop-daemon
### END INIT INFO