Thursday, September 30, 2010

How to get System IP using shell in various systems.

Sometime we want to retrive some IP address information about the system in a shell script.
This is how it can be done.

Linux:

  ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'

FreeBSD/OpenBSD:

  ifconfig  | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'

Solaris:

  ifconfig -a | grep inet | grep -v '127.0.0.1' | awk '{ print $2}'




Hari ini Hujan, parking sesak

Parking lot beside Prudential Building ... 

Tuesday, September 28, 2010

How to show hidden files on OSX

Sometime it is convenient to use  Finder instead of Terminal to copy files. 
The default Finder behavior is not to show hidden ( dot files ). 
To change this behavior, open your Terminal::

  defaults write com.apple.Finder AppleShowAllFiles YES

Then restart the Finder.
How to restart the Finder ?? ::

Hold down the 'Option' key then click on the 'Finder' icon on the Dock, Then click 'relaunch'.

*#* Warning :: CAUTIONS with the DOT files you see. DO NOT DELETE/MODIFY UNLESS YOU KNOW WHAT YOU ARE DOING !!!





Wednesday, September 22, 2010

CVS Setup for in 5 minutes or less

This is express cvs setup for SLES( not much different for Unix/Linux varients ):

A:: As ROOT
1. Install the cvs ( binary / compile from source ).
2. Define CVS environment variables in your  /etc/profile  , if you are root, or edit your  own ~/.bashrc  file, 
    if needed, to include the following two lines:

export CVSROOT=/home/cvs
export EDITOR=/bin/vi

If omited the second line, vi will be the editor used by default.

3. If you wish to have files made read-only after checking them in, define:
bash# export CVSREAD=yes

4. Initialize CVS repository:
bash# cvs -d $CVSROOT init

5. Create a CVS repository on CVS server with appropriate rights:

bash# groupadd cvs

# create cvs group
bash# useradd -g cvs -d $CVSROOT cvs

bash# chgrp -R cvs $CVSROOT

bash# chmod o-rwx  $CVSROOT

bash# chmod ug+rwx $CVSROOT

6. Allow selected users to access repository

bash# usermod -G cvs your_user_name
bash# usermod -G cvs some_other_user

B:: As your_Normal_User
7. If environment variables CVSROOT and EDITOR are not defined, you need to set them up yourself. For Linux, in  ~/.bashrc define :
export CVSROOT=/home/cvsrep
export EDITOR=/bin/vi
8. First, you may want to export files into the repository. Given you have directory, YourAppDir, with files you want under cvs control. 
bash$ newgrp cvs
bash$ cd ~/YourAppDir
bash$ cvs import srcDir vname vrel

This imports all the files in ~/YourAppDir and places them in YourAppDir module under CVS. vname and vrel are vendor name and vendor release ids. They are required, but can be any value, usually related to vendor values (vrel has no relation to the CVS version numbers).

9. You now have your code under CVS. To see that, enter the command:
bash$ ls $CVSROOT/

YourAppDir


Now, you must get your files out: 
bash$ cd ~                            # recall code is in ~/

YourAppDir



bash$ cvs checkout 

YourAppDir


This command checks out all the code in CVS module 

YourAppDir

.
Since you are in the parent directory containing 

YourAppDir

,
the contents of 

YourAppDir

 are overwritten by what is in CVS.

B:: As ROOT

To make the service available to be used:
Under SuSE 9.0 and RedHat 8.0, edit the file /etc/xinitd.d/cvs to contain:
Under SLES 10 edit /etc/xinetd.d/cvs 

======================================

service cvspserver

{
  server      = /usr/bin/cvs
  server_args = -f –allow-root=/home/cvsrep pserver
  port        = 2401
# default
  socket_type = stream
# default
  wait        = no
# default
  user        = root
# default
  passenv     = PATH
# default
}

======================================

Restart xinetd (need to be root) using:

bash# /etc/init.d/xinetd restart

Usually the configuration is finish here ... check this if yours is not working 


Under most Linuxs, insert in /etc/services:

cvspserver 2401/tcp

If not using tcpwrappers, insert in /etc/inetd.conf:

cvspserver stream tcp nowait root /usr/bin/cvs \
-–allow-root=/home/cvsrep pserver

If using tcpwrappers, insert in /etc/inetd.conf:

cvspserver stream tcp nowait root /usr/sbin/tcpd \
/usr/bin/cvs -–allow-root=/home/cvsrep pserver

Restart inetd as root:

bash# /etc/init.d/inetd restart

That all:: this is minimum configuration to make it work. 
Please read the documentations for details.


















KLCC Just Before Raining ...

The top of KLCC lost in oncoming rain cloud ... 

Petai dan Khasiat dari sudut perubatan moden

petai.JPG
ADVICE FROM UKM MEDICAL DOCTOR

Little did you know ...... after reading THIS, you'll NEVER look at    petai    in the same way again!

Petai
  contains three natural sugars -sucrose, fructose and glucose.   Combined with fiber, petai gives an instant, sustained and substantial   boost of energy. Research has proved that just two servings of petai provide enough energy for a strenuous 90-minute wor kout. No wonder   petai is the number one fruit with the world's leading athletes. But energy   isn't   the only way petai can help us keep fit. It can also help overcome or prevent a substantial number of illnesses and conditions, making it a must to add to our daily diet.  


Depression:
 
According to a recent survey undertaken by MIND among people suffering   from   depression, many felt much better after eating petai. This is because petai   contain tryptophan, a type of protein that the body converts into   serotonin, known to make you relax, improve your mood and generally make you feel happier.


PMS(premenstrual syndrome):
 
Forget the pills - eat petai. The vitamin B6 it contains regulates blood   glucose levels, which can affect your mood.


Anaemia :
 
High in iron, petai can stimulate the production of haemoglobin in the blood   and so helps in cases of anaemia.


Blood Pressure:
 
This unique tropical fruit is extremely high in potassium yet low in salt,   making it perfect to beat blood pressure. So much so, the US Food and Drug Administration has just allowed the petai industry to make   official   claims for the fruit's ability to reduce the risk of blood pressure   and   stroke.


Brain Power :
 
200 students at a Twickenham (Middlesex) school were helped through their   exams this year by eating petai at breakfast, break, and lunch in a bid to  boost their brain power. Research has shown that the potassium-packed fruit can assist learning by making pupils more alert.


Constipation:
 
High in fiber, including petai in the diet can help restore normal   bowel   action, helping to overcome the problem without resorting to laxatives.


Hangovers:
 
One of the quickest ways of curing a hangover is to make a petai milkshake,   sweetened with honey. The petai calms the stomach and, with the help of the honey, builds up depleted blood sugar levels, while the milk soothes and   re-hydrates your system.


Heartburn:
 
Petai has a natural antacid effect in the body, so if you suffer from   heartburn, try eating petai for soothing relief.


Morning Sickness
  :
Snacking on petai between meals helps to keep blood sugar levels up   and   avoid morning sickness.


Mosquito bites
  :
Before reaching for the insect bite cream, try rubbing the affected   area   with the inside of the petai skin. Many people find it amazingly successful at reducing swelling and irritation.


Nerves:
 
Petai is high in B vitamins that help calm the nervous system.


Overweight:
 
Studies at the
<? xml:namespace prefix = st1 ns = 'urn:schemas-microsoft-com:office:smarttags' /> Institute of Psychology in Austria found pressure at work   leads to gorging on comfort food like chocolate and crisps. Looking at 5,000 hospital patients, researchers found the most obese were more likely to be in high-pressure jobs. The report c oncluded that, to avoid panic-induced food cravings, we need to control our blood sugar levels   by   snacking on high carbohydrate foods every two hours to keep levels steady.    


Ulcers:
 
Petai is used as the dietary food against intestinal disorders because   of   its soft texture and smoothness. It is the only raw fruit that can be eaten without distress in over-chronicler cases. It also neutralizes over-acidity and reduces irritation by coating the lining of the stomach.


Temperature control
 :
Many other cultures see petai as a 'cooling' fruit that can lower both the   physical and emotional temperature of expectant mothers. In hoiland, for   example, pregnant women eat petai to ensure their baby is born with a cool   temperature.


Seasonal Affective Disorder (SAD) :
 
Petai can help SAD sufferers because they contain the natural mood   enhancer, tryptophan.


Smoking:
 
Petai can also help people trying to give up smoking. The B6, B12 they contain, as well as the potassium and magnesium found in them, help the   body recover from the effects of nicotine withdrawal.
 


Stress:
 
Potassium is a vital mineral, which helps normalize the heartbeat,   sends oxygen to the brain and regulates your body's water balance. When we are   stressed, our metabolic rate rises, thereby reducing our potassium levels.   These can be rebalanced with the help of a high-potassium petai snack.


Strokes:
 
According to research in 'The New Engla nd Journal of Medicine, '   eating   petai as part of a regular diet can cut the risk of death by strokes by as   much as 40%'.


Warts:
 
Those keen on natural alternatives swear that if you want to kill off   a  wart, take a piece of petai and place it on the wart. Carefully hold the petai in place with a plaster or surgical tape!

So, as you can see, petai   really   is a natural remedy for many ills. When you compare it to an apple, it   has   four times the protein, twice the carbohydrates, three times the   phosphorus, five times the vitamin A and iron, and twice the other vitamins and minerals. It is also rich in potassium and is one of the best value   foods around.  So maybe its time to change that well-known phrase so that   we say, 'A Petai a day keeps the doctor away'.   

Tuesday, September 21, 2010

Groupon

Just come across this word from a meeting just know.
Groupon ~ a method of marketing, buzz marketing ... 

Good concept indeed...

Wednesday, September 8, 2010

板野友美

Who is this 板野友美 ? The English name is :: Itano Tomomi 

Monday, September 6, 2010

Iklan tv3 2010 - Sudah di tarik balik siarannya

Kontrovesi iklan tv3. Iklan Hari Raya di tambah unsur krismas/deepavali. sgt tidak berpengetahuan pelulus / pembikin iklan ini.

Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...