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 :)
Enjoy

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.

Friday, February 21, 2014

Relative deploy locations for visual studio 2012+

Working with team foundation server, you may end up having various publish profiles to publish various configurations. You can specify relative paths in the local folder location by adding something like the following:
$(MSBuildProjectDirectory)\..\..\..\Deploy\WebSite
Watch out that the $(MSBuildProjectDirectory) points to the folder that contains the pubxml file, so it points to \Properties\PublishProfiles folder. So, the 3 back in the path, end up in the solution folder (if there is one).

Saturday, February 1, 2014

Visual studio 2013 evaluate expression problem

While debugging in vs 2013, you may run into the issue of the quick watch not evaluating the expressions while debugging. Try enabling Managed Compatibility mode by going to
Options --> Debugging --> General --> Use Managed Compatibility Mode
Note that this happened while debugging wcf services under windows 7 and never occurred on my machine running windows 8.1, but I may have been lucky.
Hope this save you some time and also check this blog post for more weird debug issues

Wednesday, January 22, 2014

Deleting multiple small files fast on windows

If you want to delete 21Gb or small txt files from your hard disk you will notice that the GUI is slow (finding files first etc). The fastest way I have found is the following:

del /f/s/q foldername > nul
rmdir /s/q foldername

Thanks Hugo for the tip.

Tuesday, January 21, 2014

Building CEF with visual studio 2013

Building Chromium Embedded Framework project (CEF) is very easy. It just needs time. Lot's of time and disk space (~21Gb).

Thursday, January 16, 2014

Redirect and the ThreadAbort exception

Tired of getting the ThreadAbort exception when you have the Common Language Runtime Exceptions enabled? Then do it properly using the following code:

Response.Redirect(url, false);
Context.ApplicationInstance.CompleteRequest();

Enjoy!

Working with Hyper-V on windows 8

I love the new Hyper-V integration on window 8 and I think I will not be able to switch to another version unless there is a Hyper-V support! I have been working lately on multiple dev environments thanks to the virtualization capabilities of win8 and this is a quick guide on how I organize my work environments.

Wednesday, January 15, 2014

Git rebase without commiting changes

If you are working on tons of changes (like switching from bootstrap v2 to v3), you might need to rebase often in order to keep up to date with your colleagues' changes. Working with visual studio helps keeping track of the added files, but if you need to, you can git add --all to add any new files. After that, create a temporary commit:

git commit -m 'tempCommit' // Create a temp commit 
git pull --rebase origin master // Rebase to the latest master 

Fix any conflicts if needed (and do "git rebase --continue" if conflicts occur) and then soft reset the head to discard the temp commit.

git reset HEAD~1

Friday, January 3, 2014

Change unidentified networks to private

Working with Hyper-V in windows 8 you might need to change the private network location to private in order to access the host's web server from a client virtual machine (e.g. testing a site in older browsers). By default, the private network doesn't contain any domain controller or dns server and you might have static ips on your vms and the host. This means that by default the connection's location is public as the network is unidentified. To change the location of your unidentified networks to private, I found a powershell script.