# Delete Blank Lines

# Delete EMPTY Blank Lines


mkdir `date +%y%m%d%H%M%S`


CentOS 6 Netinstall URLs

32 bit:
64 bit:


Yum Security Updates

yum install yum-security
yum update --security


  • Disable splash by setting Log0=0 in /usr/lib/





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

Server Setup

  • Uncomment auth required 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


./ –layout default –install rkhunter –propupd –pkgmgr RPM

rkhunter --update
(rkhunter -c --cronjob 2>&1 | mail -s "Daily Rkhunter Scan Report" root)


cd /root/chkrootkit
./chkrootkit 2>&1 | grep "INFECTED|Vulnerable"


IP Blocking

cd /etc/postfix edit access_client file and add the ip address you want to block (e.g REJECT

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:

! user@domain.tld

Copy to another address

To keep a copy, use the ‘c’ flag:

! user@domain.tld

To bin spam flagged by SpamAssassin

Ok, it’s ruthless, but if you just want to bin spam without seeing it add this.


! ^X-Spam-Status: Yes

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

Outlook Migration


* Arf arf.

Leave a Reply