Skip to content

Instantly share code, notes, and snippets.

View dadodasyra's full-sized avatar

dadodasyra

View GitHub Profile
@dadodasyra
dadodasyra / ini_translator.js
Last active January 2, 2024 14:53
This little scripts translate from an ini file to another one using google translate api
import translate from "translate";
translate.engine = "google"; // Or "yandex", "libre", "deepl"
translate.key = "";
const langSource = "fr";
const langDest = "tr";
//Read langSource.ini line by line
import fs from "fs";
<?php
declare(strict_types=1);
require "vendor/autoload.php";
$outputData = [
"ocean" => 0,
"plains" => 1,
"desert" => 2,
@dadodasyra
dadodasyra / PM5_World_converter.php
Created November 5, 2023 19:24
Convert world with plugin code to leveldb (can be used with sort of a TestCommand) it freezes the server until the end of the conversion and automatically detect the base format.
<?php
$originalPath = "/root/servers/miscs/converting/lobby";
$backupPath = "/root/servers/miscs/converting/backup"; //this will create a folder under this one with the name of the world
$providerManager = new WorldProviderManager();
$writableFormats = array_filter($providerManager->getAvailableProviders(), fn(WorldProviderManagerEntry $class) => $class instanceof WritableWorldProviderManagerEntry);
$requiredOpts = [
"world" => "path to the input world for conversion",
"backup" => "path to back up the original files",
@dadodasyra
dadodasyra / PM4_SkinStealer.php
Last active May 28, 2022 12:23
Add this code where you want to steal the skin of $sender, change the path at the imagepng method to your target
<?php
$height = 64;
$width = 64;
switch (strlen($sender->getSkin()->getSkinData())) {
case 64 * 32 * 4:
$height = 32;
break;
case 64 * 64 * 4:
break;
@dadodasyra
dadodasyra / MinecraftBedrockServerFinder.php
Created April 16, 2022 17:30
A simple PHP tool to scan IP ranges and looking for online minecraft bedrock servers
<?php
error_reporting(E_ERROR | E_PARSE);
use JetBrains\PhpStorm\ArrayShape;
class TestWork extends Thread {
//updated version that works with pThreads v3.2.1 and php 7.3.23
protected $complete;
protected $result;
//$pData is the data sent to your worker thread to do it's job.
public function __construct($ip) {