Skip to content

Instantly share code, notes, and snippets.

@prhr
prhr / readme.md
Created March 19, 2021 18:36 — forked from troyfontaine/readme.md
Resize root partition (or how to remove the default /home partition) on CentOS 7 online

Resize root partition (or how to remove the default /home partition) on CentOS 7 online

This requires you to be able to ssh into the instance using the root user account and that no services be running as users out of /home on the target machine.

The examples are from a default installation with no customation-you NEED to know what you're working with for volumes/partitions to not horribly break things.

By default, CentOS 7 uses XFS for the file system and Logical Volume Manager (LVM), creating 3 partitions: /,/home and

Step 1 - Copy /home Contents

To backup the contents of /home, do the following:

@prhr
prhr / clean_zabbix_db.sh
Created March 31, 2020 12:44 — forked from hatifnatt/clean_zabbix_db.sh
Clean old data from Zabbix database
#!/usr/bin/env bash
# Inspired by http://whatizee.blogspot.com/2016/10/zabbix-history-table-clean-up.html
# This scrip clean history* and trends* tables. It will copy "right" data to new tables
# and then drop old bloated ones.
# Enable debug
#set -x
DATE_MINUS_3M=$(date -d "now -3months" +%Y-%m-%d)
@prhr
prhr / Regex To Match Interface Details
Created March 24, 2020 15:21 — forked from JonTheNiceGuy/Regex To Match Interface Details
Regex to match Interface details
IPSO Trunked Non-VRRP (run ifconfig -a)
lname\s+([^>]+)\s+flags[^>]+>\s+vlan-id\s+(\d+)\s+inet mtu \d+\s+(inet ([\d+\.\d+\.\d+\.\d+]+)|([\d+\.\d+\.\d+\.\d+]+))\/(\d+)\s+broadcast\s+\S+[^>]+>\s+ether\s+(\S+)
ifname 1
vlan 2
ip 4 or 5
subnet 6
mac 7
IPSO Trunked VRRP (run ifconfig -a)