Wednesday, May 27, 2009

SSH Port forwarding

Local Forwarding: forward local service to remote service

Local: ssh -L 9998::
Remote server: nc -l
Local: nc localhost 9998


Remote Forwarding: forward remote service to local service
Local: nc -l localhost 9998
Local: ssh -R 9999::
Remote server: nc -l locahost 9999

Friday, July 21, 2006

How to enable dtrace with usermod on Solaris 10?

To enable dtrace for "foo"
usermod -K defaultpriv=basic,proc_owner,dtrace_kernel,dtrace_proc,dtrace_user foo

Friday, July 14, 2006

How to instrument WebLogic with JProbe?

There are two ways.

1. Customize startManagedWebLogic.sh with instrumentation.
For instance, for JProbe, we can do the following
${JPROBE}/bin/jplauncher
-jp_java="$JAVA_HOME/bin/java" -jp_input="myapp.jpl" -Dweblogic.Name=${SERVER_NAME} -Dweblogic.management.username=${WLS_USER} -Dweblogic.management.password=${WLS_PW} -Dweblogic.management.server=${ADMIN_URL} -Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" -Duser.timezone="MST" -Djava.security.auth.login.config="${EM_ABP_HOME}/wl_jaas.config" weblogic.Server

jplaucher will kick off the instrumented JVM.

2. Use a different node manager start up script.
To avoid passing those environment variables as above, use a customized node manager start up script is a good idea.

look at startNodeManager.sh to write your own

nodemanager.properties
======================
StartTemplate=myjprobe.sh


For example, if you set StartTemplate=myjprobe.sh, myjrobe.sh is used to start Weblogic Managed server with jplauncher just like in 1.

Sunday, December 05, 2004

indoor volleyball and basketball

Ever since the beach volleyball is over, I have been playing indoor volleyball and basketball every Sat afternoon. It has been fun and will end this season next week. I will be on vacation/time off soon:-).They approved my time off and I could spend my chinese new year in china with my parents this time. fell pretty cool and excited. I plan do some travelling.

last night went out for dinner (YunNan style). Then we played poker and "killer" game at a friend's place. He finished his contract and go back to Beijing next week.. should be loads of fun over there. I will probably see him in over a month over there. o well it's wierd last night that a few us has been playing "killer" on and on, me 4 times, then playing "cop" 2 times.. some ppl never did.. odd as it is. had to take 5-6 shots of hard liquor. going down my throat and burned right to my stomach.. eventually feel sleepy and all went home.. haven't had this 65 % liquor for a while.. it is good and I sleep till 10:00 and no need to go work or give a ride or sth...good feeling.

Friday, December 03, 2004

Pytion is not java

Python is not Java!

I like what he said: stop writing too much code . I will add: stop thinking too much code

Tuesday, November 30, 2004

hackable software is about control over code

Then hackers like UNIX while the rest loves Windows. However Windows is morphing itself into a UNIX kernel with its window system. Why? It is because it is statically hackable in UNIX thru shell script, pipe etc. That give them more control.

Open source software and UNIX have a common characteristic: hackable. For UNIX, it appears hard to hack for a starter. Windows seems go the other way. But once you master C, a few shell script language then everythings seems downhill from there.

And the hackers like open source just because it is hackable. The more hackable the software is, the more control hackers over it. The software (actually requirements from human) is a live form that keeps changing dynamically, to maintain sth. like that you need it be hackable, either staticlly hackable or dynamically.

Wednesday, November 24, 2004

feather linux's working sweet

http://featherlinux.berlios.de

pretty sweeeeet as tiny as 60M. I've tried it on my Thinkpad and desktop from a CD. Both worked. It even gave me a different ip address (DHCP) other than the one assigned at work.

I'd like to make a small linux distribution for programmer only, just gcc,perl,python, tcl and shells, netcat, nmap and a few other networking tools. will do that in my spare time:-).

http://www.sysresccd.org/ is cool too for resucuing the Linux/Windows, i will burn 1 CD tonight and see how it works.

http://www.knoppix.net/ is for Knoppix distribution.

The Feather Linux article is a good one.

Tuesday, November 23, 2004

an interesting observation

After reading an interview for HPING creator , I 've learned quite a few networking tools are created by Italitan devleopers such as the one used in Matrix Reloaded(NMAP). It also reminds me of how Python and Linux get created in Europe. o well Perl and GNU comes from America, however I think Python and Linux are more important nowadays. What drives inventions by individual in computer technology?

Most of technological advances happened in America seem to come from well funded organization's team work. For instance, Bell labs invented UNIX, Berkeley for BSD, Xerox Parc for GUI and Ethernet, MIT for X window, with one exception of Larry Wall'sPerl. With my personal experience as working in both in US and Canada for years, my humble guess is most developers here like to get paid for their work. Getting paid is a good thing, however the idea of it also hinders the great invention by individual, so most of inventions in I.T are done by large team instead of talented individaul. Why do we like to get paid for the software we wrote? I think it's due to higher pressure level living in America.












home automation links

I'm thinking of give it a spin and maybe add a Python API, then some CLP.

career move?

I am thinking about what kinda of company should be right for me and make me happier at work.

For a long time (a little over 10 years) I have mostly worked with small or large organization such as start-up, banks, insurance company, big I.T firm. Sometimes I have to cut my resume shorter since the fast changing jobs during dot com boom. From 1994-2001, almost all the projects are brand new, i had chances to practice my design skills, it is fun, cool and rewarding. After 2001, things have changed, every job I took is like fire fighting, trouble shooting, I am more and more towards into all-in-one firefighter. I feel tired and bored, like to rant more than ever. I am checking out Google labs now, other places who uses Python/C as their major programming language. It seems most talented and smarter people like to work for Amazon, Google and Yahoo type. That might make them happier than working with company drones and million dollar going-down-the-toilet projects.

Based on my experience, i have two ways out of this dilemma. One is to find a travelling consulting job and keep doing what I am doing, but keep the firefighting short and brief, earn better bucks, take another 3 months off to somewhere exotic and fun and collect myself for brain damage for the previous 9 months. The other would be totally forgot what I've become, find a cool company like Google and start a new career working with smart ppl.







Monday, November 22, 2004

add links

finally I got some time today to add my frequent visited links to my links. it will make it easier for me to navigate them.

Thursday, November 11, 2004

some typical WAS HA configuration

For a typical WAS HA architecture, it's sth like the following:

WTE(Caching Proxy)<---->ND (Network Dispatcher)<-->multiple IHS <---> WAS cluster (vertically cloned WAS) <--> DB2/MQ

Each one occupies a physical machine. Pretty expensive cost, multiple points of failure if not set up correctly, each one performs its own function.




HD enclousre works like a charm

I bought this Powerdata HD enclousre 2.5" for $14.99CAN and 1 year in store warranty. It 's pretty darn fast and I'd copied 900M in about 5 minutes. I like this design since it's pluggable and I can still use my notebook HD for other purpose.

Tivoli Performance Viewer jumpstart hack

TPV turns out to be a usable tool for PD and performance monitoring. At once I used it to find if a suspicious EJB method has been called. That really helped our dreadful deadlock hunting in WCS.

If you happen to have a WAS 5.x installed but without TPV installed, you can just copy from someone else's WAS with TPV by doing the following:

1. copy tperfviewer.bat/.sh to the $WAS_HOME/bin
2. copy perf*.jar, pmi*.jar, chart.jar (KL group's chart widget) to $WAS_HOME/lib.

I call it jumpstart since it 's like copy some files from the working one to the non-working one.

Now you are ready to fire it up like "tperfviewer ", soap port is 8879 for WAS ND by default.




Tuesday, November 02, 2004

Murphy's Love Laws

1. All the good ones are taken.
2. If the person isn't taken, there's a reason. (corr. to 1)
3. The nicer someone is, the farther away (s)he is from you.
4. Brains x Beauty x Availability = Constant.
5. The amount of love someone feels for you is inversely proportional to how much you love them.
6. Money can't buy love, but it sure gets you a great bargaining position.
7.The best things in the world are free --- and worth every penny of it.
8. Every kind action has a not-so-kind reaction.
9. Nice guys(girls) finish last.
10. If it seems too good to be true, it probably is.
11. Availability is a function of time. The minute you get interested is the minute they find someone else.

Monday, October 25, 2004

Tuesday, October 19, 2004

a simple Jython timing function

for any func i'd like to time in Java, I can use it with a call

print 'foo takes=',mytime(foo,[bar1,bar2,..barN])



# a higher order func
def mytime(f,args):
start=System.currentTimeMillis()
f(*args)
end=System.currentTimeMillis()

return end-start


Wednesday, October 13, 2004

write tools in Jython

It should work with other JDBC drivers. Wrote this article at the beginning of year as a result of making my working life easier.

english
   
chinese


Thanksgiving long weekend flu

i 'd been coughing lately. half of ppl around me are coughing.. must be flu.. weekend is even busier than weekdays... toronto has a crazy night life for asian ppl.. karoke, late dinner, drinks,friends known and unknown.. just like old times.

Friday, October 08, 2004

the design of CLP

Today I took a quick look at WSLT (from BEA) as a scripting solution (written in Jython) for WebLogic admin tasks.

For the last couple of days, I implemented a mini CLP for some WAS DynaCache cache. It is simple and quite extensible. I followed the DB2 CLP design.

This brings me an interesting thought on this issue.
Which way is better?

#1: design CLP commands only in a list of string seperated by white space characters and let
platform shell to take care of flow control, variable,name space if any.

#2: a full scripting language such as WebSphere 's wsadmin and Weblogic's WSLT. It provides flow control, variable, etc. That's why Jacl or Jython has been directly exposed to the end user (i.e. administrator).

Personally, i think #1 is better in that after a while, I don't need to look at the command reference any more. If I want to control it, always go back to my favorite shell. Secondly, for anyone who don't know Tcl or Jython (as most admin from Perl or Shell) syntax well, to look up the reference is pain in the butt.

DB2 CLP design gets this right: to keep simple things simple.

Victor