Skip to content

Instantly share code, notes, and snippets.

View hartraft's full-sized avatar
🍻

hartraft

🍻
  • Belgium
View GitHub Profile
@hartraft
hartraft / bench-rk3588.md
Last active January 8, 2024 02:11
Digging into MariaDB for MariaDB Internals hack by Phil Eaton https://eatonphil.com/2024-01-wehack-mysql.html

Creating mysqld link
[100%] Built target mariadbd
Creating mariabackup link
[100%] Built target mariadb-backup
make -j$(nproc)

5106.18s user
613.70s system
726% cpu
@hartraft
hartraft / macos-post-install.md
Created December 4, 2023 11:29
A few essential tools after getting a Mac
  • Rectangle - Windows+Left/Right equivalent
  • Clippy - Windows+Shift+V for copy/paste history
  • Alt tab - Standard windows switching behaviour instead of stupid switch by "Application"
@hartraft
hartraft / danger.sh
Created November 23, 2023 13:06
However, it's essential to use eval with caution because it can introduce security risks, especially if the input to eval is not sanitized properly. If the content being evaluated includes user input or external data, there's a risk of code injection. Avoid using eval with untrusted input. Here's an example of a risky use of eval:
#!/bin/bash
user_input="; rm -rf /"
# This is dangerous!
eval "echo Hello $user_input World"
@hartraft
hartraft / README.md
Created September 29, 2023 22:01
CRiU - Checkpoint/Restore in Userspace in aarch64 demonstration

CRiU

Using the simple example from the website. https://criu.org/Simple_loop

Install CRiU

sudo apt update
sudo apt install criu

# Check criu is installed with the correct kernel
@hartraft
hartraft / free-backend-hosting.md
Created August 1, 2023 10:15 — forked from bmaupin/free-backend-hosting.md
Free backend hosting
-- Cache and table hit rates for Postgres
SELECT
'index hit rate' AS name,
(sum(idx_blks_hit)) / nullif(sum(idx_blks_hit + idx_blks_read),0) AS ratio
FROM pg_statio_user_indexes
UNION ALL
SELECT
'table hit rate' AS name,
sum(heap_blks_hit) / nullif(sum(heap_blks_hit) + sum(heap_blks_read),0) AS ratio
FROM pg_statio_user_tables;
@hartraft
hartraft / ignore.txt
Created March 21, 2020 13:11
Syncthing file ignore list
# This file contains fixed global exclude patterns
*~
~$*
.~lock.*
~*.tmp
]*.~*
]Icon\r*
].DS_Store
].ds_store