Skip to content

Instantly share code, notes, and snippets.

import threading
import typing
from dataclasses import dataclass, field
from queue import Queue
from typing import TypeVar, Generic
T = TypeVar('T')
R = TypeVar('R')
  • DONE Domain Fronting to be blocked on Azure
    • HN
    • Azure
    • two https domains resolve to the same IP address
      • eg., (search for site:azureedge.net)
        • tmgpulse.azureedge.net
        • goodie.azureedge.net
      • an SSL request contains of two parts
        • SSL headers which contain "SNI"/server name indicator
  • encrypted HTTP content
#!/usr/bin/env bash
# HAHA, so you may not blame me.
exit 1
set -euo pipefail
# eg sda1
DISK="$1"
interface ExtractHookProps<T> {
extractor: () => T;
setup: (hookValue: T) => void;
}
function ExtractHook<T>(props: React.PropsWithChildren<ExtractHookProps<T>>) {
let {extractor, setup, ...others} = props;
let hookValue = extractor();
setup(hookValue);
return <div {...others} />
# remove analytics boxes on every tweet
twitter.com##div:has(> a[href$="/analytics"]):style(display: none !important)
# remove footer
twitter.com##div:has(> nav[aria-label="Footer"][role="navigation"])
# remove relevant people sidebar
twitter.com##div:has(> aside[aria-label="Relevant people"][role="complementary"])
# one-line for-you|following header
// https://github.com/envoyproxy/data-plane-api/blob/main/envoy/service/ratelimit/v3/rls.proto
syntax = "proto3";
package envoy.service.ratelimit.v3;
service RateLimitService {
rpc ShouldRateLimit(RateLimitRequest) returns (RateLimitResponse) {}
}
@thewisenerd
thewisenerd / UniversalPicturesAU.csv
Created January 4, 2023 06:35
does universal pictures australia bother to renew their domain names
date title yt_id url active registrant debug
20110706 Johnny English Reborn Exclusive Trailer wawSjr2xX74 www.johnnyenglishreborn.com.au False
20111123 Battleship - Global Teaser Trailer 3EtQDQgj3iQ battleshipmovie.com True
20111125 American Pie Reunion f_Sb-xsIKPs americanreunionmovie.com.au False
20120116 American Pie Reunion - Red Band Trailer spv2lOBRDWw americanreunionmovie.com.au False
20120124 American Pie: Reunion - Trailer B QsllnLSOEjM americanreunionmovie.com.au False
20120215 Dr Seuss The LORAX - Zac Efron How to Get a Girl 39vZOPsdT1k www.theloraxmovie.com.au False
20120213 Dr Seuss The LORAX - Zac Efron on Ted kp11JnYDI1E www.theloraxmovie.com.au False
20120217 Dr Seuss The LORAX - Taylor Swift on Audrey wEP-GmqB0xk www.theloraxmovie.com.au False
20120214 Dr Seuss The LORAX - Betty White on Grammy Norma LVpV4jCu7yE www.theloraxmovie.com.au False
package org.dummy.jmhbench
object FeatureFlags {
val enabled: String = System.getenv("FEATURE-FLAG-ENABLED") ?: "false"
val enabledT: Boolean = enabled.toBoolean()
fun viaFunction(): String {
return System.getenv("FEATURE-FLAG-ENABLED") ?: "false"
}
# better handle tonumber errors
def parseCpu($cpu): (
if ($cpu == null) then
$cpu
else
(if ($cpu|endswith("m")) then
($cpu|rtrimstr("m")|tonumber)/1000
else
($cpu|tonumber)/1
end)
@thewisenerd
thewisenerd / ReqW7MAjqb48.js
Created December 9, 2022 10:45
azure cost portal url decode
// string sanitization?
function t(n) {
for (var t, i = [], r = 0; r < n.length; r++)
t = n.charCodeAt(r),
t < 128
? i.push(t)
: t < 2048
? i.push(192 | t >> 6, 128 | t & 63)
: t < 55296 || t >= 57344
? i.push(224 | t >> 12, 128 | t >> 6 & 63, 128 | t & 63)