Skip to content

Instantly share code, notes, and snippets.

View wiesty's full-sized avatar
:shipit:
Leberkas

Wiesty wiesty

:shipit:
Leberkas
View GitHub Profile
@wiesty
wiesty / discord_dev.sh
Created July 2, 2025 10:18
Enable Discord developer console on mac
SETTINGS=~/Library/Application\ Support/discord/settings.json
FILE=$(< "$SETTINGS" jq ". + {DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING: true}")
echo $FILE | jq . | tee "$SETTINGS"
@wiesty
wiesty / rip_text_from_page.py
Last active June 7, 2025 12:50
Extract text from any page (and subpages) and bypass robots.txt
from playwright.sync_api import sync_playwright
from urllib.parse import urljoin, urlparse
import os
import time
# === config ===
START_URL = "https://www.example.com/somepath"
WAIT_BETWEEN_REQUESTS = 2.5
OUTPUT_FILE = "output1.txt"
@wiesty
wiesty / bulk2webp.py
Created November 4, 2024 13:30
This script recursively converts JPEG, JPG, and PNG images in the current directory to WebP format, adjusting the quality to ensure each file remains under 1 MB in size.
import os
from PIL import Image
source_folder = os.getcwd()
target_folder = os.path.join(source_folder, "webp_converted")
if not os.path.exists(target_folder):
os.makedirs(target_folder)
max_file_size = 1 * 1024 * 1024
@wiesty
wiesty / gist:cc0d5784587f7105e00cbf4c39851817
Created April 10, 2024 11:11
Unban/Whitelist IP from mod security web application firewall ban
SecRule REMOTE_ADDR `@ipMatch 127.0.0.1` `id:3;phase:1;t:none;log;pass;ctl:ruleRemoveById=55666`
Range would be
SecRule REMOTE_ADDR `@ipMatch 127.0.0.1/24` `id:3;phase:1;t:none;log;pass;ctl:ruleRemoveById=55666`
both combined
SecRule REMOTE_ADDR `@ipMatch 127.0.0.1/24;127.0.0.1` `id:3;phase:1;t:none;log;pass;ctl:ruleRemoveById=55666`
@wiesty
wiesty / index.js
Created March 7, 2024 23:17
Discord v10 personal (Token based) Api call to update the personal status. (After update it sends an webhook.)
require('dotenv/config');
const axios = require('axios');
let data = JSON.stringify({
"status": "dnd"
// ('invisible', 'online', 'idle', 'dnd')."
});
let config = {
method: 'patch',