Skip to content

Instantly share code, notes, and snippets.

View dzil123's full-sized avatar

Daniel Z. dzil123

  • California, US
  • 11:19 (UTC -08:00)
View GitHub Profile
@dzil123
dzil123 / build.sh
Last active November 14, 2023 09:39
#!/bin/bash
# ubuntu 20.04
sudo apt update; sudo apt dist-upgrade; sudo apt install libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev build-essential git cmake
mkdir src
cd src
curl -L https://github.com/raysan5/raylib/archive/refs/tags/4.5.0.tar.gz | tar xz
pushd raylib-4.5.0/src
@dzil123
dzil123 / explorer.py
Created October 7, 2023 09:17
MapleCTF 2023 Data Explorer solution
#!/bin/env python3
import math
import re
import sys
ALPHABET = "".join(chr(0x100 + x) for x in range(11 * 17))
PAYLOAD = """
WITH RECURSIVE
import builtins
import inspect
import sys
_print = builtins.print
def trace_func(frame, event, arg):
for l in [frame.f_globals, frame.f_locals]:
if l.get("print") is not None and l["print"] is not _print:
type Head<T extends unknown[]> = ((...args: T) => never) extends (
_: infer R,
...args: any
) => never
? R
: never;
type Tail<T extends unknown[]> = ((...args: T) => never) extends (
_: any,
...args: infer R
{
// Version 1:
interface Document {
buffers: Buffer[];
accessors: { [key: string]: number }; // number is an index into buffers
}
interface Buffer {
value: number | string | boolean;
}
@dzil123
dzil123 / diff.diff
Last active October 27, 2022 17:10
Planet ocean effect depth fix
diff --git a/shader.glsl b/shader.glsl
index ec7854a..3825944 100644
--- a/shader.glsl
+++ b/shader.glsl
@@ -140,31 +140,34 @@ void fragment() {
depth = exp(-depth);*/
// Normalized Device Coordinates needs to be -1 to 1 in Godot
- vec3 ndc = vec3(SCREEN_UV, depth) * 2.0 - 1.0;
+ vec3 ndc = vec3(SCREEN_UV * 2.0 - 1.0, depth);
@dzil123
dzil123 / client.py
Created July 25, 2022 05:08
DiceCTF@HOPE2022 web/inspect-me
import socket
import ssl
import h2.connection # pip install h2
HOST = "inspect-me.mc.ax"
def send_headers(h2conn, path, method, cookie):
headers = [
@dzil123
dzil123 / out.txt
Last active November 30, 2020 11:34
A parsing of packet_full.yaml with digmake: https://github.com/dzil123/digmake/commit/87ae458e
packet_len: 16, packet_id: 0x00, id_len: 1
Packet id: 0x00
[242, 5, 9, 108, 111, 99, 97, 108, 104, 111]...
Sent by client
Packet of type packet_inspector::do_one_packet::{{closure}}::Handshake:
Handshake {
protocol_version: 754,
address: "localhost",
port: 33333,
next_state: 2,
@dzil123
dzil123 / wasm.sh
Last active June 16, 2020 10:09
Helper to create and build projects with https://github.com/yewstack/yew as an alternative to wasm-pack
#!/usr/bin/bash
# uses bash specific features
# Formatted with 'shfmt -i 4 -w file.sh'
# set -e
# set -u
set -o pipefail
shopt -s lastpipe
@dzil123
dzil123 / main.rs
Created April 13, 2020 06:50
Pythagorean Theorem
use std::fmt::{self, Display};
fn main() {
let b = None;
let a = None;
let c = Some(5.0);
let ans = pyth(a, b, c).unwrap();
println!("Answer: {}", ans);
println!("{:?}", ans);