Set-up redundant MySQL system

Note: Setting up the slave like this, means it can only be used to read.. don’t ever try to write to it because you will break replication. If you want to add writing to it, set replication up both ways and change the auto-increment-increment and auto-increment-offset on both/all servers to ensure the unique keys don’t […]

Add users to vsftpd

Source: #edit /etc/vsftpd.conf or /opt/etc/vsftpd.conf local_enable=YES chroot_list_file=/etc/vsftpd.chroot_list or /opt/etc/vsftpd.chroot_list chroot_list_enable=YES #You may alsow ant to disable anonymous access #You may also want to enable write access #Create vsftpd.chroot_list in /etc/ or /opt/etc/ Add the username you want to export to ftp. If the user you want to add is not a system user then […]

Show iptable blocks

#!/bin/bash range=”$1 $2″ cntonly=”$3″ if [[ $cntonly == “c” ]] ; then #Count only res=$(grep -c “$range.*iptables denied” /var/log/debug*) echo “$res” else #Get actual lines res=$(grep “$range.*iptables denied” /var/log/debug*) echo “$res” fi exit 1 Example usage: ./ Nov 11 Will show all dropped connections on November the 11th or ./ Nov 11 c Will show […]

Clear — MARK — from logs

Clear existing ones: sed ‘/.*MARK –/d’ messages > messagesf #Or replace on the spot: sed -i ‘/.*MARK –/d’ messages Only write it once per day: vim /etc/default/syslogd SYSLOGD=”-m 1440″

Debian VPS (OpenVZ) Quick Setup

Fix getty processes causing log file growth Comment out all but the first (tty1) getty entries vim /etc/inittab … # Note that on most Debian systems tty7 is used by the X Window System, # so if you want to add more getty’s go ahead but skip tty7 if you run X. # 1:2345:respawn:/sbin/getty 38400 […]