Skip to content

Instantly share code, notes, and snippets.

View KD-MM2's full-sized avatar
😀

Cao Thai Duong KD-MM2

😀
View GitHub Profile
@matteobertozzi
matteobertozzi / 1_otp.ts
Last active August 9, 2024 15:57
Generate Time Based OTP in Javascript/Typescript, Python, Java
async function generateOneTimePassword(rawKey: Uint8Array, counter: number): Promise<number> {
const data = new DataView(new ArrayBuffer(8));
data.setBigUint64(0, BigInt(Math.floor(counter)), false);
const algo = { name: 'HMAC', hash: 'SHA-1' };
const key = await crypto.subtle.importKey('raw', rawKey, algo, false, ['sign']);
const hmacHash = new Uint8Array(await crypto.subtle.sign(algo, key, data.buffer));
const offset = hmacHash[hmacHash.byteLength - 1] & 0x0f;
const hotp = (hmacHash[offset] & 0x7f) << 24
@akash-gajjar
akash-gajjar / tldv.py
Last active November 24, 2025 21:15
Download videos from TLDV.io
from datetime import datetime
from os import system
import requests
import json
## Please install ffmpeg before running this script and make sure it's in your PATH
## brew install ffmpeg
## Please install requests before running this script
## pip3 install requests
@DNA64
DNA64 / LCD-Game-Shrinker-Guide.md
Last active October 10, 2025 08:45
LCD-Game-Shrinker-Guide

LCD-Game-Shrinker

LCD-Game-Shrinker is a program that shrinks MAME high-resolution artwork and graphics for portable devices running LCD-Game-Emulator. You can read more on the projects GitHub page: https://github.com/bzhxx/LCD-Game-Shrinker

When creating this guide for LCD-Game-Shrinker I used the FREE Oracle VM VirtualBox with Ubuntu 20.0.4.2 LTS running under Windows 10. This is a great way to get a build environment set up quickly.

ATTENTION! - YOU MUST USE AN LTS VERSION OF UBUNTU!

Make sure you use a LTS version of Ubuntu, and better still, I suggest Ubuntu 22.04.5 LTS simply because it's not going to give you any unexpected issues. DO NOT USE AN INTERIM RELEASE OF UBUNTU! - PPAs (Personal Package Archive) often lag behind new Ubuntu releases, especially interim ones like 25.04 (as of 2025-08-17) and will cause you nothing but a great deal of headaches! You can try newer LTS releases, but if you have issues just use 22.04.05

@userdocs
userdocs / authelia_nginx.md
Last active November 3, 2025 15:04
A simplified Authelia nginx reverse proxy configuration
@phlinhng
phlinhng / a-trojan-with-nginx-stream-module.md
Last active March 8, 2025 13:22
Trojan + NGINX 多網站共存

利用 NGINX 的 Stream 模塊 sni_preread 功能,可以做到讓 Trojan 和其他網站在同一台機器上共享 443 端口。