Skip to content

Instantly share code, notes, and snippets.

View sjfbo's full-sized avatar
🐈

sj sjfbo

🐈
  • Prague, Czech Republic
  • 08:44 (UTC +02:00)
View GitHub Profile
@sjfbo
sjfbo / proxy.py
Created October 17, 2023 20:30 — forked from EmilHernvall/proxy.py
Transparent proxy for rewriting web pages to include The Hoff
"""
Install twisted (pip install twisted) and PIL (pip install PIL), and run the script.
On your gateway, run the following commands:
iptables -t nat -A PREROUTING -i br0 -s ! 192.168.0.20 -p tcp --dport 80 -j DNAT --to 192.168.0.20:8080
iptables -t nat -A POSTROUTING -o br0 -s 192.168.0.0/24 -d 192.168.0.20 -j SNAT --to 192.168.0.1
iptables -A FORWARD -s 192.168.0.0/24 -d 192.168.0.20 -i br0 -o br0 -p tcp --dport 8080 -j ACCEPT
Substitute 192.168.0.20 for the computer running the proxy.
"""
@sjfbo
sjfbo / gitcom.md
Created April 30, 2014 20:37 — forked from jednano/gitcom.md

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

$ git init

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results