Saturday 8 February 2014

Check disk drive for badblock,errors

badblocks is used to search for bad blocks on a device (usually a disk partition). Device is the special file corresponding to the device (e.g /dev/sda1). It can be a good idea to periodically check for bad blocks. This is done with the badblocks command. It outputs a list of the numbers of all bad blocks it can find. This list can be fed to fsck to be recorded in the filesystem data structures so that the operating system won’t try to use the bad blocks for storing data. The following example will show how this could be done. The command:
badblocks -v /dev/sda1 > badblocks.txt 
The above command will generate the file badblocks.txt. You can pass this file to the fsck command to record these bad blocks. Do make sure you type in the correct filesystem, etc ext3,ext4,xfs.
fsck -t ext3 -l badblocks.txt /dev/sda1
Reference: Link1

Thursday 6 February 2014

Setup SVN (Subversion) on Fedora / RHEL

Apache Subversion (often abbreviated SVN) is a software versioning and revision control system distributed as free software under the Apache License. Developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly compatible successor to the widely used Concurrent Versions System (CVS).

This instructions will help you installing SVN server.

Install PHP and Apache Packages

yum install httpd php php-devel php-cli php-pear


Start Apache web server and setup for it to autostart on system boot
yum install httpd php php-devel php-cli php-pear
service httpd restart
chkconfig httpd on


Install svn using yum
yum install mod_dav_svn subversion


Configure Subversion (subversion.conf)
vi /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<Location /svn>
DAV svn
SVNParentPath /svn/repos/projectX
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/svn-auth-file
Require valid-user
</Location>

Create SVN Repository

cd /svn/repos/projectX
svnadmin create svnrepo
chown -R apache:apache svnrepo


Create SVN Users
Following commands will create two users for svn.
htpasswd -cb /etc/svn-auth-file admin9 pass9
htpasswd -b /etc/svn-auth-file user8 pass8

If you are wondering why I display the password on commandline. I actually hit a bug. My httpd version is 2.4.4. See this Link1 Link2

If you have httpd 2.4.6 and above you can use below command.

htpasswd /etc/svn-auth-file user7

Access Your Repository in Browser

Open using a browser to access the repository.
http://192.168.0.5/svn/svnrepo/

Enter user name and password in browser.

Checkout Files to Your Repository
svn co http://192.168.0.5/svn/svnrepo/

Add and Checkin Files to Your Repository
cd svnrepo
vi fileA.txt 
vi fileB.txt
svn add fileA.txt fileB.txt
svn ci fileA.txt fileB.txt -m "First commit"

Access http://192.168.0.5/svn/svnrepo/ url in browser, you will see your new files there.

search iomeweekly