Skip to content

Instantly share code, notes, and snippets.

View mikroskeem's full-sized avatar
👻

Mark Vainomaa mikroskeem

👻
View GitHub Profile
##!/usr/bin/env python
# -*- coding: utf-8 -*-
"""yggdrasil.py
A tool for debugging and exploring yggdrasil, Minecraft's new
authentication system.
Usage:
yggdrasil.py login <username> [--password=<password>]
yggdrasil.py migrated <username>
@Tasssadar
Tasssadar / mako-aosp-Implement-kexec-hardboot.patch
Last active January 7, 2022 17:10
kexec-hardboot for LG Nexus 4 (mako)
From a5c71c50da839c6932af1903bcc0036daa033f7e Mon Sep 17 00:00:00 2001
From: Vojtech Bocek <[email protected]>
Date: Mon, 30 Sep 2013 18:02:43 +0200
Subject: [PATCH] Implement kexec-hardboot
"Allows hard booting (i.e., with a full hardware reboot) to a kernel
previously loaded in memory by kexec. This works around the problem of
soft-booted kernel hangs due to improper device shutdown and/or
reinitialization."
More info in /arch/arm/Kconfig.
@windytan
windytan / emoji.pl
Last active August 14, 2023 14:50
Visualize SSH public key fingerprints using Unicode emoji
# Oona Räisänen 2013
# http://windytan.com
# ssh-keygen -l -f ~/.ssh/id_rsa.pub | perl emoji.pl
@emoji = qw( 🌀 🌂 🌅 🌈 🌙 🌞 🌟 🌠 🌰 🌱 🌲 🌳 🌴 🌵 🌷 🌸
🌹 🌺 🌻 🌼 🌽 🌾 🌿 🍀 🍁 🍂 🍃 🍄 🍅 🍆 🍇 🍈
🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓 🍔 🍕 🍖 🍗 🍘
🍜 🍝 🍞 🍟 🍠 🍡 🍢 🍣 🍤 🍥 🍦 🍧 🍨 🍩 🍪 🍫
🍬 🍭 🍮 🍯 🍰 🍱 🍲 🍳 🍴 🍵 🍶 🍷 🍸 🍹 🍺 🍻
@aadnk
aadnk / SendRawTellPacket.java
Created January 1, 2014 03:36
Send a raw tell command to a player through ProtocolLib.
package com.comphenix.example;
import java.lang.reflect.InvocationTargetException;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
@ycarmel
ycarmel / bash-history-to-zsh-history.js
Last active December 23, 2019 05:16
Bash history to Zsh history
// This is how I used it:
// $ node bash-history-to-zsh-history.js >> ~/.zsh_history
var fs = require("fs");
var a = fs.readFileSync(".bash_history");
var time = Date.now();
a.toString().split("\n").forEach(function(line){
console.log(": "+ (time++) + ":0;"+line);
});
@aadnk
aadnk / ArtificalChunkErrors.java
Created March 23, 2014 20:12
Prevent certain chunks from being processed by certain players.
package com.comphenix.example;
import org.bukkit.plugin.java.JavaPlugin;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
@john2x
john2x / 00_destructuring.md
Last active September 24, 2025 00:52
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,
@danielkza
danielkza / fedora-bfq.py
Last active May 2, 2017 15:23
Script to build a BFQ-patched kernel from Fedora packages
#!/usr/bin/env python2.7
from __future__ import print_function
import sys
import os.path
import re
import shutil
from glob import glob
from HTMLParser import HTMLParser
from subprocess import check_output, check_call, Popen, CalledProcessError, PIPE
@nogweii
nogweii / draft.md
Last active July 14, 2017 17:08
rough draft for why arch linux doesn't work with Gen2 HyperV machines

3 issues are present immediately when trying to install Archlinux in a Gen2 HyperV VM:

  1. Keyboard doesn't work. See http://www.gossamer-threads.com/lists/linux/kernel/1985855 for more details.
  2. The network doesn't work. See http://www.hurryupandwait.io/blog/running-an-ubuntu-guest-on-hyper-v-assigned-an-ip-via-dhcp-over-a-wifi-connection for more details.
  3. When you do try to do network operations, there are checksum errors. See http://forge.univention.org/bugzilla/show_bug.cgi?id=33160 for more details.

To solve the keyboard, you need to enable the SERIO_I8042 kernel module. Which won't autoload (when it's set to =M in Kconfig) as HyperV gen2 images don't virtualize any PS/2 devices. And due to a missing dependency, hyperv_keyboard.ko can't load without it. (https://bugs.archlinux.org/task/39820 for some more details.)

The network doesn't work at all, as the traffic isn't getting outside of the VM. This is the case with other Linux VMs, and isn't necessarily Arch's fault. Sharing the n