Skip to content

Instantly share code, notes, and snippets.

@hvva
hvva / onion_gen
Last active August 29, 2015 14:05
Brute force generate valid onion addresses: 16 character [a..z][2..7]
#!/bin/bash
# Brute force generate valid onion addresses: 16 character [a..z][2..7]
# 'a' is the left-most character - 'p' is the right most
# rtl controls if addresses are enumerated rtl or ltr
rtl=0
for a in {{2..7},{a..z}}; do
for b in {{2..7},{a..z}}; do
@hvva
hvva / csv2json.sh
Last active April 23, 2025 06:08
Convert CSV to JSON using bash
#!/bin/bash
# A script to convert a CSV (excel export) file into JSON
# Usage ./csv2json input.csv > output.json
# Slightly modified version of SECAGUY's:
# http://blog.secaserver.com/2013/12/convert-csv-json-bash/
input=$1
[ -z $1 ] && echo "No CSV input file specified" && exit 1
[ ! -e $input ] && echo "Unable to locate $1" && exit 1
@hvva
hvva / UNCountries.json
Last active August 29, 2015 14:05
United Nations Regions, Sub-regions, Countries and ISO3 codes in JSON
[
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"BDI","country":"Burundi"},
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"COM","country":"Comoros"},
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"DJI","country":"Djibouti"},
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"ERI","country":"Eritrea"},
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"ETH","country":"Ethiopia"},
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"KEN","country":"Kenya"},
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"MDG","country":"Madagascar"},
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"MUS","country":"Mauritius"},
{"region":"AFRICA","subregion":"Eastern Africa","iso3":"REU","country":"Réunion"},