Thursday, December 2, 2010

Setup Shell limits for Oracle user in Linux

Add lines to /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

Above values depend on your environment.

Add following script to /etc/profile.local
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ] ; then
ulimit –p 16384
ulimit –n 65536
else
ulimit –u 16384 –n 65536
fi
fi

Have a nice day!

Transfer files between Unix/Linux with SCP

The scp command can be used in three ways: 1. to copy from your computer to a remote server 2. to copy from a remote server to your computer, and 3. to copy from a remote server to another remote server.

copy from your computer to a remote server:

# scp examplefile user_id@your_server:/home/user_id/

copy from a remote server to your computer

# scp user_id@your_server:/home/user_id/examplefile .

copy from a remote server to another remote server

# scp user_id1@server1:/home/user_id1/examplefile user_id2@server2:/home/user_id2/

Putting'' an entire directory


# scp -r dir1 user1@server1:/MyRsrch/dir2/

``Getting'' an entire directory


ucsu> scp -r user1@server1:dir1/09  /dir2/r9/



Have a nice day.

Friday, November 5, 2010

Certificate request and import with Keytool commands

These commands allow generating a new keystore file, creating a CSR, and importing certificates. Any root or intermediate certificates will need to be imported before importing the primary certificate for your domain.

• Generate a Java keystore and key pair
keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048
• Generate a certificate signing request (CSR) for an existing Java keystore
keytool -certreq -alias mydomain -keystore keystore.jks -file mydomain.csr
• Import a root or intermediate CA certificate to an existing Java keystore
keytool -import -trustcacerts -alias root -file Thawte.crt -keystore keystore.jks
• Import a signed primary certificate to an existing Java keystore
keytool -import -trustcacerts -alias mydomain -file mydomain.crt -keystore keystore.jks
• Generate a keystore and self-signed certificate
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048

Java Keytool Commands for Checking
If you need to check the information within a certificate, or Java keystore, use these commands.

• Check a stand-alone certificate
keytool -printcert -v -file mydomain.crt
• Check which certificates are in a Java keystore
keytool -list -v -keystore keystore.jks
• Check a particular keystore entry using an alias
keytool -list -v -keystore keystore.jks -alias mydomain

Other Java Keytool Commands

• Delete a certificate from a Java Keytool keystore
keytool -delete -alias mydomain -keystore keystore.jks
• Change a Java keystore password
keytool -storepasswd -new new_storepass -keystore keystore.jks
• Export a certificate from a keystore
keytool -export -alias mydomain -file mydomain.crt -keystore keystore.jks
• List Trusted CA Certs
keytool -list -v -keystore $JAVA_HOME/jre/lib/security/cacerts
• Import New CA into Trusted Certs
keytool -import -trustcacerts -file /path/to/ca/ca.pem -alias CA_ALIAS -keystore $JAVA_HOME/jre/lib/security/cacerts

Ref: http://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html

Thursday, October 14, 2010

Create and install new certificate using "openssl" for a Secure Apache web server

1. Assume xyz is the company and supplychain.xyz.com is website.
2. Change to the SSL directory (go for appropriate driectory for your company)
cd /etc/apache2/ssl.key
3. Create Key for the server
#openssl genrsa –out supplychain.xyz.com-server.key 2048
4. Create a certificate signing request in the following directory (go for appropriate driectory for your company)
cd /etc/Apache2/ssl.csr
#openssl req –new –x509 –days 365 –key supplychain.xyz.com.key –out supplychain.xyz.com.csr

It will ask the following parameters
Parameters: -C “supplychain.xyz.com” –c US –s Kentucky –l Louisville -o “XYZ LLC” -u “eBusiness Services” -n “supplychain.xyz.com”
5. Test the certificate contents by using “openssl x509 –text –in supplychain.xyx.com.csr –noout”

6. Send the csr file to vendor to get the new certificate
7. When CA provides certificate, rename the certificate as supplychain.crt
8. Copy this file to the following directory /etc/Apache2/ssl.crt
9. Change group memebship to Apache with “chgrp apache supplychain.crt”
10. Edit the following file :
/etc/apache2/vhosts.d/supplychain-ssl.conf

SSLEngine on

# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. A test
# certificate can be generated with `make certificate' under
# built time.
SSLCertificateFile /etc/apache2/ssl.crt/supplychain.crt

# Point SSLCertificateKeyFile at the private key.
SSLCertificateKeyFile /etc/apache2/ssl.key/supplychain.xyz.com-server.key

# If your CA tells you that you need the Intermediate or Root
# certificate, install and specify it as here:
SSLCACertificateFile /etc/apache/ssl.crt/ca-bundle.crt (in our case no need to change it)

11.Restart Apache if needed
/etc/init.d/apache2 restart

Tuesday, October 12, 2010

Enable SSH in Soalris 10

Enable ssh root login in Solaris 10

1. Change the file /etc/ssh/sshd_config with PermitRootLogin no to replace PermitRootLogin yes
2. restart the services
#svcadm restart svc:/network/ssh:default

Configuring Telnet/FTP on Solaris

Configuring Telnet/FTP to login as root in Solaris

Make sure that you NEVER configure your production servers for this type of login because its bad security practice:

Configure Telnet for root logins
Simply edit the file /etc/default/login and comment out the following line as follows: # If CONSOLE is set, root can only login on that device.
# Comment this line out to allow remote login by root.
#
# CONSOLE=/dev/console

Configure FTP for root logins
First remove the 'root' line from /etc/ftpd/ftpusers.
Also, don't forget to edit the file /etc/ftpd/ftpaccess and comment out the 'deny-uid' and 'deny-gid' lines. If the file doesn't exist, there is no need to create it.

Have a nice day!

Wednesday, May 26, 2010

Smoothly transition from Exchange Server 2003 to Exchange 2010

Smoothly transition from Exchange Server 2003 to Exchange 2010


I have found this useful article on Exchange migration on web. When migrating from Exchange Server 2003 to Exchange Server 2010, you can't perform an in-place upgrade to Exchange Server 2010. Microsoft requires that organizations perform a clean Exchange Server 2010 installation onto a separate server and then to migrate mailboxes and public folder content to the new Exchange 2010 server.

This means that you'll need Exchange Server 2003 and Exchange 2010 to coexist either short-term -- a couple of hours -- or long-term. In either case, coexistence can be difficult because Exchange Server 2003 and Exchange 2010 are very different. This tip explains some of the key differences between the two versions and some of the tasks you'll have to perform as part of the transition.

Active Directory issues

Before deploying Exchange Server 2010 in an Exchange 2003 organization, you must prepare Active Directory and existing Exchange servers. This process isn't too labor-intensive; however, it does involve making a few irreversible changes to both Exchange and Active Directory. It's good practice to backup of all your Exchange servers and at least a couple of your domain controllers before starting.

You'll have to perform some the following configuration tasks:

  • Verify that any domain containing users with Exchange server mailboxes are set to Windows Server 2003 domain native mode.
  • Make sure that all of your global catalog servers are running Windows Server 2003 SP1 or higher. It's also acceptable to run Windows Server 2003 R2 or Windows Server 2008.
  • Ensure that your Active Directory schema master is running Windows Server 2003 SP1 or higher. Again, Windows Server 2003 R2 or Windows Server 2008 is acceptable.

Check that any domain controller that's hosting a flexible single master operations role is running at least Windows Server 2003 SP1.

  • Set the Active Directory forest to Windows Server 2003 forest functional level.
  • Remove any Exchange 2000 or Exchange 5.5 servers from your organization and set the existing Exchange server to native mode.

Disable link state updates


Exchange Server 2003 uses link state updates to keep track of which routes are used for to communicate between routing groups; however, Exchange Server 2010 doesn't use link-state updates. In smaller organizations, this architectural difference doesn't pose a problem; Exchange 2003 will continue to use link-state information. Exchange 2010 servers will ignore link-state updates.

In larger organizations, there are often multiple Exchange Server 2003 routing groups. You may have to create multiple routing group connectors between Exchange Server 2003 and Exchange 2010. In these situations, you must suppress minor link-state updates or routing loops may occur.

To disable minor link-state updates, modify the registry on each Exchange 2003 server. But this can be dangerous; making a mistake can often destroy Windows and Exchange Server.

To suppress link-state updates, open the Registry Editor and navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RESvc\Parameters

Right-click on the Parameters container and select the New | DWORD Value command. Name the new parameter SuppressStateChanges and assign it a value of 1. To finish, close the Registry Editor and restart the SMTP service, the Microsoft Exchange MTA stacks service and the Microsoft Exchange routing engine service.

Ref: SearchExhange.com

19 May 2010 | Brien Posey, Contributor

http://searchexchange.techtarget.com/generic/0,295582,sid43_gci1512791,00.html?track=NL-359&ad=767559&asrc=EM_NLT_11650090&uid=980702

Have a nice day!

Tuesday, May 18, 2010

Streaming issues-Video is bufferering every 2 minutes or forever on wireless

Streaming issues-Video is bufferering every two minutes or forever

Streaming video is buffering contineously on wireless network. It is more irritating. It will happen due to changes in wireless card properties:

Open wireless NIC properties as shown in picture


Click on configure button to see properties of wireless NIC. In Next window slect Advanced tab as shown in figure. Setup the setting of "Adhoc QOS mode" to WMM disabled.

2. Second reason is speed of your wireless network. If it is normal speed, then setting of above one will fix streaming issues.



Have a Nice Day!


















Monday, May 17, 2010

Recovering failed Exchange Server

Recovering failed Exchange Server

Exchange installs most of its configuration Data in Active Directory. In disaster recovery scenario, if you building server on new hardware(even on old hardware), then you can pull Exchange data from Active Directory using following switches during installation:

Install Windows OS on new server with same name and IP. Run Exchnage setup from CD:

For Exchange 2003
Setup /disasterrecovery

For Exchange 2007
Setup /m:RecoverServer

For Exchange 2010
Setup /m:RecoverServer

After installing server, you need to create or make drives/drive letters and folder structure as in old server for restoring storage groups. Dismount the any storage groups if exchange installation creates on new server. Restore Exchange databases from backups. Mount the databases after restoration. Generally restore task will mount databases automatically. Then server is ready and it replaces old server with new hardware.

Have a Nice Day!

Saturday, May 8, 2010

Stale NFS file handle error

Stale NFS file handle error

Recently I went through this stale error because of miscommunication between NFS server and client. This error is typically seen on a client system which has active NFS mount point. The NFS client doesn't know how to communicate for any change of NFS server configuration.

For example, assume the NFS mount point is /nfstestdir and error would be occurred as

df -k

drwxr-xr-x 13 root root 4096 2009-01-06 16:35 usr
drwxr-xr-x 24 root root 4096 2009-01-06 16:51 var
ls: cannot access nfsdir: Stale NFS file handle
[root@test1 /]#

Now just unmount the NFS volume forcefully using -f

[root@test1 /]# umount -f /nfstestdir

Remount it again using following command

[root@test1 /]# mount nfsserver:/nfstestdir /nfstestdir -t nfs

Have a nice day!

Saturday, May 1, 2010

Mount ISO image in Solaris

Mount ISO image in Solaris

Copy an ISO image(for example "test1.iso) to /tmp/test1.iso or wherever you want. Then create a loopback file device (/dev/lofi/1) with the following command:

# lofiadm -a /tmp/test1.iso /dev/lofi/1

The above command creates a block device version of a file. You can mount this block device to /mnt with the following command:

# mount -F hsfs -o ro /dev/lofi/1 /mnt

These commands can be combined into a single command:

# mount -F hsfs -o ro `lofiadm -a /tmp/test1.iso` /mnt

To see files and folders of iso image

# cd /mnt

# ls or #ls -l

Unmount ISO: # umount /mnt

Unmount loop device : # lofiadm -d /dev/lofi/1

Have a Nice Day!

Wednesday, April 14, 2010

LogParser (Microsoft Tool) to parse Logs/Files

LogParser (Microsoft Tool) to parse Logs/Files

Recently I went through a situation to parse windowslog files (*.evtx/*.evt files) to format output into a text file. Using this tool my job was finished very smooth and amazed seeing the output.

1. You can download LogParser tool from Microsoft

http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en

2. Run LogParser.msi file to install on your local system.

3. Copy the folder Logparser2.2 from c:\program files\Log parser 2.2 to d:\logparser on respect server/client system. If you want parse on a local system then there is no need to copy the folder.

4. Go to the directory on local system or remote system and run this command to format windows event logs into text format

D:\LogParser.exe “SELECT TimeGenerated, SourceName, EventCategoryName, Message INTO report.txt FROM ‘Directory Service’ WHERE EVENTID = 1307”

5. You can run this tool in a schedule task to parse event logs depend on your requirements.

6. You can parse remaining windows logs like Application, System, Security, DNS and File Replication Service by replacing “Drectory Service” in above command. There is no limit to use this tool and it depends on your imagination. You can find more documentation on this tool in installed folder as LogParser.chm.

Have a nice day!

Techie



Saturday, April 10, 2010

Mount ISO image in Linux


Mount ISO image in Linux

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. They appear in the mount point directory using following commands:

1. Copy or ftp the iso image to /tmp or any other directory
2. Login as root
3. Create the directory "disk1" under /mnt directory as shown below
# mkdir -p /mnt/disk1
4. Use mount command to mount "test1.iso" image to above directory:
#mount -o loop /tmp/test1.iso /mnt/disk1
5. Change directory to see files:
# cd /mnt/disk1
# ls
6. Unmount using "umount" after finishing your job:
# cd /
# umount /mnt/disk1


Have a nice day! Techie

Friday, April 9, 2010

Duplicate emails in inbox

Duplicate emails

First check actually there is any duplicate messages are revieving or sending your SMTP server or email server with message tacking tool. Open System manger --->Tools --->Message tracking

If there is no duplication of deliveries, it could be that there is a corrupt email message in your inbox or on mail server.

Microsoft Outlook
1. Delete the corrupted email from your deleted items and all other folders.
2. If you don't know which one corrupted use "Mapieditor" to find it( you need Admin help on this)

Outlook Express
1. Download all messages from server
2. Delete all messages/emails on server for your mailbox

Problem: "Leave Messages on the Server" check box
Sometimes, The "Leave Messages on the Server" box has been checked on your Outlook Express account settings will cause duplicate messages.
Solution: Uncheck the"Leave messages on the Server" box. It is under Tools --->Accounts ---> Mail ---> Click on Mail account --->Click on Properties --->Advanced

Problem: Outlook Express downloads messages from a POP3 server twice.
Solution: There is not an available workaround for this problem. . . Simply delete the duplicate messages. :)

Have a Nice weekend!!!!
Ravi Challa

Wednesday, April 7, 2010

Recover deleted Outlook items/mails from any folder

Requirements: MS-Exchnage email account; Hands on experience to modify registry
Outlook provides a way to recover items after you have permanently deleted them, including after emptying the Deleted Items folder. You can recover items on before retension time of MS-Exchange server.
By default, to use the Recover Deleted Items command on the Tools menu, you must be viewing the Deleted Items folder. By modifying the registry, this command is available regardless of which Outlook folder that you are viewing. You can view and recover deleted items, including those items that were permanently deleted by using SHIFT+DELETE, for the folder that you are viewing.
Caution If you use the registry editor incorrectly, you might cause serious problems that might require you to reinstall your operating system. Use the registry editor at your own risk.
1. Exit Outlook.
2. Open the Windows registry editor.
3. Browse to My Computer\HKEY_LOCAL_MACHINE\Software\Microsoft\Exchange\Client\Options.
4. On the Edit menu, point to New, and then click DWORD Value.
5. Type the name DumpsterAlwaysOn.
Note Do not type any spaces in the name.
6. Set the DWORD value to 1.
7. Restart Outlook.
The Tools menu now has the Recover Deleted Items command for every Outlook folder. Now you can recover permanently deleted items from any folder. Steps to recover:
1. Highlight the respect folder and go to tools --->Options ----> Select Recover deleted items
2. Select the items to recover and click OK.
3. You are done and your items are back.

Have A Nice Day!
Ravi Challa