Skip to content

Instantly share code, notes, and snippets.

Justen Walker justenwalker

Block or report user

Report or block justenwalker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@justenwalker
justenwalker / unsafeAssassinateEndpoint.md
Created Jan 9, 2014
Cassandra unsafe assassinate - removing a dead node from the cluster
View unsafeAssassinateEndpoint.md

Unsafe Node Assassinate

On Cassandra 1.1.x, nodetool removetoken on a dead node hangs. The only way to reliably remove the node from the cluster is to use an undocumented JMX command to force the remove of the node from gossip.

Upgrading to 1.2.x and above should obviate these steps in favor of nodetool removenode - See 1.2 Docs

It's probably also a good idea to run a nodetool repair after this operation - See wiki

Prerequisites

@justenwalker
justenwalker / Vagrantfile
Created Jan 10, 2014
Vagrant file for testing graphite
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<eos
#! /bin/bash
REQUIREMENTS="Django<1.7"
# Prerequisites
apt-get update
View PasswordChecker.coffee
###*
* @namespace PasswordChecker
*
* Utility class to check a password's complexity
*
*
* {@link PasswordChecker.strength} returns an object containing:
*
* - *summary* The results of {@link PasswordChecker.summary}
* - *total* The total raw score for the password
@justenwalker
justenwalker / README.md
Created Aug 30, 2014
Ansible Dynamic Inventory script for etcd
View README.md

etcd dynamic inventory script

Generarates inventory for ansible from etcd using python-etcd library.

The script assumes etcd.ini to be present alongside it. To choose a different path, set the ETCD_INI_PATH environment variable:

export ETCD_INI_PATH=/path/to/etcd.ini
@justenwalker
justenwalker / docker
Created Nov 12, 2014
boot2docker shim
View docker
#! /bin/bash
if [ "running" = `boot2docker status` ]; then
IP=`boot2docker ip 2>/dev/null`
export DOCKER_CERT_PATH="$HOME/.boot2docker/certs/boot2docker-vm"
export DOCKER_TLS_VERIFY=1
export DOCKER_HOST="tcp://$IP:2376"
/usr/local/bin/docker "$@"
else
echo "boot2docker is not running"
View keybase.md

Keybase proof

I hereby claim:

  • I am justenwalker on github.
  • I am justenwalker (https://keybase.io/justenwalker) on keybase.
  • I have a public key whose fingerprint is DF04 3245 AE35 DBE3 0890 1D49 6AA4 DD62 7E5E 24EE

To claim this, I am signing this object:

View damon-example.ps1
#!powershell
$env:DAMON_CPU_LIMIT="2048" # MHz
$env:DAMON_MEMORY_LIMIT="2048" # MB
# Run my.exe inside a job object
& damon.exe my.exe
@justenwalker
justenwalker / damon-example-snip.hcl
Created Nov 8, 2018
Damon example raw_exec config section
View damon-example-snip.hcl
driver = "raw_exec"
config {
command = "damon.exe" # Damon is the new task entry-point (it should be on the PATH)
args = ["my.exe","arg1","arg2"] # Your command + Args here
}
@justenwalker
justenwalker / damon-metrics-config-example.hcl
Last active Nov 8, 2018
Damon prometheus metrics example
View damon-metrics-config-example.hcl
# Ask for a port on which Damon can serve Prometheus metrics
network {
port "damon" {}
}
# Advertise damon as a service
service {
port = "damon"
name = "${NOMAD_TASK_NAME}-damon"
}
@justenwalker
justenwalker / call-windows.go
Last active Jan 10, 2019
Calling Windows API from Go
View call-windows.go
package win32
import "syscall"
import "unsafe"
var (
kernel32DLL = syscall.NewLazyDLL("kernel32.dll")
procCreateJobObjectA = kernel32DLL.NewProc("CreateJobObjectA")
)
You can’t perform that action at this time.