Skip to content

Instantly share code, notes, and snippets.

javascript:(() => {if (window.location.href.startsWith("https://bookwalker.jp/de")) {twitterImage = document.querySelector('meta[name="twitter:image"]').content; window.location = "https://c.bookwalker.jp/coverImage_" + twitterImage.slice(27,twitterImage.indexOf('/', 27)) + ".jpg"}})();
@neckothy
neckothy / open-in-steam.bookmarklet.js
Last active June 30, 2024 19:41
open steam community or store pages in the steam client using steam://openurl/{url}
javascript:(() => {if (window.location.href.startsWith("https://steamcommunity.com/") || window.location.href.startsWith("https://store.steampowered.com/")) {window.location = "steam://openurl/" + window.location.href;}})();
@neckothy
neckothy / winO.user.js
Created January 24, 2024 12:13
-1 click
// ==UserScript==
// @name Latest Win-O' Archive Redirect
// @namespace Violentmonkey Scripts
// @match https://desuarchive.org/co/search/subject/official%20win-o%27-thread/
// @grant none
// @version 1.0
// @author neckothy
// @description -1 click
// ==/UserScript==
@neckothy
neckothy / get_vapters.py
Created January 18, 2024 09:24
get volumes and chapters included in a manga archive
# really low effort, assumes internal page names follow something close to the Madokami naming scheme
# originally started to be able to auto update tracking sites before I realized I don't care enough
# > python get_vapters.py path/to/archive.cbz [path/to/additional/archives.cbz]
# path/to/archive.cbz: v01, c001-005
import os
import re
import sys
import zipfile
@neckothy
neckothy / intercepting-http-requests-for-mobile-apps.md
Last active January 15, 2024 09:22
Setting up a Man-in-the-Middle proxy for intercepting HTTP(S) requests from Android or iOS apps

Intercepting HTTP(S) Requests for Mobile Apps

Table of Contents
@neckothy
neckothy / inject-system-ca.py
Last active January 15, 2024 09:20
Temporarily inject your mitmproxy cert to the system certificate store on a rooted Android emulator / device. See info / warnings at top of script before use.
"""
Temporarily inject your mitmproxy cert to the system certificate store on a rooted Android emulator / device.
Based on (and heavily borrowed from) HTTP Toolkit's awesome adb interceptor:
https://github.com/httptoolkit/httptoolkit-server/blob/main/src/interceptors/android/android-adb-interceptor.ts
Requires:
adb_shell - https://github.com/JeffLIrion/adb_shell
openssl in path
@neckothy
neckothy / kccalendar.py
Created January 4, 2024 10:45
Bad script to print a simplified version of the Kodansha Comics release calendar.
import requests
import sys
API_URL = "https://api.kodansha.us/product/ReleaseCalendar"
def filter_format(filt):
if filt.lower() in ("manga", "man", "m"):
return "?filterBy=manga"
elif filt.lower() in ("books", "book", "boo", "b"):
@neckothy
neckothy / get-kfa-key.sh
Last active February 13, 2024 05:57
Extract keyfile from Kindle for Android on a rooted device/emulator
#!/bin/bash
# https://github.com/noDRM/DeDRM_tools/discussions/440
# REQUIRES ROOTED DEVICE / EMULATOR
# get Notifications.pref.xml
xml=$(adb shell su -c 'cat /data/data/com.amazon.kindle/shared_prefs/Notifications.pref.xml')
# extract dsn from xml
dsn=$(echo -n "$xml" | grep -Po '(?<=<string name="serializedDeviceAttributes">{&quot;dsn&quot;:&quot;)[0-9a-f]{32}')
# convert to hexadecimal
hex=$(echo -n "$dsn" | od -A n -t x1 | sed 'N;s/[\n ]//g')
@neckothy
neckothy / autogray.sh
Last active December 12, 2023 06:27
Automatically grayscale images which fall under a set saturation threshold
#!/bin/bash
# https://www.imagemagick.org/discourse-server/viewtopic.php?t=19580#p81226
# https://unix.stackexchange.com/a/9499
# http://www.fmwconcepts.com/imagemagick/tidbits/image_info.php#gray
find . -type f \( -name '*.jpg' -o -name '*.png' \) -exec sh -c '
for file do
graytest=$(identify -format "%[colorspace]" "$file")
if [[ $graytest != Gray ]]; then
sattest=$(convert "$file" -colorspace HSL -channel g -separate +channel -format "%[fx:mean<.12?1:0]" info:)
@neckothy
neckothy / manga-ripping-tools.md
Last active February 3, 2024 11:08
Public tools related to ripping licensed English manga