Monday, June 30, 2014

Using RequestFiltering feature, other way around

I came across a simple request from customer wherein they wanted to use 'request filtering' feature in IIS by setting 'Allow unlisted file name extensions' to unchecked. Simple request but it created mess to our product and it started showing up HTTP errors. By adding few extensions (for e.g. isapi_redirect.dll) it started working by opening few webpages but failed later. I also tried to use 'Allow URL' feature by adding few URLs but since our URLs are generated dynamically (struts mapping) we can't add each and every URL under this option.
All the options were searched but at the end we could locate 'URL rewrite' which gives handy options to allow or deny based on RegEx or WildCards.
More description can be found in this below link:
http://stackoverflow.com/questions/24034498/iis-request-filtering-allow-url

Tuesday, June 26, 2012

Few Debian Upgrades/Changes Conti....

Continuing from my previous updates in Debian.
Prior to Debian 6.0 we used update-rc to register any service and could provide the priority of start and kill init scripts. This priority would put the sequence for your script. But with the entry of 'insserv' this setting of seems to have been removed and with 'required_stop' and 'required_start' this has to be achieved. This has been introduced probably to achieve the parallel boot process in Debian.
So, Rather than using numbers, explicitly state which services you need, and it will end up in the correct order.
Refer to: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667464

Tuesday, May 22, 2012

Few Debian Upgrades/Changes

I was looking for an internal issue and could see few changes in Debian Machines as compare to other linux machines.
To put our own services (like running scripts) at shutdown of system we create the script under /etc/init.d. For e.g. /etc/init.d/CA-BADAL. Provides permissions to this script.
This script based on the run levels 0-6 (I guess) has to be placed under /etc/rc* folder.
Normally in non-debian we create a symbolic link under this rc* folder using following command:
 'ln -s /etc/init.d/CA-BADAL /etc/rc0.d/CA-BADAL'
And then we just run the 'touch' command to this script under folder /var/log/subsys, for e.g:
 'touch /var/log/susbsys/CA-DSM'
Now the script should execute when you shutdown the machine.
But in Debian instead of above two process of creating symbolic link and creating blank copy under syslog you need to execute the 'insserv' command. for e.g.
 'insserv /etc/init.d/CA-BADAL'
Not this script shall run when you shutdown the Debian Machine.

One more thing I am seeing in Debian is that its removing the content of /tmp folder whenever we do a fresh reboot. Hasn't researched this but may be I am missing something.

Please refer the link below for further information on 'insserv':
http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot

Monday, January 2, 2012

2011 - The year that was

A new year started. New resolutions, new beginning, new expectations. uh! We say everything as new but when the year ends, we find those resolutions, beginning and expectations the same one which were made last in last new year too. Anyways, to celebrate new year also means to do some introspection. I had a good last year. New job, new friends, new community, new place, new challenges. Really that was the year in which I had lots of new things. I shifted to new company and came to Hyderabad. I left Pune, where I as for last 5 years, did my PGDM, joined my first job. Pune really is a nice place to enjoy. It has the best refreshing crowd. I had a chance to live with one of my best friends and room-mates. But since I have left my home for doing education and job, I have realized that life never remains same. Changes and dis-balances are opportunity to learn and become strong and take it up to a new level. It may change in a moment of time. So, be ready to leave anything behind and embrace what you are going to get. I never thought and expected which happened to me when I came to Hyderabad. First thing was that I found nice people who later on became my best buddies and second, I joined a music band (it wasn't a dream come true, but helps me to keep-up with my hobby). I hope my quest continues in search of 'nothing' as of now :) . New year has just started, I will drive it as the life unfolds.

Tuesday, December 27, 2011

Life of others .... A way to learn

It was a foggy morning that day in north and I was travelling on a train from Dehradun to Delhi. It was good that i unknowingly booked that ac seat for me nearly two months back. Outside temperature, i can't say exactly but may be 5 deg and our compartment was reading 23 degrees inside. I had to take away my jacket as half jersey was enough for me.
Train was already delayed and I was praying it won't get delay anymore as I had to catch a flight from delhi to Hyderabad. Our compartment was filled with school students eagerly waiting to reach their home to spend their vacation, few families quarreling that they weren't getting enough space to put their luggage, people asking to pantry person to get then Tea as they don't want coffee. So, many faces (happy, struggling etc), requirements and aspirations. I was just thinking about myself, how the life has changed for me. I was nothing few years back. Just a Bachelor Degree in Science and I used to think it would be great if I get a job in Call-Center at least to start with. I hails from a place where there is a lack of guidance and also my friend circle was like that too. I am not praising myself but yes I put some good foot forward after my graduation and got myself in a position that I can proud of. Sitting alone I was hoping everything goes smoothly as it is. Around 3hr of journey left when our train stopped in a small station. God, I was getting irritated by such small halts. I could see no one on the station but a poor man with a blanket on him which was enough to save his life from this breath taking cold, I guess. He started moving towards the track and picked up a polythene and dropped something from the newspaper cover he had into it (which I guess was food). That wasn't unusual, after all he was poor and what more you expect though I was feeling pity on him. He jumped back onto the platform and picked a tobacco packet too. Oh! he was picking as if he was expecting something from those thrown packets. He opened the packet and tried to get something out of it. Wasn't to my surprise but there was nothing on it and that guy, he wasn't also surprised too. He calmly put the packet down and moved towards the tap, cleaned his hands and picked handful of rice to eat from his polythene. Such a life, no frustration, no anger. He just expected something and picket that packet to find nothing. This whole act didn't surprise me much as he has no one to yell on except his own destiny but why to curse that too as you are the one who nurture and play with it. But it reminded me the simplicity, calmness, acceptance which we need to have in our life to have a peaceful mind. What if he would have got something from that polythene or that tobacco packet. I think his reaction would have been the same, numb, because he don't expect any surprises. But still his reaction was same for the case too when he got nothing. When we are sailing a smooth life then its so lovely but it may be harsh too. Life inside that AC train was a bit calm and outside it was the practical world, where you have to survive against all the odds. The lesson I could gather from that journey is be ready to face any poor situation, don't expect too much, don't be excited for the surprises in life because surprises are never planned.

Thursday, September 8, 2011

My Facebook Page got Hacked :(

My Facebook page got hacked last week.
My password wasn't changed but the profile was completely. According to that I lives in Karachi, DOB 14 Aug 1947, female .. looking for men :). Also, it added some posts in my wall visible to everyone.
First thing I did was update my password. Then I removed all those posts from my wall, so that no one receives it. Then I updated my profile. But I wasn't able to update my DOB, 'About me' and 'Interested in'. I checked every settings in FB but couldn't update it. Then I found that in 'Account Settings' -> Privacy -> 'Deactivate your account' -> 'My account was hacked' you can reset your password and update your DOB, but 'About Me' and 'Interested In' was still the matter of concern :(.
Then I searched FB for help topics but could hit the answer. Then I searched in Google for this and I found the answer which was already discussed in FB discussions :). Google search still rules.
These two fields can be updated via m.facebook.com. Go to mobile browser and login to your FB account. From there I could easily update my account settings which I wasn't able to do via Desktop Browser.

Sunday, August 28, 2011

Some Windbg commands for stack trace

I received a crash dump on Windows for one of the applications. To reproduce the stack trace I used some useful commands below:
1) "C:\Program Files (x86)\Debugging Tools for Windows (x86)\symchk.exe" /r c:\windows\system32 /s SRV*c:\Windows\Symbols*http://msdl.microsoft.com/download/symbols => symchk checks which Windows .pdb is not present under system32 and copies them to the location c:\Windows\Symbols. This command is not required unless you requires to check stack trace related to Windows.
1) .symopt +0x40 => I wasn't having the exact matching .pdb of the respective DLL's. So, this command forces to use the pdb which I have provided.
2) !analyze -v => I makes the output verbose. Display full message along-with stack trace. For e.g. which pdb isn't found.

Apart from these steps provide the location of .pdb in Windbg. In case of multiple paths use `;`.

Tuesday, May 10, 2011

Unforgettable moments at PTC - II

And here is my last day and my last blog from the desktop of this company :). As compare to yesterday I am pretty relaxed today.
Completing few HR and finance formalities.
Will surely miss my PTC colleagues.
Lets see what new company has got for me.

Monday, May 9, 2011

Unforgettable moments at PTC - I

Its my second last day at PTC. After few hours I will leave for my flat and will come back again tomorrow which will be my last day. My heart beat has increased, I am shivering, feeling heat, thinking a lot and thats just because tomorrow is my last day.

I have enjoyed my last 3years at PTC. I started as a fresher. Its so unlike that I have done a Bsc(PCM) and end up doing a job in a Product base Company and that too in C/C++. I think it was my perseverance which landed me here.

Thanks a lot to my manager Amit Chordia. Such a cool guy. He has been a true mentor to me.

Monday, May 2, 2011

Export/Import a static variable

I faced a scenario in which I required to export/import (from/to a DLL) a structure pointer variable declared as NULL in a .cxx file.

static Notify_struct *ptr_name = NULL;

Now since it a .cxx file I can't use my Export/Import API, because in-case this file is read undet dllimport it will report compilation error as 'definition of dllimport not allowed'.
So, I moved declared this variable to a header file like this:

extern DLLEXPORTIMPORTAPI Notify_struct *ptr_name ;

This made the DLL to export this variable easily.
Few points to make. I cannot write in the header file:

EXPORTIMPORTAPI static Notification_db *notification_db;

as it reports ‘error C2201: must have external linkage’.

Thursday, April 28, 2011

Export/Import template class

I am thankful to this really nice article which helped me to resolve issues to export/import template class instance.
I surfed a lot and couldn't found a way to export/import the whole template class. Instead we need to do explicit template instantiations to achieve this.

For e.g. instead of whole class you do it like this:
template class DLLEXPORTIMPORTAPI Container < int >;

//DLLEXPORTIMPORTAPI is __declspec(dllexport) or __declspec(dllimport)

Wednesday, April 20, 2011

New Findings While DLLization

I faced a problem where the address of a structure (as a void pointer) is passed from one DLL 'A' to 'B'. Idea is that you store these void pointers to DLL 'B' and call them latter on the basis of some assigned keys. This structure contains data variables and some others functions/structure address too.
So, while fetching the address back from DLL 'B' rest of address pointed by the structure gets corrupted.
So, the questions arises are:
1) Shall we do a deep copy and pass structure instead of pointers.
2) Is passing pointers across DLL's is acceptable?

While looking for the solution I came across this interesting article from IBM. http://publib.boulder.ibm.com/infocenter/zvm/v5r3/index.jsp?topic=/com.ibm.zvm.v53.dmsa3/hdcode.htm.
Below are few highlights of this article:
1) A source file that contains a function call through a pointer that may point to either a function or function descriptor must be compiled as non-DLL code.
2) A source file that calls imported functions or imported variables by name must be compiled as DLL code.
3) A source file that contains a comparison of function pointers that may be DLL function pointers must be compiled as DLL code.
4) A source file that may pass a function pointer to DLL code through a parameter or a return value must be compiled as DLL code.

Aisha_Record_Final.wmv

Monday, June 21, 2010

Try DLL'ze your Legacy code

DLL's are awesome, why to update your whole code for a simple change, just update DLL's. Get DLL's and get your build time down just like a squeezed lemon :) . But have you ever tried getting DLL's for the executable containing nearly 150 libraries and you are handling the legacy code running from last 20-25 years?
Making DLL's of smaller number of libraries are easier but the time consumption in the process of creation if you get into more and more libraries.
Common errors which you may face while creating the DLL:
1) While Linking: Unresolved symbols. To resolve check your link line, you probably have not included the required library.
2) Circular dependency tree: This is most annoying and requires a bit of hard work. Either the dll you are creating is itself is the dependency of a library (of a DLL) that you have included or that library depends on some other which interns depends to it.
3) Linking error, symbol already in libcpmt.dll (static) and msvcrt*.dll (dynamic) both. In such cases check your objects, some of them would have got build with MT flag. Convert them to MD and linking will get succeed.

Saturday, May 23, 2009

Computer Virus: Sometimes are very Interesting

Just faced two virus issues and found them very interesting. Most of the anti-viruses were not able to remove them completely. I found these viruses inside my pen-drive.

First one is very common. Sometimes we tries to open the pen drive, it shows us different options to open it or says that the drive is not accessible. If we scan the pen drive with anti-virus, they mostly report it as uninfected. As far as I have learned these virus gets activated whenever we open the pen drive through ‘auto-play’. So first of all avoid using auto-play option. Now, open your pendrive through explorer, then got to tools -> folder option. Go to view tab and uncheck the ‘Hide protected operating system files. After this you will find a System.inf/Startup.inf (or some autorun file). Remove this file. Then eject your pen drive and insert it again. You would be now able to open the pen drive though double click or enter. :)

The second virus I dealt was creating an exe with a directory picture inside the parent directory. Since the exe was just as a directory in picture I clicked it many times which did nothing but executed that exe and made my computer slow. After unchecking the same check box as mentioned above I found new directories like System and New Folder. System folder contained a Driver.exe. I delete both these directories and found the problem solved.

Friday, October 3, 2008

Song of The Week


Gavin Rossdale Love Remains The Same

Tuesday, September 30, 2008

Aaksa Beach, Mumbai


It was the second time in a year when I went Andheri, Mumbai to meet my friends. It hardly takes 4 hour by bus from Pune to reach there. I boarded the bus at 4:30pm Friday which took 1 1/2 hours to reach Mumbai-Pune highway only. It was a bad and a boring start.
I reached Andheri at 10:20pm. How can we expect to reach in time when we do have slow driving bus and unmoving traffic.
Next day we planned to visit Aaksa Beach at Malad which we heard in a song of movie 'God Tussi Great Ho'. I am sure many others would have already visited this beach soon after hearing this song.
At 5pm Saturday we hired AutoRikshaw from Inorbit (Shooping Mall), Malad for the Aksa beach which took nearly 25 minutes to reach there. Aksa is far from the crowd of the city. It is quite clean and wasn't packed by the visitors. Either this was the reason or we have become more responsible towards cleaning. Both of these are partially correct.
We were surprised to see the rates of food stuff in the shops at beach. Its was just approximate to MRP :), whereas in Railway Platform you will get the things nearly 5Rs more to the MRP.
It was the first time when I saw a beach. You can fell the difference in the blowing air and noise made by the waves. These noise instead of creating a havoc at your mind bring peace to it. But as the noise will grow you will scare as it means that big waves are on their way. So, don't let the nature go angry but respect it.
We played and enjoyed there till the sun set. The reflection of Sun on the sea was sparkling. Watching a sunset is always beautiful and watching it setting behind the sea brings natures one of the best gift to humans.
For returning back to Andheri we hired the auto to reach Malad railway station and then boarded local train for Andheri.
Its always a fun to visit there and yet again my trip to Mumbai was fruitful.

Friday, August 8, 2008

Tuesday, July 8, 2008

Song of The Week


OneRepublic - Someone to Save You