Siddesh BG's Build Release Config mgmt Blog

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

Tuesday, 19 May 2009

How to start sshd in AIX Machine?

Posted on 01:23 by Unknown
- Login as root
- startsrc -s sshd #This will start sshd process
0513-059 The sshd Subsystem has been started. Subsystem PID is 27216.

- lssrc -s sshd #To check the status of sshd
Subsystem Group PID Status
sshd ssh 253954 active


We can set environment variables in the file /etc/environment. Variables set in this variables overrides variables defined in shell login scripts like .bashrc, when logged in using ssh
Read More
Posted in AIX ssh, commands | No comments

Monday, 11 May 2009

Perforce spec depot

Posted on 22:58 by Unknown
No need to manage manually perforce specs like client spec, job spec, label spec, branch spec, protection table, etc. Perforce (from 2005.1 release) provides a special depot called specs depot which take care of managing these specs by automatically creating a new version under //spec for each spec modifications.
How to create spec depot?
- p4 depot spec (or any other name U wish)
- In type field change it to spec (by default it comes local)
- Save it. It creates //spec depot. From now on any modifications to specs are stored under //spec depot. For example client spec changes will be stored in //spec/client/client-name.p4s

How to populate spec depot with change details for specs already created?
Run command "p4 admin updatespecdepot -a" (This command available from 2007.3 release).
If you want to restrict population to specific type of spec, then modified command will be
p4 admin updatespecdepot -s spec
Ex: p4 admin updatespecdepot -s client
Read More
Posted in Perforce | No comments

Tuesday, 14 April 2009

Perforce resources

Posted on 04:36 by Unknown
Perforce official Blog/
Perforce twitter
Perforce knowledge base
Perforce Website
Perforce Mail list perforce-user@perforce.com
Perforce @ CM crossroads
Read More
Posted in Perforce | No comments

Monday, 16 February 2009

rsync: command not found error even though rsync installed in local & remote server (Solaris)

Posted on 04:13 by Unknown
I was trying to take backup of some content from a Solaris machine to Linux machine using rsync. But it was giving a strange error

> /usr/bin/rsync -avuz --stats someuser@remote-solaris-machine:/export/CVS-xcert/* /export/HCL-CVS
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(454) [sender=2.6.9]

Even though rsync installed in both local & remote machines, it is complaining about rsync unavailability in Solaris machine (Remote machine)

What happened here is that it was not able to find rsync in standard path in remote machine. The solution for this problem is

/usr/bin/rsync -avuz --stats --rsync-path=/usr/local/bin/rsync someuser@remote-solaris-machine:/export/CVS-xcert/* /export/HCL-CVS

In these type of problems we need to explicitly suggest the rsync path of remote machine through --rsync-path argument
Read More
Posted in commands | No comments

Wednesday, 4 February 2009

MD5 and SHA1 checksums

Posted on 20:40 by Unknown
A checksum or hashsum is a fixed-size data computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmissions or storage. The integrity of the data can be checked at any later time by recomputing the checksum and comparing it with the stored one. If the checksums do not match, the data was certainly altered.

A cryptographic hash function is a deterministic procedure that takes an arbitrary block of data and returns a fixed-size bit string, the hash value, such that an accidental or intentional change to the data will almost certainly change the hash value. In many contexts, the data to be encoded are often called the "message", and the hash value is also called the message digest or simply digest.

The ideal hash function has four main properties:
* it is easy to compute the hash for any given data,
* it is extremely difficult to construct a text that has a given hash,
* it is extremely difficult to modify a given text without changing its hash,
* it is extremely unlikely that two different messages will have the same hash.

In cryptography, MD5 (Message-Digest algorithm 5) is a widely used cryptographic hash function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of files. Collision has been found in the MD5 algorithm, meaning that you may get a same md5 hash value from two different files, indicate md5 hash is no longer unique. Therefore, some of the downloads uses sha-1 for data integrity checksum, one of the example is Fedora 7 DVD.

The SHA (Secure Hash Algorithm) hash functions are a set of cryptographic hash functions. The three SHA algorithms are structured differently and are distinguished as SHA-0, SHA-1, and SHA-2. No attacks have yet been reported on the SHA-2 variants. sha-1 uses 160 bits.

sha1sum is a computer program which calculates and verifies SHA-1 hashes. It is commonly used to verify the integrity of files. It (or a variant) is installed by default in most Unix-like operating systems, including Mac OS X. Variants include shasum, sha224sum, sha256sum, sha384sum and sha512sum, which use a specific larger hash function than SHA-1. Versions for Microsoft Windows also exist. Some weaknesses have been found in SHA1. However, sha1sum is still usable for general-purpose file checksumming, and is widely considered more secure than MD5 or a CRC.

md5sum is a computer program that calculates and verifies 128-bit MD5 hashes. The MD5 hash (or checksum) functions as a compact digital fingerprint of a file. It is extremely unlikely that any two non-identical files existing in the real world will have the same MD5 hash. The md5sum program is installed by default in most Unix, Linux, and Unix-like operating systems or compatibility layers. BSD variants (including Mac OS X) have a similar utility called md5. Versions for Microsoft Windows do exist. Note that a cryptanalytic attack on the MD5 algorithm has been found, which means a method has been found to calculate a file that will have a given md5sum in less than the time required for a brute force attack. Although it would still be quite computationally expensive to construct such a file, md5sum should not be used in situations where security is important (such as cryptographic hashing). It is still useful for general-purpose file integrity verification, such as protecting against random bit flips.

How to create MD5 checksum?
Let say you want to check the file getos.sh.
> md5sum getos.sh
02b0ca290739f9d50fa6591e3892d3dd getos.sh

With this, it prints out the 128 bit fingerprint strings. Tally the string you obtained with the provided one. Provider do the same way to obtain this string and publish to the site.

Another way let say you have more files to verify, you can create a text file, such as md5sum.txt
283158c7da8c0ada74502794fa8745eb ubuntu-6.10-alternate-amd64.iso
549ef19097b10ac9237c08f6dc6084c6 ubuntu-6.10-alternate-i386.iso
5717dd795bfd74edc2e9e81d37394349 ubuntu-6.10-alternate-powerpc.iso
99c3a849f6e9a0d143f057433c7f4d84 ubuntu-6.10-desktop-amd64.iso
b950a4d7cf3151e5f213843e2ad77fe3 ubuntu-6.10-desktop-i386.iso
a3494ff33a3e5db83669df5268850a01 ubuntu-6.10-desktop-powerpc.iso
2f44a48a9f5b4f1dff36b63fc2115f40 ubuntu-6.10-server-amd64.iso
cd6c09ff8f9c72a19d0c3dced4b31b3a ubuntu-6.10-server-i386.iso
6f165f915c356264ecf56232c2abb7b5 ubuntu-6.10-server-powerpc.iso
4971edddbfc667e0effbc0f6b4f7e7e0 ubuntu-6.10-server-sparc.iso

First column is the md5 string and second column is the location of the file. To check all them from file, do this:

> md5sum -c md5sum.txt

The output will be like this if success
...
ubuntu-6.10-desktop-amd64.iso: OK
ubuntu-6.10-desktop-i386.iso: OK
...


How to perform sha1 checksum?
The lines below are fedora 7 DVD iso’s Hash
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

96b13dbbc9f3bc569ddad9745f64b9cdb43ea9ae F-7-i386-DVD.iso

To perform sha1 checksum, it works similar to md5sum
> sha1sum F-7-i386-DVD.iso | grep "96b13dbbc9f3bc569ddad9745f64b9cdb43ea9ae"

Copy and paste the sha1 code and paste it with grep after the pipelines, if a line has returned indicate it passes the checksum, else, too bad :( , you have to download the iso again.

Ref: Wikipedia & linux.byexamples.com
Read More
Posted in commands | No comments

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
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • 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...
  • AIX: make: 1254-055 Dependency line needs colon or double
    We get this compilation issue "make: 1254-055 Dependency line needs colon or double" while compiling C/C++ code in AIX machines. I...
  • 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...
  • 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...
  • 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...
  • 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 ...
  • Tweak single instance of tinderbox to work on two different perforce servers
    Tinderbox is a tool developed by Mozilla, which collects build logs and presents the logs and the result it in a nice, clear and concise way...
  • What is Apache Hadoop?
    Newbies can get a clean and simple introduction to Hadoop from the following Pivotal blog posts 1)  Demystifying Apache Hadoop in 5 Pictures...
  • How to know architecture of a AIX machine?
    We can easily know the architecture type in Linux or Solaris systems with the help of "uname" command. But uname command in AIX do...
  • Few words about windows service
    What is windows service? it's a program that runs invisibly in the background. But can't the same thing be said for a number of prog...

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)
      • How to restart windows from command line ?
    • ►  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)
  • ►  2008 (20)
    • ►  December (6)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  July (8)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile