Skip to content

Instantly share code, notes, and snippets.

View Xunnamius's full-sized avatar
🐕

Bernard Xunnamius

🐕
View GitHub Profile
@Xunnamius
Xunnamius / ANSI-Test.sh
Created October 21, 2022 07:09 — forked from mxmerz/ANSI-Test.sh
Shell script to test support of ANSI color and style codes
# ANSI Start Codes
# Styles.
Normal="\x1b[0m"
Bold="\x1b[1m"
Faint="\x1b[2m"
Italic="\x1b[3m"
Underline="\x1b[4m"
Blink_Slow="\x1b[5m"
Blink_Rapid="\x1b[6m"
@Xunnamius
Xunnamius / clear.bash
Created December 3, 2021 02:48
Completely clear / delete all the GitHub Actions workflow run history of a GitHub repository
for a in $(curl -qs "https://api.github.com/repos/<OWNER>/<REPO>/actions/runs" | jq -r '.workflow_runs[].id'); do curl -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: token <TOKEN>" "https://api.github.com/repos/<OWNER>/<REPO>/actions/runs/$a"; done
@Xunnamius
Xunnamius / crypto-pbkdf2-example.js
Created July 1, 2021 04:18 — forked from skeggse/crypto-pbkdf2-example.js
Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
var crypto = require('crypto');
// larger numbers mean better security, less
var config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// more iterations means an attacker has to take longer to brute force an
@Xunnamius
Xunnamius / equal-width.md
Created May 14, 2021 02:40 — forked from panoply/equal-width.md
2 column full width table for github markdown

Equal widths

Github markdown full-width 2 column table.

@Xunnamius
Xunnamius / unbound.conf
Created May 11, 2021 10:59 — forked from MatthewVance/unbound.conf
Config for running Unbound as a caching DNS forwarder (performance settings optimized for Raspberry Pi 2).
server:
###########################################################################
# BASIC SETTINGS
###########################################################################
# Time to live maximum for RRsets and messages in the cache. If the maximum
# kicks in, responses to clients still get decrementing TTLs based on the
# original (larger) values. When the internal TTL expires, the cache item
# has expired. Can be set lower to force the resolver to query for data
# often, and not trust (very large) TTL values.
cache-max-ttl: 86400
@Xunnamius
Xunnamius / unbound.conf
Created May 11, 2021 10:15 — forked from lepiaf/unbound.conf
Unbound configuration IPv4 and IPv6
server:
interface: 0.0.0.0
interface: ::0
access-control: 192.168.42.0/24 allow
access-control: 127.0.0.0 allow
access-control: 2001:db8:dead:beef::/48 allow
# unbound optimisation
num-threads: 4
@Xunnamius
Xunnamius / rspamd-whitelisting.md
Created February 27, 2021 02:28 — forked from ThomasLeister/rspamd-whitelisting.md
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = true;
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";
@Xunnamius
Xunnamius / cloudSettings
Last active March 22, 2023 01:29
[WINDOWS] Visual Studio Code Settings Sync Gist
{"lastUpload":"2023-01-13T13:14:51.619Z","extensionVersion":"v3.4.3"}
@Xunnamius
Xunnamius / keyplay.sh
Created May 6, 2020 16:58
How to get fingerprints of public keys in pem files
sudo openssl x509 -noout -fingerprint -md5 -inform pem -in /some/path/fullchain.pem
sudo openssl x509 -noout -fingerprint -sha1 -inform pem -in /some/path/fullchain.pem
sudo openssl x509 -noout -fingerprint -sha256 -inform pem -in /some/path/fullchain.pem
@Xunnamius
Xunnamius / void-vector.c
Created May 6, 2020 16:57
C void* vectors
// vector.h
#ifndef VECTOR_H_
#define VECTOR_H_
#include <stdint.h>
#include "cexception_configured.h"
#define VECTOR_GROWTH_FACTOR 2