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 May 28, 2025 21:21
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 April 24, 2023 06:43
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 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.

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

Before we continue it's important that you make sure Ubuntu is updated or you'll be installing old outdated packages and get errors.

@userdocs
userdocs / authelia_nginx.md
Last active October 2, 2024 00:37
A simplified Authelia nginx reverse proxy configuration

Nginx

nginx is a reverse proxy supported by Authelia.

Configuration

We will be working with these files.

/etc/nginx/authelia.conf
@phlinhng
phlinhng / a-trojan-with-nginx-stream-module.md
Last active March 8, 2025 13:22
Trojan + NGINX 多網站共存

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