OVH VPS – how to change the hostname
secure tmp for Cpanel
/usr/tmpDSK
/scripts/securetmp - secure /tmp and /var/tmp
Options:
- auto: skip interactive customization questions
- install: install & enable securetmp service
- uninstall: disable & uninstal securetmp service
- daemonize: run securetmp in background ( default true )
Sample usages:
# run in interactive mode
> /scripts/securetmp
# disable interactive mode, run in background
> /scripts/securetmp --auto
# disable interactive mode, do not run in background
> /scripts/securetmp --auto --nodaemonize
one line csf setup
yum update -y;yum install -y epel-release;yum install -y perl-Crypt-SSLeay perl-Net-SSLeay bind-utils perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph nano wget mc lsof nload tcpdump monit rsync zip unzip ipset langpacks-en glibc-all-langpacks perl-Math-BigInt-FastCalc iptables;cd /usr/src; rm -fv csf.tgz; wget -c https://download.configserver.com/csf.tgz;tar -xzf csf.tgz;cd csf;sh install.sh; cd ~; perl /usr/local/csf/bin/csftest.pl
Как найти недавно модифицированные файлы в Linux
convert image to pdf
dovecot custom rules/moving emails
nano /etc/dovecot/sieve-after/spam-to-folder.sieve
require ["fileinto","mailbox"];
if header :contains "X-Spam-Flag" "YES" {
fileinto :create "Junk";
stop;
}
if header :contains "X-Spam_bar" "+" {
fileinto :create "Junk";
stop;
}
if header :contains "X-Spam_bar" "++" {
fileinto :create "Junk";
stop;
}
if header :contains "X-Spam_bar" "+++" {
fileinto :create "Junk";
stop;
}
if header :contains "X-Spam_bar" "++++" {
fileinto :create "Junk";
stop;
}
if header :contains "X-Spam_bar" "+++++" {
fileinto :create "Junk";
stop;
}
chown -R root:dovecot /etc/dovecot/sieve-after
sievec /etc/dovecot/sieve-after/spam-to-folder.sieve
OVH VPS add the new IP:
1. cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
2. nano /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE="eth0:0"
ONBOOT="yes"
BOOTPROTO="none" # For CentOS use "static"
IPADDR="IP_FAIL_OVER"
NETMASK="255.255.255.255"
BROADCAST="IP_FAIL_OVER"
3. ifup eth0:0
OVH VPS upgrade/disk resize:
1. reboot from live-cd
2. lsblk
3. umount /dev/vdb1
4. e2fsck -yf /dev/vdb1
5. fdisk -u /dev/vdb
6. Command (m for help): p
7. Command (m for help): d
8. Command (m for help): n
9. Select (default p): p
10. Partition number (1-4, default 1): 1
11. Command (m for help): a
13. Command (m for help): w
14. dumpe2fs /dev/vdb1 | grep superblock
15. fsck -b 32768 /dev/vdb1 (if error present use 15.1)
15.1 e2fsck -yf /dev/vdb1
16. mount /dev/vdb1 /mnt
17. df -h
18. disable live-cd and reboot
Original OVH post
Reinstall softaculous
mkdir -p /root/softaculous_reinstall_backup
cp -pv /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/enduser/universal.php /root/softaculous_reinstall_backup/
cp -pv /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/enduser/iscripts.php /root/softaculous_reinstall_backup/
cp -pv /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/enduser/categories.ser /root/softaculous_reinstall_backup/
cp -Rpv /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/conf /root/softaculous_reinstall_backup/
rm -Rf /usr/local/cpanel/whostmgr/docroot/cgi/softaculous
wget -N http://files.softaculous.com/install.sh && chmod 755 install.sh && ./install.sh
cp -pv /root/softaculous_reinstall_backup/universal.php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/enduser/universal.php
cp -pv /root/softaculous_reinstall_backup/iscripts.php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/enduser/iscripts.php
cp -pv /root/softaculous_reinstall_backup/categories.ser /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/enduser/categories.ser
cp -pRv /root/softaculous_reinstall_backup/conf /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/conf
or
wget -N http://files.softaculous.com/install.sh
chmod 755 install.sh
./install.sh --reinstall
also, a way to debug
/usr/local/cpanel/whostmgr/docroot/cgi/softaculous/cli.php --repair