Skip to content

Instantly share code, notes, and snippets.

View pirafrank's full-sized avatar
⚙️
building Rusty things for no apparent reason...

Francesco Pira pirafrank

⚙️
building Rusty things for no apparent reason...
View GitHub Profile
@pirafrank
pirafrank / JetBrainsMono.css
Created January 15, 2020 22:02
JetBrainsMono.css font for Blink Shell. Credits to JetBrains. https://www.jetbrains.com/lp/mono/
This file has been truncated, but you can view the full file.
@font-face {
font-family: "JetBrainsMono";
font-style: italic;
font-weight: bold;
src: url(data:font/ttf;charset-utf-8;base64,AAEAAAASAQAABAAgRFNJRwAAAAEAAkQYAAAACEdERUYADwBqAAABLAAAABRHUE9TABkADAAAAUAAAAAQR1NVQopsxGkAAAFQAAB1zk9TLzI04dKYAAB3IAAAAGBjbWFwYXYREgAAd4AAAAdoY3Z0IDfnDYgAAjR8AAAAxGZwZ21QwPw8AAI1QAAADf1nYXNwAAAAEAACNHQAAAAIZ2x5Ztp5Cu0AAH7oAAGGfmhlYWQPpVo0AAIFaAAAADZoaGVhAQIFYAACBaAAAAAkaG10eNexJikAAgXEAAAJemxvY2ENPa0+AAIPQAAABQZtYXhwBH8QVwACFEgAAAAgbmFtZZxEAyAAAhRoAAAGaXBvc3SqrNVGAAIa1AAAGaBwcmVwIOWmPAACQ0AAAADWAAEAAAAMAAAAAAAAAAEAaAABAAIAAQAAAAoADAAOAAAAAAAAAAEAAAAKADQCigACREZMVAAObGF0bgAcAAQAAAAA//8AAgAAAAIABAAAAAD//wACAAEAAwAEY2FsdAAaY2FsdAEyemVybwJKemVybwJQAAAAigAAAAEAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBgAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AH
@pirafrank
pirafrank / nordvpn_download.sh
Created January 7, 2020 19:54
download .ovpn files per country from nordvpn website
#!/bin/bash
country="$1"
# e.g. fr, it, de, etc.
mkdir -p "$country/UDP"
cd $country/UDP
curl -sSL https://nordvpn.com/ovpn | grep -E "\/$country[0-9]*.nordvpn.com" | grep 'UDP' | cut -d'"' -f2 | xargs wget
cd ..
mkdir TCP
@pirafrank
pirafrank / basebalance.py
Last active July 9, 2019 22:20
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"],
credentials["api_secret"],
api_version='2016-03-03')
@pirafrank
pirafrank / requirements.txt
Last active April 22, 2020 22:05
creating, starting, listing and killing Scaleway VMs via script in Pythonista for iOS
requests
@pirafrank
pirafrank / git_mirror.sh
Created December 17, 2018 23:19
mirror your git repos to make a backup
#!/bin/bash
for url in $(ssh git.example.com ls-urls)
do
echo "Cloning $url ..."
git clone --mirror "$url"
done
@pirafrank
pirafrank / ovpn_generator.conf
Last active January 9, 2019 13:51
Generator of .ovpn files with hardened client config and embedded cert, key and ta.key.
client
dev tun
proto udp
remote <SERVER> <PORT>
resolv-retry infinite
nobind
persist-key
persist-tun
key-direction 1 # <-- DO NOT change this! (server.conf must have: tls-auth ta.key 0)
cipher AES-256-CBC
@pirafrank
pirafrank / exif_datetime_setter.sh
Last active September 28, 2018 16:35
Update EXIF datetime data from filename pattern (if not set) or update file timestamps from EXIF metadata (if it is set)
#!/bin/bash
# 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/exif_datetime_setter.sh {} \;
@pirafrank
pirafrank / curl.md
Created September 19, 2018 09:13 — forked from subfuzion/curl.md
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
pirafrank / share.sh
Last active September 17, 2018 23:03
A simple script to create a folder with a random name to be served by a web server
#!/bin/bash
if [ -z "$1" ]; then
echo "Error: no arguments given"
echo "Usage: ./share.sh file1 file2 file3 etc."
exit 1
fi
# Script variables
basepath="/var/www/sharing.example.com"
@pirafrank
pirafrank / hex_to_base64_and_back.sh
Created September 14, 2018 09:23
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/ssh_host_ecdsa_key.pub | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64 | base64 -d | od -t x1 -An