Skip to content

Instantly share code, notes, and snippets.

View yigtuyumz's full-sized avatar
💭
✋🏻

Yiğit Uyumaz yigtuyumz

💭
✋🏻
View GitHub Profile
@yigtuyumz
yigtuyumz / libsanctlua.c
Last active September 30, 2026 01:35
Sanct Lua Module
// Compile
/* rm -f libsanctlua.so ; \ */
/* gcc -shared -fPIC -Wall -Wextra -Werror -std=c99 \ */
/* -I./tools/luasrc/lua55/include \ */
/* -o libsanctlua.so libsanctlua.c \ */
/* -L./tools/luasrc -llua55 \ */
/* -Wl,-rpath,./tools/luasrc */
// Lua auxilary library header, includes most of the typedefs and definitions
@yigtuyumz
yigtuyumz / memdump.c
Last active June 12, 2026 01:08
memdump.c
#include <unistd.h>
static const char *const g_hextable = "0123456789abcdef";
static void
ft_putaddr(unsigned char *buffer, unsigned long addr,
unsigned char *buffer_index)
{
char shift;
@yigtuyumz
yigtuyumz / Makefile
Last active October 13, 2026 00:57
Static & Dynamic Libraries in Makefile
################################################################################
# Project Metadata #
################################################################################
AUTHOR := yigtuyumz
VERSION_MAJOR := 1
VERSION_MINOR := 0
VERSION_PATCH := 0
VERSION := $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
NAME := sanctmake
@yigtuyumz
yigtuyumz / sanct_arch.sh
Last active January 8, 2026 04:00
Arch Linux Intallation for x86_86-efi UEFI + GRUB + BTRFS + PHYSICAL SWAP + ZRAM
###############################################################################
# ARCH LINUX - UEFI + GRUB + BTRFS + PHYSICAL SWAP + ZRAM
###############################################################################
###############################################################################
# PRE-INSTALLATION: PREPARE INSTALLATION MEDIA (ON HOST MACHINE)
###############################################################################
# Replace /dev/sda with your actual USB drive identifier
sudo dd if=/path/to/archlinux.iso of=/dev/sda bs=4M status=progress oflag=sync
@yigtuyumz
yigtuyumz / generate_uniq.sh
Last active February 16, 2026 09:51
Generate Random Unique Integers Within a Range
#!/usr/bin/env bash
print_help() {
cat <<EOF
Usage: $0 -m <MIN> -M <MAX> [OPTIONS]
Generate a list of unique random numbers and optionally pass them as arguments
to a program. If no program is specified, './a.out' is used by default. If this
file does not exist or is not executable, the generated list is printed to the
STDOUT.
@yigtuyumz
yigtuyumz / my_alloc.c
Created August 28, 2025 10:58
Basic Memory Allocator With Thread Safety & Error Status
/* compile it via gcc my_alloc.c -lpthread */
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <errno.h>
#include <pthread.h>
typedef struct header_s {
size_t size;
AS := nasm
ASFLAGS := -felf64 -O0 -dwarf -g
LD := ld
LDFLAGS :=
ASM_SRCS := div.s
ASM_OBJS := $(ASM_SRCS:.s=.o)
ASM_EXEC := $(ASM_SRCS:.s=)
TARGET := $(ASM_EXEC)
@yigtuyumz
yigtuyumz / large_files.sh
Last active September 8, 2025 10:59
Display Large Files in Given Path
#!/usr/bin/env bash
usage() {
echo "Usage: ${0} [OPTION]... [PATH] [N]"
echo
echo "List the N largest files in a given directory."
echo
echo "Arguments:"
echo " PATH The directory to search for files (required)."
echo " N The number of largest files to list (required)."
@yigtuyumz
yigtuyumz / SooprCOW.sh
Last active July 15, 2025 21:58
Super QCOW2 Starter for x86_64 Hosts
#!/usr/bin/env bash
# For the first time run, don't use this script!!! Use:
# qemu-system-x86_64 -m 1024 -nographic -serial mon:stdio
SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
# QEMU binary
QEMU="qemu-system-x86_64"
@yigtuyumz
yigtuyumz / network.sh
Created May 13, 2025 10:00
FreeBSD Network Interface Configuration
#!/usr/bin/env bash
#
# FreeBSD Network Interface Configuration
# Feel free to set your settings for inet, netmask and defaultrouter.
# This script modifies em0 interface only. (Soon, interface name can be configured.)
# inet: IPv4 Address for the interface
# netmask: subnet mask for the interface
# defaultrouter: network gateway address
#