Skip to content

Instantly share code, notes, and snippets.

Francesco Pira pirafrank

Block or report user

Report or block pirafrank

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
pirafrank /
Last active Jul 9, 2019
quick way to check your Coinbase balance for listed currencies
import json
from coinbase.wallet.client import Client
with open('app/credentials.json', 'r') as f:
credentials = json.load(f)
client = Client(credentials["api_key"],
pirafrank /
Created May 23, 2019
creating, starting, listing and killing Scaleway VMs by Python API
#! python2
import console
import dialogs
import urllib2
import json
import requests
import time
api_token = "aaabbb11-9087-5678-1234-000000aaaaaa"
pirafrank /
Created Dec 17, 2018
mirror your git repos to make a backup
for url in $(ssh ls-urls)
echo "Cloning $url ..."
git clone --mirror "$url"
pirafrank / ovpn_generator.conf
Last active Jan 9, 2019
Generator of .ovpn files with hardened client config and embedded cert, key and ta.key.
View ovpn_generator.conf
dev tun
proto udp
remote <SERVER> <PORT>
resolv-retry infinite
key-direction 1 # <-- DO NOT change this! (server.conf must have: tls-auth ta.key 0)
cipher AES-256-CBC
pirafrank /
Last active Sep 28, 2018
Update EXIF datetime data from filename pattern (if not set) or update file timestamps from EXIF metadata (if it is set)
# Simple script to parse JPG photo filename and set exif datetime,
# creation date and file modification date accordingly.
# Filename pattern is YYYYMMDD_hhmmss.
# Timezone is taken by your PC.
# exec this script by searching for .JPG and .jpg files in given folder
# find . -type f -name "*.JPG" -o -name "*.jpg" -exec /path/to/ {} \;
pirafrank /
Created Sep 19, 2018 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

pirafrank /
Last active Sep 17, 2018
A simple script to create a folder with a random name to be served by a web server
if [ -z "$1" ]; then
echo "Error: no arguments given"
echo "Usage: ./ file1 file2 file3 etc."
exit 1
# Script variables
pirafrank /
Created Sep 14, 2018
convert hex string to base64 string and viceversa
# convert hex string to base64 string
| xxd -r -p | base64
# convert base64 string to hex string
| base64 -d | od -t x1 -An
# Example: the whole circle in one command
# convert base64 to binary, to sha256 checksum (string in hex format), to decoded hex data (xxd -r),
# to base64 string, to base64 decoded data (base64 -d), back to hex string
awk '{print $2}' /etc/ssh/ | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64 | base64 -d | od -t x1 -An
pirafrank /
Last active Sep 14, 2018
Script to calculate digest of SSH host keys with different algorithms. Output is in HEX and Base64 formats.
keylist="/etc/ssh/ /etc/ssh/ /etc/ssh/ /etc/ssh/"
printf "\n%s\n" "$(hostname)"
for keyfile in $keylist; do
if [ -f $keyfile ]; then
printf "\n $keyfile\n"
printf " %-6s -- %-6s -- " "SHA256" "HEX"
awk '{print $2}' $keyfile | base64 -d | sha256sum -b | awk '{print $1}'
pirafrank /
Created Jun 15, 2018
internet speedtest from command line
wget --output-document=/dev/null
You can’t perform that action at this time.