Friday, July 3, 2015

Homemade certificates for the web developers

Working with the web, you will definitely end up having to generate a trusted certificate at least for your localhost. In my case, I have been working with certificates a bit more and the need of a personal CA was obvious the best solution. Moreover, I wanted to modify Fiddler's CA name to avoid having the ugly "DO_NOT_TRUST_FiddlerRoot". This post describes how I automated the certificate generation process and also mitigated the Firefox's warning about the old SHA1 hashing.

Wednesday, April 1, 2015

Set / clear windows proxy via command line

It is a very common task to set and clear the proxy setting depending on the client's network configuration. I was frustrated going through Tools-->Internet options-->Connections tab-->LAN settings and configuring the proxy settings so I ended up having a couple of batch scripts that set the client's proxy and one to reset the settings when I am in a more relaxed environment where traffic passes through the normal gateway... Note that I have created shortcuts and set them to "Run as administrator" as the following commands require elevation.

Thursday, June 26, 2014

Toshiba AuthenTec duplicate fingerprints

If you have a Toshiba with AuthenTec biometric device and you forgot to clear the fingerprints before formatting your windows 8.1 installation, you will face the issue of not being able to register the same fingers in your newly created Microsoft Account. The issue steams from the buggy implementation of the Toshiba Fingerprint Utility that doesn't handle domain accounts that well. Moreover, the fingerprint biometric data are stored inside the hardware, so no matter what file you delete, you won't be able to fix this. Some people on the net report that a simple export and import of the data (using the utility as administrator) worked for them. All the reports were mentioning windows 7 so I guess they were all facing an issue with local accounts and not domain ones.
Luckily, Toshiba discovered the issue and offers a command line tool to delete all fingerprint data from the hardware. The name of this tool is TFPU WBF Delete Fingerprint Tool (a.k.a. tc30636900b.exe) and this made the trick for me.

Wednesday, May 28, 2014

Renew expired pfx certificates for click once applications

If you used the click once technology back in visual studio 2005 you have saved yourself a lot of hassle deploying newer versions, especially during the UAT phase. Unfortunately, if you used a dev certificate from visual studio and now you have to do a minor update, you will discover that the certificate has expired and visual studio won't allow you to use it to create a new click once deployment. Although Microsoft has suggested a couple of ways to tackle the problem, replacing the certificate is not an option in most of the cases and the provided code doesn't work that well. Cliff Stanford has fixed the provided codebase and I have uploaded a slightly modified version in github in order to preserve it.
The main modification is that I add 105 years to the expiration date, in order to avoid redoing the process every 5 years :)

Saturday, April 12, 2014

Create hotspot on your windows machine

Being a developer, you might want to test your localy hosted websites with various mobile devices. The easiest way is to create a virtual hotspot and have the devices connected there. This can be easily done executing the first two commands of the following gist in an administration command prompt (run as admin):
Once connected, your devices will get an ip in the range of 192.168.x.y (mine was 192.168.173.something) and the pc will be available on the 192.168.x.1 ip.
In order to disable the hotspot, just run the last command on the gist.

Sunday, March 23, 2014

Grant execute on sql user

Back in the early days of sql server, stored procedures were much faster compared to normal queries. This meant that a typical system would host more than 200 stored procedures (hopefully on the same schema). In order to grant execute access to a role or user you can use the following snippet

Friday, February 28, 2014

Removing deleted files from git

If you have accidentally added huge binary files in a repo and you want to remove them, use the following git command:
Thanks fly to Sam Watkins for sharing this.