Skip to content

Instantly share code, notes, and snippets.

View tracker1's full-sized avatar

Michael J. Ryan tracker1

View GitHub Profile
@tracker1
tracker1 / settings.json
Created June 21, 2023 23:22
Synchronet VS Code Settings
{
"editor.rulers": [76, 80],
"editor.formatOnSave": true,
"editor.tabSize": 2,
"files.associations": {
"*.ssjs": "javascript",
"*.msg": "plaintext",
"*.ans": "plaintext",
"*.asc": "plaintext",
"*.rip": "plaintext",
@tracker1
tracker1 / terminal_info.rs
Created March 17, 2023 14:41
Terminal Information
use std::io::{self, Read, Write};
use std::net::TcpStream;
fn get_remote_terminal_info(stream: &mut TcpStream) -> io::Result<(u16, u16, bool, bool, bool)> {
// Send the control code to query the size of the terminal
write!(stream, "\x1b[18t")?;
stream.flush()?;
// Read the response from the terminal
let mut buf = [0u8; 32];
let n = stream.read(&mut buf)?;
@tracker1
tracker1 / docker-compose.yml
Created July 7, 2022 21:51
Docker PiHole + Wireguard + Caddy Proxy
# after starting (docker-compose up -d)
# run docker-compose logs wireguard to view the qr-code for wireguard clients
version: "2.2"
# network required to specify ip for services
networks:
vpnet:
driver: bridge
ipam:
config:
@tracker1
tracker1 / logging.ts
Created August 18, 2021 02:05
TypeScript Standard Loggerr
import fclone from "fclone";
export enum LogLevel {
Fatal = -1,
Error = 0,
Warn = 1,
Info = 2,
Debug = 3,
Trace = 4,
}
# RoughneckBBS Compose File
version: "3.3"
services:
sbbs:
container_name: sbbs
image: bbsio/synchronet:nightly-20210314
restart: always
command: bash -c "sbbs-init && /sbbs/exec/sbbs w- s- m- f-"
volumes:
- $PWD/ctrl:/sbbs/ctrl
@tracker1
tracker1 / Password References.md
Created April 19, 2021 23:00 — forked from technion/Password References.md
A set of references on modern password policies

References on modern password policies

Below links provide source, reference link and relevant quote

Standards

NIST

https://github.com/usnistgov/800-63-3/blob/nist-pages/sp800-63b/sec5_authenticators.md

Verifiers SHOULD NOT impose other composition rules (e.g., requiring mixtures of different character types or prohibiting consecutively repeated characters) for memorized secrets. Verifiers SHOULD NOT require memorized secrets to be changed arbitrarily (e.g., periodically).However, verifiers SHALL force a change if there is evidence of compromise of the authenticator.

Major organisations

@tracker1
tracker1 / hash-passphrase.js
Created September 1, 2020 20:53
Passphrase Hashing
import util from 'util';
import crypto from 'crypto';
const HASH_ALGO = 'sha512';
// nist recommends 10000, 10x nist, approx 83ms on i7-8650U
const HASH_ITERATIONS = 100000;
const HASH_SALT_BYTES = 16; // Exceeds NIST Minimum 32/8 (4 bytes)
const HASH_BYTES = 64; // Match Hash Algorithm lengh / bits (512 / 8);
function sanitizeHtml(input) {
if (typeof input !== 'string') return input;
if (input.indexOf('<') === -1) return input;
const div = document.createElement('div');
div.innerHTML = input;
div.querySelectorAll('script').forEach((el) => el.remove());
div.querySelectorAll('style').forEach((el) => el.remove());
div.querySelectorAll('*').forEach((el) => {
const events = el.getAttributeNames().filter((a) => a.indexOf('on') === 0);
@tracker1
tracker1 / text.dat.js
Created June 15, 2020 05:21
Synchronet Default text.dat as JavaScript
// save to (exec/mods)/text.dat.js - at the top of login/login/shell files, load('text.dat.js')
bbs.replace_text(/* MsgSubj */ 1, "\1n\1h\1c\xda\xc4\xc4\xc4\xc4\xc4\xc4\1n\xc4\xc4\xc4\xc4\xc4\xc4\1h\1k\xc4\xc4\xc4\xc4\xc4\xc4\xc4\1n\1c\xc4\xc4\xc4\xc4\xc4\xfa\xfa\xfa\xfa\r\n\1h\xb3 \1bSubj\1n\1b: \1h\1c%.70s");
bbs.replace_text(/* MsgAttr */ 2, "\r\n\xb3 \1bAttr\1n\1b: \1h\1c%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s");
bbs.replace_text(/* MsgTo */ 3, "\r\n\xb3 \1bTo \1n\1b: \1h\1c%.70s");
bbs.replace_text(/* MsgToExt */ 4, " #%s");
bbs.replace_text(/* MsgToNet */ 5, " (%.40s)");
bbs.replace_text(/* MsgFrom */ 6, "\r\n\1w\xb3 \1bFrom\1n\1b: \1h\1c%.33s");
bbs.replace_text(/* MsgFromExt */ 7, " #%s");
bbs.replace_text(/* MsgFromNet */ 8, " (%.35s)");
bbs.replace_text(/* MsgDate */ 9, "\r\n\1w\xb3 \1bDate\1n\1b: \1h\1c%.24s %s (%s)\r\n\1w\xc0\xc4\xc4\xc4\xc4\xc4\xc4\1c\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\1n\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\1h\1k\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\1n\1c\xc4\xc4\xc4\xc4\xc4\xc4\xc4\
@tracker1
tracker1 / .eslintrc.js
Created May 11, 2020 23:07
eslint-prettier
module.exports = {
parser: 'babel-eslint',
extends: ['plugin:prettier/recommended', 'prettier/react'],
plugins: ['prettier', 'jest'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
},