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
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 != "/" {
@madalinignisca
madalinignisca / 01_nginx-reload-post-hook.sh
Created January 2, 2024 09:00 — forked from justinhartman/01_nginx-reload-post-hook.sh
Let's Encrypt Certbot post hook command for Nginx which checks the updated configuration files and reloads the server if everything validates.
#!/usr/bin/env bash
#
# Certbot Nginx Reload
#
# Let's Encrypt Certbot post hook command for Nginx which checks the updated
# configuration files and reloads the server if everything validates.
#
# Author : Justin Hartman <[email protected]>
# Version : 1.0.1
# License : MIT <https://opensource.org/licenses/MIT>
@madalinignisca
madalinignisca / hideunhideitemsmacosdesktop.sh
Created November 25, 2023 10:00
Hide / UnHide items on MacOS Desktop
# This will hide
defaults write com.apple.finder CreateDesktop -bool false; killall Finder
# This will show them back
defaults write com.apple.finder CreateDesktop -bool true; killall Finder