Wednesday, September 3, 2008

Chrome Google browser - running slow

I just installed it on my Vista workstation.
However the pages were taking a long time to load. This was a total suprise as it new browser runs lightning fast on other XP worstaions in the office.

I first though that the problem is with Vista but then noticed that the status bar prints"resolving proxy" message. We do not have proxy server in our office, so I checked the connection settings and realised that the problem is caused by Google's Web Accelerator which I installed yeterday!

Disabling the proxy in the connection settings and turning the accelerator off made the Google browser fly.


















So looks like compatability issue between these two products.

Friday, July 4, 2008

Securing SQL for a .Net website

Preventing SQL injection is more important than ever as any site that is not hacker proof is sure to get hacked.
Hopefully you won't have to find out the hard way.

The No 1 preventive is to use paramaterized SQL queries from your code.
Sometimes this may not be possible as you may not have access to the code or changing the code may be a huge undertaking.

Securing objects at SQL level is something that can easily be done regardless of how secure your code is.
The only caveat is that all data access from your web app should be via Stored Procedures.

The concept is only Grant your application minimum access rights..
1) Access to run SPs
2)Have select permissions on tables. (Or ideally only certain tables). You don't really need to give the user access to tables unless your procs contain any dynamic SQL. Dynamic SQL requires the user to have select permissions on the tables being accessed.

Webcoda standard website set up is as follows.

1. Create a windows account on the server for the application to run under.

2. Under Directory Security in IIS set up the website to run as the new account.



3) In your web.config add the following line.

<system.web>
<identity impersonate="true">
</SYSTEM.WEB>

This reason for doing this is that if your application uses it's own application pool then the site will actually run as the identity of the application pool (by default Network Service). This web.config change will force it to run under the IIS account.

4) In SQL don't assign this user to any roles for the DB but run ths following script

select 'Grant Execute on ' + name + ' to [domain\username]'
from sysobjects where xtype in ('P')

This will generate the script to assign exec permission on all procs.

5) Assign only Select permissions on all tables (optional)

Thursday, April 24, 2008

Should you eat your own dog food or have a gourmet dinner?

Most IT guys working with Microsoft technologies would know the phrase eating your own dog food. For those have never heard the term, to say that a company "eats its own dog food" means that it uses the products that it makes/sells.

My question is what if you don't want to eat dog food? Or what if someone else makes better tasting dog food? Should you only eat one brand of dog food out of loyalty?

At WebCoda we work with Microsoft Technologies so up until recently I ate Microsoft flavor everything. Lately though I find myself straying and it's at once both exciting and unnerving.

Where did I go wrong, how has it come to this you ask?
Well let me take you back about a year when I decided I would try working with Firefox as my main browser instead of Internet Explorer. It all seemed so innocent at the time.

My IE was playing up and was taking way too long to start loading new web pages.
Before I knew it, I was installing plugins. Oh at first it was just little ones like the color picker and the measuring tool. But before I knew it I had installed the web dev toolbar and Firebug. I knew at this point I was a goner. I could never go back to boring old IE that was still taking 3 weeks to load up a simple web page and had as much decent functionality as an Ipod - Very little. (Hey I could have said as a Mac).

The next step in my demise came when we switched our mail over to Google Apps. Maybe it was the 25 gig of mail storage or maybe it was all the extra apps such as calendar, documents and mobile access. Or maybe it was the moonlight. I can't say but suddenly I found myself using Thunderbird instead of Outlook (gasp!!). The integration with IMAP and Google calendar was too much to resist.

I am now having regular arguments with my business partner over whether we should store company info and documents in Sharepoint or whether we use Google sites or one of the many other such sites out there.
The reason is this. Why should we host our own sites which need regular backing up, only have internal access and need to be upgraded manually when we can let someone like Google handle all these things? Everytime I log into one of the google sites there seems to be a new feature they have added like a little gift that you were not expecting.

Don't get me wrong. I am a big fan of Microsoft products - The operating Systems (Except Vista), Media Center is awesome and of course the programming tools and languages rock.

Maybe it's just that I don't like the taste of dog food.

Wednesday, April 23, 2008

Things that every web developer should do in their life time (Or atleast in their lunch time)

As a web developer for Webcoda I have been creating websites for others for over 10 years. Sometimes just like the proverbial shoemaker, we web developers just don't have the time to maintain our own websites. Even worse, we can be too busy coding to look into sites that most Net users every day.

So for my first ever Blog I have decided to discuss things that every web developer should do. (On the web, not in public)
I might even create my own certification if you pass all of them!

Not necessarily in order of importance..
  1. Buy something from Amazon. - Amazon is the king of shopping sites. From suggestions and reviews to the amazing check out process and order tracking.
  2. Set up a Facebook account. There has never been a more fun way to spend your work day and what better way to reunite with all the people you swore you would never speak to again? It's also an amazing display of web 2.0 and remember - what reality TV is to television, social networking is to the web. We all bitch about it, yet at the same time are strangely drawn to it.
  3. Sell something on Ebay. If you have nothing to sell, make something up. I hear anything that resembles Jesus sells well. Maybe sell your soul (You won't be needing it where you're going anyway [insert evil laugh here])
  4. Buy something on Ebay. If you have never experienced the sheer thrill of an online auction now is the time!! Bid for that cheap Ipod knock off that some guy in Korea has made from sawdust and potato skins. You never know it will probably work better then the real thing.
  5. Upload a video to Youtube.
  6. Explore Google Earth.
  7. Write a Blog on Blogger.
  8. Create social book marks with Digg or Del.icio.us.
  9. Use P2P software to download music and movies. It's only illegal if you get caught!
  10. Do your banking over the net.
  11. Use Paypal
  12. Twitter on Twitter
If you get really adventurous you could combine a few.
E.G. Create a Digg bookmark to a Blog about a video that you posted on Youtube where you sell something on Ebay that you bought on Amazon.

There are more but if you manage these points you can officially call yourself a web developer.