Skip to content

Instantly share code, notes, and snippets.

View Xunnamius's full-sized avatar
🐕

Bernard Xunnamius

🐕
View GitHub Profile
@Xunnamius
Xunnamius / cloudSettings
Last active March 22, 2023 01:27
[LINUX] Visual Studio Code Settings Sync Gist
{"lastUpload":"2023-02-12T14:30:28.930Z","extensionVersion":"v3.4.3"}
@Xunnamius
Xunnamius / gist:81e7dc01a6ec525156c6f7f2929d89ee
Created May 6, 2020 16:29
(Q3 2019) Tracking the progress on the various use case scenarios we come up with for SwitchCrypt

Use Cases

Intra-file Variable Security Regions (VSR)

[StrongBox UC flag: uc_secure_regions]

Communicating classified materials, grand jury testimony, national secrets, etc. require the highest level of discretion when handled, yet sensitive information like this often appears within a (much) larger amount of data that we care less about in context.

@Xunnamius
Xunnamius / workaround.md
Created May 6, 2020 16:52
WSL2 External Host (LAN) Access Workaround

Step 1: netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=3000 connectaddress=localhost connectport=3000
Step 2: Add Allow local routing to ports 3000-4000 rule to Windows Firewall's inbound connection ruleset

@Xunnamius
Xunnamius / DIGEST_FORWARDING.sql
Last active May 6, 2020 16:55
Epic SQL: DIGEST_FORWARDING (used in my Postfix instances)
DROP FUNCTION DIGEST_FORWARDING;
DELIMITER //
CREATE FUNCTION DIGEST_FORWARDING (s VARCHAR(80))
RETURNS TEXT
DETERMINISTIC
LANGUAGE SQL
CONTAINS SQL
SQL SECURITY INVOKER
@Xunnamius
Xunnamius / blitz.sh
Last active May 6, 2020 16:55
Blitz, the dirty server stress tester
#!/bin/bash
# A little program to quickly stress test a server
# blitz <url> <# of requests> <method>
# <url> defaults to localhost
# <# of requests> defaults to 30
# <method> defaults to POST
# Probably a good idea to type method names with capital letters
@Xunnamius
Xunnamius / uncirc_recirc.js
Created May 6, 2020 16:56
Circular JSON Implementation: `uncirc` and `recirc` for stringifying/parsing circular objects in JavaScript
// Takes an object and replaces the circular references (including deep circular references) with strings
var uncirc = function(obj, ident, seen)
{
seen = seen || {};
// Push the object identity (key) and object (value) onto the "seen" list
seen[ident] = obj;
// Returns the ident of a value or null if we have not yet seen it
// Could have made this an anonymous function
@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
@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 / 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 / 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");
}