Skip to content

Instantly share code, notes, and snippets.

View drazisil's full-sized avatar
💭
Always Online - Somewhere

Molly Crendraven drazisil

💭
Always Online - Somewhere
View GitHub Profile
export function TCPListener({
incomingSocket,
config,
log,
onSocketData = onSocketData,
onSocketError = onSocketError,
}: {
incomingSocket: ISocket;
config: TServerConfiguration;
log: TServerLogger;
@drazisil
drazisil / bad.rs
Last active November 21, 2023 13:54
// This does not
// 1. Start by reading the encrypted session key and displaying it as an ascii string
let session_key = parsed_packet.get_encrypted_session_key();
debug!("Encrypted session key: {}", session_key);
// 2. Convert the ascii string to bytes
let session_key_bytes = hex::decode(session_key).unwrap();
error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file '/home/drazisil/racebox/tools/database/package.json'. Supply the `rootDir` compiler option to disambiguate.
Install Docker
Verify the `sudo egrep -c '(vmx|svm)' /proc/cpuinfo` is greater then 0
https://medium.com/axon-technologies/installing-a-windows-virtual-machine-in-a-linux-docker-container-c78e4c3f9ba1
sudo docker pull ubuntu:24.04
sudo docker run --privileged -it --name ubuntukvm --device=/dev/kvm --device=/dev/net/tun -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cap-add=NET_ADMIN --cap-add=SYS_ADMIN ubuntu:24.04 /bin/bash
[email protected] test
> vitest run
RUN v1.6.0 /home/drazisil/projects/probable-spoon
❯ test/connections.spec.js (1) 5009ms
❯ TCPServer (1) 5008ms
× should return an error if the port is in use 5008ms
@drazisil
drazisil / build-pdm.patch
Created August 13, 2024 11:37
fix: enable pdm to build itself for tools like pytest can find it
pyproject.toml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index c27dd99..67c08fc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -16,8 +16,9 @@ readme = "README.md"
license = {text = "MIT"}
function throwme() {
const err = new Error("foo");
err.cause = "bar";
throw err;
};
const expect = (fn) => {
const self = {};
self.fn = fn;
let thrown = false