Skip to content

Instantly share code, notes, and snippets.

View carlosm3011's full-sized avatar
💭
Mining Internet and RPKI routing data

Carlos Martinez-Cagnazzo carlosm3011

💭
Mining Internet and RPKI routing data
View GitHub Profile
@carlosm3011
carlosm3011 / ripeval.service
Created July 4, 2017 15:05
RIPE-NCC RPKI Validator - systemd unit file
# cat /etc/systemd/system/ripeval.service
[Unit]
Description=RIPE-NCC RPKI Validator
After=network.target
[Service]
Type=forking
User=ripeval
WorkingDirectory=/home/ripeval
ExecStart=/home/ripeval/ripeval_latest/rpki-validator.sh start
@carlosm3011
carlosm3011 / bash-friendlier-automoplete.sh
Last active October 19, 2019 06:03
Friendlier autocomplete for bash (mac, linux)
# set this parameter in .bashrc or .bash_profile
# Source: [See gist comments]
#bind 'set mark-symlinked-directories on'
# (Hopefully) For all readline-enabled processes
# If ~/.inputrc doesn't exist yet: First include the original /etc/inputrc
# so it won't get overriden
# if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi
@carlosm3011
carlosm3011 / named.log.config
Created June 16, 2017 13:34
bind9 logging config
logging{
channel simple_log {
file "/var/log/named/bind.log" versions 3 size 5m;
severity warning;
print-time yes;
print-severity yes;
print-category yes;
};
channel queries_log {
@carlosm3011
carlosm3011 / ssh_config_osx_sierra
Last active June 20, 2018 19:59
ssh config tweaks for macOS Sierra
# macOS Sierra ssh config tweaks
# This file (or something similar) should go in $HOME/.ssh/config
# Permissions should be set to 0600
#
# Comments:
# UseKeychain: allow ssh-agent to read keys from macOS's keychain (avoiding the need to re-input passphrases all the time)
#
#
# PubKeyAccecptedKeyTypes: accept old pubkey types (needed for accesing older ssh implementations)
# KexAlgorithms: accept old style key exchanges
@carlosm3011
carlosm3011 / key2keytag.py
Last active November 16, 2016 01:34
Get a DNSKEY key tag from base64 raw public key rdata (DNSKEY record)
def key2keytag(flags, alg1, alg2, keydata):
# first parameter of struct.pack is a fortmat string
data = struct.pack('!HBB', flags, alg1, alg2)
data += base64.b64decode(keydata)
# data += keydata
v = 0
for i in range(len(data)):
if i & 1:
v += ord(data[i])
else:
@carlosm3011
carlosm3011 / hedns_updater.sh
Created July 11, 2016 04:58
Updating hostnames on Hurricane Electric's free DNS service
#!/bin/bash
#
# Usage: hedns_updater.sh 4|6 hos.na.me passwd
af=$1
hname=$2
ukey=$3
# get my ip address
ipaddr=$(curl -ks -$af https://wtfismyip.com/text)
#!/opt/local/bin/python2.7
######
# gen letters
######
import smtplib
from email.mime.text import MIMEText
import sys
import string
import csv
@carlosm3011
carlosm3011 / keen_write.py
Created March 18, 2016 15:45
keen_write.py: Simple script to upload events to keen.io
import string
keen.project_id = "56eae5a3d2eaaa4d7181e9de"
keen.write_key = "3ce6df1a63b8aa1fbb9c7a929f192e93e8ea5d4fad19fa75c026b4d32b5ff22a53fb6bd3f9fa5ccb81abfae65edb6735fa1f6615a5863666c7ae14aa75a9740d3d8ab7a183a720d720d6fb0121b67ffea11974107a018dd02c03b1c19d5bf6ab"
keen.read_key = "05fdaa87631ae5b783cd24c516e9acfcecdc50e1f20a7c77928a378962dc05d1c9ac90a6f9394dc93298b14128fe7429b32cb7faa9b625ba6e617ca1f4ddf2bf9bda86ea4ce5e78d6fae3870a1b1fdc6821cea2f9cce4594bd5a816279100527"
keen.master_key = "F361F6CC3751F727226F0E371CA39A0376AAA6B212DF709E501F0FA8A91041BE"
# get parameters, use field_name field_value ...
evp = []

Keybase proof

I hereby claim:

  • I am carlosm3011 on github.
  • I am carlosm3011 (https://keybase.io/carlosm3011) on keybase.
  • I have a public key whose fingerprint is AF6B 67E1 B238 3FB0 568D 1913 A43E 4A71 41AE B744

To claim this, I am signing this object:

@carlosm3011
carlosm3011 / run.sh
Created November 19, 2015 21:07
run.sh for setting env variables for python apps
#!/bin/bash
####################################################################
# Python wrapper - sets env variables appropiately
# v2 - 20151109
####################################################################
# change this PYTHON variable if using an alternative python
# interpreter
PYTHON="/usr/bin/python"
export SRCHOME=$(pwd)