Archive for October, 2010

Using SED command line to delete line from a file.

d Delete pattern space. Start next cycle.

You can use the following one liner to remove one line (line 3) from a file.

$ sed -i 3d ~/.ssh/known_hosts

This will remove line 3 form the file ~/.ssh/known_hosts

Transferring all your cpanel accounts using shell.

First we need to create all accounts backup on your current server, execute following command

cat /var/cpanel/users | while read line; do
/scripts/pkgacct $line
done

All accounts are backuped up under /home, now transfer all accounts backup to your new server using SCP command line.

scp cpmove-* root@new-server-ip:/home

Now to resoter the accounts.

To restore all accounts, put all the users in the file named users on the new server /home

cat /home/users | while read line; do
/scripts/restorepkg $line
done

Cant see the Statistics module icon in the regular account editor.

For Parallels Plesk Sitebuilder for Linux/Unix

All modules icons are there except the statistics. What should I do to be able to access it?

Login to Sitebuilder Control Panel as admin and go to the Modules -> Statistics page.

To activate statistics reporting select check box Enable statistics located in the bottom left corner of the Statistics module screen.

Also, this module is available only for regular sites. It should be accessible in the left column at the Extra step. We need to add this module into an appropriate plan in the Plan Management section.

Reference: http://parallels.com/

Wrong certificate error when I open any domain via HTTPS.

Look into /etc/httpd/conf.d/ssl.conf for the line like:

VirtualHost _default_:443

If it exists you have to delete/comment this default SSL virtual host starting from the
“VirtualHost _default_:443″ line and ending with “/VirtualHost”.

Then stop and start (not restart!) Apache server.

/etc/init.d/httpd stop && /etc/init.d/httpd start

Reference : http://parallels.com

SBDavid

Flushing DNS Cache on your system

Flushing DNS Cache on your system.

When your computer visits a website for the first time, it stores the website’s DNS information in a local cache.

The instructions unique to particular operating systems are below.

From the command line on a windows operating system type:

ipconfig /flushdns

From a Linux operating system.

/etc/init.d/nscd restart

Nscd is a daemon that provides a cache for the most common name service requests

From MAC on the terminal window

dscacheutil -flushcache

Directory Service (DNS) cache - Gather information, statistics, initiate queries, flush the cache. dscacheutil replaces most of the functionality of thelookupd tool provided prior to OS X Leopard.

« Prev - Next »