Skip to content

Instantly share code, notes, and snippets.

View CristianCantoro's full-sized avatar
🎯
Focusing

Cristian Consonni CristianCantoro

🎯
Focusing
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

resolve SBN authority id to wikipedia.it

(requires jq and gnu parallel)

  • get all Q ids with P396 property > ids.txt

~ make get

##############################################################################
##
## iptables rules for a Tor node with port knocking hiding SSH.
##
## These rules are based on a combination of:
## https://raw.githubusercontent.com/torservers/
## server-config-templates/master/iptables.test.rules
## and
## https://www.debian-administration.org/article/
## 268/Multiple-port_knocking_Netfilter/IPtables_only_implementation
@CristianCantoro
CristianCantoro / keybase.md
Created February 16, 2017 23:01
keybase.md

Keybase proof

I hereby claim:

  • I am cristiancantoro on github.
  • I am cristiancantoro (https://keybase.io/cristiancantoro) on keybase.
  • I have a public key ASD3Kw17RB1F0WqiERb4VZ7d9ZwMpusDGQjppWw3H8CcfAo

To claim this, I am signing this object:

@CristianCantoro
CristianCantoro / backup_restic.sh
Last active February 9, 2018 15:48
Backup script for restic
#!/usr/bin/env bash
# shellcheck disable=SC2128
SOURCED=false && [ "$0" = "$BASH_SOURCE" ] || SOURCED=true
if ! $SOURCED; then
set -euo pipefail
IFS=$'\n\t'
fi
awk_script=$(cat <<'AWKSCRIPT'
@CristianCantoro
CristianCantoro / histo_timestamps.py
Last active March 13, 2018 20:06
Create a histograms with time on the x-axis using arrow and matplotlib
#!/usr/bin/env python
import argparse
import arrow
from matplotlib import pyplot as plt
from matplotlib import dates as mdates
def get_args():
description=('Make an histogram from a list of timestamps')
@CristianCantoro
CristianCantoro / tsp.h
Created May 15, 2018 14:55
An header that works for C and C++
#ifndef TSP_H
#define TSP_H
#ifdef __cplusplus
// C++ code
using namespace std;
namespace helpers {
long long get_elapsed_time(void);
bool has_reached_timeout(void);
@CristianCantoro
CristianCantoro / esempio.sh
Last active May 25, 2018 09:57
Example script with docopts
#!/usr/bin/env bash
# shellcheck disable=SC2128
SOURCED=false && [ "$0" = "$BASH_SOURCE" ] || SOURCED=true
debug=false
parallel=false
query=''
topic=''
read -rd '' docstring <<EOF
@CristianCantoro
CristianCantoro / signal.sh
Last active May 25, 2018 18:22
Testing `nohup`, `&` and `disown`
#!/usr/bin/env bash
# shellcheck disable=SC2128
SOURCED=false && [ "$0" = "$BASH_SOURCE" ] || SOURCED=true
if ! $SOURCED; then
set -euo pipefail
IFS=$'\n\t'
fi
mypid="$$"