Category Archives: Linux

VI Editor

Paragraph
Next – }
Previous – {

Sentence

Next sentance – )
Previous sentance – (

Inserting and appending text

inserts text to the left of cursor – i
nserts in the beginning of line -I
appends text to right of cursor -a
appends to the end of line- A

Adding new line

add a new line below the current line -o
adds a new line above the current line – O

file

Go to end of file – :$
on chacter forword – :w
One word forword – :W
go to a line number – :ine_number
display file info – :^g

Moving Cursor in File

Left – h
Right – l
Up – k
Down – j

Line

Beginning – ^ or B
end – $

Deleting the text :

deletes text above the text – x
deletes text character on right of cursor- X
deletes line- 20 20d
deletes current line- dd
delete till end of current -line. D

Replacing a character & word

replace the character above the cursor – r
replces characters until Esc is pressed – R
replaces the word from cursor to the end indicated by $ sign – cw
replaces till end of line – C

Substitute

subistutes current charcater – s
substitutes entire line – S

Undo last changes

undo last change – u
undo changes to the current line – U

Copy and pasting lines

copys the current line into buffer – yy
copies 5 lines from the current line – 5yy
pastes the current buffer – p

Searching

Searches for the word name in the file – /name
n continues search forward – n
N searches backwards – N

Saving

saves the text does not quit -:w
saves & quit the editor – :wq!
save ZZ
Quit without saving – q!
Search & Replace – s/<search>/<replace>/g .

Repeating last command .

Recovering a unsaved vi file – vi -r filename

Linux

Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of Linux is the Linux kernel, an operating system kernel first released 5 October 1991 by Linus Torvalds.
Linux was originally developed as a free operating system for Intel x86-based personal computers.

It has since been ported to more computer hardware platforms than any other operating system. It is a leading operating system on servers and other big iron systems such as mainframe computers and supercomputers:

more than 90% of today’s 500 fastest supercomputers run some variant of Linux, including the 10 fastest. Linux also runs on embedded systems such as mobile phones, tablet computers, network routers, televisions  and video game consoles; the Android system in wide use on mobile devices is built on the Linux kernel.

The development of Linux is one of the most prominent examples of free and open source software collaboration: the underlying source code may be used, modified, and distributed—commercially or non-commercially—by anyone under licenses such as the GNU General Public License. Typically Linux is packaged in a format known as a Linux distribution for desktop and server use. Some popular mainstream Linux distributions include Debian (and its derivatives such as Ubuntu), Fedora and openSUSE. Linux distributions include the Linux kernel, supporting utilities and libraries and usually a large amount of application software to fulfill the distribution’s intended use.

A distribution oriented toward desktop use will typically include the X Window System and an accompanying desktop environment such as GNOME or KDE Plasma. Some such distributions may include a less resource intensive desktop such as LXDE or Xfce for use on older or less powerful computers. A distribution intended to run as a server may omit all graphical environments from the standard install and instead include other software such as the Apache HTTP Server and an SSH server such as OpenSSH. Because Linux is freely redistributable, anyone may create a distribution for any intended use. Applications commonly used with desktop Linux systems include the Mozilla Firefox web browser, the LibreOffice office application suite, and the GIMP image editor.

Since the main supporting user space system tools and libraries originated in the GNU Project, initiated in 1983 by Richard Stallman, the Free Software Foundation prefers the name GNU/Linux.

Installing ionCube

Run the below given commands to install ioncube in ubuntu linux

1) Chnage directory to /usr/local/

cd /usr/local/

2) Download ionCube loaders

wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

3) Extract the file

tar zxvf ioncube_loaders_lin_x86.tar.gz

4) Add reference to your php.ini file

a) Chnage sirectory to apache2

cd /etc/php5/apache2/

b) Make sure that you have the back up of php.ini file

sudo cp php.ini php.ini.bck

c) Edit the php.ini file and add the referance

sudo gedit php.ini

zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so

5) Restart apache

/etc/init.d/apache2 restart

How To Enable mod_rewrite In LAMP- Ubuntu Linux

NOTE :  Follow below given steps  at your own risk .

1) give permissions to the /var/www/ directory

sudo chown -R $USER:$USER /var/www/

2) Install the Apache module mod_rewrite

a2enmod rewrite

3)  Chnage the directory and keep the back up of the file “000-default”

cd /etc/apache2/sites-enabled/

sudo cp  000-default 000-default1

4) Edit the file 000-default

sudo vi 000-default

Look for the below given code

Options Indexes FollowSymLinks MultiViews
AllowOverride none
Order allow,deny
allow from all

Modify “AllowOverride none” to “AllowOverride All”

5) Restart Apache

sudo /etc/init.d/apache2 restart