How to fix Java plugin in Firefox (DRAFT)

sudo ln -s /usr/lib/jvm/java-6-sun-1.6.0.14/jre/plugin/i386/ns7/libjavaplugin_oji.so

aamr@aamr-laptop:/usr/lib/firefox-3.5.4pre/plugins$ sudo ln -s /usr/lib/jvm/java-6-sun-1.6.0.14/jre/plugin/i386/ns7/libjavaplugin_oji.so
4 lrwxrwxrwx 1 root root 73 2009-08-27 11:52 libjavaplugin_oji.so -> /usr/lib/jvm/java-6-sun-1.6.0.14/jre/plugin/i386/ns7/libjavaplugin_oji.so

Tagged , | Leave a comment

Killing a process that listening on a port

Sometimes you may want to stop a server application that is running on a pre-defined port number.

lets give an example; if you have a tomcat server running on port 8080, you don’t have the process number to execute the kill command, and you don’t want to go through the ps hell.

here’s what you should do to stop (kill) the tomcat process:

first, make sure that the server is running on that port :
netstat -nap | grep 8080

then, kill the process that is running on that port using this command:
fuser -k 8080/tcp

this will kills the process that listens on port 8080

note: the fuser binary resides in different places based on your linux distribution. So, to find its exact binary location, uses this command:
whereis fuser

Tagged , | Leave a comment

Highlight your grep results

Used grep command before ?
grep is a very good command that allows you to grep text 🙂
It allows you to search the contents of a file/group of files for a string (regular expression)

of course it is great, but the output may be somewhat confusing !!!!

so, try this:
alias grep=’grep –color=always’
then try to use grep, you will see the output contains the string you search for is highlighted.

try to put this command in your .bashrc file in order not to re-alias it each time, like that :
echo “alias grep=’grep –color=always'” >> ~/.bashrc

Tagged | Leave a comment

Print the exact contents for a file

If you want to print the exact contents of a file (the white spaces, the new lines), use this command:

more file_name | od -c

Tagged , | Leave a comment

Count number of lines in a text file

wc -l file_name

Tagged , | Leave a comment