This file contains 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/sh | |
# colors IP addresses | |
grep -a --color=always -E "((0|1{0,1}[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}(0|1{0,1}[0-9]{1,2}|2[0-4][0-9]|25[0-5])|(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))|$" $1 |
This file contains 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
#!/usr/bin/python3 | |
# reads a list of IP subnets in CIDR notation from stdin and collapses it | |
import sys | |
import ipaddress | |
subnets6 = [] | |
subnets4 = [] | |
input_list = sys.stdin.readlines() |
This file contains 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 <math.h> | |
#include <stdio.h> | |
#ifndef EXAMPLE | |
#define EXAMPLE 0 | |
#endif | |
#ifndef ACCURATE | |
#define ACCURATE 1 | |
#endif |
This file contains 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
keycode 14 = 5 percent EuroSign EuroSign eacute Eacute | |
keycode 24 = q Q adiaeresis Adiaeresis aacute Aacute | |
keycode 26 = e E eacute Eacute EuroSign EuroSign | |
keycode 29 = y Y udiaeresis Udiaeresis uacute Uacute | |
keycode 30 = u U uacute Uacute udiaeresis Udiaeresis | |
keycode 32 = o O oacute Oacute odiaeresis Odiaeresis | |
keycode 33 = p P odiaeresis Odiaeresis oacute Oacute | |
keycode 38 = a A aacute Aacute adiaeresis Adiaeresis | |
keycode 94 = less greater less greater bar bar |
This file contains 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
URxvt.scrollBar: false | |
URxvt.internalBorder: 0 | |
URxvt.font: xft:DejaVuSansMono:size=9.4:antialias=true | |
URxvt.boldFont: xft:DejaVuSansMono:bold:size=9.4:antialias=true | |
URxvt.saveLines: 1000 | |
URxvt.color0: #000000 | |
URxvt.color1: #b21818 | |
URxvt.color2: #18b218 | |
URxvt.color3: #b26818 |
This file contains 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
# ,-------------------------------------- Minute [0,59] | |
# | ,------------------------------ Hour [0,23] | |
# | | ,---------------------- Day of the month [1,31] | |
# | | | ,-------------- Month of the year [1,12] | |
# | | | | ,------ Day of the week ([0,6] with 0=Sunday) | |
# | | | | | |
This file contains 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 <inttypes.h> | |
#include <signal.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
char *name; | |
void term(int signum) | |
{ |
This file contains 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 <stdio.h> | |
#include <assert.h> | |
#include <malloc.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#define FN void __attribute__((noreturn)) | |
#define LAMBDA(c_) ({ FN _ c_ _;}) |
This file contains 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
import System.Environment (getArgs) | |
import System.IO (hPutStrLn, stderr) | |
import Data.List (genericTake) | |
import Text.Read (readMaybe) | |
-- sqrt possibly inaccurate for large primes. | |
primes = 2 : [ n | n<-[3,5..], all (\x -> n `mod` x /= 0) $ takeWhile (<= (floor $ sqrt $ fromIntegral n)) primes] | |
-- guaranteed to be correct for all primes, but much slower: | |
-- primes = 2 : [ n | n<-[3,5..], all (\x -> n `mod` x /= 0) $ takeWhile (<= (quot n 2)) primes] | |
-- for all n out of [1..] there's a prime p so that n < p < 2*n (Bertrand's postulate) |
This file contains 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
* { | |
animation-name: colors; | |
animation-duration: 4s; | |
animation-iteration-count: infinite; | |
} | |
@keyframes colors { | |
0% { text-shadow: 0 0 1pt hsl(0, 100%, 50%); } | |
17% { text-shadow: 0 0 1pt hsl(60, 100%, 50%); } | |
33% { text-shadow: 0 0 1pt hsl(120, 100%, 50%); } |
OlderNewer