Skip to content

Instantly share code, notes, and snippets.

View nathankellenicki's full-sized avatar

Nathan Kellenicki nathankellenicki

View GitHub Profile
@nathankellenicki
nathankellenicki / jump.sh
Created August 19, 2013 20:53
A very small utility to mark and jump between local directories. Copypasta into your .bash_profile (I can't take credit for this, though I also can't find where I originally found it. I've made a few modifications.)
export MARKPATH=$HOME/.marks
function jump {
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p $MARKPATH; ln -s "$(pwd)" $MARKPATH/$1
}
function unmark {
rm -i $MARKPATH/$1
}
@nathankellenicki
nathankellenicki / keybase.io
Created February 26, 2015 23:33
Keybase.io Verification
### Keybase proof
I hereby claim:
* I am nathankunicki on github.
* I am nathankunicki (https://keybase.io/nathankunicki) on keybase.
* I have a public key whose fingerprint is 8A9B ABD6 C7D3 D390 C57C 7608 9083 521A CC71 CB15
To claim this, I am signing this object:
@nathankellenicki
nathankellenicki / Dockerfile.template
Created November 16, 2016 19:17
Cassandra 3.9 with Stratio Lucene secondary indices Dockerfile
FROM cassandra:3.9
RUN apt-get update && \
apt-get install -y wget git-core maven ca-certificates && \
/var/lib/dpkg/info/ca-certificates-java.postinst configure
RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u71-b15/jdk-8u71-linux-x64.tar.gz && \
mkdir /opt/jdk && \
tar -zxf jdk-8u71-linux-x64.tar.gz -C /opt/jdk/ && \
rm jdk-8u71-linux-x64.tar.gz && \
@nathankellenicki
nathankellenicki / ubuntu-kernel-4.14.11.sh
Last active January 4, 2018 14:55
Upgrading Ubuntu 16.04 to Kernel 4.14.11 for Meltdown/Spectre
#!/bin/bash
mkdir kernel
cd kernel
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.11/linux-headers-4.14.11-041411-generic_4.14.11-041411.201801022143_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.11/linux-image-4.14.11-041411-generic_4.14.11-041411.201801022143_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.11/linux-headers-4.14.11-041411_4.14.11-041411.201801022143_all.deb
sudo dpkg -i *.deb
cd ..
rm -rf kernel
sudo reboot now
Looking for Hubs...
Connected to NK_DuploCargo!
lpf2hubmodeinfo Port 00, type 0029 (DUPLO_TRAIN_BASE_MOTOR) +0ms
lpf2hubmodeinfo Port 00, hardware version 0.0.00.0001, software version 0.0.00.0001 +1ms
Attached device 41 to undefined
lpf2hubmodeinfo Port 01, type 002a (DUPLO_TRAIN_BASE_SPEAKER) +1ms
lpf2hubmodeinfo Port 01, hardware version 0.0.00.0001, software version 0.0.00.0001 +0ms
Attached device 42 to undefined
lpf2hubmodeinfo Port 11, type 0017 (HUB_LED) +0ms
lpf2hubmodeinfo Port 11, hardware version 0.0.00.0001, software version 0.0.00.0001 +1ms
@nathankellenicki
nathankellenicki / index.html
Last active March 6, 2022 04:28
Bank of the Core GCC-1000 Currency Converter
<!DOCTYPE html>
<html>
<head>
<title>Bank of the Core GCC-1000 Currency Converter</title>
<style>
.strike {
text-decoration: line-through;
}
</style>
<script>
@nathankellenicki
nathankellenicki / hwid.js
Created March 18, 2020 03:39
HWid Decryption Functions
private _parseHandshake (handshake: Buffer) {
const publicKey = handshake.slice(25, 58);
const salt = handshake.slice(132, 136);
this._theirPublicKey = publicKey;
this._theirSalt = salt;
}
private _sendHandshake () {
const ecdh = crypto.createECDH("prime256v1");
lpf2hubmodeinfo Port 00, type 0025 (COLOR_DISTANCE_SENSOR) +8s
lpf2hubmodeinfo Port 00, hardware version 1.0.00.0000, software version 1.0.00.0000 +0ms
lpf2hubmodeinfo Port 00, total modes 11, input modes 11001011111, output modes 00010100000 +30ms
lpf2hubmodeinfo Port 00, mode combinations [1001111] +45ms
lpf2hubmodeinfo Port 00, mode 0, name COLOR +15ms
lpf2hubmodeinfo Port 00, mode 0, RAW min 0, max 10 +30ms
lpf2hubmodeinfo Port 00, mode 0, PCT min 0, max 100 +30ms
lpf2hubmodeinfo Port 00, mode 0, SI min 0, max 10 +30ms
lpf2hubmodeinfo Port 00, mode 0, SI symbol IDX +30ms
lpf2hubmodeinfo Port 00, mode 0, Value 1 x 8bit, Decimal format 3.0 +44ms
// Simple metrics gathering
export default class SimpleMetrics {
constructor () {
this.mainStartTime = +(new Date());
this.startTimings = {};
this.reportedTimings = [];
}
startTiming () {
const PoweredUP = require("node-poweredup");
const poweredUP = new PoweredUP.PoweredUP();
poweredUP.scan();
console.log("Looking for Hubs...");
poweredUP.on("discover", async (hub) => {
await hub.connect();