Tag Archives: Command

set up subversion

1) Install SVN

sudo apt-get install subversion libapache2-svn

2) Create your repository. Once svn is installed on your host, you can proceed with the repository set up

svnadmin create /svnrepos

3) Create a SVN User

Run the below given command

vi /svnrepos/conf/svnserve.conf

and paste here the below given code in  svnserve.conf

anon-access = none
auth-access = write
password-db = passwd

4)Create a password file:

vi /svnrepos/conf/passwd
# add users in the format : user = password
phpcode = phppass

5)  Import Your Project

svn import /projects/myrailsproject file:///svnrepos/myrailsproject

6) Start the SVN Server as Daemon

svnserve -d

7) Restart apache

sudo /etc/init.d/apache2 restart

set up svn

1) Install SVN

sudo apt-get install subversion libapache2-svn

2) Create your repository. Once svn is installed on your host, you can proceed with the repository set up

svnadmin create /svnrepos

3) Create a SVN User

Run the below given command

vi /svnrepos/conf/svnserve.conf

and paste here the below given code in  svnserve.conf

anon-access = none
auth-access = write
password-db = passwd

4)Create a password file:

vi /svnrepos/conf/passwd
# add users in the format : user = password
phpcode = phppass

5)  Import Your Project

svn import /projects/myrailsproject file:///svnrepos/myrailsproject

6) Start the SVN Server as Daemon

svnserve -d

7) Restart apache

sudo /etc/init.d/apache2 restart

SVN Repository

Subversion is an open source version control system. Using Subversion, you can record the history of source files and documents. It manages files and directories over time. A tree of files is placed into a central repository. The repository is much like an ordinary file server, except that it remembers every change ever made to files and directories.

Subversion is built on a portability layer called APR—the Apache Portable Runtime library.

Subversion is a centralized system for sharing information. At its core is a repository, which is a central store of data. The repository stores information in the form of a filesystem tree—a typical hierarchy of files and directories. Any number of clients connect to the repository, and then read or write to these files. By writing data, a client makes the information available to others; by reading data, the client receives information from other

What makes the Subversion repository special is that it remembers every change ever written to it—every change to every file, and even changes to the directory tree itself, such as the addition, deletion, and rearrangement of files and directories.

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

Check a directory with PHP CodeSniffer

phpcs /var/www/test/xml

FILE: /var/www/test/xml/index.php
——————————————————————————–
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
——————————————————————————–
1 | ERROR | End of line character is invalid; expected “n” but found “rn”
2 | ERROR | Missing file doc comment
——————————————————————————–
FILE: /var/www/test/xml/xml.php
——————————————————————————–
FOUND 8 ERROR(S) AND 1 WARNING(S) AFFECTING 8 LINE(S)
——————————————————————————–
1 | ERROR | End of line character is invalid; expected “n” but found
| | “rn”
2 | ERROR | Missing file doc comment
13 | ERROR | Expected “foreach (…) {n”; found “foreach(…)n{n”
15 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 3
16 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 3
18 | ERROR | Line indented incorrectly; expected 4 spaces, found 3
19 | ERROR | Line indented incorrectly; expected at least 8 spaces, found 4
19 | WARNING | Line exceeds 85 characters; contains 92 characters
21 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 3
——————————————————————————–

Check a file with PHP CodeSniffer

phpcs test.php

FILE: /var/www/test/test.php
——————————————————————————–
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
——————————————————————————–
1 | ERROR | End of line character is invalid; expected “n” but found “rn”
2 | ERROR | Missing file doc comment
——————————————————————————–