Skip to content

Instantly share code, notes, and snippets.


Francesco Pira pirafrank

View GitHub Profile
pirafrank / ephemeral.html
Last active Oct 20, 2020
ephemeral text editor. content lives only in your browser, until you refresh the page.
View ephemeral.html
<!DOCTYPE html>
You curious :P
<html lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ephemeral Text Editor</title>
pirafrank / ephemeral
Created Oct 19, 2020
an ephemeral text editor in your browser. create a new bookmark and paste the raw content of this gist inside in the url field. enjoy!
View ephemeral
pirafrank /
Created Oct 18, 2020 — forked from Knight1/
Hetzner Cloud create temporary Windows Servers
ID=`hcloud server list | tail -1 | grep Windoof | awk '{print $1;}'`
CONTEXT=`hcloud context active`
if [ "$CONTEXT" != "testing" ]; then
echo "[CRIT] Aborting, wrong context"
pirafrank / s3_kms_docker_registry_policy.json
Created Oct 4, 2020
AWS policy to host a private docker registry on an AWS-KMS encrypted S3 bucket. Attach it to a new IAM user to get Access and Secret keys that only allow access to the given bucket.
View s3_kms_docker_registry_policy.json
"Version": "2012-10-17",
"Statement": [
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
"Effect": "Allow",
pirafrank / cloudflareDoH.mobileconfig
Last active Oct 7, 2020
iOS, iPadOS and tvOS 14 support MDM profile to set encrypted DNS requests (DNS-over-HTTPS and DNS-over-TLS) on cellular and Wi-Fi connection. To install, open this page from your device and click ‘Raw’ on the one of your choice in the GitHub page. Then continue installation in Settings app. Browse after installing to check it
View cloudflareDoH.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
pirafrank /
Created Jun 3, 2020
Script that calculates digest of SSH host keys (different algorithms, output in HEX and Base64) and generates SSHFP DNS entries
# available as gist at
# keep it in this order to match SSHFP numbers
keylist="/etc/ssh/ /etc/ssh/ /etc/ssh/ /etc/ssh/"
algolist="sha256 sha1 md5"
pirafrank / jwtBody.js
Created May 25, 2020
extract jwt body with no validation
View jwtBody.js
# sometimes you only need to get JWT body data without validating it
# WARNING: use this only if you have already validated the token in earlier steps in the chain
const jwt = "eyJ0eX...";
const jwtBodyJson = JSON.parse(Buffer.from(jwt.split(".")[1], "base64").toString());
pirafrank /
Created May 21, 2020
python3 -m http.server PORT for a CORS world
#!/usr/bin/env python3
# It's python3 -m http.server PORT for a CORS world
from http.server import HTTPServer, SimpleHTTPRequestHandler
import sys
class CORSRequestHandler(SimpleHTTPRequestHandler):
pirafrank /
Last active Apr 22, 2020
dummy script to create, list and delete VMs on scaleway. differently from, this is meant to be run on PC
#! python2
#import console
#import dialogs
import urllib2
import json
import requests
import time
api_token = "aaabbb11-9087-5678-1234-000000aaaaaa"
View tinyproxy.conf
## tinyproxy.conf -- tinyproxy daemon configuration file
## This example tinyproxy.conf file contains example settings
## with explanations in comments. For decriptions of all
## parameters, see the tinproxy.conf(5) manual page.
# User/Group: This allows you to set the user and group that will be
You can’t perform that action at this time.