Skip to content

Instantly share code, notes, and snippets.

View teidesu's full-sized avatar
🌸
meow?

alina sireneva teidesu

🌸
meow?
View GitHub Profile
@teidesu
teidesu / validate-fs.mts
Created January 2, 2025 14:21
script to find and remove broken files from a gocryptfs-powered overlay filesystem
import * as fsp from 'fs/promises'
const BASE_PATH = '/mnt/s3-desu-priv-encrypted/music'
const BASE_PATH_UNDERLYING = '/mnt/s3-desu-priv'
async function* walk(path: string) {
const entries = await fsp.readdir(path, { withFileTypes: true })
for (const entry of entries) {
const fullPath = path + '/' + entry.name
if (entry.isDirectory()) {
@teidesu
teidesu / pds-fix-blobstore-db.mjs
Created November 23, 2024 23:30
for bluesky pds, when the underlying blobstore gets out of sync with actor's db, to fix media load issues
import * as fs from "node:fs";
import * as crypto from "node:crypto";
import * as path from "node:path";
import { DatabaseSync } from 'node:sqlite'
const BLOBSTORE = '/srv/bluesky-pds/blobstore';
const DATA_DIR = '/srv/bluesky-pds/data';
const DID = 'did:web:tei.su'
const didHash = crypto.createHash('sha256').update(DID).digest('hex').slice(0, 2);
@teidesu
teidesu / no-svelte.user.js
Last active October 25, 2024 13:11
all my homies hate svelte
// ==UserScript==
// @name no svelte
// @description all my homies hate svelte
// @namespace teidesu
// @match *://*/*
// @grant window.close
// @grant GM_addElement
// @grant GM_getValue
// @grant GM_setValue
// @grant GM.getValue
@teidesu
teidesu / Open TikTok App.user.js
Created March 30, 2024 10:09
userscript for ios to open modded tiktok through deeplinks. requires https://apps.apple.com/us/app/userscripts/id1463298887
// ==UserScript==
// @name Open TikTok App
// @version 1.0.0
// @author teidesu
// @match *://*.tiktok.com/*
// ==/UserScript==
let m = window.location.pathname.match(/^\/@[^\/]+\/video\/(\d+)/)
if (m !== null) {
window.location.href = `snssdk1233://aweme/detail/${m[1]}`;
}
@teidesu
teidesu / _nginx-web-auth
Last active June 8, 2023 19:00
web-based password protection, in pure nginx, with php support
dummy file for gist title
@teidesu
teidesu / baza76.js
Created October 17, 2022 15:25
hex и base64? нет, блин, НЁХ и БАЗА76
// не бейте за кринж код, писала на коленке по фану
const HEX_ALPHABET = '0123456789абвгде'
const B76_ALPHABET =
'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя0123456789'
function toНёх(buf) {
let ret = ''
for (let i = 0; i < buf.length; i++) {
const byte = buf[i]
@teidesu
teidesu / mosru-ege-check.js
Created June 14, 2022 21:25
idk why i made this. this checks ege (use) results via mos.ru
const _got = require('got')
const cheerio = require('cheerio')
// cookie хедер с mos.ru
const COOKIE = ''
// код регистрации
const REG_CODE = '1234-5678-9012'
// номер документа без серии
const DOC_NUM = '123456'
@teidesu
teidesu / prefixed-localstorage.js
Last active September 23, 2022 12:18
Proxy for localStorage that prefixes all keys.
const prefix = 'prefix_'
const rawLS = window.localStorage
const wrappedLS = new Proxy(rawLS, {
get(target, prop, receiver) {
if (typeof target[prop] === 'function') {
return function(key, value) {
return target[prop](prefix + key, value)
}
}
@teidesu
teidesu / drklo-emoji-ripper.js
Created June 22, 2021 13:12
Utility to rip emojis and generate sprite sheets and meta information for them.
/**
* Emoji sprite and data generator.
*
* Data is taken from frankerfacez.com and name->char index is generated.
*
* Sprite generator works by parsing some of the code in DrKLO/Telegram (Telegram for Android)
* and downloading emoji files contained there, while generating code and sprite.
*
* Can easily be modified to generate JSON instead of CSS or to download from some other source.
* Can also be easily ported to TypeScript
@teidesu
teidesu / KawaiiCircularProgress.java
Created June 22, 2021 13:12
Kawaii material circular progress for android. preview: https://imgur.com/49Qs6GT
package desu.player.views;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;