Friday, December 11, 2009

Thursday, December 10, 2009

Websphere Cluster Installation

#############To create a new cell##############################
manageprofiles
-create
-templatePath C:\IBM\WebSphere\AppServer\profileTemplates\cell\dmgr
-nodeProfilePath C:\IBM\WebSphere\AppServer\profiles\TSTDMGR
-profileName TSTDMGR
-cellName TSTCELL
-nodeName TSTDMGR
-appServerNodeName TSTPROXY
#############To start deployment manager#######################
startManager
#############To enable security################################
Login to admin console
Enable security
stopManager
startManager
#############To add windows service for DMGR###################
WASService.exe
-add "DMGR"
-serverName "dmgr"
-profilePath "C:\IBM\WebSphere\AppServer\profiles\TSTDMGR"
-wasHome "C:\IBM\WebSphere\AppServer"
-logfile "C:\IBM\WebSphere\AppServer\profiles\TSTDMGR\logs\dmgr\startServer.log"
-logRoot "C:\IBM\WebSphere\AppServer\profiles\TSTDMGR\logs\dmgr"
-stopArgs "-username admin -password password"
-startArgs "-username admin -password password"
#############To create node01###################################
manageprofiles.bat
-create
-profileName "TSTAPP01"
-templatePath "C:\IBM\WebSphere\AppServer\profileTemplates\managed"
-profilePath "C:\IBM\WebSphere\AppServer\profiles\TSTAPP01"
-nodeName "TSTAPP01"
#############To federate node01#################################
addNode tstproxy.example.ca
#############To add windows service for the node################
WASService.exe
-add "NODEAGENT"
-serverName "nodeagent"
-profilePath "C:\IBM\WebSphere\AppServer\profiles\TSTAPP01"
-wasHome "C:\IBM\WebSphere\AppServer"
-logfile "C:\IBM\WebSphere\AppServer\profiles\TSTAPP01\logs\nodeagent\startServer.log"
-logRoot "C:\IBM\WebSphere\AppServer\profiles\TSTAPP01\logs\nodeagent"
-stopArgs "-username admin -password password"
-startArgs "-username admin -password password"
#############To create node02####################################
manageprofiles.bat
-create
-profileName "TSTAPP02"
-templatePath "C:\IBM\WebSphere\AppServer\profileTemplates\managed"
-profilePath "C:\IBM\WebSphere\AppServer\profiles\TSTAPP02"
-nodeName "TSTAPP02"
#############To federate Node02##################################
addNode tstproxy.example.ca
#############To add windows service for the node#################
WASService.exe
-add "NODEAGENT"
-serverName "nodeagent"
-profilePath "C:\IBM\WebSphere\AppServer\profiles\TSTAPP02"
-wasHome "C:\IBM\WebSphere\AppServer"
-logfile "C:\IBM\WebSphere\AppServer\profiles\TSTAPP02\logs\nodeagent\startServer.log"
-logRoot "C:\IBM\WebSphere\AppServer\profiles\TSTAPP02\logs\nodeagent"
-stopArgs "-username admin -password password"
-startArgs "-username admin -password password"
#############To install HTTP Server##############################
Install IBM HTTP Server from the CD
Install Port 80
Admin Port 8008
#############To add the webserver to the admin console###########
System Administration > Nodes > Add Node > Unmanaged >
Servers > Web Servers > New >
Plugin Location = C:\IBM\HTTPServer\Plugins\

Tuesday, December 8, 2009

KVM Setup


KVM Virtualization On Ubuntu Host

################install KVM and vm builder utils#######################
sudo apt-get install kvm kvm-pxe libvirt-bin ubuntu-vm-builder bridge-utils

################install uml utilities##################################
sudo apt-get install uml-utilities

################Test kvm installation##################################
virsh -c qemu:///system list

################/etc/network/interfaces################################
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

#virtual interface
auto br0
iface br0 inet static
address 172.16.2.230
network 172.16.2.0
netmask 255.255.255.0
broadcast 172.16.2.255
gateway 172.16.2.252
bridge_ports eth0
bridge_stp off
bridge_fd 9
bridge_hello 2
bridge_maxwait 12

##############To create virbr0 DHCP####################################
sudo vim /etc/libvirt/qemu/networks/default.xml

#change this to
<network>
<name>default</name>
<bridge name="virbr%d" />
<forward/>
<ip address="192.168.122.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.122.2" end="192.168.122.254" />
</dhcp>
</ip>
</network>

#this
<network>
<name>default</name>
<bridge name="virbr%d" />
<forward/>
<ip address="10.0.1.1" netmask="255.0.0.0">
<dhcp>
<range start="10.0.1.10" end="10.0.1.100" />
</dhcp>
</ip>
</network>

##############Restart virtual network##################################
sudo virsh net-list
sudo virsh net-destroy default
sudo virsh net-stop default

##############Command to create a new image file#######################
sudo qemu-img create -f qcow win2k3-64.img 10G

##############Command to boot from the disk############################
sudo qemu-system-x86_64 -m 512 -hda win2k3-64.img -cdrom /dev/dvd -boot d -vnc :1

##############Script to generate random MAC address####################
#! /usr/bin/python
# macgen.py script generates a MAC address for Xen guests
#
import random
mac = [ 0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
print ':'.join(map(lambda x: "%02x" % x, mac))

##############Command to launch the image##############################
sudo qemu-system-x86_64 -hda vms/tstproxy/win2003-64.qcow -m 1024 -net nic,macaddr=00:16:3e:03:d9:5f -net tap -nographic -localtime &
sudo qemu-system-x86_64 -hda vms/tstapp01/win2003-64.qcow -m 2048 -net nic,macaddr=00:16:3e:33:0e:8a -net tap -nographic -localtime &
sudo qemu-system-x86_64 -hda vms/tstapp02/win2003-64.qcow -m 2048 -net nic,macaddr=00:16:3e:3e:7e:14 -net tap -nographic -localtime &

##############Command to check the available memory####################
free -m
free -m -l -s 2

##############Command to list running KVM/QEMU processes###############
ps -A | grep qemu

Friday, October 2, 2009

Google Gandhi

Wednesday, September 9, 2009

My Ubuntu Desktop


Development version of Chromium browser in Karmic Alpha 5

Wednesday, August 19, 2009

Vala

Programming Language
Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.
http://live.gnome.org/Vala


Val(a)IDE
Val(a)IDE is an Integrated Development Environment (IDE) for the Vala programming language.
http://www.valaide.org/


Example Code
class Sample : Object 
{
void run()
{
stdout.printf ("Hello World\n");
}

static void main (string[] args)
{
var sample = new Sample();
sample.run ();
}
}

Code Compilation Example

valac --pkg gtk+-2.0 main.vala


`C` Code Generation Example

valac --pkg gtk+-2.0 -C main.vala


Generated Source

#include <glib.h>
#include <glib-object.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_SAMPLE (sample_get_type ())
#define SAMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SAMPLE, Sample))
#define SAMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SAMPLE, SampleClass))
#define IS_SAMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SAMPLE))
#define IS_SAMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SAMPLE))
#define SAMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SAMPLE, SampleClass))

typedef struct _Sample Sample;
typedef struct _SampleClass SampleClass;
typedef struct _SamplePrivate SamplePrivate;

struct _Sample {
GObject parent_instance;
SamplePrivate * priv;
};

struct _SampleClass {
GObjectClass parent_class;
};


static gpointer sample_parent_class = NULL;

GType sample_get_type (void);
enum {
SAMPLE_DUMMY_PROPERTY
};
static void sample_run (Sample* self);
Sample* sample_new (void);
Sample* sample_construct (GType object_type);
static void sample_main (char** args, int args_length1);
Sample* sample_new (void);



static void sample_run (Sample* self) {
g_return_if_fail (self != NULL);
fprintf (stdout, "Hello World\n");
}


static void sample_main (char** args, int args_length1) {
Sample* sample;
sample = sample_new ();
sample_run (sample);
(sample == NULL) ? NULL : (sample = (g_object_unref (sample), NULL));
}


int main (int argc, char ** argv) {
g_type_init ();
sample_main (argv, argc);
return 0;
}


Sample* sample_construct (GType object_type) {
Sample * self;
self = g_object_newv (object_type, 0, NULL);
return self;
}


Sample* sample_new (void) {
return sample_construct (TYPE_SAMPLE);
}


static void sample_class_init (SampleClass * klass) {
sample_parent_class = g_type_class_peek_parent (klass);
}


static void sample_instance_init (Sample * self) {
}


GType sample_get_type (void) {
static GType sample_type_id = 0;
if (sample_type_id == 0) {
static const GTypeInfo g_define_type_info = { sizeof (SampleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sample_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Sample), 0, (GInstanceInitFunc) sample_instance_init, NULL };
sample_type_id = g_type_register_static (G_TYPE_OBJECT, "Sample", &g_define_type_info, 0);
}
return sample_type_id;
}

Wednesday, August 12, 2009

Ubuntu - Restricted Extras

The following command installs flash, java and codecs for different multimedia formats on Ubuntu.

sudo apt-get install ubuntu-restricted-extras


Details: https://help.ubuntu.com/community/RestrictedFormats

DB2-AS/400 SQL - Selecting Column Details

SELECT COLUMN_NAME, COLUMN_TEXT FROM QSYS2.SYSCOLUMNS WHERE TABLE_SCHEMA = '<LIBRARY>' AND TABLE_NAME = '<TABLE>'

Tuesday, June 2, 2009

DB2-AS/400 SQL - Restarting Identity Counter

SQL statement for resetting the identity counter, after clearing the table.
Database Server: IBM AS/400 DB2

ALTER TABLE <TABLE NAME> ALTER COLUMN <IDENTITY COLUMN> RESTART WITH 1

Friday, April 17, 2009

Expression Language (EL)

Expression Language

A primary feature of JSP technology version 2.0 is its support for an expression language (EL). An expression language makes it possible to easily access application data stored in JavaBeans components. For example, the JSP expression language allows a page author to access a bean using simple syntax such as ${name} for a simple variable or ${name.foo.bar} for a nested property. Click JSF EL reference to continue reading..