Skip to content

Instantly share code, notes, and snippets.

View theoparis's full-sized avatar
🔥
Compiling LLVM with -fskibidi -Ohio -march=rizz

Theo Paris theoparis

🔥
Compiling LLVM with -fskibidi -Ohio -march=rizz
View GitHub Profile
@theoparis
theoparis / index.ts
Created April 28, 2023 09:45
thash zig + bun backup
const modes = {
argon2d: 0,
argon2i: 1,
argon2id: 2,
};
export type Mode = keyof typeof modes;
export type WasmExports = {
memory: { buffer: ArrayBuffer };
hptr: () => number;
@theoparis
theoparis / shell.nix
Last active March 31, 2023 06:19
LLVM MLIR Nix Shell
# BSD Zero Clause License
#
# Copyright (c) 2023 Theo Paris
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
@theoparis
theoparis / idevicerestore.sh
Last active April 2, 2023 01:46
idevicerestore.sh
#!/bin/sh
set -oux
git clone https://github.com/libimobiledevice/libirecovery -j$(nproc)
git clone https://github.com/libimobiledevice/idevicerestore -j$(nproc)
git clone https://github.com/libimobiledevice/libimobiledevice-glue -j$(nproc)
git clone https://github.com/libimobiledevice/usbmuxd -j$(nproc)
git clone https://github.com/libimobiledevice/libimobiledevice -j$(nproc)
git clone https://github.com/libimobiledevice/libusbmuxd -j$(nproc)
git clone https://github.com/libimobiledevice/libplist -j$(nproc)
@theoparis
theoparis / main.rs
Last active March 1, 2023 16:46
rust + hyper http dynamic routing
#![feature(async_closure)]
use crate::handler::router::handle;
use anyhow::Result;
use futures::future::FutureExt;
use handler::router::DynamicRouter;
use hyper::{
service::{make_service_fn, service_fn},
Body, Response, Server, StatusCode,
};
use matchit::Router;
@theoparis
theoparis / build.zig
Created October 30, 2022 03:56
build.zig wip errors
const std = @import("std");
const builtin = @import("builtin");
const builder = @import("builder/main.zig");
const Features = std.Target.x86.Feature;
const kernel_build_mode: std.builtin.Mode = .Debug;
const user_build_mode: std.builtin.Mode = .ReleaseSafe;
const target = blk: {
@theoparis
theoparis / build.sh
Last active October 28, 2022 22:36
build statically linked cross gcc compiler (assumes you have downloaded the sources and prequsities for gcc)
#!/bin/sh
set -e
TARGET=${TARGET:-"x86_64-linux-musl"}
PREFIX=${PREFIX:-"/usr/local/dev/gcc"}
CC=${CC:-"gcc"}
CXX=${CXX-"g++"}
LANGUAGES=${LANGUAGES:-"c,c++,go"}
./configure \
const std = @import("std");
const c = @cImport({
// linux networking headers for modifying interfaces
@cInclude("ifaddrs.h");
@cInclude("net/if.h");
@cInclude("sys/ioctl.h");
});
pub const SIOCGIFINDEX = 0x8933;
pub const SIOCGIFFLAGS = 0x8934;
@theoparis
theoparis / build.sh
Last active November 20, 2022 09:00
build llvm and clang 16 statically
#!/bin/sh
set -e
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lldb;lld;mlir" \
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-unknown-linux-musl" \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
-DLLVM_BUILD_STATIC=ON \
-DLLVM_USE_LINKER=mold \
@theoparis
theoparis / uncrustify.cfg
Created October 19, 2022 03:58
uncrustify config for c++
indent_with_tabs = 2
align_with_tabs = true
input_tab_size = 2
output_tab_size = 2
indent_columns = 2
indent_paren_close = 2
indent_continue = 2
nl_func_call_start_multi_line = true
nl_func_call_args_multi_line = true
nl_func_call_end_multi_line = true
@theoparis
theoparis / .config
Last active October 21, 2022 05:31
linux 6.0.1 kernel config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.0.1 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=120200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23900