Month: July 2009

Using vim as a diff and merge tool

with Andrej’s article I found some nice tips & tricks and the Vim manual for diff tasks. Some useful commands, * “vim -o one.txt two.txt three.txt” (for horizontal split), “vim -O one.txt two.txt three.txt ” (for vertical split) * go to the next diff point ” ]c “; go to previous diff point “ [c…


Script to daily email APF status

You are running APF on your server, but sometimes you think “is APF running fine?” This script sends you an email with APF satus. Log in to your server as root Create the script: # nano apf1.sh Put this on the file: #!/bin/bash tail -200 /var/log/apf_log | mail -s “APF Status” you@yourdomain.com Save and Exit…


Run TOP in batch mode

top can be run non-interactively, in batch mode. Time delay and the number of iterations can be configured, giving you the ability to dictate the data collection as you see fit. Here’s an example: top -b -d 10 -n 3 >> top-file We have top running in batch mode (-b). It’s going to refresh every…


Crontab Basics

Change to the user you want to, then open the crontab editor: # crontab -e you can use this variables: a = the minute after the hour that you want it done b = the hour you want it done c = Day of the Month d = Month of the Year e = Day…


Can’t connect to local MySQL server through socket

I you are reading this, probably you are getting the next error: /usr/local/bin/mysqladmin: connect to server at ‘localhost’ failed error: ‘Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)’ Check that mysqld is running and that the socket: ‘/tmp/mysql.sock’ exists To fix it, and if you are running cPanel just try to run the…


Fix Not Found Error on rvsitebuilder – The server was not able to find the document

If you get the next problem on rvsitebuilder running on a cpanel server: Not Found The server was not able to find the document (./3rdparty/rvsitebuilder/index.php/sitebuilder/sitebuilderhome) you requested. Please check the url and try again. You might also want to report this error to your webhost. It should fix the problem to you: Log in as…


How to Change cPanel Theme via command line

If you need to change all cpanel account themes, you can use this command as root: # replace RS=oldtheme RS=newtheme — /var/cpanel/users/* This will change all the cpanel users theme, if you need to change only one account, # cd /var/cpanel/users/ # nano user_account and replace rhe “RS=” line


How to check CentOS version

Sometimes you just login in into a box using ssh and need to check the OS version. If this box runs CentOS you can use this command to determine what is the CentOS version: [root@box ~]# cat /etc/*release* CentOS release 4.3 (Final)


Single cPanel Account Backup Restore using SSH

You can backup a single cPanel account trough ssh using pkgacct cPanel script located at /scripts folder on your server. This tip is helpful for WebHosting companies that uses cPanel as Hosting control Panel – Login to your cPanel server as root. To backup a sigle account use the next commands: # cd /scripts #…


Recovering the root password from the boot loader (GRUB)

When GRUB loads up, select the Red Hat Linux entry on the GRUB menu and then press “e” to edit the boot configuration. Locate a line like this: kernel /boot/vmlinuz-x.x.xx-x.xxx root=LABEL=/hdc – type the number ‘1’ at the end. Doing so boots the computer into run level 1- single user mode you will automatically be…