Out Here In The Field : Generations


PHP 5.3 & MySQL 5.1 for RHEL 4.x
February 7, 2010, 10:57 pm
Filed under: *Nix, Red Hat | Tags: , , , , ,

For those who are still using RHEL 4.x and in need of deploying PHP 5.3 & MySQL 5.1 , you can get the required rpm packages from here.



how to find files by age
December 13, 2009, 12:15 pm
Filed under: *Nix, AIX, HP-UX, oracle | Tags: , , , , ,

So I don’t know what that vendor engineer did to my EBS install, some of the concurrent manager function is spitting temporary files to my /tmp directory. The thing is, that &^%$^$** engineer insisted that he has setup that all temp files are stored in it’s EBS specific directory, and clean up process has been scheduled for them. But every couple of days my /tmp is clogged with files belonged to EBS service account

Since these files basically has no expiration date, and the scheduled clean up does not cover that particular directory, I have to set my own temp files cleaning cycle. Here is what I need :

  1. find files belong to the EBS service account, let’s assume it’s “oracle”
  2. find files within certain age range
  3. delete those files
  4. automate the task to run everyday

The last part is pretty easy with crontab. The 1-3 part must be done carefully since there is a bunch of other file on /tmp that I would rather not touch :D

So here is the find command that I use to accomplish task 1 to 3 :

find /tmp -mtime +3 -type f -user oracle -exec rm -rf {} \;
  • the -mtime +3 flag is used to search for files which were last modified 3 or more days ago
  • the -type f flag is used so that the search will only find plain files only
  • the -user oracle is used so that the search will only find files belong to the user “oracle”
  • the -exec rm -rf {} is used so that every single files found by the search is automatically deleted. The search will find a single file at the time, and put the file name between the bracket.

At first I’m not sure whether the file should be deleted right away or not, so at first I decided that, instead of deleting the files, I move it to a temporary directory so I can review the files, and then delete them. Here is the find command that I use :

find /tmp -mtime +3 -type f -user oracle -exec mv {} /dumptmp \;

With the above command, instead of deleting the files found by the search, it move the said files to different location. I can then review and examine whether the files are save to be deleted.



root equivalent user on AIX ? Use sudo!
December 6, 2009, 7:16 am
Filed under: *Nix, AIX | Tags: , ,

So I got several AIX boxes hosting Oracle EBS. Since the company that I work for is obliged to follow SOX 404 standard, and that means no root password sharing for each administrators. Hence, I need to create a user for each administrators, and grant them a root equivalent right.

One approach to do this on Linux (and HP-UX) box is by changing each administrator account UID number to 0, essentially making all login from those account to be forwarded to root. The problem with this approach is that those account will use all config and history or log files of the root account. For example, when you look at .history file, you won’t be able to tell which user perform what, since all activity from each account will be recorded as if it was performed by root.

What I can do is to use sudo, that will allow you to delegate root access to certain user or group of user. Here is a little how to on installing sudo.

  1. Get the source here , as of the time of writing the current stable one is 1.7.2p1
  2. Since You will need to compile sudo from the source, make sure the C compiler is installed, and can be called. You can purchase a license for C compiler from IBM, or you can always use the good old GCC. To check, simply type “cc”.
    if the output is similar to this :

    # cc
    ksh: cc:  not found.

    Then either the C compiler is not installed, or simply that it is not on your path. In my case it was the later. “cc” from the xlC compiler was installed on “/usr/vac/bin”. So what you can do is either create a symlink of “cc” to “/usr/sbin” or “/sbin”, or to add “/usr/vac/bin” to your path. To temporarily ad “/usr/vac/bin” to your path, type the following :

    # export PATH=$PATH:/usr/vac/bin

    Test it by running “cc -qversion” if you’re running the xlC compiler, or “cc –version” if you are using GCC.

    # cc -qversion
    IBM XL C/C++ Enterprise Edition for AIX, V9.0
    Version: 09.00.0000.0000
  3. Untar the source, and then compile.
    # gunzip sudo-1.7.2p1.tar.gz
    # tar xvf sudo-1.7.2p1.tar
    # cd sudo-1.7.2p1
    # ./configure
    # make
    # make install

    The steps above should install sudo executables, sudo in /usr/local/bin and visudo in /usr/local/sbin. I believe that both directories are not on your $PATH. for ease of use, create a symlink for both of the executables :

    # ln -s /usr/local/bin/sudo /usr/bin/sudo
    # ln -s /usr/local/sbin/visudo /usr/sbin/visudo
  4. I assume that all account that will be used by administrator team has already been created. The correct way of creating user account is by using “smit user”. Put all administrators account in one group, in my case “wheel”. To do this, use “smit group”
    # smit group

    Go to “Add a Group”, put “wheel” on Group Name. Go to USER List and press F4 or Escape+4 to get the list of available user. Mark each administrator accounts with F7 or Escape+7. If you’re done, press Enter

  5. Find and edit the /etc/sudoers configuration using visudo
    # visudo

    uncomment the following line :

    %wheel ALL=(ALL) ALL

    Save. Log out from the root account.

We’re done :) To use sudo simply do “sudo command-name”. For example, to create a folder /opt/sources using sudo, type :

$ sudo mkdir /opt/sources



World of Goo Pick Your Price campaign
October 22, 2009, 11:39 am
Filed under: *Nix, Ubuntu, Windows, gaming, life on the wired | Tags: , , , ,

Commemorating one year of World of Goo, 2D Boy, the developer of the DRM free game is holding a “pick your price” promo for the said game.  Instead of paying the usual USD20, you get to choose how much money you’re going to spend for a copy of The World of Goo. Go here to get to the promo page.



How to be a computer expert
September 14, 2009, 12:43 am
Filed under: time out

I can’t stop reading  XKCD’s :D

tech support sheet

tech support sheet



ORA-27054 on RHEL
September 13, 2009, 12:17 am
Filed under: *Nix, E51, IRL, Red Hat, life on the wired, oracle | Tags: , , , , , ,

I previously encountered this issue on my 10.2 RAC nodes running on top of HP-UX. I faced it the 2nd time when performing postclone operation on a Oracle EBS 12.0.0.5 on AIX. This time, the error popped up when I’m trying to perform postclone for Oracle EBS HCM module  on a RHEL  4U6 x86-64. A reference in using nfs for Oracle can be found here. My NFS partition is mounted using :

mount 172.16.2.82:/hcmdev /u01 -o rw,bg,intr,hard,
timeo=600,wsize=32768,rsize=32768,nfsver=3,tcp

I don’t have to put “noac” on the option since the RHEL node is not an RAC cluster



Jaunty Jackapole and Toshiba Satellite M300-E413

I upgraded my Intrepid install a couple of months ago to Jaunty, but I haven’t got the chance to blog about it. In fact it’s been a while since I posted anything on my blog. The update is fairly straight forward, and as expected, broke several functions in my lappie, namely graphic acceleration and bluetooth. For fglrx, I suggest you to stick to the ubuntu sanctioned package, available from their repos, since the newest package from ATI broke several things in my box, such as Xinerama :( You can refer to my intrepid post on how to install it from Ubuntu repos

For bluetooth, you still need to install omnibook-source package. The steps to get it to work is almost the same as on my intrepid howto, with a couple of changes here and there. Get everything you need to build a module by opening console and type:


surfer@M5MobileMark-II:~$sudo apt-get install module-assistant build-essential

After that, double click on the omnibook-source file to install the package. Follow the instruction. Next is to build the module:


surfer@M5MobileMark-II:~$sudo m-a a-i omnibook-source

To activate the bluetooth adapter immediately, type:

surfer@M5MobileMark-II:~$sudo modprobe omnibook ectype=14 userset=0 lcd=0 display=0 blank=0 battery=0 ac=0 bluetooth=1

The next thing to do is to get the bluetooth adapter to start on boot. Add the module to the /etc/modules. Open the file by console

surfer@M5MobileMark-II:~$sudo nano /etc/modules

Add a new line, and put omnibook then save. My /etc/modules looks like this:


 fuse
 lp
 sbp2
 omnibook

Next, create script that will be executed on boot:

surfer@M5MobileMark-II:~$sudo nano /etc/modprobe.d/omnibook

….and add the following line to the file

options omnibook ectype=14 userset=0 lcd=0 display=0 blank=0 battery=0 ac=0 bluetooth=1

Save, and reboot. The bluetooth adapter should work after reboot.

To get bluetooth to work after a hibernate, do the following steps :

surfer@M5MobileMark-II:~$ cd /usr/lib/pm-utils/sleep.d/
surfer@M5MobileMark-II:~$ sudo nano 89bluetooth

Put these lines on the file:

#!/bin/bash
rmmod -f omnibook
modprobe omnibook ectype=14 userset=0 lcd=0 display=0 blank=0 battery=0 ac=0 bluetooth=1

Save. Set the file to be executables by :

surfer@M5MobileMark-II:~$ sudo chmod 755 89bluetooth

After that, bluetooth adapter should be able to start after resume



12:34:56-7/8/9
August 7, 2009, 12:50 pm
Filed under: *Nix, Ubuntu, time out
12:34:56-7/8/9

12:34:56-7/8/9



sqlplus with crontab
August 6, 2009, 6:02 pm
Filed under: *Nix, IRL | Tags: , , , ,

Ever want to run oracle’s sqlplus with crontab? Most of the time, the script won’t be executed, even though you’re already using the right user account. This is because crontab does not source the user’s environment variable when executing the command, and this cause some specific ORACLE variables not having the correct vaules, and in turn caused sqlplus to be unable to find some files required to run.

To solve this, you need to source the environment variables on your script. This is how the crontab script looks like :

$ more gstat.sh
. /home/oracle/.profile
/scripts/gstatsql.sh

and gstatsql.sh contains the sqlplus command that I want to run, while the gstat.sh is the one called by crontab. This is how my crontab looks like :

30     19      *       *       *       /scripts/gstat.sh

With this, crontab will source the environment variables for the user oracle, and sqlplus will be able to run correctly.



Happy Belated Birthday, Samuel Morse!
April 26, 2009, 11:47 pm
Filed under: time out