Skip to content

Instantly share code, notes, and snippets.

View wtfbbqhax's full-sized avatar
🦧

Victor Roemer wtfbbqhax

🦧
View GitHub Profile
@wtfbbqhax
wtfbbqhax / FNV1a128Hash.cpp
Last active April 8, 2023 23:24
FNV1a128 Hash from Go ported to C++
#include <iostream>
#include <cstring>
#include <cstdint>
#include <cmath>
#include <array>
#include <vector>
#include <cstdint>
#include <tuple>
@wtfbbqhax
wtfbbqhax / system-memory.awk
Created May 18, 2022 02:33
Reading System Memory with Awk (parsing /proc/mem)
#!/usr/bin/awk -f
/MemTotal/ { mem_total=$2 }
/MemFree:/ { mem_free=$2 }
/MemAvail/ { mem_avail=$2 }
/AnonPage/ { anon_pages=$2 }
/Mapped: / { mapped=$2 }
/Slab: / { mapped=$2 }
END {
print "TOTAL FREE AVAILABLE ANON MAP SLAB BUF CACHE DIRTY"
@wtfbbqhax
wtfbbqhax / Dockerfile
Created April 24, 2022 19:52
AbcIP built for Webassembly runtime
FROM emscripten/emsdk:3.1.7 as emsdk
ENV LIBPCAP="libpcap-1.10.1"
RUN apt-get update
RUN apt-get install -y flex bison
RUN wget https://www.tcpdump.org/release/.tar.gz
COPY .sha .
#RUN sha256sum -c .sha
@wtfbbqhax
wtfbbqhax / vim_luajit.patch
Created April 9, 2022 04:02 — forked from shirosaki/vim_luajit.patch
Add --with-luajit to link vim with luajit
diff --git a/src/Makefile b/src/Makefile
--- a/src/Makefile
+++ b/src/Makefile
@@ -376,18 +376,22 @@ CClink = $(CC)
# Uncomment the next line to fail if one of the requested language interfaces
# cannot be configured. Without this Vim will be build anyway, without
# the failing interfaces.
#CONF_OPT_FAIL = --enable-fail-if-missing
# LUA
@wtfbbqhax
wtfbbqhax / PowerShell Notes.md
Last active June 14, 2018 21:22
PowerShell learning

Providers

Show all providers

Get-PSProvider

Working with the alias provider

@wtfbbqhax
wtfbbqhax / set_rotation.lua
Last active December 28, 2017 18:30
Tremulous: set a rotation on the reactor via lua
reactor = game.gentity_t.find(nil, 'team_human_reactor')
reactor:set_rotation(0, 360, 0)
@wtfbbqhax
wtfbbqhax / test.lua
Created December 27, 2017 18:06
Tremulous: Lua control of game entities
-- This script moves the Reactor into the positon of an Acid tube.
reactor = game.gentity_t.find(nil, 'team_human_reactor')
ent = game.gentity_t.find(nil, 'team_alien_acid_tube')
ent.health = 0
ent.die(ent, ent, ent, 100, 0)
reactor.origin = ent.origin
pcapfifo
https://github.com/wtfbbqhax/pcapfifo
backtrace
https://github.com/wtfbbqhax/backtrace
libunified2
https://github.com/wtfbbqhax/libunified2
u2json
@wtfbbqhax
wtfbbqhax / README.md
Created November 1, 2017 15:37
Rename a whole lot'a shit at once

Recursively s/SFXHASH/XHash/g in all .cc, .h and .c source files

rpl -R -x.cc -x.h -x.c SFXHASH XHash .

@wtfbbqhax
wtfbbqhax / files.c.diff
Created November 17, 2016 07:03
Search gamedir last, "base" first.
diff --git a/Makefile b/Makefile
index fb5e233..a333a50 100644
--- a/Makefile
+++ b/Makefile
@@ -2588,7 +2588,7 @@ UIVMOBJ = $(UIOBJ_:%.o=%.asm)
$(B)/$(BASEGAME)/ui$(SHLIBNAME): $(UIOBJ)
$(echo_cmd) "LD $@"
- $(Q)$(CC) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(UIOBJ)
+ $(Q)$(CC) -I${ASSETS_DIR}/ui $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(UIOBJ)