Skip to content

Instantly share code, notes, and snippets.

View Nithanim's full-sized avatar

Nithanim

  • Somewhere with trains
  • Austria
View GitHub Profile
# JMH 1.11.2 (released 319 days ago, please consider updating!)
# VM version: JDK 1.8.0_60, VM 25.60-b23
# VM invoker: C:\Program Files\Java\jdk1.8.0_60\jre\bin\java.exe
# VM options: -server
# Warmup: 10 iterations, 1 s each
# Measurement: 10 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: benchmark.ArithmeticBenchmark.testDivide
@MetaInfServices(JavacAnnotationHandler.class)
@HandlerPriority(1024)
public class DetermineListenerTypesProcessor extends JavacAnnotationHandler<DetermineListenerTypes> {
@Override
public void handle(AnnotationValues<DetermineListenerTypes> av, JCTree.JCAnnotation jca, JavacNode jn) {
JavacNode parent = jn.up();
JCTree.JCClassDecl classDecl = (JCClassDecl) parent.get();
for (JCTree tree : classDecl.defs) {
if (tree instanceof JCTree.JCMethodDecl) {
@Nithanim
Nithanim / eqtstakingsetup.sh
Last active November 14, 2017 22:34
EQT Staking Setup for Debian
#NO AUTOINSTALLER!
#RUN COMMANDS MANUALLY AND FIX POTENTIAL ERRORS
########## BASIC SETUP
#Assumes:
# * Basic linux experience
# * Working debian-like system (Should work on debian stretch (with the fix), jessie and the raspberry versions of it)
apt-get update
apt-get install tmux unzip -y
@Nithanim
Nithanim / info.md
Last active September 9, 2017 19:49
Cultures Modloader

ModLoader

Beschreibung

Da es schwer ist, alle Wünsche in ein einziges Modpack zu verpacken, hätte ich es etwas in die Richtung versucht, einen ModLoader zur Verwaltung der Mods zu erstellen. Ziel ist es, nicht für jedes Pack (oder Karte mit Spieländerungen) einen eigenen Installer mitzubringen. Vielmehr wäre es sinnvoller, nur die Informationen über die Änderungen mit zuliefern und die Verwaltung von einem eigenen Programm übernehmen zu lassen.

Dies hat den Vorteil, dass nur ein einziges Programm die Veränderungen des Spieles kontrolliert und so Problemen und Konflikten verschiedener Änderungen entgegenwirkt. Der Installer einer Map muss ebenfalls nicht viel mehr mitliefern, außer eventuell den ModLoader, der aber separat oder on-demand heruntergeladen werden sollte, um nicht mehr Traffic und Speicherplatz als nötig zu verbrauchen.

Der ModLoader wäre in der Lage, das ganze Spiel mit einem (oder mehreren) Modpacks generell zu verändern. Ich persönlich glaube weniger daran, dass große Modpacks entstehen

@Nithanim
Nithanim / gist:766c31475377b0bd594bab974a1de8d2
Last active September 25, 2022 08:12
Northland/Nordland or 8th Wonder of the World/Weltwunder map.dat file format
<!-- mediawiki -->
<!-- Note: the decoding is not completely right because on bigger maps my parser crashes. For smaller maps it works though. -->
The map.dat has no index table at the beginning of the file. It rather uses entry-headers (called "hoix"es) that state what type of content the next block contains and how long it is. The byte-order is Little Endian.
== Hoix ==
A hoix denotes a header of a datablock in the map.dat. The file starts with this.
{| class="wikitable"
@Nithanim
Nithanim / northland_on_linux.md
Created January 21, 2019 04:03
Northland/8th Wonder of the World on Linux

Northland/8th Wonder of the World on Linux

Wine is needed which can be downloaded from https://winehq.org/. Note that the game is 32 bit and most likely needs the 32 bit arch enabled.

For Ubuntu the instructions can be found on https://wiki.winehq.org/Ubuntu including the 32 bit command. At time of writing I am on Ubuntu 18.04 (bionic) with the wine staging branch.

$ wine --version                                                                                                                        
wine-4.0-rc6 (Staging)
@Nithanim
Nithanim / wol.sh
Created April 27, 2019 12:13
Extremely minimalistic WoL (Wake on Lan/Magic Packet) http webserver
#!/bin/bash
mac_addr=$'\x7B\x01\x2A\xE2\x96\x25'
packet_header=$'\xFF\xFF\xFF\xFF\xFF\xFF'
packet_macs="$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr$mac_addr"
packet="$packet_header$packet_macs"
@Nithanim
Nithanim / README
Created April 28, 2019 12:26
Freenas zfs recovery to nfs share (with geli)
Start the booting process of freenas.
Press any buttons to pause boot sequence.
If you land in menu with boot hit enter
In menu "Welcome to FreeNAS" (shark ascii art) find "escape to loader prompt".
(https://www.ixsystems.com/community/threads/zfs-has-failed-you.11951/)
type "set vfs.zfs.recover=1"
and "set vfs.zfs.debug=1"
then "boot -s"
@Nithanim
Nithanim / wol.java
Created May 1, 2019 15:26
Simple WoL (Wake on Lan) in Java
package me.nithanim.test.wol;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
public class Main {
public static void main(String[] args) throws IOException {
// 0B-5A-70-78-C0-D6
-XX:MaxGCPauseMillis=50 -XX:+UseStringDeduplication -XX:+UseG1GC -XX:+DisableExplicitGC -XX:ParallelGCThreads=8 -XX:+UnlockExperimentalVMOptions -XX:G1HeapRegionSize=32M