Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dequis
dequis / ldpreload.c
Created July 20, 2022 10:09
sleep(4) frizz reduction spray for zoom
/*
sleep(4) frizz reduction spray for zoom
because this thing decides to freeze for a long time every time i plug/unplug
my usb hub, or when any cable is loose. seems to be 4 seconds multiplied by
number of plug/unplug events received
caveats:
- your video will still be frozen as usual, re-enable video
- this might increase the risk of your devices not showing up after it
@dequis
dequis / n26_ynab.py
Created January 4, 2020 23:04
Script I use to send n26 transactions to YNAB. Not documented as it's not really intended to be used by anyone but me but good luck.
import requests
from n26.api import Api as N26Api
from datetime import datetime, timedelta
from pprint import pprint
ENABLE_YNAB = True
YNAB_TOKEN = '...'
BUDGET_ID = '...'
ACCOUNT_ID = '...'
// gcc -g -shared -fPIC $(pkg-config --cflags bitlbee) bitlbee_ssl.c -o bitlbee_ssl.so
#include <bitlbee.h>
#include <ssl_client.h>
static void
beessl_init(account_t *acct)
{
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dequis
dequis / gregex.c
Created February 11, 2017 02:44
Fuzzing test cases for GRegex/posix regexps
/*
$ gcc $(pkg-config --cflags glib-2.0) -lpthread gregex.c libglib-2.0.a libpcre.a -o gregex
$ echo -n 'pattern\ntext' | ./gregex
*/
#include <glib.h>
#include <string.h>
int main() {
GRegex *preg;
@dequis
dequis / skypeweb.dot
Last active May 26, 2018 00:00
skypeweb troubleshooting flowchart http://dequis.org/skypeweb.png
digraph {
graph [nodesep=0.1, pad="1,0"];
node [fontsize=9, fontname="DejaVu Sans", margin=0.01];
edge [fontsize=9, fontname="DejaVu Sans"];
start [label="I'm getting an error\ntrying to log in to skypeweb"];
using_latest [label="Are you using\nskypeweb 1.5 or newer?"];
using_latest_no [label="Upgrade to the\nlatest version"];
@dequis
dequis / scrape.sh
Created June 6, 2015 04:53
radare.today index generator/scraper. requires httpie, pup, jq https://github.com/radare/radare2/wiki/radare.today-index
baseurl=http://radare.today
maxpage=$(http -v HEAD $baseurl/page/9999/ | grep Location | grep -o '[0-9]*')
for page in $(seq 1 $maxpage); do
http --follow $baseurl/page/$page/ | pup -p 'h1.post-title a json{}' | jq '.[] | {"title": .text, "url": .href}' >> output.json
done
cat output.json | jq -r '" * [\(.title)]('$baseurl'\(.url))"' > result.md
@dequis
dequis / patch.py
Last active December 19, 2017 19:01
MSN ApplicationId binary patcher for pidgin/bitlbee/etc - OBSOLETE now that pidgin/bitlbee have the correct fix - READ THE COMMENTS!
#!/usr/bin/env python
"""
MSN ApplicationId patcher for pidgin/bitlbee/whatever
(because you're too lazy to rebuild the whole thing.)
Usage examples:
python patch.py /usr/sbin/bitlbee
python patch.py /usr/lib/purple-2/libmsn.so
@dequis
dequis / playerinteractevent.py
Created November 3, 2014 07:09
PlayerInteractEvent test plugin written in MiniPython
# ---
# name: PlayerInteractEventTest
# ---
import quick
def msg(text):
quick.plugin.server.broadcastMessage(text)
def nice(text):
@dequis
dequis / playermoveevent.py
Created October 18, 2014 23:12
PlayerMoveEvent test plugin written in MiniPython
# ---
# name: Test
# version: 1.0
# author: dx
# ---
import quick
def format_location(l):
return "x=%.3f y=%.3f z=%.3f yaw=%.3f pitch=%.3f" % \