Dec 18, 2013

Not able to login Jenkins ? Locked yourself by messing security ? How to disable security in Jenkins

Rarely we end up locking ourself in jenkins so that we couln't login Jenkins.


For example -

If you enable security before creating an account, you end up being access denied with out any login account in hand.
























Jenkins throws error like

javax.servlet.ServletException: hudson.security.AccessDeniedException2: anonymous is missing the Overall/Administer permission

This can be solved by editing the config.xml  and disabling the security by changing

<useSecurity>true</useSecurity>

into 

<useSecurity>false</useSecurity>

You can refer this url from Jenkins - https://wiki.jenkins-ci.org/display/JENKINS/Disable+security



Dec 13, 2013

How to Fix error 'Could not determine the server's fully qualified domain name, using 127.0.0.1 '

Problem:

[root@spa ~]# service httpd start
Starting httpd: httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for S erverName
                                                           [  OK  ]
[root@spa ~]#

solution:

Edit /etc/httpd/conf/httpd.conf
and search for ServerName and add
ServerName localhost

How to reset passwords in perforce

From time to time, it is inevitable that users will forget Perforce passwords. A Perforce superuser can set a new password for any user with:

    Release 99.1 and later:

        p4 passwd username

    (Perforce will prompt the superuser for a new password for user username.)

C:\Users\mohan>p4 passwd thangam
Enter new password:
Re-enter new password:
Password updated.

How to delete the changelist and workspace of another user ( clean ex-employee workspace to reclaim space and license )


this will give you the pending changes on the client

p4 changes -c user_workspace

this will delete the pending change list of your choice

p4 change -d

after that, you can delete the client using

p4 client -d user_workspace

How to overwrite symbolic links in unix

You can overwrite symbolic links by using -f to the default command

Example
mohan@mysys /cygdrive/c/
$ ln -s /tmp/test.sh tumba
mohan@mysys /cygdrive/c/
$ ls -l
total 80
lrwxrwxrwx  1 mohan        Domain Users    5 Oct  9 14:59 tumba -> /tmp/test.sh
mohan@mysys /cygdrive/c/
$ ln -s /tmp/build_env.log  tumba
ln: failed to create symbolic link `tumba': File exists
mohan@mysys /cygdrive/c/


 Now we can overwrite the existing symbolic link by using -f







$ ln -s -f /tmp/build_env.log  tumba
mohan@mysys /cygdrive/c/
$ ls -l
total 80
lrwxrwxrwx  1 mohan        Domain Users    5 Oct  9 14:59 tumba -> /tmp/build_env.log

How to fix perforce error 'Some file(s) could not be transferred from client.'

Problem:
open for read: c:\p4\client_spec.txt: The system cannot find the file specified.
Submit aborted -- fix problems then use 'p4 submit -c 1347493'.
Some file(s) could not be transferred from client.

Cause:
When you try to open a file which does not exist in perforce, it gives above error. First do a p4 add, and then open it.

How to change the binary name from the defalut name setup.exe in Installshield


installshield  - change setup.exe name
release tab-> product configureation -> setup file name(change)

Specify the file name—without the .exe file extension—that InstallShield should use
for the setup launcher file that it generates at build time. If this setting is blank,
InstallShield uses the default value of Setup, and the setup launcher file is called
Setup.exe.

how to format FAT 16 in windows 7


C:\Users\mohan>format G:  /FS:FAT /A:16K
Insert new disk for drive G:
and press ENTER when ready...
The type of the file system is FAT.
Verifying 3835M
The specified cluster size is too small for FAT16/12.

How to Unmount an ISO in linux

To see the list of currently mounted file systems,

#mount

To unmount a mounted iso,






# umount /mnt/iso

assuming that your image is mounted at /mnt/iso

How to mount ISO in Linux using command line

Procedure to mount ISO images under Linux

As Root

1)Create some directory to mount the iso so that you can view it as a regular directory.

             # mkdir -p /mnt/disk

2) Use mount command as follows to mount iso file called disk1.iso:

             # mount -o loop disk1.iso /mnt/disk

Now to see the contents of iso file, Change directory to list files stored inside an ISO image:
            # cd /mnt/disk
            # ls -l


More about loop device

A loop device is a pseudo-device that makes a file accessible as a block device. Loop devices are often used for CD ISO images and floppy disc images. Mounting a file containing a filesystem via such a loop mount makes the files within that filesystem accessible. They appear in the mount point directory using above commands.

how to add files under apache server

In Apache server, add your contents under a directory and create symlink to it under /var/www/html/

or

move your directory under /var/www/html/

How to send mail in linux

mail -s "Hello world" mohan@yahoo.com

Use Control+D to move next item

Execution Failed: "/bin/vi" ".\t1636t37.tmp": The system cannot find the path specified.

Problem:
Execution Failed: "/bin/vi" ".\t1636t37.tmp": The system cannot find the path specified.

Cause:
you are trying to do a p4 edit in cgywin, where p4 is pointing to the windows version  c:\program files\p4.exe so its trying to open textfile in vi using windows p4.exe. Change the default p4  pointing to the cygwinversion and try.

How to check whats running in the perforce server or How to monitor perforce server

Like the 'top' command in Linux which helps us to see what process and commands are running in the system, perforce has 'monitor' command to list the operations running in its system.

It lists the users and their commands currently running in the perforce server

Example -

mohan@vmlinux/cygdrive/c/p4_mohan/user_informatio
5.0/output
# p4 monitor show
 7097 R mohan    00:00:00 monitor
 7098 R rama       00:00:00 labels
 7099 R arus    00:00:00 spec
28435 R perforce   00:30:31 verify

Could not connect to perforce. error 'It is possible that someone is intercepting your connection to the Perforce P4PORT '10.31.64.101:1888''

Error Message:

[mohan@spl ~]$ p4 info
******* WARNING P4PORT IDENTIFICATION HAS CHANGED! *******
It is possible that someone is intercepting your connection
to the Perforce P4PORT '10.11.64.101:1888'
If this is not a scheduled key change, then you should contact
your Perforce administrator.
The fingerprint for the mismatched key sent to your client is8A:BE:F1:B9:DC:E3:50:D1:16:D6:6D:66:BB:AE:0B:26:86:C0:60:DC
To allow connection use the 'p4 trust' command.


Reason:
This happens due to environmental changes like change of ip or mac address etc. It makes the established and stored fingerprint to mismatch. So you have to reestablish the 'trust' with the server again. so we will not be able to run any command.

You have to do this by issuing 'p4 trust -f'

[build@splash ~]$ p4 trust -f
******* WARNING P4PORT IDENTIFICATION HAS CHANGED! *******
It is possible that someone is intercepting your connection
to the Perforce P4PORT '10.11.64.101:1888'
If this is not a scheduled key change, then you should contact
your Perforce administrator.
The fingerprint for the mismatched key sent to your client is8A:BE:F1:B9:DC:E3:50:D1:16:D6:6D:66:BB:AE:0B:26:86:C0:60:DC
Are you sure you want to establish trust (yes/no)? yes
Added trust for P4PORT 'ssl:p4pserver.cmp.com:1888' (10.11.64.101:1888)


Now you can try some p4 commands to verify.

how can I find out the "source" changelist of the newly created branch in perforce?

To see details on source of branch integrated in perforce

After branching from base branch to a new branch, can we find the changelist at which the branch is created from source branch?

You can find it by using the below command with the new branch ( the child branch for whom you are interested to see the history)

p4 changes -i  //depot/child_branch


This will list  the  changes of this branch followed by the changes happened in its parent branch. By describing the changes you can get the particular parent branch name.

Syntax for p4 describe

p4 describe <changelist number>

example-
$ p4 describe 1129671
Change 7129671 by ravis1@project on 2010/06/29 06:51:50

        starting tomcat using "start startup.bat" command

Affected files ...

... //dev/env/atia/eventrepository/install/install.bat#11 edit
... //dev/env/atia/eventrepository/readme.txt#6 edit