A simple PHP Cache library – Pettakam

Hello all, Its been a long time since my last post. Hmm… Time won’t be much better rather than now to introduce my simple PHP cache library – Pettakam

I named it after a tamil word ‘Pettakam’ meaning ‘Treasure Box’. Correct selection of word, indeed!

You can get the library here : https://github.com/vimalsudhan/pettakam

This cache library is effective, if you don’t have memcache or any cache server and you are running large DB queries (with lot of joints) which can be cached. This library makes use of filesytem to cache your variables, which will be faster compared to running queries in a relatively large Database.

Like in a cache server, you can set expiration time for your cached variables, can cache any datatype(numeric,string,arrays,objects) except resource-type, check cached and clear any or all cached.

As a step further for cache control, you can group your cached variables into ‘groups’ and you can clear a set(group) of cached ones. This is useful when there is a ‘UPDATE’ and a set of cached variables are affected & needs updation.

Please read through README at https://github.com/vimalsudhan/pettakam with examples and howto-s.

Its been there for a year and I am using it my codes both personal and professional 🙂 So, its hands down to say it works.

Hoping to publish more of my codes at https://github.com/vimalsudhan. Time will say…!


Vimal Sudhan at Facebook

My Headless Linux Server

Finally I setup-ed my linux server for my home! Woo Hoo!!
Now I can code, develop my stuff & sites, get my hands dirty inside linux, stream music & videos within home network, or even host an online presence with DDns…. And I can do all these without even touching the server. well things are enormous to explore with this!
And also figured out that you can switch on a machine remotely 🙂 magic packet – WOL

Its running CentOS 6 on Intel Atom processor (D425KT) with 2GB Memory, great to run for 24×7 with very less power consumption.

How to set screen size in mobile/wap site?

If you didn’t know, well its easy as putting your leg in mud clean.
You can set width for your wap site to enclose the whole mobile screen size by using ‘viewport’ meta tag. As you know, meta tags are special instructions sent to browser in our case mobile browser. With many meta tags available, we have another one called ‘viewport’ used to control layout.

Use this tag in head:
<meta name="viewport" content="width=device-width">

“width=device-width” will set width of your site to available width of device screen size. So, now you can use css properties like width:100% to create clean layouts

I hope this helps!

Is your eclipse working in Fedora 15?

Just after I updated my server to Fedora 15, I found out that eclipse is crashing when code/content assist comes up. I started searching in internet for a solution and got many with a lot not fixing my issue. Finally, I figured out why.. Its due to the new libwebkit!

With lot and lot of changes in Gnome 3, they also managed to change the name of libwebkit to libwebkitgtk. Obviously, eclipse can’t know this (like the other tons of application struggling in Gnome 3).

So to make your eclipse work with Code assist without crashing, do the following

  1. Create a symbolic link for libwebkit
    ln -s /usr/lib/libwebkitgtk-1.0.so.0 /usr/lib/libwebkit-1.0.so.2
    or whatever version of libwebkit you have
  2. Add org.eclipse.swt.browser.UseWebKitGTK=true to eclipse.ini or config.ini of eclipse

I hope this helps.
See ya!

UPDATE : eclipse.ini works only with fedora versions prior to 16. For everything else, please update to config.ini

A Blog to post!!

I have a blog to post!
I have a blog to post!!
I have a blog to post!!!
I have a blog to post!!!!
I have a blog to post!!!!!

May be I can remember like this….
Busy days btw