Skip to content

Instantly share code, notes, and snippets.

@chocolatkey
chocolatkey / hash.ts
Created February 4, 2023 10:52
CDB over HTTP
const STARTING_HASH = 5381;
export default function cdbHash(key: string) {
let hash = STARTING_HASH;
const length = key.length;
for (let i = 0; i < length; i++) {
hash = ((((hash << 5) >>> 0) + hash) ^ key.charCodeAt(i)) >>> 0;
}
@chocolatkey
chocolatkey / README.MD
Last active April 8, 2023 08:13
Cloudflare S2 Browser Isolation Trace

This is just some quick data from the CF browser isolation beta. If you inspect the isolated webpage, there's a debug-sidebar you can add a show class to to make visible. From there, you can run a trace and get some info about the machines these VMs are on. These are the stubs of the metadata elements of two random traces I made.

P.S. no exploits found yet ;)

@chocolatkey
chocolatkey / regex.md
Last active January 10, 2021 23:50
Stimulus.JS 2.0.0 target upgrade from 1.x

Easy to do in VS Code global search

Search: data-target="([\w\d]+)\.([\w\d]+)"

Replace: data-$1-target="$2"

@chocolatkey
chocolatkey / loopbackCookie.go
Created December 16, 2020 23:17
Express signed cookie parser (for loopback) in go
import (
"crypto/hmac"
"crypto/sha256"
"crypto/subtle"
"encoding/base64"
"net/http"
"net/url"
"strings"
)
@chocolatkey
chocolatkey / startup-pageant.cmd
Last active April 24, 2020 01:15
Windows startup script to run Putty's pageant + the Git for Windows ssh-pageant for forwarding
@echo off
echo Starting PuTTY Pageant...
start "" "C:\Program Files\PuTTY\pageant.exe" %USERPROFILE%\.ssh\id.ppk
echo Starting Git4Win ssh-pageant...
"C:\Program Files\Git\git-cmd.exe" --no-needs-console --hide ""C:\Program Files\Git\cmd\start-ssh-pageant.cmd" >nul & exit"
@chocolatkey
chocolatkey / podman-deploy.sh
Last active November 24, 2019 03:46
newbie podman deploy script
#!/bin/bash
# chocolatkey 2019-10-05 - 2019-11-23
set +e
PD_POD_NAME="my-pod-name"
PD_POD_PORT="9000"
PD_CONTAINER_NAME="my-container-name"
PD_PACKAGE_URL="docker.pkg.github.com/myuser/myrepo/mydockerpackage"
if [ "$1" == "" ]; then
@chocolatkey
chocolatkey / filter.txt
Created September 30, 2019 20:20
Bypass Komiflo region detection (add to ublock origin filter)
||region-test.komiflo.com/region-test.gif$image,redirect=1x1-transparent.gif,domain=komiflo.com
@chocolatkey
chocolatkey / detected_noises.md
Last active August 3, 2019 02:56
Live Transcribe Android Decompilation

strings.xml, regex: <string name="description_([\w\d_]+)">(.*)</string> --> | $1 | $2 |

Name Description
alarm_clock Sounds made by a clock that is designed to make an audible signal at a specific time.
applause The sound of a group of people clapping their hands to express approval.
baby_cry_or_infant_cry A young child crying or bawling.
bagpipes A wind instrument using enclosed reeds fed from a reservoir of air in the form of a bag.
banjo A string instrument with a thin membrane stretched over a frame or cavity as a resonator, called the head.
bird Communication calls from birds including bird calls and songs.
@chocolatkey
chocolatkey / cron_optim_png.py
Created April 2, 2019 05:16
PNG Image optimizer to run as a cronjob using oxipng
# -*- coding: utf-8 -*-
# Cron PNG Image optimizer
# chocolatkey (Henry) 2019-03-12
version = "1.1.0"
BASE = "/your/path"
LOCK_FILE = BASE + "/optim.lock"
import os
import sys