Skip to content

Instantly share code, notes, and snippets.

View Xunnamius's full-sized avatar
🐕

Bernard Xunnamius

🐕
View GitHub Profile
@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
@Xunnamius
Xunnamius / dbh.c
Created May 6, 2020 16:57
Pretty print (kinda) some hex in 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 16:57
CMSC154-p2bomb-c
/***************************************************************************
* cs154-2016 Project 2 Defusing a binary "bomb"
***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "support.h"
#include "phases.h"
FILE *infile;
@Xunnamius
Xunnamius / puzzle1.js
Created May 6, 2020 16:57
L's Puzzle #1 (Christmas)
var c=String.fromCharCode,f=function(...n){m='';n.forEach(function(x){m+=(x==32?' ':c(97+x));});return m;};throw f(-39,32, 3,8,3,32,24,7 + 7,20,32,19,7,8,13,10,32,8,19,32,22,14,20,11,3,32,1,4,32,19,7,0,19,30 + 2,4,0,18,24,-34); f(14,7)+","+f(32,24,14,20,32,9 + 9,14,11,21,4,3,32,8,19)+"!"+f(32,22,4,11,11)+","+f(32,3 + 3,14,14,3,32,5,14,17,64 / 2,24,14,20)+"."+f(32,12,4,17,17,24,32,2,7,17,8,18,19,12,0,18,32,24,0,32,4,23,19,17,0,14,17,3,8,13,0,17,24,32,11,8,19,19,11,4,32,15,17,14,19,4,6,4,18,32,14,5,32,12,8,13,4)+". "+f(24,14,20,32,7,0,21,4,32,12,0,3,4,32,19,17,20,11,24,32,8,12,15,17,4,18,18,8,21,4,32,15,17,14,6,17,4,18,18)+","+f(32,1,20,19,32,24,14,20,32,7,0,21,4,32,0,32,11,14,13,6,32,22,0,24,18,32,19,14,32,6,14)+"! "+f(13,14,19,32,19,14,14,32,11,14,13,6)+","+f(32,19,7,14,20,6,7)+". remain "+f(12,4,11,11,14,22)+","+f(32,5,14,17,32,24,14,20,32,0,17,4,32,13,4,0,17,4,17,32,19,7,0,13,32,24,14,20,32,12,0,24,32,19,7,8,13,10)+". "+"~L";
# Solved by Ricky
# Solved by Abe
@Xunnamius
Xunnamius / odroidxu3_sensors.sh
Created May 6, 2020 16:56
OdroidXU3(+E) Sensor Read (shell)
#!/bin/bash
# enable the sensors
echo 1 > /sys/bus/i2c/drivers/INA231/4-0045/enable
echo 1 > /sys/bus/i2c/drivers/INA231/4-0040/enable
echo 1 > /sys/bus/i2c/drivers/INA231/4-0041/enable
echo 1 > /sys/bus/i2c/drivers/INA231/4-0044/enable
# settle two seconds to the sensors get fully enabled and have the first reading
sleep 2