Skip to content

Instantly share code, notes, and snippets.

View insilications's full-sized avatar
🐼

Francisco Boni insilications

🐼
View GitHub Profile
@osy
osy / tpm-rant.md
Last active June 24, 2025 10:23
TPM provides zero practical security

TPM provides zero practical security

TPM (Trusted Platform Module) is as useful for preventing real attackers as the TSA is at preventing real terrorists. The architecture is fundamentally flawed and most existing implementations are completely broken. I thought this argument was settled decades ago[1] when "trusted computing" was introduced mostly as a way to provide DRM and ownership capabilities to organizations. It has largely failed to impact the consumer market when it was introduced back in the early 2000s. However, recently there seems to be a movement by certain parties to reintroduce this failed product back to the market. Microsoft argues that in order to use Windows 11, you need TPM 2.0 compatible hardware because[2]:

The Trusted Platform Module(TPM) requirement ena

# calculation are based on http://www.esreality.com/index.php?a=post&id=1945096
# assuming windows 10 uses the same calculation as windows 7.
import struct
# set according to your device:
device_dpi = 304 # mouse/touchpad dpi
screen_dpi = 157
sample_point_count = 30
sensitivity_factor = 1.0
# sensitivity factor translation table: (windows slider notches)
@betafcc
betafcc / mypy_operators.py
Created October 14, 2022 18:52
Mypy type-level operators
from __future__ import annotations
from typing import (
Any,
Awaitable,
Callable,
Iterable,
Literal,
Mapping,
ParamSpec,
@yinonburgansky
yinonburgansky / windows-acceleration-function.py
Last active June 15, 2025 22:18
windows acceleration function
# calculation are based on http://www.esreality.com/index.php?a=post&id=1945096
# assuming windows 10 uses the same calculation as windows 7.
# guesses have been made calculation is not accurate
# touchpad users make sure your touchpad is calibrated with `sudo libinput measure touchpad-size`
# import matplotlib.pyplot as plt
import struct
# set according to your device:
xinput_device_id = 13
device_dpi = 1000 # mouse dpi
@JohannesMP
JohannesMP / EnableDiscordDevExperiments.md
Last active July 2, 2025 15:25 — forked from ExordiumX/betaenabler.js
Enabling Discord Dev Experiments on Discord for Windows (2022-02)

Enable Dev Experiments in Discord for Windows

image

This guide shows how to enable dev mode for the Discord desktop application running on Windows (as of February 2022).

This can be used to view beta experiments to try features currently in development that are included but hidden by default in Discord release builds.


@Amanieu
Amanieu / pie_reloc.rs
Created August 25, 2021 00:53
PIE self-relocation in Rust
/// Processes all relocations in the ELF dynamic section
unsafe fn process_pie_relocations(auxv: &mut AuxVec) {
// Locate the PT_DYNAMIC segment in the program headers. If we don't have
// a .dynamic section then it means that we are a static executable and
// don't need any relocations.
let pt_dynamic = auxv
.phdr
.iter()
.filter(|p| p.p_type == linux::PT_DYNAMIC)
.next();
@joanbm
joanbm / nvidia-fix-linux-5.14.patch
Created July 12, 2021 19:03
Tentative fix for NVIDIA 465.31 driver for Linux 5.14-rc1
From f18c541edc5e122b06b0c1e65d0a422f0b8109e7 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <[email protected]>
Date: Fri, 2 Jul 2021 02:09:58 +0200
Subject: [PATCH] Tentative fix for NVIDIA 465.31 driver for Linux 5.14-rc1
---
common/inc/nv-time.h | 6 ++++++
nvidia-drm/nvidia-drm-drv.c | 4 ++++
2 files changed, 10 insertions(+)
@reveng007
reveng007 / All_about_static_and_dynamic_in_linux.md
Last active April 28, 2025 19:02
`Static` vs `Dynamic` library in `Linux`, `PIC`,`PIE`, `plt`, `got`, `Virtual vs Physical Addresses`:

Static vs Dynamic library in Linux, PIC, PIE, plt, got, Virtual vs Physical Addresses:


plt ---> procedure linkage table
logical addresses ---> virtual addresses
virtual address space (VAS) or address space ---> is the set of ranges of virtual addresses that an operating system makes available to a process.
memory management unit (MMU) or paged memory management unit (PMMU) ---> is a computer hardware unit having all memory references passed through itself, primarily performing the translation of virtual memory addresses to physical addresses.
Virtual address space randomization ----> Address space layout randomization ----> (ASLR)

NOTE:

@l0k18
l0k18 / caching.md
Created April 18, 2021 00:28
script for increasing linux memory caching

The following is a bundle of sysctl and other things to make linux keep more data from disk in memory.

The last line specifically precaches a huge amount of file data immediately to memory, you should use du -h -d0 /path/to/somewhere' to find out how big the paths you set for this. A typical /usr` folder on current linux will be around 7gb, and my go compilation cache sits at around 11gb, which is comfortable in 32gb and it definitely speeds things up.

#!/bin/bash
modprobe bfq
for d in /sys/block/nvme0*
do
 # HDD (tuned for Seagate SMR drive)