Thanks to visit codestin.com
Credit goes to gist.github.com

Skip to content

Instantly share code, notes, and snippets.

@tekgnosis-net
tekgnosis-net / postfix-debconf-get-selections.txt
Created August 27, 2025 13:55 — forked from gene1wood/postfix-debconf-get-selections.txt
postfix debconf-get-selections using myhost.example.com as an example domain name
# Internet protocols to use:
# Choices: all, ipv6, ipv4
postfix postfix/protocols select all
# System mail name:
postfix postfix/mailname string myhost.example.com
# Add a 'mydomain' entry in main.cf for upgrade?
postfix postfix/mydomain_warning boolean
# Correct tlsmgr entry in master.cf for upgrade?
postfix postfix/tlsmgr_upgrade_warning boolean
# Root and postmaster mail recipient:
@tekgnosis-net
tekgnosis-net / proxmox_raid1_recovery.sh
Created October 2, 2024 04:08 — forked from MakiseKurisu/proxmox_raid1_recovery.sh
Recover Proxmox VE RAID-1 configuration when one disk is replaced / readded
# TODO: Add ESP disk replacement
# Assuming the disk in problem is /dev/sdb, and we are running off /dev/sda in degraded mode.
# However, if both /dev/sda and /dev/sdb have been booted in degraded mode,
# then the next time when you boot with both disk present, initramfs will not be able to mount root in rw mode.
# In that case, you may have PERMANENT DATA LOSS if you are not careful, and MAKE BACKUPS of your current disks before any recovery.
# I HAVE NOT tried to recovery from such situation, as my plan is always recovery from existing backups.
# However, I'm more likely to recreate the system from scratch, as my data are stored in RAID and with multiple backups,
# so I only need to recreate my VM environment according to the script I'm writting on Gist. I love fresh system anyway.
@tekgnosis-net
tekgnosis-net / proxmox_btrfs_raid1.sh
Created October 2, 2024 04:07 — forked from MakiseKurisu/proxmox_btrfs_raid1.sh
Convert Proxmox VE over Btrfs to RAID-1 configuration
# Please follow https://gist.github.com/MakiseKurisu/3a44918bccf3383c0b5ccf362f429c8b first to set up rootfs
# Assuming rootfs on /dev/sdb2, and adding /dev/sda to the RAID-1 configuration
# Remove existing Proxmox installation and LVM Thin storage
pvesm remove local-lvm
vgremove pve -y
# Set up partition table
(echo g; echo n; echo ''; echo ''; echo '+512M'; echo t; echo 1; echo n; echo ''; echo ''; echo ''; echo w) | fdisk /dev/sda
@tekgnosis-net
tekgnosis-net / proxmox_custom_partition_layout.sh
Created October 2, 2024 04:07 — forked from MakiseKurisu/proxmox_custom_partition_layout.sh
Migrate Proxmox VE to a custom partition layout feat. Btrfs
# The following script was tested for fresh install only, without any VM
# Assuming Proxmox is installed in /dev/sda with LVM-ext4 partition and UEFI boot, and the target disk is /dev/sdb
# Prepare
sed -i "s/deb/#deb/" /etc/apt/sources.list.d/pve-enterprise.list
apt update
apt full-upgrade -y
# WARNING! Check your target disk device name!
lsblk
@tekgnosis-net
tekgnosis-net / iommu.sh
Created September 29, 2024 07:58 — forked from n1snt/iommu.sh
A simple bash script to get the list of iommu groups & the devices in those iommu groups.
#!/bin/bash
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done
@tekgnosis-net
tekgnosis-net / nginx-wordpress.conf
Created September 26, 2024 05:04 — forked from nfsarmento/nginx-wordpress.conf
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
#!/bin/bash
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Lockable script boilerplate
@tekgnosis-net
tekgnosis-net / clone_root_disk.md
Created October 17, 2023 02:43 — forked from keilmillerjr/clone_root_disk.md
Cloning a Root Disk (Linux)

Cloning a Root Disk (Linux)

Preface

You need to create a bootable live disk to clone your disk. You can not copy a partition that is mounted. If you do not have internet access, use gparted. Otherwise, it might be better to use your operating systems live installer, such as Manjaro. We can download gparted and still have things like a web browser incase we get stuck. We will be using the Manjaro live disk for this guide.

Create a bootable live disk

  1. Download Manjaro.
  2. Insert USB disk.
@tekgnosis-net
tekgnosis-net / Installation.md
Last active October 23, 2018 00:01 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges