Skip to content

Instantly share code, notes, and snippets.

View HitLuca's full-sized avatar
👨‍💻
Doing AI stuff

Luca Simonetto HitLuca

👨‍💻
Doing AI stuff
View GitHub Profile
@HitLuca
HitLuca / main.py
Created March 29, 2022 10:03
DearPyGUI 1.4.0, dragging images on the canvas
import dearpygui.dearpygui as dpg
# thing user last clicked
global currentPick
currentPick = None
# thing mouse last hovered
global currentSelection
currentSelection = None
@HitLuca
HitLuca / ufw_allow_cloudflare_ips_443.sh
Last active July 28, 2022 13:54
Outputs a series of ufw rules that enable external access from legitimate Cloudflare ips to port 443
#!/bin/sh
cd /tmp
wget https://www.cloudflare.com/ips-v4 -O ips-v4-$$.tmp
wget https://www.cloudflare.com/ips-v6 -O ips-v6-$$.tmp
for cfip in `cat ips-v4-$$.tmp`; do echo "sudo ufw allow from $cfip to any port 443 proto tcp comment 'Cloudflare ipv4'"; done
for cfip in `cat ips-v6-$$.tmp`; do echo "sudo ufw allow from $cfip to any port 443 proto tcp comment 'Cloudflare ipv6'"; done