Skip to content

Instantly share code, notes, and snippets.

Avatar

Eduardo Diaz ziluvatar

View GitHub Profile
@ziluvatar
ziluvatar / token-generator.js
Last active Jan 10, 2021
Example of refreshing tokens with jwt
View token-generator.js
/**
* 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');
@ziluvatar
ziluvatar / run_proxy.sh
Last active Apr 4, 2018
Setup web proxy on macOs + run mitmproxy
View run_proxy.sh
#!/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 / gist:dcbddfaaf408e0586d4b
Created Jan 16, 2016
Download an entire website
View gist:dcbddfaaf408e0586d4b
# 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 / gist:8713455
Created Jan 30, 2014
Linux command to sniff a port in console
View gist:8713455
#sudo apt-get install tcpflow
sudo tcpflow -i any -C -e port <port>
You can’t perform that action at this time.