Skip to content

Instantly share code, notes, and snippets.

import java.lang.reflect.*
Thread thread = Thread.currentThread()
Field threadLocalsField = Thread.class.getDeclaredField("threadLocals")
threadLocalsField.setAccessible(true)
Object threadLocalTable = threadLocalsField.get(thread)
def values = threadLocalTable.table.grep().collect { it?.value }

Keybase proof

I hereby claim:

  • I am maurociancio on github.
  • I am maurociancio (https://keybase.io/maurociancio) on keybase.
  • I have a public key whose fingerprint is 82A2 CCE0 6130 BDB1 AC23 A0A7 28DD 372C 57A5 A958

To claim this, I am signing this object:

@maurociancio
maurociancio / setup.sh
Last active December 20, 2015 15:19 — forked from bbeck/setup.sh
########################
# Install the Oracle JDK
########################
JDK_URL="http://download.oracle.com/otn-pub/java/jdk/6u32-b05/jdk-6u32-linux-x64.bin"
wget --quiet --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "${JDK_URL}"
chmod +x "jdk-6u32-linux-x64.bin"
yes | ./jdk-6u32-linux-x64.bin
sudo mkdir -p /usr/lib/jvm/
@maurociancio
maurociancio / register_jdk7_for_update_alternatives.sh
Created June 4, 2012 17:53 — forked from cwchien/register_jdk7_for_update_alternatives.sh
script for registering JDK7 to update-alternatives in Debian's way
#!/bin/bash
# "Register JDK7 for update-alternatives Script in Debian Way"
# Based on 1. codeslinger's "install_java7_alternatives" from https://gist.github.com/445930
# 2. sun-java6-plugin.deb postint script (for plugin)
# Modified by Cheng-Wei Chien<e.cwchien@gmail.com>, 2012-04-27
# ------------------------------------------------------------------------------
# Note: This script works on x86/amd64 Debian GNU/Linux|Ubuntu.
# If you use other arch or distro, you may have to modify some parameters.
#
# Usage: 1. Extract jdk7 tar.gz to, for example, /usr/lib/jvm/java-7-sun-1.7.0.4,