Skip to content

Instantly share code, notes, and snippets.

View mikepage's full-sized avatar
🌍
Online

Mike Pagé mikepage

🌍
Online
View GitHub Profile
ddev mutagen reset && ddev config global --performance-mode=none && ddev config --performance-mode=none
# Delta Fiber
62.45.70.100
62.45.71.100

Reset Edgerouter X to factory defaults and connect to LAN network with IPv4 address range 192.168.1.1/24 configured. When the EdgeRouter X is reset to factory defaults, it is in a minimal, unconfigured state:

  • IP address: The router itself is accessible via 192.168.1.1 on eth0 only.
  • DHCP: Disabled. No devices will receive an IP address automatically.
  • Interfaces: Only eth0 has a static IP (192.168.1.1), all other interfaces are not configured.

SSH into Edgerouter X (use port 2222 for SSH) and update config, replace 192.168.1.254 with main router IP

dnf remove patchman-client
dnf install imunify-patchman
imunify-antivirus patchman migrate
systemctl enable patchman-client
systemctl restart patchman-client
mkdir -p /etc/patchman/license
echo "KEY" > /etc/patchman/license/key
# Replace EMAIL
doveadm force-resync -u EMAIL -f "*"
systemctl restart dovecot

Directadmin, add default ssh keys for new users

Create the custom scripts directory (if it doesn’t exist)

mkdir -p /usr/local/directadmin/scripts/custom

Create the user_create_post.sh script or update existing script when immunify360 is active

Install the required tools:

dnf install cloud-utils-growpart

Use growpart to extend the partition to the end of the disk:

growpart /dev/vda 4
#!/bin/bash
# Description:
# This script searches for lines containing 'redirect' in all managesieve.sieve files
# located in /home/**/imap/**/**/sieve/ paths.
# Find and grep lines containing 'redirect'
find /home -type f -path "*/imap/*/*/sieve/managesieve.sieve" -exec grep -Hn 'redirect' {} \;
#!/bin/bash
# Check if a file was provided
if [ -z "$1" ]; then
echo "Usage: $0 logfile"
exit 1
fi
# Process the file line by line
while IFS= read -r line; do
# local
composer update
git add composer.lock
git commit -a -m "Composer update"
# remote
git pull
composer install --no-dev -o -a
php craft up
php craft clear-caches/all