Wednesday, April 9, 2014

Running 32 bits Binary in Linux 64

It usually shows the problem as complaining about ld-linux.so not found.

Installing glib 32 bit version solve the problem.

In RHEL:

yum install glibc.i686

It is better to define original installation dvd as a repo and use it to install.

RHEL Add Local DVD as Reporsitry

Touch /etc/yum.repose.d/rhe-dvd.repo
Add The following inside:

[rhel-dvd]
name=Red Hat Enterprise Linux $releasever - $basearch - DVD
baseurl=file:///mnt/dvdrom/
enabled=1
gpgcheck=0


/mnt/dvdrom supposed to be mount point of DVD

Add Sudoer

Platform: RHEL

Config File: /etc/sudoers

Add username as the following format:

user MACHINE=COMMANDS
like
username ALL=(ALL)     ALL

Sunday, March 9, 2014

Generate a Date Range in MySQL

Set @i:=0;

SELECT DATE(DATE_ADD( '2014-03-01' - INTERVAL 1 DAY, INTERVAL @i:=@i+1 DAY ) ) AS datesSeries
FROM `CS3_Statistics`.`HC_Report`, (SELECT @i:=0) r
where @i < DATEDIFF( '2014-03-07' + INTERVAL 1 DAY, '2014-03-01' )
;


Thursday, October 10, 2013

Java 7 IP 6 to 4

Java 7 is using IP6 for its connectivity by default, to disable it and use IP4 the following setting can be set in windows or unix environment to override it

_JAVA_OPTIONS -Djava.net.preferIPv4Stack=true


Saturday, September 21, 2013

TCL Expect Script Directory

These are expect parameter to work with command line options:

puts $argc     # number of argument passed to script
puts $argv    # array list of arguement, script name not included
puts $argv0  # the name of script include path of calling e.g. ./test.sh

set path [file dirname $argv0]    # obtain script directory
cd $path      # Change directory to script directory



# Find script path through links as well
set originalPath [pwd]
set scriptPath   $::argv0
set workingPath  [file dirname $::argv0]
while {![catch {file readlink $scriptPath} result]} {
    cd $workingPath
    set scriptPath  [file join [pwd] $result]
    set workingPath [file dirname $scriptPath]
}
cd [file dirname $scriptPath]
set scriptPath [pwd]
cd $originalPath

Wednesday, August 28, 2013

Read and Clear big wtmpx

Read
/usr/lib/acct/fwtmp < wtmpx


Clear
cd /var/adm
gzip -c wtmpx > wtmpx-2013.gz
> wtmpx