Skip to content

Instantly share code, notes, and snippets.

View likecyber's full-sized avatar
🛠️
I called myself the Artisan.

Likecyber likecyber

🛠️
I called myself the Artisan.
  • Thailand
  • 00:01 (UTC +07:00)
  • Facebook likecyber
View GitHub Profile
@likecyber
likecyber / EmbyUpdateWithPatch.sh
Last active February 5, 2025 18:01
Script for Synology DSM's Emby Server to update and patch itself with free Emby Premiere.
#!/bin/bash
# The script must be executed as the root user, or it will fail.
# You must have "Container Manager" installed before running this script.
# Additionally, "Emby Server" must be running or the script will do nothing.
# Manually run the script once to apply free Emby Premiere patch.
# Make sure to update the ASSET_PREFIX and ASSET_SUFFIX based on your Synology model.
# Check your asset prefix and suffix from here: https://github.com/MediaBrowser/Emby.Releases/releases/latest
# CAUTION: Tested only on emby-server-synology72_4.8.10.0_x86_64.spk. Compatibility with other versions is no guarantee.
@likecyber
likecyber / getSmbiosUuid.go
Created July 13, 2024 12:08
A simple Golang function for getting Windows's SMBIOS UUID.
package main
import (
"fmt"
"syscall"
"unsafe"
)
const (
RSMB = 0x52534D42
@likecyber
likecyber / cluster-bun-polyfill.js
Last active July 12, 2024 10:55
Node.js's Cluster polyfill module for Bun (shared socket is not supported, but IPC should work)
import assert from 'node:assert';
import cluster from 'node:cluster';
import { EventEmitter } from 'node:events';
import { fork } from 'node:child_process';
try {
new cluster.Worker();
} catch (err) {
if (err.code === 'ERR_NOT_IMPLEMENTED') {
const callbacks = new Map();
@likecyber
likecyber / DF-BetterScreenSaver.cs
Last active February 6, 2024 10:20
Disable monitor and re-enable again after moving mouse cursor. (DisplayFusion Scripted Function)
// This Scripted Function allows one monitor to turn off while keeping the rest on.
// It is recommended to install Virtual Display Driver to have dummy monitor.
// https://github.com/itsmikethetech/Virtual-Display-Driver
// Please adjust the resolution and scale according to your monitor,
// then create 3 seperate profiles in DisplayFusion.
// 1st: Only active monitor; 2nd: Only dummy monitor; 3rd: Both monitors
// You can create a trigger to run when idling longer than specific time.
@likecyber
likecyber / gmail2http.js
Last active October 31, 2023 14:08
Forward Gmail to HTTP with Google Apps Script
// Simply run Install function once to setup.
// The following script does send HTTP requests for each unread email from any sender with the email domain '@domain.com'.
// The emails are processed in chronological order, from the oldest to the newest.
// This script is implemented with Single Instance Locking to prevent duplication.
// This script is implemented with Execution Timeout to prevent the execution time limit from being exceeded.
function Install () {
Uninstall();
ScriptApp.newTrigger('Run').timeBased().everyMinutes(1).create();
}
@likecyber
likecyber / DataTables.class.php
Last active January 23, 2022 22:51
My Universal Simple PHP DataTables Class (should be compatible with any database driver)
<?php
class DataTables {
public $table_name = "";
public $columns = array();
public $wheres = array();
public $search = "";
public $filters = array();
@likecyber
likecyber / auto_plesk_trial.php
Last active August 12, 2024 17:08
Auto Plesk Trial Renewal (using Anti-Captcha to solve ReCaptcha)
<?php
/*
Make sure to enter $anticaptcha_key before upload to server.
Upload "auto_plesk_trial.php" file to "/home/centos/auto_plesk_trial.php"
Then create Schedule Task in Root account of Plesk.
Task Type: Run a PHP script
Script path: /home/centos/auto_plesk_trial.php
Use PHP version: 7.x.x / 8.x.x
Run: Cron style * * * * *
const delay = millis => new Promise((resolve, reject) => {
setTimeout(_ => resolve(), millis)
});
const userAccount = await wax.login();
unityInstance.SendMessage('Controller', 'Server_Response_LoginData', userAccount);
const account = userAccount;
await delay(10000);
@likecyber
likecyber / Wifi Authentication (EN).md
Last active March 5, 2023 21:32
Wifi Authentication (EN)

Warning!

This guideline is based on the 2019 year event. It may not working at some points, please be cautious at all cost!

Welcome to my guideline!

Hi! This is my first guideline written in Markdown. We are going to create WiFi Authentication system by using FreeRADIUS with Chillispot on CentOS 7.6.

@likecyber
likecyber / PromptPay_QR_Payload.class.php
Last active June 2, 2019 02:23
Build/Extract PromptPay QR Code Payload in PHP for convenience payment.
<?php
class PromptPay_QR_Payload {
public function Generate ($ewallet_id, $amount = null, $one_time = false) {
switch (strlen($ewallet_id)) {
case 10:
$ewallet_type = "01"; // Phone Number
$ewallet_id = "0066".substr($ewallet_id, 1, 9);
break;
case 13: