Skip to content

Instantly share code, notes, and snippets.

@gnyman
gnyman / netcheck.py
Created August 4, 2023 06:16
Very simple network checking script which reboots your Huawei 5G modem when internet goes down. It will also print the signal statistics as csv every 30 seconds which might help you figure out why things break. Mostly untested, might or might not work, no returns, all purchases are final :-)
import os
import time
import sys
import csv
import datetime
import subprocess
from huawei_lte_api.Client import Client
from huawei_lte_api.Connection import Connection
@gnyman
gnyman / script.js
Created January 3, 2024 14:17
Incognito button for ChatGPT
// Simple script that adds a "incognito" shortcut to ChatGPT (toggles the history)
// run this in the console, or add it to StopTheMadness, Tampermonkey or similar
// Author @gnyman
// Licence CCO
function waitForElement(xpath) {
return new Promise((resolve, reject) => {
// Check if the element already exists
var existingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if (existingElement) {
@gnyman
gnyman / index.php
Created April 11, 2024 19:19
Stupidly simple php file upload server for local networks.
<?php
/* == Minimal stupidly simple file upload script ==
* *DO NOT USE THIS IN A UNTRUSTED ENVIRONMENT*
* There very little security. I have tried to block the most obvious thing
* (uploading of php files) and directory traversal. But this was done in 30
* minutes mostly with a LLM so I wouldn't trust it at all. Use something
* better for a untrusted environment.
*
* With that said, you can run this by placing it in a folder, naming it
* index.php then running php -S 0.0.0.0:8000 in that folder. You can then