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 | |
wget https://invisible-island.net/datafiles/current/terminfo.src.gz | |
gunzip -k terminfo.src.gz | |
# https://invisible-island.net/ncurses/ncurses.faq.html#big_terminfo | |
tic -s -1 -I -e'mintty, mintty-direct, mintty+common, | |
xterm+256color, kitty+setal, xterm+direct, ansi+rep, | |
ecma+strikeout, ecma+index, vt420+lrmm, xterm+sm+1006, | |
xterm+pcfkeys, xterm+tmux, ecma+italics, xterm-basic, |
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/env python3 | |
# encoding=utf-8 | |
# vim: set nobomb : | |
from enum import IntEnum, unique | |
from dataclasses import dataclass, field | |
from typing import Optional, Tuple | |
from datetime import datetime, timedelta | |
import json | |
from argparse import ArgumentParser |
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 | |
# PROVIDE: pcscd | |
# REQUIRE: LOGIN | |
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf | |
# to enable this service: | |
# | |
# pcscd_enable="YES" | |
. /etc/rc.subr |
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 <stdint.h> | |
#include <sys/mman.h> | |
int main(void){ | |
void * const hint = (void*)~(uintptr_t)0; | |
const void * const reserved = mmap(hint, 1, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); | |
printf("hint:%p\nreserved: %p\n", hint, reserved); | |
} |
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 <vector> | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
int main(int argc, char **argv){ | |
(void)argc; | |
(void)argv; |
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 <stddef.h> | |
#include <stdint.h> | |
#include <array> | |
#ifdef __clang__ | |
#define decAndCMOVmem(ctr, dst, src) \ | |
__asm__( \ | |
"dec\t%[count]\n\t" \ | |
"cmovz\t{%[from], %[to]|%[to], %[from]}" \ | |
: [to] "+r" (dst), [count] "+r" (ctr)\ |
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
#!/sbin/openrc-run | |
command="/usr/local/bin/ddns-route53" | |
description="Route53 Dynamic DNS daemon" | |
cfgfile="/etc/ddns-route53/ddns-route53.yml" | |
schedule='\*/15\ \*\ \*\ \*\ \*' | |
command_args="--config \"${cfgfile}\" --schedule ${schedule}" | |
command_user="ddnsr53u:ddnsr53" | |
command_background=true | |
pidfile="/run/${RC_SVCNAME}.pid" |
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/env python3 | |
# encoding=utf-8 | |
# vim: set nobomb: | |
from tkinter import * | |
from threading import Thread, Lock, Event | |
from queue import SimpleQueue | |
from time import sleep | |
from typing import List | |
import random |
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/env python3 | |
# encoding=utf-8 | |
# vim: set nobomb: | |
from random import SystemRandom | |
from typing import List, Optional | |
def bitting(codes: int, macs: int, length: int, progress: Optional[List[int]]=None) -> List[int]: | |
if 0 == length: |
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/env python3 | |
# encoding=utf-8 | |
# vim: set nobomb: | |
from itertools import chain, cycle, repeat | |
from typing import Iterable, Iterator, Reversible, TypeVar | |
T = TypeVar('T') |