Skip to content

Instantly share code, notes, and snippets.

View acheong08's full-sized avatar
🎯
Focusing

Antonio Cheong acheong08

🎯
Focusing
View GitHub Profile
(function (root, factory) {
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof module === "object" && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
@acheong08
acheong08 / tls_finger.go
Created November 17, 2023 01:14
Quick script for checking TLS fingerprint
// To do: Make this into a full blown site that monitors the internet for changes in TLS fingerprints
package main
import (
"crypto/sha256"
"crypto/tls"
"encoding/hex"
"flag"
"fmt"
@acheong08
acheong08 / portfwd.sh
Last active November 9, 2023 18:01
Port forwarding utility
#!/bin/bash
# Default protocol is tcp
PROTOCOL="tcp"
# Usage function to display help
usage() {
echo "Usage: $0 [--udp|--tcp] --source <source-port> --dest <destination-ip:port>"
echo "Example (TCP): $0 --source 80 --dest 172.20.10.2:80"
echo "Example (UDP): $0 --udp --source 53 --dest 172.20.10.2:53"
@acheong08
acheong08 / htmj.js
Created November 5, 2023 17:21
HTMX but with JSON
class HTMJ {
constructor() {
this.init();
}
init() {
document.addEventListener("DOMContentLoaded", () => {
this.parseTemplates();
});
}
@acheong08
acheong08 / conv.go
Created September 29, 2023 20:24
Convert Twitter Database Dump to SQLite
package main
import (
"bufio"
"database/sql"
"fmt"
"os"
"strings"
_ "github.com/mattn/go-sqlite3"
@acheong08
acheong08 / cputemp.sh
Created September 17, 2023 15:03
CPU temperature script
#!/bin/bash
paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/'
@acheong08
acheong08 / sample.js
Last active September 2, 2023 12:02
Bounty: Help grug brained dev with JS - Amount negotiable.
function foo() {
let fetchCopy = window.fetch;
return function() {
return fetchCopy('http://example.com');
};
}
let boo = foo();
function bar() {
This file has been truncated, but you can view the full file.
137c137
< 9357: (e) => {
---
> 9514: (e) => {
1096c1096
< (r.text = n(9514)),
---
> (r.text = n(1274)),
1104c1104
< var i = n(9514);
package main
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"golang.org/x/crypto/scrypt"
)
@acheong08
acheong08 / makeKeyHash.js
Last active August 17, 2023 08:04
Extracted hash function from Obsidian Vault. It is used at https://api.obsidian.md/vault/create and vault keyhash in websocket.
const crypto = require("crypto");
function B(e) {
return e.slice(e.byteOffset, e.byteOffset + e.byteLength);
}
async function _(e) {
const t = await j(e);
return G(t);
}