This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import os | |
import sys | |
from itertools import chain | |
from collections import defaultdict | |
import argparse | |
from operator import attrgetter | |
import json | |
from importlib import import_module |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -xe | |
calculate_subnet() { | |
IP=$1 | |
PREFIX=$2 | |
{ IFS=. read -r i1 i2 i3 i4; } <<< $IP | |
{ IFS=. read -r xx m1 m2 m3 m4; } <<< $(for a in $(seq 1 32); do if [ $(((a - 1) % 8)) -eq 0 ]; then echo -n .; fi; if [ $a -le $PREFIX ]; then echo -n 1; else echo -n 0; fi; done) | |
printf "%d.%d.%d.%d\n" "$((i1 & (2#$m1)))" "$((i2 & (2#$m2)))" "$((i3 & (2#$m3)))" "$((i4 & (2#$m4)))" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQGNBF12A68BDAC6TJidwDHYotVuDxz6egEPAXDmDadyEL2AxZcc9Ugpcv29jIwI | |
3b5g+uWZexXhEqqYsW3JHeVD5Anm2JzOXCSzEY8sAX7UD5wcFC30MJfgpTNU1nPl | |
hEP7b8d56AlVDjrrffFD2BzI+TaBKEUPIoQsaOZlICuPZji8yacG+LjYZGn9v+Rt | |
K2VDqcan7E4KQQjF/lIZJCMDThJyHw2NCkiLK9JK/gZs/VukLUr31KukzZw2WKWY | |
3FAcUXQmY86r+7r6lMqcwlM2UazQh9AtY/d27MEJP/zHj7znZVjgOUkDDqNxcnKp | |
S4YxkuqtkYrXIyvlrLrWxkIRkFX14PJrLxbAoufOdjclIgauDBAWU1DSS7urFLIG | |
fgoxE/dWhJ1hu5TVRIx7oJ5IhiZOBJthJE9rPFORj2pIK/EA3knnDsHrzTJH+8AQ | |
cJnaqjWADiFjWawVpLw491l+CmeuvbLACN59F0zpq/1n5KLRG/5N0sxVwblPxBif |
OlderNewer