Siddesh BG's Build Release Config mgmt Blog

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, 28 January 2009

Perforce branch locking

Posted on 01:05 by Unknown
You can lock Perforce branch,depot or any other folder by using either
1) Protection table
2) Triggers

Using protection table:
You can lock a branch by just creating a new rule in Protection table. For example here, we are locking a branch called //dev/envision/esi/... by just providing only read permission to group xxx

read group xxx * -//dev/envision/esi/...


Here is a complex example.
The below protection table locks the branch //release/envision4.1sp1/... for every one else, except the user xxxats2. It locks for all the concerned groups release-xxx-4.0, xxx, yyy-group, yyy-all

                =write group release-xxx-4.0 * -//release/envision4.1sp1/...

                =write group xxx * -//release/envision4.1sp1/...
                =write group yyy-group * -//release/envision4.1sp1/...
                =write group yyy-all * -//release/envision4.1sp1/...
                write user xxxats2 * //release/envision4.1sp1/...

                =write group ddds * -//user_information/enVision/4.1_SP1/output/...
                =write group uuuu-info * -//user_information/enVision/4.1_SP1/output/...
                =write group yyy-all * -//user_information/enVision/4.1_SP1/output/...
                write user xxxats2 * //user_information/enVision/4.1_SP1/output/...



Points to remember:

  • The protection table order works from bottom to top. Hence place new locking rules below the existing rules in order for it be in effect.
  • =write : means, provide all other privileges ( like read, open), except write
  • Use "p4 protects //release/envision4.1SP1/..." command to find out which all groups/users already have write privileges. Remove write privileges from all the concerned groups


Using triggers:
You can also lock a branch by writing a changelist submission trigger of type change-submit. Here the trigger logic work something like, when a changelist comes for submission, check for files under branch which you want to lock and also check for some .lock file created in a location accessible to server. If .lock file is present then cancel change submission.
Cons: This will definitely slowdown the CL submission time.
Read More
Posted in Perforce | No comments

Thursday, 22 January 2009

Setting up NFS server (Fedora core10) and client on FC6

Posted on 05:56 by Unknown
NFS means Network File System. NFS allows a system to share directories and files with others over a network. By using NFS, users and programs can access files on remote systems almost as if they were local files.
Benefits of NFS:
*) Local workstations use less disk space because commonly used data can be stored on a single machine and still remain accessible to others over the network.
*) There is no need for users to have separate home directories on every network machine. Home directories could be set up on the NFS server and made available throughout the network.

How NFS Works?
NFS consists of at least two main parts: a server and one or more clients. The client remotely accesses the data that is stored on the server machine. In order for this to function properly a few processes have to be configured and running.
The server has to be running the following daemons: portmap or rpc.portmap, rpc.nfsd, rpc.lockd, rpc.statd, rpc.mountd, rpc.rquotad.

Configuring NFS Server
Through Gui: Redhat & Fedora distributions provide a GUI interface to setup NFS server.
Just type "system-config-nfs" on a terminal to invoke GUI setup. Then click "Add" Button at top left. Provide directory which you want to share and allowed hosts. In case if you don't want to restrict hosts, then type "*" in hosts field. Select permissions read-write/read-only and then click "ok".

Through command line:
Edit /etc/exports file. An entry in /etc/exports will typically look like this:
directory machine1(option11,option12) machine2(option21,option22)

Example: /opt *(rw,sync)

To make more robust, you can configure optional files /etc/hosts.allow and /etc/hosts.deny

After this make sure daemons portmapper, nfsd is running in your system ("rpcinfo -p" command will help you in this regard). Then run the command "exportfs -ra" to force nfsd to re-read the /etc/exports file.

For more details refer http://www.linux.org/docs/ldp/howto/NFS-HOWTO/server.html


Configuring NFS Client:

Mounting remote directories:
Make sure portmapper and optional rpc.statd, rpc.lockd daemons running on your system. With these daemons running, you should now be able to mount the remote directory from your server just the way you mount a local hard drive, with the mount command.For example
mount master.foo.com:/opt /mnt/opt or
mount -t nfs master.foo.com:/opt /mnt/opt

The standard form of the mount command, is
mount -t type device dir
where -t vfstype( file system types)

Windows mount: mount -t cifs //128.222.180.22/channel /mnt/envision -o username=,domain=corp

Getting NFS File systems to be mounted at boot time:
NFS file systems can be added to your /etc/fstab file the same way local file systems can, so that they mount when your system starts up. The only difference is that the file system type will be set to nfs and the dump and fsck order (the last two entries) will have to be set to zero. For example
cat /etc/fstab
# device mountpoint fs-type options dump fsckorder
10.31.251.75:/export/kits/envision /export/kits/envision nfs defaults 0 0

Then run "mount -a" command and also if require umount

Details: http://www.higs.net/85256C89006A03D2/web/PageLinuxNFSClientSetup. and also man mount
Read More
Posted in NFS | No comments

Wednesday, 21 January 2009

Knowing processor information from Solaris Box

Posted on 05:23 by Unknown
Solaris provides a command called psrinfo which displays information about processors.

For example to know whether your system runs on AMD or Intel processor, run this command with following arguments

bash-3.00# psrinfo -p -v
The physical processor has 1 virtual processor (0)
x86 (GenuineIntel family 15 model 4 step 8 clock 3391 MHz)
Intel(r) Xeon(tm) CPU 3.40GHz


As always, try out man psrinfo for detailed information.
Read More
Posted in Solaris | No comments

How to expand vmware disk space?

Posted on 03:02 by Unknown
You can expand vmware disk space in already installed VM Workstation by using a utility called vmware-vdiskmanager. This utility can be found in your VMWare Workstation installation directory i.e C:\Program Files\VMware\VMware Workstation.

Suppose if you want to increase your disk space from 8GB to 15 GB, then run this command as given below

vmware-vdiskmanager.exe -x 15Gb "Red Hat Enterprise Linux 4.vmdk"

Here the last argument needs to be replaced with your own .vmdk file for which you need to increase it's size.

If every thing goes well the output from above command will be
-----------------------------------------------------------------------------
O/P:
Using log file C:\DOCUME~1\guruss1\LOCALS~1\Temp\vmware-guruss1\vdiskmanager.log
Grow: 100% done.
The old geometry C/H/S of the disk is: 1044/255/63
The new geometry C/H/S of the disk is: 1958/255/63
Disk expansion completed successfully.

WARNING: If the virtual disk is partitioned, you must use a third-party
utility in the virtual machine to expand the size of the
partitions. For more information, see:
http://www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1647

-----------------------------------------------------------------------------

Make sure you logged out from your workstation when you execute this command.

For more help run "vmware-vdiskmanager -help"
Read More
Posted in vmware | No comments

Thursday, 15 January 2009

Use of .PHONY targets in Makefiles, an example

Posted on 03:56 by Unknown
Targets that do not represent files are known as phony targets. Examples are standard phony targets such as "clean", "all". It also makes a target always out of date.

It is important to note that make cannot distinguish between a file target and phony target. If by chance the name of a phony target exists as a file, make will associate the file with the phony target name in its dependency graph. If, for example, the file clean happened to be created running make clean would yield the confusing message:
$ make clean
make: `clean' is up to date.

Since most phony targets do not have prerequisites, the clean target would always be considered up to date and would never execute.

To avoid this problem, GNU make includes a special target, .PHONY, to tell make that a target is not a real file. Any target can be declared phony by including it as a prerequisite of .PHONY:
.PHONY: clean
clean:
rm -f *.o

Now make will always execute the commands associated with clean even if a file named clean exists.

Here is a simple Makefile which demonstrates the problem and solution
------ Makefile --------------------------
all: print
print:
cat clean
clean:
rm *.o
--------------------------------------------
If you just call make, it outputs the contents of "clean" file present in the current working directory.
For Ex:
[siddesh@jadoo phony]$ make
cat clean
This is a clean script

Suppose if you want to run clean target to remove .o files, then you need to run "make clean". But you woudn't be getting desired output. Lets see what it reports

[siddesh@jadoo phony]$ make clean
make: `clean' is up to date.

Corrected Makefile
------------------------------------------
all: print
print:
cat clean

.PHONY: clean
clean:
rm *.o
--------------------------------------------
Now if you try "make clean", it will call clean target to clean .o files
[siddesh@jadoo phony]$ make clean
rm *.o
Read More
Posted in Makefile | No comments
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • Solution to Project Euler Problem 10 - Find the sum of all the primes below two million
    http://projecteuler.net/problem=10 Problem The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two mi...
  • 0509-036 Cannot load program p4 because of the following errors
    Here is the full description of error ............ bash-3.00# p4 info exec(): 0509-036 Cannot load program p4 because of the following error...
  • fortifyclient uploadFPR An internal error has occurred
    When you try to upload a .fpr file to Fortify 360 server and you get the below mentioned error. Then, this blog provides one of the route ca...
  • Installing and configuring Fortify on Linux and Windows machines
    Installing Fortify on Linux (RHEL 5 32 bit) Download Fortify archive Fortify-360-2.6.5-Analyzers_and_Apps-Linux-x86.tar.gz and extract it to...
  • Unable to resolve target system name - a DNS problem
    I was not able to ping to any machines from my Windows 2003 server. I did following steps to debug & resolve the issue, which was relate...
  • Fortify scan automation steps for analyzing c/c++ code (Makefiles)
    I wrote in my previous blog about installing and configuring Fortify client. This blog presents standard steps to automate fortify scan for ...
  • Perforce - can't edit exclusive file already opened
    In perforce, whenever a binary file like doc, xls or ppt files are checked out, it is opened in exclusive lock mode. So no other person can ...
  • Posting a JIRA bug using Perl Mechanize
    Perl provides modules which can be used as command line browser to automate tasks dependent on web pages. Among them LWP and mechanize are i...
  • Perforce and cygwin
    Are you a command-line freak ? Do you want your automated shell scripts to run on Windows ? Do you wish to work with Perforce commands on Cy...
  • jenkins error: java.io.IOException: Authentication method password not supported by the server at this stage
    When I tried to add a node to jenkins/hudson using ssh as launch method, the authentication keeps on failing with the below error. [12/15/11...

Categories

  • AIX
  • AIX ssh
  • ANT
  • apache
  • appliance
  • awk
  • branching
  • build-failures
  • cgi-perl
  • code-signing
  • commands
  • continuous Integration
  • cvs
  • cygwin
  • DNS
  • Drupal
  • EPM
  • euler
  • Fortify
  • hadoop
  • hpux
  • html
  • InstallShield
  • iptables
  • iso
  • jenkins-hudson
  • Jira
  • kiwi
  • linux
  • Makefile
  • maven
  • Miscellaneous
  • mysql
  • nexus
  • NFS
  • package
  • Perforce
  • Perl
  • php
  • rbuilder
  • rpath
  • rpm
  • rsync
  • Solaris
  • ssh
  • SuseStudio
  • tinderbox
  • unix
  • Visual studio 2008
  • vmware
  • war
  • webserver
  • wget
  • windows
  • xterm

Blog Archive

  • ►  2013 (12)
    • ►  December (1)
    • ►  July (2)
    • ►  April (2)
    • ►  March (2)
    • ►  February (3)
    • ►  January (2)
  • ►  2012 (43)
    • ►  December (2)
    • ►  November (1)
    • ►  October (4)
    • ►  September (7)
    • ►  August (5)
    • ►  July (4)
    • ►  June (2)
    • ►  May (3)
    • ►  April (4)
    • ►  March (3)
    • ►  February (1)
    • ►  January (7)
  • ►  2011 (23)
    • ►  December (4)
    • ►  November (9)
    • ►  October (4)
    • ►  September (1)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
  • ►  2010 (15)
    • ►  December (2)
    • ►  November (1)
    • ►  September (3)
    • ►  April (1)
    • ►  February (6)
    • ►  January (2)
  • ▼  2009 (28)
    • ►  November (5)
    • ►  October (3)
    • ►  September (2)
    • ►  August (1)
    • ►  July (1)
    • ►  June (5)
    • ►  May (3)
    • ►  April (1)
    • ►  February (2)
    • ▼  January (5)
      • Perforce branch locking
      • Setting up NFS server (Fedora core10) and client o...
      • Knowing processor information from Solaris Box
      • How to expand vmware disk space?
      • Use of .PHONY targets in Makefiles, an example
  • ►  2008 (20)
    • ►  December (6)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  July (8)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile