Skip to content

Instantly share code, notes, and snippets.

View Xetera's full-sized avatar

Xetera Xetera

View GitHub Profile
@Xetera
Xetera / xseed-sonarr.py
Created February 16, 2024 00:54
Script for hardlinking usenet imports in sonarr into a separate folder with its original download name
#! /usr/bin/env python3
import requests
import os
import pathlib
SONARR_TOKEN = os.environ.get("SONARR_TOKEN")
# directory where hardlinks will be created for renaming purposes
HARDLINK_TARGET = os.environ.get("HARDLINK_TARGET")
# DRY_RUN=true to test without touching the filesystem
DRY_RUN = os.environ.get("DRY_RUN", "false").lower() == "true"
@Xetera
Xetera / xseed-usenet.py
Last active February 15, 2024 22:40
A cross-seeding script to go through radarr's import history and hardlink movies downloaded from usenet with their original titles
#! /usr/bin/env python3
import requests
import os
import pathlib
RADARR_TOKEN = os.environ.get("RADARR_TOKEN")
# directory where hardlinks will be created for renaming purposes
HARDLINK_TARGET = os.environ.get("HARDLINK_TARGET")
# DRY_RUN=true to test without touching the filesystem
DRY_RUN = os.environ.get("DRY_RUN", "false").lower() == "true"
@Xetera
Xetera / mask.js
Created August 3, 2023 10:25
Mask sensitive values in an entire json file in github actions
const file = await import(process.argv[2], { assert: { type: "json" } })
function getValues(obj) {
const values = []
if (typeof obj !== "object") {
return values
}
for (const key of Object.keys(obj)) {
if (typeof obj[key] === "object") {
@Xetera
Xetera / spotify_image_size.ts
Created April 19, 2023 08:14
Function for converting between spotify album art sizes in-memory
const MagicImageBytes = {
640: 0b1011001001110011n,
300: 0b0001111000000010n,
64: 0b0100100001010001n,
} as const;
/**
* Converts a spotify link to a new size.
*
* @see
@Xetera
Xetera / ivd-autofill.js
Last active January 25, 2024 20:40
Interaktif Vergi Dairesi Otomatik Ödeme Scripti
const CARD_NUMBER = "1234123412341234"
const CARD_OWNER = "John Doe"
const CARD_CVV = 999
const CARD_EXPIRY = "3/26"
// Change above this line
function typeString(elementId, str, callback) {
let element = document.getElementById(elementId)
if (!element) {
@Xetera
Xetera / kahve_dunyasi.json
Created October 19, 2022 22:01
List of all Kahve Dunyasi locations around the world
[
{
"storeId": "d1d14969-c3e3-e711-80e0-005056010583",
"storeName": "Kahve Dünyası - Promenade",
"storeCode": "509",
"city": "HAWALLİ",
"state": "AL KUWAİT",
"district": "AL MOTASEM STREET",
"country": "KUVEYT",
"address": "Inside The Sultan Center, Al Motasem Street, Al Kuwait Hawalli",
@Xetera
Xetera / ban_check.py
Created September 18, 2022 14:29
Python function for checking when a site was banned by the Turkish government
from typing import Optional
import requests
import re
import datetime
def check_turkish_ban_date(site: str) -> Optional[datetime.date]:
"""
Looks up when a site (domain + tld) was banned in turkey.
Returns None if the site isn't banned.
@Xetera
Xetera / armongate.geojson
Last active September 5, 2022 05:28
All MAC Fitness locations in Turkey
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Xetera
Xetera / weverse_post.py
Last active August 11, 2022 09:58
Scraping post data from weverse's new naver api using an hmac
from hashlib import sha1
import hmac
import time
import base64
import requests
import urllib.parse
js_link_regex = re.compile("src=\"(.+\/main.*\.js)\"")
secret_key_regex = re.compile("return\s?\"([a-fA-F0-9]+)\"")
@Xetera
Xetera / metrics.js
Last active May 6, 2022 00:11
Adblock-proof metric proxy. Make it impossible for adblock maintainers to block your internal metrics.
import Random from "seedrandom";
import express from "express";
const alphabet = "abcdefghijklmnoprstuvwyz123456789////";
const random = (rnd: () => number, len: number, min = 0) =>
Math.floor(rnd() * (len - min)) + min;
function generateEndpoints(salts: string[]) {
return salts.map((salt) => {