Skip to content

Instantly share code, notes, and snippets.

@olivierlemoal
olivierlemoal / transparent_proxy.md
Last active July 15, 2022 10:38
HOWTO setup Transparent proxy
@olivierlemoal
olivierlemoal / event_listener.py
Last active February 17, 2021 19:48
i3 script to toggle between last windows
Moved to https://github.com/olivierlemoal/i3-swap-focus
# Wine wrapper
# - Create new prefix with custom wine version
# - Custom Wine options
# - Install/remove DXVK/D9VK
# - Support winetricks
## Wrapper options
WINE_PATH="/home/user/.local/share/lutris/runners/wine/"
WINE_VERSION="lutris-5.0-x86_64"
export WINEPREFIX="/path/to/prefix"
# Configure proxy
$ wine control
> Paramètres internet > Connections
# Add certificate
> Paramètres internet > Contenu > Editeurs > Importer
// ==UserScript==
// @name Opensubtitles Fake Extension
// @version 1
// @match *://www.opensubtitles.org/*
// @match *://www.opensubtitles.com/*
// @grant none
// ==/UserScript==
var meta = document.createElement('meta');
meta.name = "accesslevel";
iptables -t mangle -I PREROUTING -m policy --pol ipsec --dir in -j NFLOG --nflog-group 5
iptables -t mangle -I POSTROUTING -m policy --pol ipsec --dir out -j NFLOG --nflog-group 5
tcpdump -s 0 -n -i nflog:5
import socket
import time
IP = "127.0.0.1"
PORT = 9220
def receiv():
data = None
try:
[
{"keys": ["ctrl+:"], "command": "toggle_comment", "args": { "block": false } },
{"keys": ["ctrl+shift+:"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
#! /usr/bin/env python3
import sys
import os
from path import path
if len(sys.argv) < 2:
print("Usage : {} path".format(sys.argv[0]))
exit(1)
path = path(sys.argv[1])
@olivierlemoal
olivierlemoal / idadif3.py
Last active January 19, 2023 17:48
Python 3 port of idadif.py
#!/usr/bin/env python3
# Small IDA .dif patcher
import re
import struct
from binascii import unhexlify
from sys import argv, exit
def patch(file, dif, revert=False):
code = open(file, 'rb').read()