Skip to content

Instantly share code, notes, and snippets.

View TunaCici's full-sized avatar
🌈
Vibing @ Boiler Room

Tuna TunaCici

🌈
Vibing @ Boiler Room
View GitHub Profile
@TunaCici
TunaCici / get-affinities.sh
Created March 13, 2024 17:02
[GNU/Linux] Get All Threads & Core Affinities of a Process w/o ps or taskset
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo "Usage ./get-affinities.sh <PID>"
exit 1
fi
pid=$1
if [ ! -d "/proc/${pid}" ]; then
@TunaCici
TunaCici / misra-2004-pclint-rules.json
Created October 26, 2023 07:40
MISRA C 2004 PCLint Rules in JSON Format (Referenced from au-misra2.lnt)
{
"MISRA_C_2004": {
"description": "MISRA C 2004 ruleset.",
"sections": [
{
"name": "1. Environment",
"ruleset": [
{
"name": "Rule 1.1",
"description": "All code shall conform to ISO/IEC 9899:1990.",
@TunaCici
TunaCici / decompile-dtb.md
Created June 28, 2023 18:12
[GNU/Linux] Decompile Device Tree Blob File /w device-tree-compiler

Install device-tree-decompiler

Using apt:

$ apt install device-tree-compiler

Using pacman:

pacman -S dtc
@TunaCici
TunaCici / printf_benchmark.c
Last active May 30, 2023 08:36
Very basic C code that benchmarks both the 'stdio' and the 'printf' function. WARNING: This is an extremely simple benchmark. The results heavily depend on your 'terminal', 'stdio' and 'printf' implementation.
/*
* Author: Tuna Cici
* Date: 30 May 2023
*
* This file contains the benchmarking code for the 'printf' function.
* It is used to measure the time it takes to print a string to the 'stdout'.
*
*/
#if defined(_WIN32) || defined(_WIN64)