IIS SSL with Host Headers

23. April 2013

So had to apply an SSL Certificate to 3 sites all using host headers today in IIS7. In IIS6 it just wasn't possible, or at least I didn't know how. In IIS7 it could be done but was painful and from the command line. So today decided to see what google said before going through the commandline pain, low and behold found a blog about how changing the Friendly name of the certificate would allow the host header field to be editable when binding. So though "Why Not" gave it a try and it worked, so much easier.

Here's the blog article: http://blog.armgasys.com/?p=80

Internet, Scalability

Secure Hashes

4. March 2013

It's always a good day when I say to myself "How have I not run into this before".

Today it was HMAC secure hashes. I have to admit I've never had the need to securely hash a value, that I planned on making public. I can see several usage scenerios though.

The best I've run into is securing a file and computing a secure hash of the file for selfcontained  verification. Assuming that the "secret" key can't be captured. Another great use would be secure password hashes in a database. That way if someone is able to capture the database values, they couldn't easily reverse any passwords.

The wikipedia article on hmac.

Security

Geeks are routinely underpaid

23. January 2013

Have you been at your programming job for more than 2 years? If so then the likelyhood of being underpaid for the current job market is extremely high. There are two things you can do about it.

1. At your next review support your request and demand better compensation. 

2. Shop for a new job.

Both of these things will require you do to something geeks are notoriously bad at, negotiate.

Here are two articles on how to get the job done:

Geeks Earning More

Salary Negotiation

To this I will add the following.

Survey the open jobs in your area, get a sense of what the current market rate is for your position. Use resources that aggregate salary information for your position. Go into any negotiation about your salary armed with this information and use it as part of your argument why you should be making more!

If you continue to be underpaid for the market and it's not because you lack skills or ability you have no one to blame but yourself.

Development Process, Management, Rant, Jobs , ,

Compiling aspx pages

14. August 2012
If you ever want to compile aspx pages to know if something is broken, add this to the post build event. C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler -v / -p "$(ProjectDir)\"

.Net

Macbook Pro with Retina Display Issues

19. June 2012

Taking the plunge into a new hardware release by Apple is always risky. They have a long history of initial hardware releases having serious problems. Anyone remember the mooing Macbook Pro??? So it was with some trepidation and a 3-year Applecare that I jumped into the new Retina display Macbook Pro. So far I have only run into 2 problems.

  1. The first problem began occurring after I transferred Applications and Documents from a Time Machine backup. The UI would get flaky, there would be issues with slow redraw, and hover duplication. A reboot would fix the issue, but who wants to reboot every few minutes. This was fixed by running all maintenance tasks in OnyX. If you haven’t heard of OnyX you should take a look.
  2. My second problem was mostly cosmetic. I use VMWare Fusion every day for development in Visual Studio, so I always have it running. With the retina display VMWare kept freaking out and setting my resolution to what it thought was the maximum possible for the display. As much as I like screen real estate there is a point where actually being able to see the words on the screen is more important than real estate. Walking through all settings and options I couldn’t find anything to stop VMWare from scaling the display in fullscreen mode. A few internet searches later and I found it. The fix involves adding settings to the .vmx file in your virtual machine directory. This is just a text file so your favorite text editor should work fine. The fix involved adding the following settings:
    svga.autodetect = "FALSE"
    svga.maxWidth = "1680"
    svga.maxHeight = "1050"
    

    Now I chose the max size to match the max resolution I was using in OSX, you should of course set the resolution you are comfortable with.

Overall I like the new mac, and for an initial hardware release things are going good so far. Even if things go south though I have the Applecare to fall back on.

UPDATE: Issue #1 is back. It appears after the screensaver comes on. Not sure what is happening. Stay tuned.

UPDATE 2: Issue #1 is a semi random occurance now. Here is a work around, when it starts happening change the display resolution to "Best for Retina" and back to your desired resolution and the problem is temporarily gone.

OSX , ,

The importance of a good demo

30. April 2012

So while looking into a javascript grid framework, i thought i would see what jqGrid had to offer.

As I am browsing the site I noticed a commercial demo section which featured ASP.NET the very technology I am planning on using the grid with. So I bounce over to that site, click a few things then ran into an error. My immediate thought was, "If this is the quality of the demo what is the quality of the rest?".

Just like a resume should have no spelling or grammatical errors, a demo meant to sell software should be pretty bullet proof. Take it slow, make sure every piece works and is tested. If you plan to sell a piece of software your demo should be perfect, it is your customer's first impression of your software. You always want first impressions to be good.

Blog, javascript , ,

Lessons on Scalability

13. April 2012

 

Ran across an excellent synopsis of YouTube lessons learned in scaling their application over at HighScalability.

Four of the "Lessons" really struck me as things every architect on a large software application should learn. Copied for convenience:

Approximate Correctness - Cheat a Little

Another favorite technique. The state of the system is that which it is reported to be. If a user can’t tell a part of the system is skewing and inconsistent, then it’s not.

A real world example. If you write a comment and someone loads the page at the same time, they might not get it for 300-400ms, the user who is reading won’t care. The writer of the comment will care, so you make sure the user who wrote the comment will see it. So you cheat a little bit. Your system doesn’t have to have globally consistent transactions. That would be super expensive and overkill. Not every comment is a financial transaction. So know when you can cheat.

Expert Knob Twiddling

Ask, what do you know about your consistency model? For comments is eventually consistent good enough? Renting a movie is different. When renting there’s money so we’ll do the best we can to never lose that. Different consistency models are needed depending on the data.

Jitter - Add Entropy Back into Your System

Hot word in their group all of the time. If your system doesn’t jitter then you get thundering herds. Distributed applications are really weather systems. Debugging them is as deterministic as predicting the weather. Jitter introduces more randomness because surprisingly, things tend to stack up.

For example, cache expirations. For a popular video they cache things as best they can. The most popular video they might cache for 24 hours. If everything expires at one time then every machine will calculate the expiration at the same time. This creates a thundering herd.

By jittering you are saying  randomly expire between 18-30 hours. That prevents things from stacking up. They use this all over the place. Systems have a tendency to self synchronize as operations line up and try to destroy themselves. Fascinating to watch. You get slow disk system on one machine and everybody is waiting on a request so all of a sudden all these other requests on all these other machines are completely synchronized. This happens when you have many machines and you have many events. Each one actually removes entropy from the system so you have to add some back in.

Cheating - Know How to Fake Data

Awesome technique. The fastest function call is the one that doesn’t happen. When you have a monotonically increasing counter, like movie view counts or profile view counts, you could do a transaction every update. Or you could do a transaction every once in awhile and update by a random amount and as long as it changes from odd to even people would probably believe it’s real. Know how to fake data.

Video: Scalability at YouTube

Originating Article: 7 Years Of YouTube Scalability Lessons In 30 Minutes

Optimization, Scalability

Generic EnumParse Extension

9. December 2011

So I got frustrated with the sytax for parsing a string into an Enum value in C#. This is the generic method I came up with after reading how some other people solved the problem. It's here in case anyone else finds it useful.

        public static T EnumParse(this string value)
        {
            return EnumParse(value, false);
        }

        public static T EnumParse(this string value, bool ignoreCase)
        {
            if (String.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentNullException("value");
            }

            Type t = typeof(T);

            if (!t.IsEnum)
            {
                throw new ArgumentException("Type provided must be an Enum.", "T");
            }

            var enumType = (T)Enum.Parse(t, value, ignoreCase);
            return enumType;
        }

.Net, C# , , ,

Software Architecture Lesson

10. October 2011

Ars has a great article about Etsy and some of the architecture problems they have had to overcome. i chuckled when i read about their architecture and reliance on stored procedures. I have been advocating for years to avoid that type of architecture like the plague because of how hard it is to scale. That isn't to say that database sharding and stored procs can't work, but in my experience object relational mapping is much more likely to be successful.

Development Process

Windows 8 underway

3. October 2011

Just picked up the Developer Preview of the next version of Windows. So far it's interesting that it isn't branded Windows 8 etc. Just "Windows".

I'm also not sure I like the new look, I'll give it a little time though. I'm wondering if this will be Microsoft's hit out of the park, or epic fail ala Windows Millenium.

Windows Install

Windows ,