Saturday, December 7, 2013

Conditional formatting based on numerical values using different color



Right click on a column containing 10 ,20 and 30 and format cells,click custom and type

[BLUE][=>30]00;[MAGENTA][=>20]00;[green]00

and you are done.

you can not change the color of any cell using traditional method

Wednesday, November 27, 2013

Java not working in Internet Explorer after installing java on Windows 8 solved


I have faced this error,fortunately found the solve.

Reinstall Java using offline version.(just the jre in the second time works for me)

    Go to the Windows offline page


    On the download page, click Agree and Start Free Java Download


    If you've already installed the version, you will see a message, This software has already been installed on your computer. Would you like to reinstall it?


    Click Yes and reinstall,and you are done.


source:https://java.com/en/download/help/ie_tips.xml

Sunday, November 3, 2013

What is PAE Kernel

(PAE) stand for Physical Address Extension. It's a feature of x86 and x86-64 processors that allows more than 4 Gigabytes of physical memory to be used in 32-bit systems.

To enable PAE, open terminal and type the following command:

sudo apt-get install linux-headers-server linux-image-server linux-server

reboot.

Monday, October 28, 2013

Windows 7 network/internet slow resolved


A friend of mine kept saying networking is slow in windows 7 and over the years I have heard it from many people,so some fixes I found,

run->cmd(with admin privilege)->netsh interface tcp show global


in the output if the Receive Windows Auto-Tuning Level : normal


then


netsh interface tcp set global autotuning=disabled


now see the output of netsh interface tcp show global


Receive Windows Auto-Tuning Level : disabled should be showing up


Remote differential compression should be off as old operating systems does not support this feature,it basically compresses data over the network


to do this you have to go to


control panel-programs-turn windows feature on or off and then clear the box beside remote differential compression


disable ipv6 from your lan adapter at it's properties


set duplex settings to 10mb/s half duplex


see for suspicious process in task manager


ipconfig /flushdns,net stop dnscache,net start dnscache commands should be useful,at the end netsh winsock reset should get the job done although a restart is required.


try using ccleaner for clean up of temporary files and registry clean


try using malwarebytes for a quick scan


go to msconfig and delete unnecessary programs at start up


make windows theme the classic one so that some ram frees up


for advanced scanning use hijackthis software


I guess that's it then.



Sourav Bhattacharya


PHP & MySQL Faculty(for the last 6 years) at Growmax Infotech








Reset chrome,firefox and internet explorer


Browsers gave me lots of headache in the past,so here how you reset them

In case of firefox,

help->troubleshooting information->reset firefox

In case of Chrome

settings->show advanced settings->reset browser settings.

In case of Internet Explorer

run->inetcpl.cpl

then on general tab delete everything

then advanced-lick reset-click delete personal settings and then click reset


Sourav Bhattacharya

gnu/linux,python,php,perl trainer for the last 6 years.

Sunday, October 13, 2013

chkconfig alternative in Ubuntu



in RedHat

chkconfig --add
chkconfig --level 345 on
chkconfig --del


in Ubuntu

update-rc.d defaults
update-rc.d start 20 3 4 5
update-rc.d -f  remove

Friday, September 20, 2013

Install Ipython on Ubuntu 12.10






just these 2 commands


apt-get install ipython

apt-get install python-matplotlib

and you are done...


Sunday, June 23, 2013

Fixed Network Configuration erased after reboot issue in OpenSUSE 12.3

To make  NetworkManager in KDE works properly.

Stop the service first

# systemctl is-active network.service && \
# systemctl stop network.service

Enable NetworkManager

# systemctl --force enable NetworkManager.service

Enable the service again

# systemctl start network.service

Thursday, May 30, 2013

Enable EPEL Repo on CentOS 6.3



wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm


sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Monday, May 27, 2013

KVM virtualization in CentOS 6.4 part1


First disable selinux

Then give a hostname such as server1.sourav.com and an IP Address to an adapter

if this command shows some output then your processor is ready

egrep '(vmx|svm)' --color=always /proc/cpuinfo

 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*



 yum install kvm libvirt python-virtinst qemu-kvm

Then start the libvirt daemon 

 /etc/init.d/libvirtd start

it will not start unless hosts is properly configured 

like the entry 127.0.0.1   localhost 

and

10.10.*.*  server1.sourav.com  server1

should be there

To check if KVM has successfully been installed

virsh -c qemu:///system list


It should display something like this:

[root@server1 ~]# virsh -c qemu:///system list
 Id Name                 State

Now set up network bridge

yum install bridge-utils

 vi /etc/sysconfig/network-scripts/ifcfg-br0

 DEVICE="br0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.0.100
PREFIX=24
GATEWAY=192.168.0.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"

Modify /etc/sysconfig/network-scripts/ifcfg-eth0 as
follows (comment out BOOTPROTO, IPADDR, PREFIX, GATEWAY, DNS1, and DNS2 and add BRIDGE=br0):

DEVICE="eth0"
#BOOTPROTO=none
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE="Ethernet"
UUID="73cb0b12-1f42-49b0-ad69-731e888276ff"
HWADDR=00:1E:90:F3:F0:02
#IPADDR=192.168.0.100
#PREFIX=24
#GATEWAY=192.168.0.1
#DNS1=8.8.8.8
#DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
BRIDGE=br0


Now

/etc/init.d/network restart

 yum install virt-manager libvirt qemu-system-x86 openssh-askpass


 We will create our image-based virtual machines in the directory /var/lib/libvirt/images/ which was created automatically when we installed KVM in chapter two.

To create a Debian Squeeze guest (in bridging mode) with the name vm10, 512MB of RAM, two virtual CPUs, and the disk image /var/lib/libvirt/images/vm10.img (with a size of 12GB), insert the Debian Squeeze Netinstall CD into the CD drive and run

virt-install --connect qemu:///system -n vm10 -r 512 --vcpus=2 --disk path=/var/lib/libvirt/images/vm10.img,size=12 -c /dev/cdrom --vnc --noautoconsole --os-type linux --os-variant debiansqueeze --accelerate --network=bridge:br0 --hvm



 Of course, you can also create an ISO image of the Debian Squeeze Netinstall CD (please create it in the /var/lib/libvirt/images/ directory because later on I will show how to create virtual machines through virt-manager from your Fedora desktop, and virt-manager will look for ISO images in the /var/lib/libvirt/images/ directory)...

dd if=/dev/cdrom of=/var/lib/libvirt/images/debian-6.0.5-amd64-netinst.iso

dd if=/dev/cdrom of=/var/lib/libvirt/images/debian-6.0.5-amd64-netinst.iso

... and use the ISO image in the virt-install command:

virt-install --connect qemu:///system -n vm10 -r 512 --vcpus=2 --disk path=/var/lib/libvirt/images/vm10.img,size=12 -c /var/lib/libvirt/images/debian-6.0.5-amd64-netinst.iso --vnc --noautoconsole --os-type linux --os-variant debiansqueeze --accelerate --network=bridge:br0 --hvm

The output is as follows:

[root@server1 ~]# virt-install --connect qemu:///system -n vm10 -r 512 --vcpus=2 --disk path=/var/lib/libvirt/images/vm10.img,size=12 -c /var/lib/libvirt/images/debian-6.0.5-amd64-netinst.iso --vnc --noautoconsole --os-type linux --os-variant debiansqueeze --accelerate --network=bridge:br0 --hvm


Starting install...
Allocating 'vm10.img'              |  12 GB     00:00
Creating domain...                 |    0 B     00:00
Domain installation still in progress. You can reconnect to
the console to complete the installation process.

Now go to Applications-System Tools-Virtual Machine Manager

There you will see the virtual machine running

click open

the virtual machine will start in GUI

When you start virt-manager for the first time, you will most likely see the message Unable to open a connection to the libvirt management daemon. You can ignore this because we don't want to connect to the local libvirt daemon, but to the one on our CentOS 6.4 KVM host. Click on Close and go to File > Add Connection... to connect to our CentOS 6.4 KVM host: 







Wednesday, May 22, 2013

Configuring DNS/Bind Server on RedHat 6



nano /etc/hosts


192.168.0.101 www.sourav.com
192.168.0.101 www.test.com
192.168.0.101 redhatserver.sourav.com
192.168.0.101 redhatserver.test.com
nano /etc/resolv.conf

search sourav.com

nano /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
HWADDR="00:0C:29:46:0C:5A"
NM_CONTROLLED="no"
BOOTPROTO="STATIC"
ONBOOT="yes"
IPADDR=192.168.0.101
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
NETWORK=192.168.0.0
GATEWAY=192.168.0.201
DNS1=192.168.0.101
DOMAIN=sourav.com

emacs /etc/named.conf


options {
# make it comment ( listen all interfaces on the server )
#listen-on port 53 { 127.0.0.1; };
#change ( if not use IPv6 )
listen-on-v6 { none; };
directory "/var/named";
forwarders { 8.8.8.8;4.2.2.2; };
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
# query range ( set internal server and so on )
allow-query {
localhost;
192.168.0.0/24;
};
# transfer range ( set it if you have secondary DNS )
#allow-transfer { localhost; 192.168.0.0/24; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

# change all from here

view "internal" {
        match-clients {
                localhost;
                192.168.0.0/24;
        };
        zone "." IN {
                type hint;
                file "named.ca";
        };
        zone "sourav.com" IN {
                type master;
                file "sourav.com.fwd";
                allow-update { none; };
        };
        zone "0.0.10.in-addr.arpa" IN {
                type master;
                file "0.168.192.rev";
                allow-update { none; };
        };
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
};




nano /var/named/sourav.com.fwd



$TTL 86400
@   IN  SOA     redhatserver.sourav.com. root.sourav.com. (
        2013051001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)



    IN         NS        redhatserver.sourav.com.


    IN         A         192.168.0.101



    IN       MX    10      redhatserver.sourav.com.



redhatserver       IN      A          192.168.0.101


emacs /var/named/0.168.192.rev


$TTL 86400
@   IN  SOA     redhatserver.sourav.com. root.sourav.com. (
        2013051001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)



     IN      NS        redhatserver.sourav.com.



     IN      PTR       sourav.com.
     IN       A       255.255.255.0



    101        IN      PTR       redhatserver.sourav.com.




/etc/rc.d/init.d/named restart

Apache Server Configuration with Name Based Hosting in RedHat Linux 6

My Configuration,

Operating System  :  redhat 6.3 32bit server
Hostname          :  redhatserver.sourav.com
IP Address        :  192.168.0.101
Client Details:

Operating System  :  redhat 6.3 32bit Desktop
Hostname          :  client.sourav.com
IP Address        :  192.168.0.10


Prerequisites:

1. Set the hostname of redhatserver server

[root@redhatserver ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=redhatserver.sourav.com
2. Add the redhatserverserver hostname in ‘etc/hosts’ file

[root@redhatserver ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.250   redhatserver.sourav.com
192.168.1.250   www.sourav.com
3. Install Apache

Check and remove any previously installed packages
[root@redhatserver ~]# rpm -qa | grep httpd
or
[root@redhatserver ~]# yum list installed | grep httpd
Now install the ‘httpd’ package
[root@redhatserver ~]# yum install httpd* -y
4. Configure Apache

[root@redhatserver ~]# vi /etc/httpd/conf/httpd.conf
## line no 262 - Set the server admin mail id which is used to receive mail generated by apache ##
ServerAdmin root@sourav.com
## line no 276 - Set the redhatserversite name ##
ServerName www.sourav.com:80
## line no 292 - Set the redhatserver pages folder ##
DocumentRoot "/var/www/html"
## line no 402 - Sent the index or home page of the redhatserversite ##
DirectoryIndex sourav.html
5. Create a sample index or home page

Create the index or home page html file in the ‘/var/www/html/’ directory
[root@redhatserver ~]# vi /var/www/html/sourav.html


 Welcome to sourav redhatserversite 

6. Allow redhatserverserver through firewall

[root@redhatserver ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
Restart iptables to save changes
[root@redhatserver ~]# service iptables restart
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
7. Start Apache redhatserver server

[root@redhatserver ~]# service httpd start
Starting httpd:                                            [  OK  ]
[root@redhatserver ~]# chkconfig httpd on
Client side Configuration

1. Add the redhatserverserver and client ip address and hostname in the ‘/etc/hosts’ file

[root@client ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.251   client.sourav.com
192.168.1.250   www.sourav.com
 for name based hosting

VirtualHost *:80
    # This first-listed virtual host is also the default for *:80
    ServerName www.example.com
    ServerAlias example.com
    DocumentRoot /www/domain
/VirtualHost

VirtualHost *:80
    ServerName other.example.com
    DocumentRoot /www/otherdomain
/VirtualHost

You can alternatively specify an explicit IP address in place of the * in VirtualHost directives. For example, you might want to do this in order to run some name-based virtual hosts on one IP address, and either IP-based, or another set of name-based virtual hosts on another address.

Many servers want to be accessible by more than one name. This is possible with the ServerAlias directive, placed inside the VirtualHost section. For example in the first VirtualHost block above, the ServerAlias directive indicates that the listed names are other names which people can use to see that same redhatserver site:

ServerAlias example.com *.example.com

use name based hosting

uncomment the next line

NameVirtualHost *:80


install elinks browser

rpm -ivh elinks*

then from terminal

elinks www.sourav.com
elinks www.test.com

Friday, April 12, 2013

Create Local/Network Repo in Scientific Linux 6.3


mount /dev/sr0 /mnt/ 

install vsftpd package, so that we can use this as a FTP server to share our repository in the client systems.

Change to the directory where you mounted Scientific Linux DVD. In our example we have mounted the DVD

DVD in /mnt directory.

    # cd /mnt/Packages
    # rpm -ivh vsftpd-2.2.2-11.el6.i686.rpm


Start the FTP Service:

    # service vsftpd start

install createrepo package if it is not installed. This is package is used to create our local 

repository.

    # rpm -ivh createrepo-0.9.8-5.el6.noarch.rpm

Oops!! It shows us the dependency problem. Let us the install missing dependencies first:

    # rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm 

Then install the another one:

    # rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm

Now install the createrepo package:

Create a folder called yumserver (You can use your own) in /var/ftp/pub directory to save 

all the packages from the Scientific Linux DVD. Copy all the files in the Packages folder from the DVD to 

/var/ftp/pub/yumserver folder:

    # mkdir /var/ftp/pub/yumserver
    # cp -ar *.* /var/ftp/pub/yumserver


it will take a while to copy all the packages in the DVD. Please be patient. After all packages are copied, create a repo file called yumserver.repo in /etc/yum.repos.d/ directory.

    # nano /etc/yum.repos.d/yumserver.repo

[localyumserver]
name="my local repository"
baseurl=file:///var/ftp/pub/yumserver
gpgcheck=0
enabled=1


Where,
[localyumserver] ==> Name of the Local Repository.
comment ==> Information about the Repository.
baseurl ==> Path of the Repository (i.e where we had copied the contents from Scientific Linux DVD)
gpgcheck ==> Authentication of the Repository, which is disabled in our case.

Now it is time to create our repository. Enter the following command in the Terminal:

    # createrepo -v /var/ftp/pub/yumserver

Now the local YUM repository creation process will begin. 

Note: Delete or rename all the other repo files except the newly created repo file i.e in our 

example it is localyumserver.repo. 
Next update the repository:

        yum clean all
        yum update

You’re done now.

Client side configuration:

Create a repo file in your client system as mentioned above in the /etc/yum.repos.d/ directory 

and remove or rename the existing repositories. Then modify the baseurl as mentioned below:

[localyumserver]
comment ="My Local Repository"
baseurl=ftp://myserver.domain.com/pub/yumserver
gpgcheck=0
enabled=1 

    (or)

[localyumserver]
comment ="My Local Repository"
baseurl=ftp://192.168.10.101/pub/yumserver
gpgcheck=0
enabled=1


source:http://ostechnix.wordpress.com/2013/01/05/setup-local-yum-server-in-centos-6-x-rhel-6-x-scientific-linux-6-x/ 

Two Important chkconfig command



chkconfig --list vsftpd

chkconfig --level 35 vsftpd on

Sunday, March 31, 2013

Learning unix basics on OpenSolaris 2009 part2




You can also use Ctrl +R to search (backward) through the history.

You can capture the output from a c ommand in a n e nv ironment variable using back-ticks:
$ TIME =`date`

$ echo $TIME

Sun Mar 31 21:56:03 IST 2013


As on most UNIX-like systems, each user on OpenSolaris has a home directory. Your home
directory path is stored in the HOME environment variable. You can also use the tilde character
(~) to navigate to your home directory or to another user’s home directory. The tilde alone
implies the current user’s home directory. The following code shows how to navigate to home
directories:

$ cd ~
$ pwd
/export/home/sourav
$ cd ~sougata
$ pwd
/export/home/sougata

This example also demonstrates that the pwd command shows your current working directory.


Wednesday, March 27, 2013

Learning unix basics on OpenSolaris 2009


If you end a command line with a backslash, bash lets you continue the command on the next
line. This feature is useful for entering lengthy commands:

$ touch \

> file1

ctrl+a to take the cursor to the beginning of the line

ctrl+e to take the cursor at the end of the line

Alt+F and Alt+B move forward 

and backward, respectively, on a word-by-word, instead of character-by-character.

from the beginning of the line Ctrl+K will cut the line and at the end of the line Ctrl+Y to 
paste are the same line as in emacs .

to get a list of all the commands in your path
that start with ‘‘fil,’’ type fil and press Tab twice:
$ file

bash first completed the word up to file (because there were no commands starting with fil
that didn’t have an e next), and then provided a list of possibilities with the second Tab.


file file-roller filesync
$ file


$ history

1ls

2ls-a

3 pwd

4 whoami

5 touch testfile

6 which gcc

7 which cc

8 rm testfile

9 history

history an integer argument to see only that number of previous commands:

$ history 2

12 date

13 history 2

To Execute a command in the history, use ! . To execute the previous com-
d, use the !! shortcut:

$ !4

whoami

test

$ date

Thu Mar 28 00:08:13 IST 2013


$ !!

date

Thu Mar 28 00:08:13 IST 2013

you can see the environment variables by the command

declare

or you can use the command

set


You can print the values of the environment variables using the echo or printf commands,
accessing the value of the variable by prefixing it with the usual $ character:

$ echo $SHELL

/bin/bash

$ printf ’’$PATH \n’’

/usr/bin

Set the value of an environment variable with an assignment statement. The following example
sets the shell history size to 1,000:

$ echo $HISTSIZE

500

$ HISTSIZE =1000

$ echo $HISTSIZE

1000

Use the which command to see which version of a command you are executing
based on your path:

$ which grep
/usr/gnu/bin/grep
$ which xterm
/usr/X11/bin/xterm
$ which which
/usr/gnu/bin/which

The user created by the installer is set up with the following path:

$ echo $PATH

/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin


Directory Description

/usr/bin The default directory for commands; contains utilities such as grep and
tr , a pplications such as firefox and thunderbird , shells such as
bash and zsh , and myriad other commands

/usr/ccs/bin Traditionally System V development tools, but these have mostly moved
to /usr/bin

/usr/gnu/bin The GNU versions of commands; slightly different versions of many of
them are also found in /usr/bin

/usr/sbin The system tools, commands, and daemons, such as zfs , dumpadm ,
in.routed , and others. These are generally privileged commands.

/usr/sfw/bin Traditionally the Sun Freeware (mostly GNU) tools, but almost all of
these have been moved to /usr/bin , with symlinks left here; or
symlinks have been added to /usr/bin

/usr/ucb Traditiona lly the BSD tools, but these have been moved to / usr/bin ,
with only a few symlinks left here

/usr/X11/bin X11 commands, such as xterm , xhost , and others
/usr/openwin/bin;
/usr/X/bin;
/usr/X11R6/bin
Aliases for /usr/X11/bin
/usr/xpg4/bin Ve rsions of some of the tools that adhere to the POSIX standard, where
the versions in /usr/bin don’t

/bin Alias for /usr/bin

/sbin System tools and utilities required for booting and possibly recovering
the system if /usr is not mounted. These are generally privileged
commands.


Add a location to your path

$ PATH =$PATH:/export/home/sourav/personal/data
$ echo $PATH

this folder /export/home/sourav/personal/data will be show and any executable file there can be 

invoked directly,the executable permission has to be set though


Install Vmware Tools in OpenSolaris 2009


To install vmware tools successfully

you need to copy the vmware-solaris-tools.tar.gz in a directory(for me it is /tmp/sourav)

then 

cd /tmp/sourav

gunzip -dc vmware-solaris-tools.tar.gz | tar xvf - 

or

Decompress the file using gunzip command. For example:

# gunzip vmware-solaris-tools.tar.gz


Extract the contents of the tar file with the command:

# tar xvf vmware-solaris-tools.tar 

then 

 cd vmware-tools-distrib


To install VMware Tools, run this command from the directory you changed to in step 7:

 ./vmware-install.pl


Check if VMware tools service is running with the command:

 /etc/init.d/vmware-tools status

The output is similar to:

vmtoolsd is running

Add vmware-toolbox to the list of startup commands of your desktop.



for my opensolaris(2009)

it is in 

Preference-Sessions

Click Startup Programs tab and add these entries:

/ usr/bin/vmware-user

/usr/bin/vmware-toolbox 

source:http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1023956 



Things to do after installing OpenSolaris part 1



To see the installation log

nano /var/sadm/system/logs/install_log

To update system software database

pkg refresh

pkg list -a

to install software

pkg install softwarename such as gcc

to search a software in both locally installed software and package repositories

pkg search -lr gcc

to update broken or limited repositories

pkg rebuild-index

you will find the grub confirutation file

nano /rpool/boot/grub/menu.list

Tuesday, March 26, 2013

OpenSolaris issue DNS not working solved


I manually configured Open Solaris(2009 edition),however the DNS is not working,here how it worked out for me

Nslookup resolves the name to an ip, but pinging doesn’t make it to the box…


Static IP address

Assigning a static IP address on OpenSolaris is accomplished by editing the hostname files in the directory /etc. For example, assign a static IP address to interface bge0 by editing /etc/hostname.bge0:

192.168.0.123

Set the netmask by editing the file /etc/inet/netmasks:

192.168.0.0 255.255.255.0

Set the default gateway by editing the file /etc/defaultrouter:

192.168.0.1

Note: in this solution makes sure you have fill the DNS in the GUI mode, System > Administration > Network > DNS

and make sure file /etc/resolv.conf contain the same DNS as you fill in the GUI mode

This is exactly my problems :

Successfully Resolving DNS

 nslookup http://www.yahoo.com
Server:        202.138.224.2
Address:    202.138.224.2#53

Non-authoritative answer:
http://www.yahoo.com    canonical name = http://www.wa1.b.yahoo.com.
http://www.wa1.b.yahoo.com    canonical name = www-real.wa1.b.yahoo.com.
Name:    www-real.wa1.b.yahoo.com
Address: 209.131.36.158

Pinging IP address successfully

 ping 209.131.36.158
209.131.36.158 is alive

BUT failed to ping hostname

 ping -l http://www.yahoo.com
ping: unknown host http://www.yahoo.com

So the fix is

Open your terminal and switch to root user, then edit your /etc/nsswitch.conf file and add the word “dns“ to the hosts and ipnodes lines

This is my nsswitch.conf file snippet:



passwd:     files
group:      files
hosts:      dns
ipnodes:    dns
networks:   files
protocols:  files
rpc:        files


There is default backup of /etc/nsswitch.conf file you can also just copy /etc/nsswitch.dns over it…

 cp /etc/nsswitch.dns /etc/nsswitch.conf

You may also want to check that auto-magic mode has been disabled when setting up your networking manually;

svcs -a | grep nwam

If it is enabled type;

svcadm disable svc:/network/physical:nwam

And you are done!!!


source:http://dxzstudioz.wordpress.com/2009/11/28/opensolaris-dns-resolving-problem-when-using-static-ip/

source: http://www.jansipke.nl/network-configuration-on-opensolaris/

Tuesday, March 12, 2013

Connecting Oracle 10g express using PHP and Apche on Scientific Linux 6.2


Installed Oracle 10g Express on Scientific Linux 6.2 before

http://wowmoron.blogspot.in/2012/12/install-oracle-10g-express-on.html


Ok installed PHP and Apache on Scientific Linux 6.2 before

http://wowmoron.blogspot.in/2012/11/install-apachemysqlphp-lamp-on-centos.html

Now connecting Oracle 10g express using PHP

all we have to do basically installing zend server community edition

so the steps are

create a file

/etc/yum.repos.d/zend.repo



[Zend]
name=zend-server
baseurl=http://repos.zend.com/zend-server/6.0/rpm/$basearch
enabled=1
gpgcheck=1
gpgkey=http://repos.zend.com/zend.key

[Zend_noarch]
name=zend-server - noarch
baseurl=http://repos.zend.com/zend-server/6.0/rpm/noarch
enabled=1
gpgcheck=1
gpgkey=http://repos.zend.com/zend.key

save the file and close


yum install zend-server-php-5.3



after this

nano /var/www/html/database.php


  
&lt?php

    $conn = oci_connect("hr", "your_hr_password", "127.0.0.1/XE");

    $stid = oci_parse($conn, "select last_name, salary from employees");
    oci_execute($stid);

    $nrows = oci_fetch_all($stid, $results);

    echo "&lthtml>&lthead>&lttitle>Oracle PHP Test&lt/title>&lt/head>&ltbody>";
    echo "&ltcenter>&lth2>Oracle PHP Test&lt/h2>&ltbr>";
    echo "&lttable border=1 cellspacing='0' width='50%'>\n&lttr>\n";
    echo "&lttd>&ltb>Name&lt/b>&lt/td>\n&lttd>&ltb>Salary&lt/b>&lt/td>\n&lt/tr>\n";

    for ($i = 0; $i &lt $nrows; $i++ ) {
      echo "&lttr>\n";
      echo "&lttd>" . $results["LAST_NAME"][$i] . "&lt/td>";
      echo "&lttd>$" . number_format($results["SALARY"][$i], 2). "&lt/td>";
      echo "&lt/tr>\n";
    }

    echo "&lttr>&lttd colspan='2'> Number of Rows: $nrows&lt/td>&lt/tr>&lt/table>";
    echo "&ltbr>&ltem>If you see data, then it works!&lt/em>&ltbr>&lt/center>&lt/body>&lt/html>\n";

  ?>

(ok as I can not use opening tag and closing tag in this blog I used > and < instead)

save the file and close

open your browser

localhost/database.php

you should see data and you are done