October 14, 2006

Learn vi Editor Basics…

by @ 7:32 pm. Filed under cPanel Hosting, Micfo Web Hosting, Hosting Support, Dedicated Server Hosting, Linux Hosting, Hsphere Hosting, Ensim Hosting

Getting Started

The command “vi” without any file name will open a new file where you can enter the text and edit but while coming out you will be asked to enter a valid file name to save the text.
“vi” with a existing file name will open that file for editing.

After a file is opened it is in command mode, that is - input from the keyboard will be treated as vi commands and you will not see the words you are typing on the screen. To enter the text you have to put vi in insert by pressing ‘i’ or ‘a’ after which you can add the text and whatever is being typed will be seen on the screen. To switch between these mode Esc key is used .

Esc i — insert text mode

Esc — command mode

If you don’t want to save the work “:q” will take you out. For save and quit “:wq” is used. Simple “:w” saves the current file and don’t exit and “:q!” , “:wq!” causes a forced quit from vi.

Editing commands

Moving around the file:

h — cursor left

i — cursor right

k — cursor up

j — cursor down

^ & B — Beginning of line

$ — end of line

) — Next sentence

( — Previous sentence

} — Next Paragraph

{ — Previous Paragraph

:$ — end of file

w — one character forward

W — one word forward

:20 — go to Line no 20 or whatever number you give

Displaying file info:

^g — give name of the file, current line and total lines of a file at the bottom.

Inserting and appending text :

i — inserts text to the left of cursor

I — inserts in the beginning of line

a — appends text to right of cursor

A — appends to the end of line

Adding new line:

o — add a new line below the current line

O — adds a new line above the current line.

Deleting the text:

x — deletes text above the cursor

X — deletes text character on the right of cursor

20dd — deletes 20

dd — deletes current line

D — delete till end of current line.

d# — delete to where the # (j,k,l,h) specifies.

d/ — delete till pattern is found (forward).

d? — delete till pattern is found (backward).

d’ — delete till mark ‘char’.

Replacing a character & word:

r — replace the character above the cursor.

R — replces characters until Esc is pressed.

cw — replaces the word from cursor to the end indicated by $ sign.

C — replaces till end of line.

Substitute:

s — subistutes current charcater.

S — substitutes entire line.

Repeating last command:

. — repeats the last text.

Undo the last change:

u — undo last change.
U — undo changes to the current line.

Copy and pasting lines:

yy — copies the current line into buffer.
5yy — copies 5 lines from the current line.
p — pastes the current buffer.

Recovering an unsaved vi file:

vi -r — restores a unsaved / crashed file from buffer.

Searching:

:/name — & return searches for the word name in the file

n — continues search forward.

N — searches backwards.

Substitution:

:s///g

Saving:

:w — saves the text does not quit.

:wq — saves & quit the editor.

ZZ — save & quit the editor.

:q! — Quit without saving.

Miscellaneous:

m — mark this location and name it char.

‘ — (quote character) return to “line” named char.

` — (back-quote character) return to “place” named char.

‘’ or “ — (quote quote) return from last movement.

Thanks & Regard’s

Stacy

October 1, 2006

Resetting user password through shell on ensim server

by @ 9:47 pm. Filed under Ensim Hosting

Hello,

You can use following command in order to reset a user password through shell on your Ensim server:
EditVirtDomain -c siteinfo,passwd domain.com
Replace domain.com with user’ domain name, and you will be prompted to enter new password.

September 22, 2006

How to transfer sudomains from Ensim to cpanel

by @ 10:26 am. Filed under Blogging, Web Hosting Articles, Ensim Hosting

Hello,

As the ensim control panel and cpanel server having different directory structures we need to manually migrate subdomains from ensim to cpanel

Following is the procedure for Transfer :

1. First login to the ensim server from where you want to move .

2. Then go to subdomain directory for the domain you want to move: as

cd /home/virtual/domain.com/var/subdomain

3. Here you can see all the subdomains for this domain in the directory. Go
into each directory plus the html directory as

cd subdomainxx/html

4 Then zip up the files
tar -czvf ../../subdomainname.tar.gz *

do the same procedure for all subdomains

you have to go up 3 levels to find the files due to symbolic

cd ../../..
5. FTP the files to the new server

ftp newserver
mput *.tar.gz

6 On new server
Login to the domain’s cpanel account and create all the subdomains

7 Go to the directory where the files were ftp uploaded.
cd /home/admin

8 copy each file to the proper directory. You will need to know the admin
username for the primary domain. If the domain user is tuks123 and the
subdirectory (sudomain) is “forum” then you would copy the files like this:
mv forum.tar.gz /home/tuks123/www/forum/

9 After moving it to specific directory(sudomain) then unzip the files.
cd /home/tuks123/www/forum/
tar -zxvf forum.tar.gz

rm forum.tar.gz

10 at the last change the permission and ownership for all files in that directory as

chown tuks123:tuks123 * -R

Now finally subdomain get transfered from ensim to cpanel

enjoy…..

September 21, 2006

How to move mysql Database from ensim to cpanel (manually)

by @ 6:40 pm. Filed under cPanel Hosting, MySQL Hosting Issues., Web Hosting Articles, Linux Hosting, Ensim Hosting

Hello Friends,

Following are the steps to move database from ensim server to cpanel server.

Create a file with all the mysql databases from one domain (type in
each full file name based on the files in the

/var/lib/mysql directory). If there is just one domain then you’ll only
have one domain_com_-_xx entry, if there are several,

then just keep adding the databases.

mysqldump -Q –databases domain_com_-_xx domain_com_-_yy domain_com_-_zz -u root -p –add-drop-table > dump.sql

Step 2: Create the priviliges file

mysqldump mysql > mysql.sql -u root -p

cat mysql.sql | grep domain > mysql2.sql

Step 3: Make the Tar of Files

tar -czvf dump.tar.gz dump.sql mysql2.sql

Step 4: Transfer the files

ftp new.cpanelserver

put dump.tar.gz

At cpanel server you need to do the following steps
Login to cpanel server.

step 1:Start in the directory in /home/admin
cd /home/admin

tar -zvxf dump.tar.gz

Step 2: Run the vi editor to do a search/replace on database name

vi dump.sql

:%s/ecclestoned_com_-/ecclestoned/g

Step 3: Run the vi editor to do a search/replace on the permissions to fix
some version issues.

vi mysql2.sql

:%s/ecclestoned\\\\_com\\\\_-\\\\/ecclestoned/

:%s/);/,’Y',’Y');

Step 4: Run mysql hosting to import the databases

mysql mysql -u root -f

How to transfer sudomains from Ensim to cpanel

by @ 6:21 pm. Filed under cPanel Hosting, Linux Hosting, Ensim Hosting

Hello friends,

As the ensim control panel and cpanel control panel having different directory structures we need to manually migrate subdomains from ensim to cpanel

Following is the procedure for Transfer :

1. First login to the ensim server from where you want to move .

2. Then go to subdomain directory for the domain you want to move: as

cd /home/virtual/domain.com/var/subdomain

3. Here you can see all the subdomains for this domain in the directory. Go
into each directory plus the html directory as

cd subdomainxx/html

4 Then zip up the files
tar -czvf ../../subdomainname.tar.gz *

do the same procedure for all subdomains

you have to go up 3 levels to find the files due to symbolic

cd ../../..

5. FTP the files to the new server

ftp newserver
mput *.tar.gz

6 On new server
Login to the domain’s cpanel account and create all the subdomains

7 Go to the directory where the files were ftp uploaded.
cd /home/admin

8 copy each file to the proper directory. You will need to know the admin
username for the primary domain. If the domain user is tuks123 and the
subdirectory is “forum” then you would copy the files like this:

mv forum.tar.gz /home/tuks123/www/forum/

9 After moving it to specific directory(sudomain) then unzip the files.

cd /home/tuks123/www/forum/

tar -zxvf forum.tar.gz

rm forum.tar.gz

10 at the last change the permission and ownership for all files in that directory as

chown tuks123:tuks123 * -R

Now finally subdomain get transfered from ensim to cpanel

enjoy…..

RESELLER HOSTING | DEDICATED SERVER | PREMIUM HOSTING | VPS HOSTING

Micfo Hosting

Micfo International LLC Leading the hosting Industry with Cheap and Affordable Linux Web Hosting Packages.

internal links:

categories:

archives:

Services:

Micfo Hosting

Micfo, delivering the best cpanel web hosting with maximum reliability is our exclusive focus.
Micfo International LLC

search blog:

TOP 10 POSTS:

Pages:

General Links:

Syndicate

other:

39 queries. 0.137 seconds