Skip to content

Instantly share code, notes, and snippets.

@loganvolkers
loganvolkers / Byte Formatting for Google Sheets.md
Last active April 16, 2024 10:42
Byte formatting for Google Sheets
# Nginx configuration for stubbing _bulk requests and proxying everything
# else to a local Elasticsearch instance.
#
# This can be used to test performance of network and the load generator
# for pure bulk indexing benchmarks.
#
# This configuration has been tested with Rally (https://github.com/elastic/rally).
# nginx-extras for the more-include headers module
# sudo apt-get install nginx nginx-extras
@jasontedor
jasontedor / hsdis-jdk8.sh
Created May 22, 2017 20:53
Building the HotSpot Disassembly library from source
./clone-jdk8.sh # see https://gist.github.com/jasontedor/a1a38cfa646c186b8736#file-clone-jdk8-sh
cd hotspot/src/share/tools/hsdis
curl -L -O http://ftp.heanet.ie/mirrors/gnu/binutils/binutils-2.26.tar.gz
tar xf binutils-2.26.tar.gz
make BINUTILS=binutils-2.26 ARCH=amd64
sudo cp ./build/macosx-amd64/hsdis-amd64.dylib $JAVA_HOME/jre/lib/server/
@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
#!/bin/sh
#================================================================================
# This script fetches and builds the latest OpenJDK9 and OpenJFX (currently 8u40)
# and installs OpenJFX into the OpenJDK j2sdk image.
#
# It requires an existing 1.8 JDK installation to bootstrap the OpenJDK build
# (I used Oracle jdk1.8.0_20).
#
# Tested on Debian x86_64 (Squeeze and Wheezy)
@staltz
staltz / introrx.md
Last active April 18, 2024 15:33
The introduction to Reactive Programming you've been missing
@nolanlawson
nolanlawson / completion-for-gradle.md
Last active April 5, 2024 07:43
Gradle tab completion for Bash. Works on both Mac and Linux.

Gradle tab completion script for Bash

A tab completion script that works for Bash. Relies on the BSD md5 command on Mac and md5sum on Linux, so as long as you have one of those two commands, this should work.

Usage

$ gradle [TAB]