Sunday, May 27, 2007

welcome to beijing

i just arrived in beijing, the olympic city for 2008 a few hours ago. another business trip for 2 weeks.
1st impression, the airport is quite busy with a very long queue at the imigration check point even there are more than 10 counters & a lot of people waiting outsite with their que cards awaiting for their guest or whoever and because of the crowd, we actually missed our driver who suppose to pick us up but luckily we met him at last. or maybe i arrived in peak time, school holiday maybe...
anyway it is a big city... photo will upload later.

and this is what blogspot looks like if you blogging from here :)

hopefully i'll enjoy my stay here & can't wait for my family to come over...

sei-sei :)

Thursday, May 10, 2007

while loop with ssh issue

somehow while loop with ssh only read the first line from the input file & exit without reading the next lines.
eg:
$ cat server.txt
server1
server2
server3
$ while read server
> do
> echo $server
> ssh $server uptime
> done < server.txt
server1
13:15:08 up 49 days, 1:07, 5 users, load average: 0.00, 0.00, 0.00
the uptime command will only be run on the server1 but not on the server2 or server3. to resolve this, use the -n option with ssh, which prevents ssh from reading from standard input:
> ssh -n $server uptime

alternatively, you can use for loop. should be no issue ;)
$ for server in `cat server.txt`
> do
> echo $server
> ssh $server uptime
> done
for more info - http://sial.org/howto/shell/while-ssh/

Monday, May 07, 2007

How to be a Great Dad - 12 Awesome Tips

i found this article on how to be a great dad here at http://zenhabits.net/2007/05/how-to-be-a-great-dad-12-awesome-tips/

the 1st tip is:
  1. Put their interests first, always. Do you enjoy drinking or smoking? Guess what — it’s not good for them, and you’re setting an example with everything you do. I quit smoking about 18 months ago not for my sake, but for my kids. Now, it is still important to take care of yourself (otherwise you can’t take care of them), but you should still have them in mind.
and this remind me to the conversation with my son a few weeks ago...
- while i was driving back home from fetching abang from his school, abang & adik was arguing about using the word "aku". actually adik was using "aku" & abang told adik not to use that word & told her sister that she can only use the word when she grown up. the conversation went like this:

adik: aku bla bla bla (i can't remember what was the sentence)
abang: daddy, adik cakap aku daddy. (abang reported to me)
me: adik, not good la cakap aku.
abang: aah, dah besar cam daddy jer nanti boleh cakap aku.

and then out of nowhere abang asked me:
abang: daddy, abang besar nanti boleh hisap rokok cam daddy?
dang!!! check mate aku!
me: !!?? (terkedu sekejap before i said no cannot, not good)

well i guess it's time for me quit smoking... nahhh not now :P may be later...

anyway, go read the article above. good one!

Thursday, May 03, 2007

chage: can't lock shadow password file

i got this error "chage: can't lock shadow password file" when executing below command:
# chage -E 2008-04-28 username
google said that this error because of these 2 files exist /etc/passwd.lock or /etc/shadow.lock. they are created when a user is made with useradd command. they contain the PID of the command creating them (useradd). once the PID is gone (useradd exits) the locks no longer apply and should probably have been removed by the process that created them.

in the other word, if you remove these files, you should be able to use back the chage command above. but in my case it's still failed!

turn out that the server just rebooted & one of the start up script is hanging. the script is to start an application & need to su to one user & turn out that the user's password has expired! (got this when try to su to the user - "You are required to change your password immediately (password aged)" & hang there!)

the hanging script!
root 31001 31000 0 May02 ? 00:00:00 /bin/sh /etc/rc3.d/S99apps start
root 31002 31001 0 May02 ? 00:00:00 su - user -c /apps/startapps
killed those processes & settled! :)

p/s: changing a users passwd or locking/unlocking an account does not change, create, or remove these files.