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 / wordpress-default.css
Created May 13, 2013 13:07
Default WordPress classes for using with CSS
/**
* Default Body Class Styles
*/
.rtl {}
.home {}
.blog {}
.archive {}
.date {}
.search {}
@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 / 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 / README.md
Last active June 19, 2024 22:46
Kubernetes 1.25 on Fedora 37 @ Hetzner the right way

Kubernetes 1.25 on Fedora 37 @ Hetzner the right way

Using only kubeadm and helm from Fedora's repository Instructions are for Fedora 37+ only, using distribution's repository for installing Kubernetes.

Note: avoid kubernetes and kubernetes-master as there are deprecated and setup is more complex.

Note: I have not yet tinkered using ipv6, but it is in my plans to do it.

The result should be a decent Kubernetes cluster, with Cloud Control Manager installed and controlling layer 2 private networking allowing pods to talk at fastest speed possible. Will default to Hetzner's cloud volumes.

@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 != "/" {