Skip to content

Instantly share code, notes, and snippets.

@games647
games647 / autoIn-fastlogin-import.sql
Last active December 20, 2016 15:12
Import the auto in plugin database to the fastlogin database
INSERT INTO premium (Name, Premium, LastIp, UUID) SELECT
name AS Name,
/* Enable premium authentication only for those who want to be auto logged in, so
they have their cracked protection disabled */
!protection AND premium AS Premium,
/* Not used at the moment */
'' AS LastIp,
/* Remove the dashes - returns null if puuid is null too */
REPLACE(puuid, '-', '') AS UUID
FROM gt_nicknames
@games647
games647 / find-duplicates.sql
Last active August 26, 2016 11:51
Find duplicates in SQL if COLUMN or COLUM, COLUM has the same values. Just replace TABLE and COLUMN with your setup.
SELECT
COLUMN, COUNT(*)
FROM
TABLE
GROUP BY
COLUMN
HAVING
COUNT(*) > 1
@games647
games647 / start.sh
Created August 10, 2016 08:41
Java remote debugging startup
java -Xdebug -XX:+UnlockDiagnosticVMOptions -Xrunjdwp:transport=dt_socket,address=1000,server=y,suspend=n -jar fileName.jar
@games647
games647 / OfflineUUID.java
Created August 10, 2016 15:13
Generate a offline uuid based on the minecraft player name
import com.google.common.base.Charsets;
import java.util.UUID;
public class OfflineUUID {
public static void main(String[] test) throws Exception {
UUID.nameUUIDFromBytes(("OfflinePlayer:" + "playerName").getBytes(Charsets.UTF_8));
}
@games647
games647 / java uuid regex.txt
Last active August 1, 2019 18:42
Java UUID Regex
[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}
@games647
games647 / golang-cross-compile.sh
Last active August 26, 2016 11:51
Cross compile command syntax
GOOS=windows GOARCH=386 go build -o hello.exe hello.go
#Supported architecture: https://golang.org/doc/install/source#environment
@games647
games647 / minecraft-offline-uuid.php
Last active May 7, 2024 10:10
Generate an offline minecraft UUID v3 based on the case sensitive player name
<?
/**
* Generates a offline-mode player UUID.
*
* @param $username string
* @return string
*/
public static function constructOfflinePlayerUuid($username) {
//extracted from the java code:
//new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name));
@games647
games647 / bungee-sqlite.md
Last active December 12, 2021 04:18
Add SQLite support to your BungeeCord server.
  1. Download the SQLite driver .jar from here: https://bitbucket.org/xerial/sqlite-jdbc/downloads
  2. Open your BungeeCord/Waterfall jar with any archiver program
  3. Open the SQLite driver with any archiver program
  4. Copy the contents (the "org"-folder) from the SQLite driver to BungeeCord
  5. Now just use the SQLite settings in the ChangeSkin config.
@games647
games647 / spigot-bungee-auto-update.sh
Last active April 9, 2018 21:30
Auto updates spigot and BungeeCord based on the latest version from Jenkins
#!/bin/sh
cd /home/minecraft
mkdir tempdl
cd tempdl
wget https://ci.destroystokyo.com/job/PaperSpigot/lastSuccessfulBuild/artifact/paperclip.jar #Download the latest version of Spigot
wget https://ci.aquifermc.org/job/Waterfall/lastSuccessfulBuild/artifact/Waterfall-Proxy/bootstrap/target/Waterfall.jar #Download the latest version of BungeeCord
#Copy the .jars to the server folders
cp paperclip.jar /home/minecraft/paperclip.jar
#!/usr/bin/python3
from pysimplesoap.client import SoapClient
location = 'http://fritz.box:49000/igdupnp/control/WANCommonIFC1'
namespace = 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1'
action = 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1#'
debug = False # display http/soap requests and responses
client = SoapClient(location, action, namespace, trace=debug)