Skip to content

Instantly share code, notes, and snippets.

View PinkPandaKatie's full-sized avatar

PinkPandaKatie PinkPandaKatie

View GitHub Profile
@PinkPandaKatie
PinkPandaKatie / update_discord.py
Created January 14, 2023 18:19
Script to download the latest version of Discord on Linux
#!/usr/bin/python3
import re
import subprocess
import traceback
from pathlib import Path
import requests
def main():
r = requests.head('https://discord.com/api/download?platform=linux&format=tar.gz')
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
/* compile with gcc -m32 -O2 -o looptest */
unsigned int looptest1() {
unsigned int rv = 0;
asm volatile (
#!/usr/bin/python3
import sys
import re
import argparse
rxnum = re.compile(r'^(\d+)$')
rxtime = re.compile(r'(\d+):(\d+):(\d+),(\d+) --> (\d+):(\d+):(\d+),(\d+)')
rxcap = re.compile(r'-?\([A-Z\s0-9-]+\)')
/*
* Simple LD_PRELOAD library to dummy out getifaddrs() and return 0 results when it is called
*
* Compiling:
* gcc -m32 -fPIC -shared dummy_getifaddrs.c -o dummy_getifaddrs.so -Wall
*
* Copy dummy_getifaddrs.so to Tomb Raider dir (.../SteamApps/common/Tomb Raider/bin) then
* change steam launch options for Tomb Raider to:
*
* env LD_PRELOAD=./dummy_getifaddrs.so %command%
/*
* Based on example code at https://www.kernel.org/doc/Documentation/networking/tuntap.txt
*
* Simple program to create a tun device, then wait forever. No external dependencies, except libc.
*
* Compiling: gcc tuntest.c -o tuntest
*/
#include <unistd.h>
#include <string.h>
curl 'https://derpibooru.org/images.json?nocomments=1&perpage=50&nofav=1&deleted=1&constraint=updated&order=d&lt=2015-10-28T08%3A44%3A23.9191Z' | ./jsonpp.py|grep updated_at
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 86087 0 86087 0 0 148k 0 --:--:-- --:--:-- --:--:-- 148k
"updated_at": "2015-10-28T08:44:23.9135Z",
"updated_at": "2015-10-28T08:44:23.9061Z",
"updated_at": "2015-10-28T08:44:23.8984Z",
"updated_at": "2015-10-28T08:44:23.8903Z",
"updated_at": "2015-10-28T08:44:23.8829Z",
"updated_at": "2015-10-28T08:44:23.8760Z",
#!/usr/bin/python
import sys
import json
from collections import OrderedDict
json.dump(json.load(sys.stdin, object_pairs_hook=OrderedDict), sys.stdout, indent=True)
@PinkPandaKatie
PinkPandaKatie / wikipedia_desktop_redirect.user.js
Created April 25, 2014 16:24
Greasemonkey script which redirects Wikipedia mobile to the desktop version
// ==UserScript==
// @name wikipedia_desktop_redirect
// @namespace https://jspenguin.org/monkey
// @description Redirect mobile wikipedia to desktop version
// @include http://*.m.wikipedia.org/*
// @include https://*.m.wikipedia.org/*
// @version 1
// @grant none
// ==/UserScript==