Wednesday, August 28, 2013

AIX netstat show PID

Refer to: https://www.ibm.com/developerworks/community/blogs/brian/entry/determine_which_processes_have_listening_ports_on_aix15?lang=en


The netstat command in AIX is a little bit different.

# netstat -Aan | grep LISTEN | grep 30001
f100050000b05bb8 tcp

# rmsock f100050000b05bb8 tcpcb

Sunday, August 25, 2013

Eclipse doesn't show right color under Ubuntu

Refer to:
http://askubuntu.com/questions/70599/how-to-change-tooltip-background-color-in-unity

Install and open gnome-color-chooser .
Go to Specific → Tooltips and put black foreground over pale yellow background.

Saturday, August 24, 2013

Error creating managed object for class org.jboss.weld.servlet.WeldListener

I choose to let glassfish publish new changes automatically and when I was adding @Named to one EJB, this error popped up.

Solution: Restart Eclipse and it is gone.

Friday, May 17, 2013

Procedure compiled with errors

select * from SYS.USER_ERRORS where NAME = 'PROCEDURE NAME' and type = 'PROCEDURE'


show errors procedure sonica.PALLET_DESTACKER_TEST

Thursday, April 18, 2013

Select Nth Row From A Table In Oracle

Original link:
http://stackoverflow.com/questions/4509167/select-nth-row-from-a-table-in-oracle


select * 
  from ( select a.*, rownum rnum
           from ( YOUR_QUERY_GOES_HERE  ) a
          where rownum <= N_ROWS )
 where rnum >= N_ROWS

Monday, April 8, 2013

Search a string in clob ---ORACLE

replace table_name, column_name and string

select * from table_name where dbms_lob.instr(column_name,'string')>0;

Thursday, April 4, 2013

Eclipse auto save before run

Here has the correct answer:

http://stackoverflow.com/questions/2943122/eclipse-auto-save

The second one is correct:

if 

Window -> Preferences -> General -> Workspace and there you can check "Save automatically before build" + "Build automatically" 

don't work try this 

Preferences -> Run/Debug -> Launching -> "Save dirty editors before launching"

Monday, April 1, 2013

Compile and run Java in vim

The is the original post in stackoverflow:

http://stackoverflow.com/questions/6411979/compiling-java-code-in-vim-more-efficiently

I added two lines to it:

F12 can jump out of quickfix mode
F8 can run the java program

vimrc:


autocmd Filetype java set makeprg=javac\ %
set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%#
map <F9> :make<Return>:copen<Return>
map <F10> :cprevious<Return>
map <F11> :cnext<Return>
map <F12> :ccl<Return>
map <F8> :!java %:r<Return>

Thursday, February 7, 2013

PLSQL developer 8, oracle client 32 bit 10g and windows 7

Problem:

Even I use the 32 bit oracle client 10g on my windows 7 machine, I still can't use PLSQL developer 8 correctly. Every time I try to log in, it pops up an empty window with no error message.

Solution:

Right solution is found here:
http://stackoverflow.com/questions/3895354/allround-automations-pl-sql-developer-on-windows-7-tns-over-ip-connect-to-remo

RUN IT AS ADMINISTRATOR!!!!

Friday, February 1, 2013

Youtube has no sound in Chrome

Problem:

I was trying to play a video on youtube in Chrome. It has the video but with no sound. The system speaker works fine and I can listen to the music played by the media player. Therefore, the conclusion is that there is something wrong with Chrome.

Solution:

Open an IE and set it as default browser. Then restart Chrome.

Tuesday, January 22, 2013

Can't change default jre even though path has been modified

Problem:

The Path in environment variable is using JDK1.6 but java -version shows actually JRE 1.7 is being used.

Solution:

I am on a Windows 7 machine. I am using this way but I don't like it.

Go to C:\Windows\System32, change the java.exe and javaw.exe to whatever you like.
Then the system will pick up the setting in Path.

Wednesday, January 9, 2013

error: can't create transaction lock on /var/lib/rpm/__db.000

error: can't create transaction lock on /var/lib/rpm/__db.000

Solution:

Install it as root user.

Wednesday, November 21, 2012

grep: unknown devices method


# grep -r "-DACE_NDEBUG" .
grep: unknown devices method


solution:
remove -
use #grep -r "DACE_NDEBUG" .


Monday, November 12, 2012

Friday, November 9, 2012

Let's do some shell programming!

1. Check what shell version you have:
$ cat /etc/shells

2. Show which shell you are using currently:
echo $SHELL

3. This is a good website for learning shell:
http://arachnoid.com/linux/shell_programming.html

Monday, November 5, 2012

Failed to install java 1.3 in a x86-64 suse 11

Failed to install java 1.3 in a x86-64 suse 11.

Get the error message like: Error: can't find libjava.so.

It seems that java 1.3 has not x86 64 version.

export not working in Unix

Problem:

Create a script,  aaa.script

export bbb=/opt/ccc

Then, run it by typing ./aaa.script.

After that, # echo bbb and get nothing.

Solution:

run it by typing . aaa.script

Friday, November 2, 2012

make: 1254-057 Shell command needs a leading tab.



Notice that you need to use tab instead of spaces in line 4,7 and 10. Then, everything goes fine.



Don't use make in AIX, use gmake

gcc and g++ in AIX 6.1








I have these files download from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/ezinstall.html

They have a certain dependency on each other, so the order to execute them needs to be right.

My order 1->3->4->5->2->6

Then I wrote a simple Hello World app and run it. Get warnings like this, but they don't matter.