Skip to content

Instantly share code, notes, and snippets.

@SingingBush
SingingBush / Reviving Dead Code (trying to) - jEnesis Emulator
Created December 20, 2018 02:24
A short story about the difficulties in using unmaintained software (jEnesis)
Today I did a quick google search to see if any emulators had been written in Java. As it urns out there was a Sega Megadrive emulator called [jEnesis](http://www.workingdesign.de/projects/jenesis.php) that was written by Stephan Dittrich and released back in 2006.
Most of the site is just dead links now and I wasn't able to find a working download there but I was able to track down a build of the project else where. Unfortunately however, the build I found was version 0.0.5 from May 2006 so it doesn't include the changes that went into the final v0.1.0 that was supposed to have been built in June 2006 (perhaps it was never made public).
The jEnesis.jar that I downloaded depends on a very old [lwjgl](https://www.lwjgl.org/). The timestamp for the file was December 2005 which would make it [version 0.99](https://sourceforge.net/projects/java-game-lib/files/Official%20Releases/LWJGL%200.99/).
This old lwjgl only supported 32-bit systems, so running `java -cp jEnesis.jar;lwjgl.jar jenesis.Main` would throw a
@SingingBush
SingingBush / JavaBluetooth.md
Last active July 5, 2026 00:33
A short article about the lack a standard API for Bluetooth in Java SE

Bluetooth (or the lack of) on Java

Java SE has never had support for bluetooth, the closest thing to a standard is JABWT (Java APIs for Bluetooth Wireless Technology) defined in JSR-82 which is actually for Java ME (Micro Edition).

JSR-82 provides the specification for the javax.bluetooth and javax.obex packages and would allow for code somewhat like:

import javax.bluetooth.BluetoothStateException;
import javax.bluetooth.DeviceClass;
@SingingBush
SingingBush / godot-fedora.md
Created April 1, 2018 01:25
setting up Godot on Fedora Linux

Godot 3.0.2 (Mono Version)

Get the latest Mono

Godot requires Mono 5.4.x but the Fedora repo is still stuck on an older version. Install the latest directly from the Mono Project (currently 5.10.x).

http://www.mono-project.com/download/stable/#download-lin

rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
@SingingBush
SingingBush / aws-quick-setup-guide.md
Last active January 20, 2024 20:28
Quick setup guide for configuring a fresh AWS account

AWS quickstart guide

This guide assumes you are setting up AWS for the first time either for personal use of for a small business (couple of users). The steps will also scale to a large organisation but it's likely that you will want to think through a more complex structure for grouping users into accounts and the permissions they have.

Part 1: Be careful not to spend too much (Optional / Recommended Step)

From the top-right drop-down, select Billing and Cost Management, then Budgets, then Create budget. Here you can define a budget or use a premade template. When starting out you may want to try sticking to the Zero spend budget for example.

Part 2: Let's begin by creating an organisation with a few accounts

@SingingBush
SingingBush / Doom 3 modding.md
Last active May 28, 2023 18:20
Developing mods and maps for Doom 3 (dhewm3)

Developing mods and maps for Doom 3 (dhewm3)

Getting Doom 3

It's worth getting Doom 3 from the Steam store as it includes:

  • The original DOOM 3
  • Resurrection of Evil Expansion
  • DOOM 3: BFG Edition
@SingingBush
SingingBush / maven gpg instructions.md
Last active May 8, 2023 17:57
Maven: signing artifacts for release to maven central

These instructions cover the following topics

  • Generating/updating GPG keys
  • Publishing GPG keys
  • Adding GPG keys to GitHub
  • Using GPG keys to sign git commits
  • Using GPG keys to sign maven artifacts
  • Publishing maven artifacts to OSSRH (Open Source Software Repository Hosting)

It's recommended to also read the following documentation

@SingingBush
SingingBush / TestUtils.java
Created May 8, 2023 10:38
Matching json with mockito
import org.mockito.ArgumentMatcher;
// javax.json:javax.json-api
//import javax.json.Json;
//import javax.json.JsonStructure;
//import javax.json.stream.JsonGenerator;
// jakarta.json:jakarta.json-api
import jakarta.json.Json;
import jakarta.json.JsonStructure;
@SingingBush
SingingBush / dlang_version_check.md
Last active January 6, 2023 18:32
a collection of D version checks for compatibility
// https://dlang.org/changelog/2.101.0.html#logger
static if(__traits(compiles, (){ import std.logger; } )) {
    import std.logger;
} else {
    // logger was in 'std.experimental' for a long time but you could optionally check that too
    import std.experimental.logger;
}
@SingingBush
SingingBush / CloudWatch examples.md
Last active October 26, 2022 16:14
Advanced CloudWatch queries for aggregating and visualising application logs

CloudWatch is really powerful. As well as just searching your logs you can quickly aggregate and visualise data from your logs.

Visualising warnings and errors in a line chart

In this example we use a regex make a capture group for loglevel based on lines such as 2022-10-26T16:00:00.000Z ERROR something bad happened! then count how many times the logs contained a WARN or ERROR in the log file in a 30 minute interval. This query can be used in conjunction with the Visualization tab in CloudWatch (select Line from the dropdown).

With a little editing based on your use case, this query wiil help build an overview of your error rate

@SingingBush
SingingBush / PgpEncryption.java
Last active February 8, 2021 12:57
Spring Bean for PGP file encryption
//
// This is a variation of the example found in the Bouncy Castle Java examples on github.
// I'm using a public key provided by 3rd party to encrypt a file before sending to them. They
// have the private key so it's a one-way system, I have no need for a decrypt method. This is
// being used in a Spring Boot app, hence the annotations.
//
import org.bouncycastle.bcpg.CompressionAlgorithmTags;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.*;