Archive

Archive for September, 2011

FTP Vs. Rsync?

September 27th, 2011 Comments off

Rsync is a great utility to manage downloads of transformation of Linux hosting servers and it is very easy to set up on a web hosting server. After technically studying it one comes to know that it copies only diffs of files which have been actually changed and compressed, through SSH. And this copying process is conducted without any scripted FTP session or any other format of file transfer script.

Following are a few concepts explained which are involved in ‘Rsync’ operations.
Diffs – Not the whole file, but only the changed portion of those files are transferred. This selective transformation makes the speed of update process faster. Unlike ‘Diffs’ FTP transfers the entire file though the change is very tiny.
Compression – The transferred small portions (Diffs) of the files are compressed while the transformation process is going on and this reduces the time required for transferring the Diffs. This also reduces the load on networks used for transformation.
SSH Encryption – With ‘Rsync’ security is provided on (a) higher level than the FTP because the stream from ‘Rsync’ is passed through the ssh protocol which encrypts your session and not the RSH.
Rsync can not be used with a windows web hosting server so one should approach other suitable utilities like ‘Robocopy’ or ‘Richcopy’.

Last Line Commands In VIM Editor

September 27th, 2011 Comments off

In previous posts we saw Cursor Movement commands, Text Modification commands, and commands used in Input Mode. In this post I would like to share the last line mode commands used in a VIM editor.
So following are the last line commands of VIM editor.
w – this command is used to save the file with the same name when you opened it to edit it.
w filename –  This command works as same as we use ‘save as’ with windows applications, which allows you to save the new copy of a file with your desired name. The substitute command to ‘w filename’ is ‘sav filename’, the same task of saving a copy of file with other name can be achieved by using ‘sav filename’ command.
n.m w filename –  this command is used for saving the content of line number ‘n’ to ‘m’ to the given file name. If you want to refer to the last line number (whatever it may be) then you should use ‘$’ instead of ‘m’.
e filename – This command is used to edit another file than the current one. It’s handy for toggling among the multiple files when used with the following ‘e#’ command.
e# – After using ‘e filename’ when you want to come back to previous file then you should use ‘e#’ command.
e! – This command is used to discard the changes made to a file.
r filename – This command reads the contents from a file and inserts it below the current line.

So these were last line VIM commands used to operate a Linux hosting server.

Text Modification And Input Mode VIM Commands

September 23rd, 2011 Comments off

Commands for Text Edition

In this post I have described the VIM commands used for text modification and commands used through Input Mode.
x – to delete the character which exists under the cursor.
rn – while using this command ‘n’ to be replaced with the character which you want to place in the place of any character under the cursor.
cw – this command puts you into input mode by replacing the current word at which cursor exists.
dw- to delete the current word on which cursor exists.
dd – to delete the current line in which cursor exists.
yy – to copy a line into the buffer.
P – to paste the copied line where the cursor exists.

Input Mode Commands

i – to insert text before the cursor.
I –  this works similar as ‘i’ but starts inserting text from the beginning of the current line.
a – to append text after the cursor.
A – this works similarly as ‘a’ but starts appending text at the end of the current line.
R – this command replaces characters which is currently under the cursor, it works similarly when we type the characters in windows with the insert key on. In short it is used for overwriting the current characters. To stop this command you should press the ‘Esc’ key.
o – to open the new line under the current line.
O – to open the new line above the current line.
Thus we saw the different VIM commands which are very handy while working on a Linux Hosting server or a Linux based system.

Cursor Movement VIM Commands In Linux

September 23rd, 2011 Comments off

In previous post we saw how important VIM commands are for handling a Linux hosting server, these commands basically come under Command mode of VIM
h – to move the cursor to left side
j – to move the cursor to down side
k – to move the cursor to up side
l – to move the cursor to right side
n| – to move the cursor to a particular character of the line, this is done by giving the that place’s number and if its valid the user notices a beep sound from the system. Entering just ‘|’ will move the cursor at the starting position of a particular line.
0 – to move the cursor at the beginning of the line
^ – to move the cursor at the first non blank character of a particular line.
$ – to move the cursor at the end point of a particular line.
fx – in this command you need to use any desired character in place of ‘x’ to move the cursor at the next appearance of that particular character used in the pace of ‘x’ within a single line.
Fx – it works similarly as ‘fx’ but in the reverse order, means you can fine previous appearance of the character placed instead of ‘x’.
[wW] – moves the cursor’s position word by word.
[bB] –  moves the cursor’s position word by word in reverse order.
H- to move the cursor at topmost line of your screen.
M –  to move the cursor at the middle line of your screen
L – to move the cursor at lowest line of your screen.
Ctrl-d – to scroll down the half page.
Ctrl-u – to scroll up the half page.
Ctrl-f – to scroll down the full page.
Ctrl-b – to scroll up the full page.
nG – in this command ‘n’ to be replaced by your desired number, which moves you to that particular numbered line of a file. i.e. if you typed 81G then you will be taken to the 81st line of that particular file.
Mx – in this command ‘x’ can be replaced by any single letter to which you want to comeback after going elsewhere. In short it is used for setting a line with a marker to be visited after the next move.
” – its command with two single quotes, and used for switching the positions simultaneously between two required places. In short it acts as a toggle.

An Overview of VIM Editor In Linux

September 22nd, 2011 Comments off

Linux is becoming popular day by day as an operating system for managing web hosting services among webmasters. Due to its cost effectiveness Linux Hosting services are preferred on a large scale. As Linux is a command driven language, one should be very well familiar with the various editors which are used while operating a linux based computer system. VIM is known as one of the most popular editor among Linux users. VIM editor is an advance version of VI and it plays an important role while handling the different tags. One major advantage of using VIM editor on a Linux server is ‘it consumes very less amount of resources of the system. Surprisingly VIM also works without any interruption on a slow speed network also. There is no use of computer mouse can be experienced while working with the VIM. Many similarities can be found between the Microsoft based ‘‘Notepad’ and VIM.

VIM Operation can be divided into main three modes as following.

Command Mode :- By default you come to this mode when you start the VIM. In this mode, input text is treated as command, most of these commands can be entered with a single text character. One need to take care of upper and lower case while using these commands as they are case sensitive. Few commands can be used with combination or in a prefixed way with qualifiers.

Input Mode :- This mode enables you to use the all characters as a plain text, whichever key (except ‘Esc’) you press is treated as a text input by VIM. The text is not treated a command hence the only way to exit from the Input mode is pressing ‘Esc’ key. By pressing ‘Esc’ key you return to ‘Command Mode’

Last Line Mode :- Commands to the ex editor, on which the VIM is based, can be entered in this mode. You need to type colon ‘:’ from the Command Mode for entering in to Last Line Mode. ‘:’ and your typed text is shown on the last line of your screen and that’s why this mode is called Last Line Mode.

Forgot Your Linux Root Password?

September 22nd, 2011 Comments off

Forgetting passwords is one of the most common incidents when one works with a lot of computer devices and web hosting servers. Not remembering the password and being unable to access the computer or server is very frustrating. But fortunately you can reset the forgotten passwords on both Linux Hosting and Windows Web Hosting accounts. Here I would like to share the process of resetting the root password on a Linux Hosting account.

  • You can reset your password by rebooting a system in single user mode.
  • After booting your server, you can face GRUB boot loader where you should select kernel by using arrow key, because from it you can boot the system.
  • Press the key ‘e’ to enter in to edit mode for editing a entry.
  • Choose the second line starting with the word kernel, and again press the key ‘e’ to append to the ‘single user mode’.
  • To the end of line insert a space and type ‘s’ and hit ‘Enter’ button.
  • Now press ‘b’ for booting the system kernel in single user mode.
  • You will come to shell prompt where you need to type ‘passwd’ command to reset the password.
  • Enter your new password and hit the ‘Enter’ key.

That’s it. Here you have successfully reset your password. Now you can reboot the system for normal use.