Showing posts with label How-to's. Show all posts
Showing posts with label How-to's. Show all posts

Dec 13, 2013

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 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 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 send mail in linux

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

Use Control+D to move next item

Jul 11, 2013

How to abort shutdown scheduled in windows

You may know that we can schedule a shutdown or hibernate after some time by

shutdown /s /t 3600

In case if you want to cancel it,  you can do that by below command,

shutdown /a


For your reference, the complete help details of shutdown command listed below,


C:\Users\mohan>shutdown /?
Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
    [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

    No args    Display help. This is the same as typing /?.
    /?         Display help. This is the same as not typing any options.
    /i         Display the graphical user interface (GUI).
               This must be the first option.
    /l         Log off. This cannot be used with /m or /d options.
    /s         Shutdown the computer.
    /r         Shutdown and restart the computer.
    /g         Shutdown and restart the computer. After the system is
               rebooted, restart any registered applications.
    /a         Abort a system shutdown.
               This can only be used during the time-out period.
    /p         Turn off the local computer with no time-out or warning.
               Can be used with /d and /f options.
    /h         Hibernate the local computer.
               Can be used with the /f option.
    /e         Document the reason for an unexpected shutdown of a computer.
    /m \\computer Specify the target computer.
    /t xxx     Set the time-out period before shutdown to xxx seconds.
               The valid range is 0-315360000 (10 years), with a default of 30.
               If the timeout period is greater than 0, the /f parameter is
               implied.
    /c "comment" Comment on the reason for the restart or shutdown.
               Maximum of 512 characters allowed.
    /f         Force running applications to close without forewarning users.
               The /f parameter is implied when a value greater than 0 is
               specified for the /t parameter.
    /d [p|u:]xx:yy  Provide the reason for the restart or shutdown.
               p indicates that the restart or shutdown is planned.
               u indicates that the reason is user defined.
               If neither p nor u is specified the restart or shutdown is
               unplanned.
               xx is the major reason number (positive integer less than 256).
               yy is the minor reason number (positive integer less than 65536).

Reasons on this computer:
(E = Expected U = Unexpected P = planned, C = customer defined)
Type    Major   Minor   Title

 U      0       0       Other (Unplanned)
E       0       0       Other (Unplanned)
E P     0       0       Other (Planned)
 U      0       5       Other Failure: System Unresponsive
E       1       1       Hardware: Maintenance (Unplanned)
E P     1       1       Hardware: Maintenance (Planned)
E       1       2       Hardware: Installation (Unplanned)
E P     1       2       Hardware: Installation (Planned)
E       2       2       Operating System: Recovery (Planned)
E P     2       2       Operating System: Recovery (Planned)
  P     2       3       Operating System: Upgrade (Planned)
E       2       4       Operating System: Reconfiguration (Unplanned)
E P     2       4       Operating System: Reconfiguration (Planned)
  P     2       16      Operating System: Service pack (Planned)
        2       17      Operating System: Hot fix (Unplanned)
  P     2       17      Operating System: Hot fix (Planned)
        2       18      Operating System: Security fix (Unplanned)
  P     2       18      Operating System: Security fix (Planned)
E       4       1       Application: Maintenance (Unplanned)
E P     4       1       Application: Maintenance (Planned)
E P     4       2       Application: Installation (Planned)
E       4       5       Application: Unresponsive
E       4       6       Application: Unstable
 U      5       15      System Failure: Stop error
 U      5       19      Security issue
E       5       19      Security issue
E P     5       19      Security issue
E       5       20      Loss of network connectivity (Unplanned)
 U      6       11      Power Failure: Cord Unplugged
 U      6       12      Power Failure: Environment
  P     7       0       Legacy API shutdown

Mar 1, 2013

How to change password in perforce

You can change your password in perforce using p4 cmd 'passwd'. This is same in windows\Linux. Example given below.


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

Feb 26, 2013

How to find a system 32 or 64 bit

In any Linux variants either one of this should work ( Redhat, Cent-Os, Ubuntu, Hp-ux, Solaris etc )

[mohan@chinna ~]$ arch
x86_64
[mohan@chinna ~]$ uname -m
x86_64
[mohan@chinna ~]$ getconf LONG_BIT
64


As you can guess, 64 / x86_64 is 64bit system, whereas 32 / i386 / i686  denotes its a 32 bit sytem.


For windows
Right-click MyComputer->Properties

It will bring a window like below image, from that you can check the system type

Feb 25, 2013

How to edit iptables in linux

Problem:
sometimes you may receive below error like

The description for Event ID ( 0 ) in Source ( sshd ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: sshd: PID 2992: Accepted publickey for build from 10.69.250.31 port 33344 ssh2.

Solution :
Either Turn off the firewall in linux or add the port 22 as exception in iptables

To disable selinux  edit /etc/sysconfig/selinux    and set SELINUX to disabled.

SELINUX=disabled

I've encountered such problems when the binaries and libraries were not
executable by SYSTEM.
"chmod 755 /usr/sbin/* /usr/bin/*" fixed the problem.

If the problem still exists, add the port to the iptables.

For adding port 22 to the iptables, from shell run

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

or

edit /etc/sysconfig/iptables
and append this line

-A INPUT -p tcp --dport 22 -j ACCEPT
Save and close the file. Restart iptables:
/etc/init.d/iptables restart
or
service iptables restart
Learn more about iptables by
man iptables

Feb 24, 2013

How to add Gnome to a CentOS 6 minimal install

Problem:
sometimes you may receive below error like

The description for Event ID ( 0 ) in Source ( sshd ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: sshd: PID 2992: Accepted publickey for build from 10.69.250.31 port 33344 ssh2.

Solution :
Either Turn off the firewall in linux or add the port 22 as exception in iptables

To disable selinux  edit /etc/sysconfig/selinux    and set SELINUX to disabled.

SELINUX=disabled

I've encountered such problems when the binaries and libraries were not
executable by SYSTEM.
"chmod 755 /usr/sbin/* /usr/bin/*" fixed the problem.

If the problem still exists, add the port to the iptables.

For adding port 22 to the iptables, from shell run

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

or

edit /etc/sysconfig/iptables
and append this line

-A INPUT -p tcp --dport 22 -j ACCEPT

Feb 18, 2013

This e-mail address is associated with a Nokia Messaging account

Problem
This e-mail address is associated with a Nokia Messaging account


Solution
If you configure mails in Nokia mobiles, your mail address will be linked with your nokia accout. The same email address cannot be configured in another nokia mobile. The solution is to call Nokia customer care and request them to remove the linking for your mail address.

Feb 17, 2013

How to count occurrences of a number or text in Excel

To count occurances of a particular number or words in a range of excel cells use formula

=COUNTIF(range,"pattern")
where range is the excel cells range where you want to search for the pattern. pattern can be numbers or words but it should be within double quotes "".

Example - To count number of occurance of word "present" in cells between A1 to A10. frame the formula like below

ex - COUNTIF(A1:A10,"Present")

also you can wildcard characters in the pattern.
Example   =COUNTIF(A1:A9,"*sent")

Feb 16, 2013

How to find filetype in windows


There is a utility called "file" in unix which determines filetype  of a file. There is no default similar utility available in windows.  After trying few utilities available online, I found this one more helpful.

http://home.fnal.gov/~jklemenc/dl/filetype.zip

Find more description about the tool at http://home.fnal.gov/~jklemenc/filetype.html

I have posted screenshot of an example

C:\Documents and Settings\tig\Desktop>filetype.exe
FileType.exe
  by: Joe Klemencic
  Copyright 2004

Usage:
   FILETYPE.EXE -i [-r] [-o ] [-v] [-?]

                -i - Inspect a single file or all files in a directory
                -r  - Rename the file with the correct extension (-o ignored)
                -o  - Output path for file copies (creates if not exist)
                -v  - Verbose output
                -?  - This help text


C:\Documents and Settings\tig\Desktop>filetype.exe -i  "Reach Out-participants.pdf"
Reach Out-participants.pdf (.pdf) "Adobe PDF File"

C:\Documents and Settings\tig\Desktop>filetype.exe -i  "Perl One Liners.htm"
Perl One Liners.htm (.txt) "Text file"

C:\Documents and Settings\tig\Desktop>filetype.exe -i  SyncToySetupPackage_v21_x86.exe
SyncToySetupPackage_v21_x86.exe (.exe) "Executable File"

C:\Documents and Settings\tig\Desktop>filetype.exe -i  toolsmanual.dvi
Could not identify toolsmanual.dvi, skipping....

C:\Documents and Settings\tig\Desktop>filetype.exe -i  quickCooking.do
quickCooking.do (.pdf) "Adobe PDF File"

Feb 13, 2013

How to perform shutdown from command prompt or to schedule shutdown/reboot/logoff in windows

There is a executable which comes default with windows namely, shutdown.exe which can be called in command prompt to shutdown the system.

To perform shutdown immediatly
c:\>shutdown /s /t 00

In this /s if for shutdown, similarly you can use /r for reboot /l for logoff etc.


To shutdown windows in 1 hour
c:\>shutdown /s /t 3600

refer manual for additional options

c:\>shutdown /?

Dec 6, 2012

How to query, install, upgrade or remove RPM in linux ?

Here we are first removing an existing rpm and installing the latest version.
For any of the action you should be either root or in the sudoers list.

To query for rpm
[root@system1 share]# rpm -qa | grep cmake cmake-2.6.4-5.el6.x86_64
To erase rpm
[root@system1 share]# rpm -e cmake-2.6.4-5.el6.x86_64
           [root@system1 share]# rpm -qa | grep cmake .
           [root@system1 share]#

To install rpm

           [root@system1 share]# rpm -i cmake-2.8.8-1.el6.rfx.x86_64.rpm
           warning: cmake-2.8.8-1.el6.rfx.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
           [root@system1 share]# rpm -qa | grep cmake cmake-2.8.8-1.el6.rfx.x86_64
           [root@system1 share]#
or


remove it using yum


            [root@system1 share]# yum remove

Oct 10, 2011

How to Find Uptime in windows


In Windows to find how long the system is ON or UP after starting, you can execute  the command 'net stats srv' in command prompt.
There is another one utility called 'uptime.exe' for the same purpose but you have download them explicitly.


Mar 10, 2011

How to find filetype in windows

There is a utility called "file" in unix which determines filetype  of a file. There is no default similar utility available in windows.  After trying few utilities available online, I found this one more helpful.

http://home.fnal.gov/~jklemenc/dl/filetype.zip

Find more description about the tool at http://home.fnal.gov/~jklemenc/filetype.html

I have posted screenshot of an example


C:\Documents and Settings\tig\Desktop>filetype.exe
FileType.exe
  by: Joe Klemencic
  Copyright 2004
 Usage:
   FILETYPE.EXE -i [-r] [-o ] [-v] [-?]
                 -i - Inspect a single file or all files in a directory
                -r  - Rename the file with the correct extension (-o ignored)
                -o  - Output path for file copies (creates if not exist)
                -v  - Verbose output
                -?  - This help text
  C:\Documents and Settings\tig\Desktop>filetype.exe -i  "Reach Out-participants.pdf"
Reach Out-participants.pdf (.pdf) "Adobe PDF File"
 C:\Documents and Settings\tig\Desktop>filetype.exe -i  "Perl One Liners.htm"
Perl One Liners.htm (.txt) "Text file"
 C:\Documents and Settings\tig\Desktop>filetype.exe -i  SyncToySetupPackage_v21_x86.exe
SyncToySetupPackage_v21_x86.exe (.exe) "Executable File"
 C:\Documents and Settings\tig\Desktop>filetype.exe -i  toolsmanual.dvi
Could not identify toolsmanual.dvi, skipping....
 C:\Documents and Settings\tig\Desktop>filetype.exe -i  quickCooking.do
quickCooking.do (.pdf) "Adobe PDF File"








Feb 16, 2011

How to check windows installer version in windows

To know the version of windows installer available in your windows, check the version of msi.dll present in c:\WINNT\system32

select   msi.dll -> rightclick -> Properties -> choose "Version" tab

It will have information like

File version : 3.1.4000.4039