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
{ | |
"1": ["a", "b", "c"], | |
"2": ["d", "e", "f"], | |
"3": ["g", "h", "i"], | |
"4": ["j", "k", "l"], | |
"5": ["m", "n", "o"], | |
"6": ["p", "q", "r", "s"], | |
"7": ["t", "u", "v"], | |
"8": ["w", "x", "y", "z"] | |
} |
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
const fs = require('fs'); | |
const readline = require('readline'); | |
const defaultKeys = { | |
1: ['a', 'b', 'c'], | |
2: ['d', 'e', 'f'], | |
3: ['g', 'h', 'i'], | |
4: ['j', 'k', 'l'], | |
5: ['m', 'n', 'o'], | |
6: ['p', 'q', 'r', 's'], |
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
const fs = require('fs'); | |
const readline = require('readline'); | |
const PRECISION = 60; | |
/* see https://en.wikipedia.org/wiki/Parasitic_number */ | |
function getSmallestParasiticNumber(n, k) { | |
if (n > k) { | |
return '0'; |
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
[general] | |
fallback_to_native = true | |
profile = profile.4.0-unified_standard | |
######################################################### | |
################## Profile Section ################## | |
######################################################### | |
############# 5.0-unified ############# |
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 | |
cat $1 | grep -E -o "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | sort -t. -n -k1,1 -k2,2 -k3,3 -k4,4 | uniq | awk -f <script_path>/script.awk > /srv/ftp/subnets.rsc |
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
# | |
# Library with various ip manipulation functions | |
# | |
# convert ip ranges to CIDR notation | |
# str range2cidr(ip2dec("192.168.0.15"), ip2dec("192.168.5.115")) | |
# | |
# Credit to Chubler_XL for this brilliant function. (see his post below for non GNU awk) | |
# | |
function range2cidr(ipStart, ipEnd, bits, mask, newip) { |
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
@include "lib_netaddr.awk" | |
function sanitize(ip) { | |
split(ip, slice, ".") | |
return slice[1]/1 "." slice[2]/1 "." slice[3]/1 "." slice[4]/1 | |
} | |
function snbounds(to,i) { | |
sn_min=grp[1] | |
sn_max=grp[to] |
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
#include <errno.h> | |
#include <ctype.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#include <grp.h> | |
#include <pwd.h> |