Skip to content

Instantly share code, notes, and snippets.

View hatkidchan's full-sized avatar
💭
¯\_(ツ)_/¯

Casey hatkidchan

💭
¯\_(ツ)_/¯
View GitHub Profile
@hatkidchan
hatkidchan / nitter-check.py
Created May 19, 2023 13:08
Nitter instances checker
from asyncio import FIRST_COMPLETED, create_task, wait
from typing import Optional
from httpx import AsyncClient
from rich.progress import Progress, TaskID
from yaml import safe_load as yaml_parse
INSTANCES_YAML_URL = "https://raw.githubusercontent.com/xnaas/nitter-instances/master/.upptimerc.yml"
TEST_STATUS = "/04119__snail/status/1550513579056824322"
MAX_CONCURRENCY = 10
// x-run: ~/scripts/runc.sh % libraylib.a -lm
#include "raylib.h"
#include <math.h>
#include <raylib.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>

$2a$11$I0pa4WJBkIz9Ro7iwEDmROD3oaneW1jVZtkMtCzERg/uFFzJ1Emka

# x-run: python3 % /home/hkc/images/casey/photo_2022-09-20_19-34-19.jpg 64 64 | sh -
from zlib import compress
from PIL import Image
from sys import argv
from shlex import quote
TEMPLATE = (
"import zlib;"
'print("".join(['
"chr(x+(10<<10)) for x in zlib.decompress(%r.encode('U16')[2::2])"
#!/bin/bash
# usage: split-font-pages.sh "source-font.ttf" "output.css" "output-prefix"
for page in \
"U+0000-007F" "U+0080-00FF" "U+0100-017F" "U+0180-024F" \
"U+0250-02AF" "U+02B0-02FF" "U+0300-036F" "U+0370-03FF" \
"U+0400-04FF" "U+0500-052F" "U+0530-058F" "U+0590-05FF" \
"U+0600-06FF" "U+0700-074F" "U+0750-077F" "U+0780-07BF" \
"U+07C0-07FF" "U+0800-083F" "U+0840-085F" "U+0860-086F" \
"U+0870-089F" "U+08A0-08FF" "U+0900-097F" "U+0980-09FF" \
#!/usr/bin/python3
from random import choice, shuffle, randint
from re import findall
from os.path import expanduser
from sys import argv
with open(expanduser("/usr/share/keepassxc/wordlists/eff_large.wordlist"), "r") as f:
words = list(map(str.strip, f.readlines()))
password_mask = list(argv[1] if len(argv) > 1 else "WWWWWWWWWWWWWWWWDDDS")
// x-run: tcc -lasound -lm -run % -r 600 988 1 1319 4
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <alsa/asoundlib.h>
#include <sys/types.h>
#include <math.h>
enum {
@hatkidchan
hatkidchan / proxytest.py
Created May 16, 2022 23:24
Proxy checker
#!/usr/bin/env python3
import asyncio
import string
import random
from typing import Union, TypeVar, Tuple
from httpx import AsyncClient
from httpx_socks import AsyncProxyTransport
Result = TypeVar('Result')
#!/usr/bin/env python3
from time import sleep
with open("/proc/stat", "r") as fh:
last_total, last_busy = None, None
while True:
fh.seek(0)
for line in fh:
if line.startswith('cpu '):
parts = list(map(int, line.split()[1:]))
@hatkidchan
hatkidchan / render.py
Created April 14, 2022 08:00
Fedi.place timelapse renderer
#!/usr/bin/env python3
from csv import reader as CSVReader
from datetime import datetime
from subprocess import Popen, PIPE
from PIL import Image, ImageDraw, ImageFont
from PIL.ImageColor import getrgb
FFMPEG_ARGS = [
"ffmpeg", "-f", "image2pipe",
"-i", "-",