For excessively paranoid client authentication.
Original: https://gist.github.com/mtigas/952344
openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
For excessively paranoid client authentication.
Original: https://gist.github.com/mtigas/952344
openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
typedef uint8_t u08; | |
typedef uint32_t u32; | |
typedef uint64_t u64; | |
typedef int32_t i32; |
Poly File Layer | |
Idea: A single file content to represent a set of identical or similar files. | |
* Files can be templated. Files generated by the template are identical in the PFL (Poly File Layer) | |
* Files that have common lines, can be linked and marked as a Poly File. | |
Prior Art | |
* [ ] Read the paper | |
* Extracting a Unified Directory Tree to Compare Similar Software Products: https://sel.ist.osaka-u.ac.jp/lab-db/betuzuri/archive/1012/1012.pdf | |
* Fast Search in Hamming Space with Multi-Index Hashing: http://www.cs.toronto.edu/~norouzi/research/papers/multi_index_hashing.pdf |
package main | |
import ( | |
"crypto/x509" | |
"encoding/pem" | |
"errors" | |
"fmt" | |
"golang.org/x/crypto/ssh" | |
"io/ioutil" | |
"net" |
trap("SIGINT") { exit! } | |
total_width = `stty size`.scan(/\d+/)[1].to_i # terminal width | |
snowflakes = {} | |
puts "\033[2J"; # clearing output | |
loop do | |
snowflakes[rand(total_width)] = 0 |
#!/bin/sh | |
set -e | |
# Documentation and guides: | |
# https://docs.kernel.org/admin-guide/cgroup-v2.html | |
# https://lore.kernel.org/lkml/[email protected]/T/ | |
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_monitoring_and_updating_the_kernel/using-cgroups-v2-to-control-distribution-of-cpu-time-for-applications_managing-monitoring-and-updating-the-kernel | |
# remove if already exists | |
[ -e /sys/fs/cgroup/test1 ] && rmdir /sys/fs/cgroup/test1 |
#!/bin/ash | |
# list installed packages sorted by file size | |
apk info -e -s \* >/tmp/apksize | |
awk 'NR % 3 == 1' /tmp/apksize | cut -d ' ' -f 1 > /tmp/apkname | |
awk 'NR % 3 == 2' /tmp/apksize > /tmp/apksize2 | |
while read -r n unit; do | |
B=$n | |
case "$unit" in |
package main | |
type lruNode[K comparable, V any] struct { | |
prev *lruNode[K, V] | |
next *lruNode[K, V] | |
key K | |
value V | |
} | |
type LRUCache[K comparable, V any] struct { |
./linelen_hist.sh src '*.c' | |
COLS COUNT | |
2 1317 ████████████████████████████████████████████████████████████▌ | |
4 583 ██████████████████████████▏ | |
6 500 ██████████████████████▎ | |
8 253 ███████████▊ | |
10 264 ████████████▊ | |
12 448 ████████████████████▋ | |
14 417 ███████████████████▌ | |
16 476 █████████████████████▍ |
#!/usr/bin/env bash | |
mapfile -t words < <(grep -x '[a-z]\{5\}' "${WORDLIST:-/usr/share/dict/words}") | |
word=${words[RANDOM % ${#words[@]}]} pool=abcdefghijklmnopqrstuvwxyz | |
for ((round=1; round <= ${ROUNDS:=6}; round++)); do | |
while read -rp "$round/$ROUNDS: " guess || exit 1; do | |
[[ " ${words[@]} " == *" ${guess,,} "* ]] && guess=${guess,,} && break | |
done | |
for ((i=0, chars=0; i < ${#word}; i++)); do | |
[[ ${word:i:1} != ${guess:i:1} ]] && chars+=${word:i:1} | |
done |