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 August 22, 2025 08:02
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 August 18, 2025 10:51
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.

Make sure you're not using an interim release of Ubuntu as PPAs (Personal Package Archive) often lag behind new Ubuntu releases, especially interim ones like 25.04 (as of 2025-08-17).

Speaking of which, I've made a script called lcdsetup.sh that automates upto and including Step 6 of this guide if you prefer, which you can download from my github page. download here

@userdocs
userdocs / authelia_nginx.md
Last active August 23, 2025 10:21
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 端口。