Professional Documents
Culture Documents
Ans1.2
Computers system clock or software clock runs when a computer is on. It is implemented by
computers processor. There is a fixed clock frequency of a computer, which triggers the value 0 to 1
and then 1 to 0, so that fixed number of cycles can be defined for a second, in multiple of seconds to
define minutes, and hours and so on.
Ans1.3
www.programmingassignmentshelp.net
help@programmingassignmentshelp.net
The clock that is managed by Linux kernel is not the same as the hardware clock. Hardware clock runs
even when you computer is not running. Hardware clock is also known as BIOS clock. The Linux
software clock is not always accurate. It is kept running by a periodic timer interrupt generated by PC
hardware.
The Linux kernel keeps track of time independently from the hardware clock. During the boot, Linux
sets its own clock to the same time as the hardware clock. After this, both clocks run independently.
Linux maintains its own clock because looking at the hardware is slow and complicated.
In case h/w clock needs to be update, we can do this by rebooting the computer and then setup the
clock on BIOS screen. If it is not possible, then we can use below commands to set hardware clock:
hwclock w
hwclock systohc For syncing the hardware clock with software clock.
To sync software clock to hardware clock then we can use the below commands:
hwclock -s
hwclock hwtosys for synching software clock to h/w clock
Time synchronization is required in order to make all programs work in defined manner. If there are
mismatch between clocks, then system may behave in different manner which is not as per the
defined manner e.g. execution of scheduled tasks may be either done in advance or it may get
delayed. Read about Intelligent Recommendation System.
Ans1.4
UTC is a universal time clock, which is defined once for the world. It is set on Internet, so that anyone
can access it from there. This is made to make this world work simultaneously. When a computer is
running and connected to Internet, we can issue commands to synchronize and fetch information
from UTC. This command corrects the system time make the kernel clock equivalent to UTC.
Ans1.5
Network time protocol (NTP), is a networking protocol, it is used for clock synchronization between
computers. A semi-layered and hierarchical system of time sources is used by NTP. Each level of this
hierarchy is knowns as stratum and is assigned a number starting with 0 at the top. This number
represents the distance from Reference Clock.
Only strata from 0 to 15 are valid. Stratum 16 is used to indicate that a device is unsynchronized.
ANS 2.1
www.programmingassignmentshelp.net
help@programmingassignmentshelp.net
www.programmingassignmentshelp.net
help@programmingassignmentshelp.net
The file-system is now ready and can be mounted using command cryptmount cryptusb. To
unmount use cryptmount u cryptusb.
ANS 2.2
. Change path in dev and keyfile fields to path to cryptusb.fs and cryptusb.key if flash drive on this
machine is not mounted as /media/flash. You can also change dir field if you want the file system to
be mounted some where else. After adding this to /etc/cryptmount/cmtab save the file
# e2label /dev/mapper/cryptusb cryptusb
ANS2.3
She can use this file-system on another machine just copy
cryptusb {
dev=/media/flash/cryptusb.fs
dir=/home/adnan1/cryptusb
fstype=ext3
fsoptions=defaults
cipher=aes
keyfile=/media/flash/cryptusb.key
keyformat=builtin
}
to /etc/cryptmount/cmtab on other machine. Change path in dev and keyfile fields to path to
cryptusb.fs and cryptusb.key if flash drive on this machine is not mounted as /media/flash. You can
also change dir field if you want the file system to be mounted some where else. After adding this to
/etc/cryptmount/cmtab save the file and issue follwing commands
# cryptmount prepare cryptusb
# cryptmount release cryptusb
and you are done. you can now mount and unmount the file system using cryptmount. You may face
some problem accessing files and directories because of file permissions. You can always change file
and directory permissions using chmod and chown commands. A simple workaround is to make
root to be the owner of this filesystem. To do this mount this file system using cryptmount cryptusb
then issuing command chown root:root /home/adnan1/cryptusb. Then you can access this file
system as root on both machines. This way you wont have to change permissions whenever you take
this filesystem from one machine to other.
ANS3.1
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.
www.programmingassignmentshelp.net
help@programmingassignmentshelp.net
To access Subversion repository using the HTTP protocol, you must install and configure a web server.
Apache2 is proven to work with Subversion. Please refer to the HTTP subsection in the Apache2
section to install and configure Apache2. To access the Subversion repository using the HTTPS
protocol, you must install and configure a digital certificate in your Apache 2 web server. Please refer
to the HTTPS subsection in the Apache2 section to install and configure the digital certificate.
To install Subversion, run the following command from a terminal prompt:
#sudo apt-get install subversion libapache2-svn
ANS3.2
I have created script using Skelton script, I got my Init script subversion under /etc/init.d:
#!/bin/sh
#
# start/stop subversion daemon.
EXECUTABLE=/usr/bin/svnserve
# Test exist:ence of the executable
test -f $EXECUTABLE || exit 0
# Command line options for starting the service
OPTIONS=-d -r /usr/local/svn
. /lib/lsb/init-functions
case $1 in
start)
log_daemon_msg Starting subversion daemon: $EXECUTABLE $OPTIONS
start-stop-daemon -vo -x $EXECUTABLE -S $OPTIONS
log_end_msg $?
;;
stop)
log_daemon_msg Stopping subversion daemon: $EXECUTABLE $OPTIONS
start-stop-daemon -K -qo -x $EXECUTABLE
log_end_msg $?
;;
force-reload)
$0 restart
;;
restart)
$0 stop
www.programmingassignmentshelp.net
help@programmingassignmentshelp.net
$0 start
;;
*)
log_daemon_msg Usage: /etc/init.d/svnserve {start|stop|restart}
exit 1
;;
esac
exit 0
After created that script, I have added the script to the boot sequence:
Update-rc.d svnserve defaults
ANS3.3
The Subversion repository test can be created using the following command from a terminal prompt:
# svnadmin create fs-type fsfs /usr/local/svn/repo1
ANS3.4
Once the Subversion repository is created, we can configure the access control. We need to edit the
/usr/local/svn/repo1/conf/svnserve.conf file to configure the access control. For example, to set up
authentication, we can uncomment the following lines in the configuration file:
[general]
anon-access = read
auth-access = write
password-db = passwd
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
After uncommenting the above lines, can maintain the user list in the passwd file. So, edit the file
passwd in the same directory and add the new user. The syntax is as follows:
[users]
user1 = Us3r
For Authentication on path based acl need to change in authz file
[groups]
group = user1
test=test1
[/]
@group = rw
@test = r
www.programmingassignmentshelp.net
help@programmingassignmentshelp.net
ANS 3.5
To increase security, you can pass the -r option to svnserve, which restricts it to exporting only
repositories below that path. For example:
# svnserve -d -r /usr/local/svn
ANS 3.6
Once we create the repository we can import files into the repository. To import a directory, enter the
following from a terminal prompt:
#svn import /home/user/import/project svn://hostname/repo1/project
To checkout the the project we can use the following command
#svn co svn://hostname/project project username user1
To synchronize the project repository with the local copy, you can run the update sub-command. The
syntax of the command, entered at a terminal prompt, is as follows:
#cd project; svn update
ANS3.7
The followings stpes required to get the subversion system working
After Instalation of Subversion, Intially start the svn server with coustom script under
/etc/init.d/subversion. Using the command
# /etc/init.d/subversion start
It invokes svnserver daemon.
Listen port on 3690
Then create a repo using the below command
# svnadmin create fs-type fsfs /usr/local/svn/repo1
Configure svnserver.conf for password and path based ACL auth.
Once we create the repository we can import files into the repository. To import a directory, enter the
following from a terminal prompt:
#svn import /home/user/import/project svn://hostname/repo1/project
To checkout the the project we can use the following command
#svn co svn://hostname/project project username user1
To synchronize the project repository with the local copy, you can run the update sub-command. The
syntax of the command, entered at a terminal prompt, is as follows:
#cd project; svn update
Programming Assignments Help is the best assignment help provider in the United Kingdom.
Our online assignment writing help UK is especially dedicated for the students studying in all
UK colleges and universities. Submit assignment to get the best quality assignment help.
www.programmingassignmentshelp.net
help@programmingassignmentshelp.net