Skip to content

Instantly share code, notes, and snippets.

@ziluvatar
ziluvatar / gist:8713455
Created January 30, 2014 17:04
Linux command to sniff a port in console
#sudo apt-get install tcpflow
sudo tcpflow -i any -C -e port <port>
@ziluvatar
ziluvatar / gist:dcbddfaaf408e0586d4b
Created January 16, 2016 18:58
Download an entire website
# See http://superuser.com/questions/14403/how-can-i-download-an-entire-website
# You can install wget in mac with brew.
wget --mirror -p --html-extension --convert-links www.example.com
@ziluvatar
ziluvatar / run_proxy.sh
Last active April 4, 2018 11:47
Setup web proxy on macOs + run mitmproxy
#!/bin/bash
sudo networksetup -setwebproxy "Wi-Fi" "localhost" "8888"
sudo networksetup -setsecurewebproxy "Wi-Fi" "localhost" "8888"
# --insecure is added for development usage, where you may use self signed certificates
mitmproxy -p 8888 --insecure
sudo networksetup -setwebproxy "Wi-Fi" "" ""
sudo networksetup -setsecurewebproxy "Wi-Fi" "" ""
sudo networksetup -setwebproxystate wi-fi off
@ziluvatar
ziluvatar / token-generator.js
Last active April 11, 2024 07:10
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jsonwebtoken');