Skip to content

Instantly share code, notes, and snippets.

Avatar
🐕

Bernard Xunnamius

🐕
View GitHub Profile
@Xunnamius
Xunnamius / crypto-pbkdf2-example.js
Created Jul 1, 2021 — 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
View crypto-pbkdf2-example.js
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 — forked from panoply/equal-width.md
2 column full width table for github markdown
View equal-width.md

Equal widths

Github markdown full-width 2 column table.

@Xunnamius
Xunnamius / unbound.conf
Created May 11, 2021 — forked from MatthewVance/unbound.conf
Config for running Unbound as a caching DNS forwarder (performance settings optimized for Raspberry Pi 2).
View unbound.conf
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 — forked from lepiaf/unbound.conf
Unbound configuration IPv4 and IPv6
View unbound.conf
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 Feb 27, 2021 — forked from ThomasLeister/rspamd-whitelisting.md
How to whitelist IP addresses or domains in Rspamd
View rspamd-whitelisting.md

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 Dec 1, 2021
[WINDOWS] Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2021-12-01T16:48:18.153Z","extensionVersion":"v3.4.3"}
@Xunnamius
Xunnamius / keyplay.sh
Created May 6, 2020
How to get fingerprints of public keys in pem files
View keyplay.sh
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
View void-vector.c
// vector.h
#ifndef VECTOR_H_
#define VECTOR_H_
#include <stdint.h>
#include "cexception_configured.h"
#define VECTOR_GROWTH_FACTOR 2
@Xunnamius
Xunnamius / dbh.c
Created May 6, 2020
Pretty print (kinda) some hex in C
View dbh.c
static void debug_print_hex(const uint8_t * data, size_t len)
{
for(size_t i = 0; i < len; i++)
fprintf(stderr, "0x%x ", data[i] & 0xFF);
fprintf(stderr, "\n");
}
@Xunnamius
Xunnamius / bomb.c
Created May 6, 2020
CMSC154-p2bomb-c
View bomb.c
/***************************************************************************
* cs154-2016 Project 2 Defusing a binary "bomb"
***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "support.h"
#include "phases.h"
FILE *infile;