# Delete Blank Lines :g/^$/d # Delete EMPTY Blank Lines :g/^\_$\n\_^$/d
mkdir `date +%y%m%d%H%M%S`
CentOS 6 Netinstall URLs
32 bit: http://mirror.centos.org/centos/6/os/i386/ 64 bit: http://mirror.centos.org/centos/6/os/x86_64/
yum install yum-security yum update --security
- Disable splash by setting Log0=0 in /usr/lib/openoffice.org/program/sofficerc.
I haven’t actually used this yet, but I’ll be trying it shortly because it sounds like a brilliant idea. In a nutshell, it builds RPM/DEB/ETC packages from source packages; so rather than going ./configureÂ ; makeÂ ; make install, you go ./configureÂ ; makeÂ ; checkinstall, and then install the package (this part can be automated too). If you don’t want the package, you just uninstall it as you usually would with your package manager.
Anyone that’s ever installed something from source will probably recognise the advantage in this, but if you haven’t, it means you don’t have to worry about executables being left executable, cron jobs or processes being left running, or files being scattered all over your system. It would appear to be very convenient.
Finding a text string in a dir tree
If you want to find “some text” in an entire directory tree ( let’s say its /your_website_dir/htdocs/)
cd /your_website_dir/ find htdocs -print | xargs grep -is "some text"
Hide unused FTP Directories
Plesk shows FTP user’s chroot directories (/usr, /var, /etc*) by default, this hides all but the important stuff.
<Directory /home/httpd/vhosts> GroupOwner psacln HideNoAccess on HideGroup root </Directory>
- Uncomment “auth required pam_wheel.so use_uid“ in /etc/pam.d/su
- Change SSH port to 22222.
- Change Webmin port to 11111.
- chkconfig yum-cron on
- Set expose_php = off in /etc/php.ini
port 123 UDP
yum install ntp
./installer.sh –layout default –install rkhunter –propupd –pkgmgr RPM
#!/bin/bash rkhunter --update (rkhunter -c --cronjob 2>&1 | mail -s "Daily Rkhunter Scan Report" root)
#!/bin/sh cd /root/chkrootkit ./chkrootkit 2>&1 | grep "INFECTED|Vulnerable"
cd /etc/postfix edit access_client file and add the ip address you want to block (e.g 192.168.10.12)
save and exit, then type
postmap hash:access_client postfix reload
Forward to another address
If I wanted mail forwarded, I would cd /home/username/ (or cd ~, or even just typing cd will get you home) and edit .procmailrc (if its not there, just create one) to add this:
:0 ! email@example.com
Copy to another address
To keep a copy, use the ‘c’ flag:
:0c ! firstname.lastname@example.org
To bin spam flagged by SpamAssassin
Ok, it’s ruthless, but if you just want to bin spam without seeing it add this.
LOGFILE=procmail.log Redirect=/dev/null/ :0fw |/usr/bin/spamc :0 ! ^X-Spam-Status: Yes $Redirect
TheÂ :0fw bit feeds all your incoming mail to the spamassassin daemon for processing. If it’s flagged as spam, an extra header , X-Spam-Status , is added to mail header. It’s also usefull to have a log file of this activity – that’s the LOGFILE line. The log will be in your (or your users) home dir.
If you would rather the spam got redirected to a text file in your home dir, just change /dev/null/ to SPAM
* Arf arf.
Magento hacks, tips and tricks.
Firefox and Thunderbird addons and hacks.
Windows apps and hacks. Apps marked with a * are commercial.
WordPress addons and hacks.
Zimbra hacks, tips and tricks.