Skip to content

Instantly share code, notes, and snippets.

View madalinignisca's full-sized avatar
🏡
Open for business

Madalin Ignisca madalinignisca

🏡
Open for business
View GitHub Profile
@madalinignisca
madalinignisca / README.md
Last active February 24, 2026 00:57
Setup a clean cloud Ubuntu vm for Claude to work in it

Claude Code VM Setup

Idempotent bootstrap script for an Ubuntu 24.04 LTS development VM
optimised for Claude Code agent sessions.

Run it once to install everything. Run it again to update. Safe, transparent, and documented at every step.


Why this script?

@madalinignisca
madalinignisca / htoprc
Created November 15, 2025 06:09
htop config
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
# requires libsensors
htop_version=3.2.2
config_reader_min_version=3
fields=0 48 17 18 38 39 40 2 46 47 49 1
hide_kernel_threads=1
hide_userland_threads=0
hide_running_in_container=1
shadow_other_users=0
@madalinignisca
madalinignisca / README.md
Created August 25, 2025 06:37
Percona MySQL benchmarks for Hetzner servers

Some benchmark results.

Comparison of current results:

Server Total time (s) Transactions (total) TPS Queries (total) QPS Read (total) Write (total) Other (total) Latency avg (ms) Latency 95th percentile (ms)
Server AX102 (btrfs: compression=zstd:3) 60.00 147,450 2,457.32 2,949,000 49,146.33 2,064,300 589,800 294,900 3.25 4.91
Cloud Server CAX31 60.01 100,983 1,682.83 2,023,574 33,721.77 1,417,164 404,201 202,209 4.75 7.98

Notes:

@madalinignisca
madalinignisca / unattended_upgrades_setup.go
Created November 13, 2024 20:37
Source code for setting up unattended upgrades with compiled binary
// unattended_upgrades_setup.go
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
@madalinignisca
madalinignisca / setup_unattended_upgrades.sh
Last active November 19, 2024 08:13
Setup Unattended Upgrades on Debian All-In-One bash script.
#!/bin/bash
# setup_unattended_upgrades.sh
# This script configures Debian's Unattended Upgrades to:
# 1. Automatically update all packages.
# 2. Automatically restart services after upgrades.
# 3. Automatically respond "no" to configuration file replacement prompts.
# 4. Limit system reboots to once every two weeks if strictly required.
set -e # Exit immediately if a command exits with a non-zero status.
@madalinignisca
madalinignisca / ufw.md
Created June 15, 2024 19:19 — forked from kimus/ufw.md
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@madalinignisca
madalinignisca / debian-preseed-simple.cfg
Last active May 13, 2024 09:45
Debian installer preseed PCI compliant minimal
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/language string en
d-i debian-installer/country string ES
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto
d-i hw-detect/load_firmware boolean true
d-i mirror/protocol string http
@madalinignisca
madalinignisca / pgdata.md
Created April 2, 2024 19:25
PostgreSQL data directory structure

If you can connect using psql, then you can use this command:

postgres=# SHOW data_directory;
data_directory
-----------------------
/opt/postgres/data/

| directory | description |

@madalinignisca
madalinignisca / rename.sql
Created March 27, 2024 22:23
Rename schema to public in a postgresql database
BEGIN TRANSACTION;
ALTER SCHEMA public RENAME TO public_original;
ALTER SCHEMA my_db RENAME TO public;
DROP SCHEMA public_original CASCADE;
COMMIT;
@madalinignisca
madalinignisca / handle_not_found_404.go
Created February 19, 2024 15:17
GO net/http tips
package main
import (
"fmt"
"net/http"
)
func helloWorld(w http.ResponseWriter, r *http.Request) {
// this is what you want
if r.URL.Path != "/" {