Thursday, October 20, 2011

vimrc essentials

setlocal spell spelllang=en_us
map <F6> <Esc>:setlocal spell spelllang=en_us<CR>
map <F8> <Esc>:setlocal nospell<CR>

" toggle colored right border after 80 chars
set colorcolumn=81
let s:color_column_old = 0

function! s:ToggleColorColumn()
if s:color_column_old == 0
let s:color_column_old = &colorcolumn
windo let &colorcolumn = 0
else
windo let &colorcolumn=s:color_column_old
let s:color_column_old = 0
endif
endfunction

nnoremap <Leader>8 :call <SID>ToggleColorColumn()<cr>

Tuesday, August 02, 2011

Convert images to pdf

convert -define pdf:use-trimbox=true *.png output.pdf

Saturday, May 22, 2010

Came-back

Just move back in to Google from wordpress for no reason, ok maybe the single sign on can be one reason..

Just to inform, And will work on the visual aspect of the blog also and more importantly will restart the momentum in blogging ...

Wednesday, October 03, 2007

Moving to Wordpress....

See you all in My new blog http://sandakith.wordpress.com/
Thanks
Lahiru Sandakith

Tuesday, May 01, 2007

How To Speed Up Firefox ...


** Type “about:config” into the address bar, look for ...

network.http.pipelining

network.http.proxy.pipelining

network.http.pipelining.maxrequests

Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.

** Alter the entries as follows:

Set “network.http.pipelining” to “true”

Set “network.http.proxy.pipelining” to “true”

Set “network.http.pipelining.maxrequests” to some number like 30.

** Lastly right-click anywhere and select New-> Integer. Name it “nglayout.initialpaint.delay” and set its value to “0″. This value is the amount of time the browser waits before it acts on information it receives.

If you’re using a broadband connection you’ll load pages MUCH faster now!

Saturday, April 14, 2007

Happy Sinhala Hindu New Year 2007

Wishing you all a very happy new year 2007.
All of your dreams come true...

Monday, July 31, 2006

all about system info gathering

I had the assignment to gather system info while doing some performance testing with tomcat5.5
here are some of the info that I gotted out wile doing that

find & replace in vi

:%s///g

abt solaris system info

cpuinfo - command vmstat
meminfo - command vm stat

in top u can custermize that to ur preference
f will do the selecting the display columns
h will go to the help mode
W will write to the config file the current settings and many more

also a atsar command at unix
sar - Collect, report, or save system activity information.

Thursday, July 13, 2006

SELinux disable

SELinux is an enhancement to the Linux kernel that implements discretionary access control (DAC) and role-based access control (RBAC).

Disable SELinux by changing the following in /etc/sysconfig/selinux and rebooting the system.
SELINUX=disabled

setenforce 0 this is also be the command that diable on the fly

Wednesday, July 12, 2006

remove the old kernel Ubuntu

Ubuntu always keeps the old kernel when it install a new one, just in case this new one doesn't work well for you.


You can uninstall the old one if you don't use it anymore :
Code:
sudo apt-get remove --purge 2.6.15-23-386*

Doing this will uninstall the packages related to the 2.6.15-23 kernel, like "linux-image-2.6.15-23-386", "linux-restricted-modules-2.6.15-23-386", etc.

TCP MON and Tungsten

How to enable http other than https in the tungsten code
-------------------------------------------------------------------------
change the services.xml protocol to http
if we comment the transport tab then it will expose in all the transport methods

tungstom xml change the debug state to ON

then it should work ..

about thungsten build

Way to get out of trouble


Never do a maven clean build while the link is available to a source location from the targets location that will cleaned

before do any wbm and any other thing do check we whether that extention link exists
if so remove that thing otherwise shot dead

How to create that link

cd target/dist/tungsten-SNAPSHOT/lib/www/
rm -fr extensions/
ln -s ../../../../../modules/www/extensions/

So be alert always

Idea remote debugging

To enable remote debugging in IntelliJ Idea
First create a remote configuration on Idea that you can do remote debugging
The string pattern that will occur will look like this

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

and what we need to do is depending on your executable project wither set the JAVA_OPTS variable to the above
and start the project and then
start the debugger on idea

CINTEC AWARD for the best CSE Project

Received a latter from UOM saying that I will be receiving an award for the best CSE Project , HMM sounds crazy but thats how the life goes on . Let see what they have for me

Wednesday, July 05, 2006

place where the name servers reside

/etc/resolv.conf

cat /etc/resolv.conf to resolve the DNS names

Saturday, June 24, 2006

10 Immutable Laws of Security

The 10 Immutable Laws of Security:


* Law #1: If a bad guy can persuade you to run his program on your computer, it's not your computer anymore

* Law #2: If a bad guy can alter the operating system on your computer, it's not your computer anymore

* Law #3: If a bad guy has unrestricted physical access to your computer, it's not your computer anymore

* Law #4: If you allow a bad guy to upload programs to your website, it's not your website any more

* Law #5: Weak passwords trump strong security

* Law #6: A computer is only as secure as the administrator is trustworthy

* Law #7: Encrypted data is only as secure as the decryption key

* Law #8: An out of date virus scanner is only marginally better than no virus scanner at all

* Law #9: Absolute anonymity isn't practical, in real life or on the Web

* Law #10: Technology is not a panacea

10 Immutable Laws of Security at Microsoft TechNet.

Wednesday, June 21, 2006

Ant bash completion

In the ant/bin folder there is a Perl file called complete-ant-cmd.pl. Check the comment at the top of the file for installation instructions. In my Ubuntu notebook I had to add “complete -C complete-ant-cmd.pl ant build.sh” to my .bashrc file and not “$ complete -C complete-ant-cmd ant build.sh” (no $ and add .pl to the command). Also, not sure why is build.sh needed in all this. Anyhow, after installing this extension command completion for Ant works great. It is a bit slow the very first time you use it but it creates a cache file called .ant-targets-... and then it is much faster.

Sunday, June 04, 2006

note from the hongkong airport

Though this was published late, this was a original blog at that location

Blog Form the Hong Kong International Air

Time : Sri Lanaka 1 45 PM
: Honk Kong 3 45 PM

We 3 (ME , Amila, Sris), finally arrived at the Hong Kong International
Airport. They say that this is the best Airport around. Its one of the
best that you can get. We went shopping but seems all the electronic
equipments are bit expensive than we thought. To refresh the journey all the way up to here we first got in to CX700 and landed in Bankok, Thailand after nearly 3 hours of air time. Lucky I received the window seat there and I got this valuable experience to see the outside when the Airjet take off from the ground. This was my first flight experience and to be at the window at your first flight means that you are very lucky. Saw how the our small world can be seen from
30000 km above and the temperature sometimes around -10 C. But at the Bankok airport we never got the chance to getdown from the plane due to this security reason, thats very unfortunate for us. But leaving bangkok we arrived at Hong Kong after a another 2 and half hour of journey. And we got arroung 4 hour before the the flight to San Fransisco arrives. And then got into the San Fransisco flight and unfortunately the seats are located right in the middle row that we were never saw the outside thought the flight. The flight was almost full and all kinds of pessengers were there. This wes the tedious part of the flight and we almost felt seep 80% of the flight time. The food was served in different menus twise of the flight and Some ware good but some were not that much eatable for me. Finally we arrived at the SF and Ryan was there to meet us. we never got any trouble with the baggages and it was a relief for us.

So that how it goes , first flight completed successfully !

Friday, May 26, 2006

Linux Splash Creation with GIMP

The splash image is the image shown in the background when GRUB is displaying the list of operating systems you can boot. All you need to customize it is the GIMP or Imagemagick and gzip.

You will need to make sure your GRUB supports the splashimage command. I took image from gentoo.org and cut a little for the GRUB background

Creating image (GIMP)

1. Start the GIMP.
2. Click on File->New or type Ctrl+N
3. In the new image dialog, change Width to 640 pixels and Height to 480 pixels. (The image should be of size 640x480 pixels.) Now click OK.
4. Create the image which you would like to be the splash image. It's quite fun to experiment with the various tools of the GIMP!
5. After you have finished creating the image, hit Alt+i or right click on the image and click on Image->Mode->Indexed...
6. In the Indexed Color Conversion dialog that appears, click on the radio button "Generate optimal Palette" and in "# of colors" enter 14. Click OK.(The image should be of only 14 colors)
7. Now right-click on the image and click on File->Save As...Save the file as ImageName.xpm in a directory of your choice.

For some reasons i could not create *.xpm so i save it as *.png and then

convert ImageName.png ImageName.xpm

(convert is a part of media-gfx/imagemagick)

You can save image from this page and convert it skipping image creation hassle


Creating image (Imagemagick)

* You can also pick an image (any type supported by ImageMagick) and execute:

convert -resize 640x480 -colors 14 picture.jpg ImageName.xpm


Installing the Image

gzip ImageName.xpm
mount /boot
mv ImageName.xpm.gz /boot/grub/

* In the /boot/grub/grub.conf you have to point splashimage to newly created image i.e.

File: /boot/grub/grub.conf

# Splash Image
splashimage=(hd0,0)/grub/ImageName.xpm.gz

That's it! When you reboot, you will find your image in the background, with the menu of operating systems etc. in the foreground.

Monday, April 17, 2006

building Axis 2 locally

steps to get the Axis 2 build in GNU/Linux env
----------------------------------------------

download the source from svn repo
$ svn co http://svn.apache.org/repos/asf/webservices/axis2/trunk/java axis2/

get maven installed in the local env
download maven 1.0.2 tar ball and extract that
get the env valiables set MAVEN_HOME and add MAVEN_HOME/bin to the path
u should create the local repo also and then i ll wornt download those jars at the 2 time
$MAVEN_HOME/bin/install_repo.sh $HOME/.maven/repository

check the maven working - source the .bash_profile and then maven

go to the axis2 home and then maven
this will get all the jars nessesary and build axis
thats it :)

Wednesday, April 05, 2006

Apache Portable Runtime and Tomcat

The Apache Portable Runtime is a highly portable library that is at the heart of Apache HTTP Server 2.x.APR has many uses, including access to advanced IO functionality (such as sendfile, epoll and OpenSSL), OS level functionality (random number generation, system status, etc), and native process handling (shared memory, NT pipes and Unix sockets).

APR support requires three main native components to be installed:

  • APR library
  • JNI wrappers for APR used by Tomcat (libtcnative)
  • OpenSSL libraries
wrapper library sources are located in the Tomcat binary bundle.The file is in the bin/tomcat-native.tar.gz . Once the build environment is installed and the source archive is extracted, the wrapper library can be compiled using (from the folder containing the configure script):
./configure && make && make install

First I need to install the APR on my local machine

that I needed to downlod the APR and the APR util in to the same machine and install it in th /usr/local/apr then I compiled the native code of the comcat then that succeed

./configure --with-apr=/usr/local/apr/
make clean && make && make install
-------------------------------------------------------------------------------------------
Check wether the tomcat uses this APR in their process -

then at this java.library.path it search as
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home/sandakith/software/jdk1.5.0_06/jre/lib/i386/client:/home/sandakith/software/jdk1.5.0_06/jre/lib/i386:/home/sandakith/software/jdk1.5.0_06/jre/../lib/i386

Then what needed to be done is to include those created libs at /usr/local/apr/lib to the one of the location that it complains that it can not find that

other way is that you can edit the java,library.path - still not done:)
Then that thing in the catalina.out will not be visible and it will optimize the performance using this native libraries