misc hashtab, software_review

Many times I used file hashes to verify that it’s been correctly downloaded or uploaded. It’s especially useful with large files where things are more likely to go wrong. That’s why most MD5 or SHA1 hashes provided with many large file downloads such Linux distros.

Ubuntu MD5 Hashes

Best shell extension ever: HashTab!

This is a just quick plug about one of my favourite tools in Windows: HashTab. The best thing about it is that it’s a shell extension. So to find out the hash values of a file is simple as right-clicking and selecting File Hashes tab. So, using the MD5 has example above, if you have downloaded ubuntu-14.04.1-server-amd64.iso all you have to do is check it’s properties.

File Hashes

HahsTab also monitors the clipboard. So if you copy the MD5 value from Ubuntu’s site it automatically compares it with the calculated hash values and confirms file integrity with a large shiny green check!

Out of the box it displays most common 3 hash algorithms but if you need more supported algorithms.

HashTab Settings

Resources

dev topshelf, windows_service, csharp

Topshelf

In almost all projects I’ve worked there was always a need for scheduled background jobs. Windows Services are well-suited for the job but when it comes to deployment and debugging they fall short. This is where TopShelf comes to rescue!

TopShelf in action

With TopShelf all you need to do is create a Console Application as your Windows Service and initialize TopShelf in the Main method:

Topshelf

Configuring it is quite easy and straightforward. It also has a nice comprehensive documentation on its official site. You can define all the parameters like the account that will run the service, the recovery policy and start-up type.

What about scheduling

Scheduling is also a crucial feature in background services. TopShelf doesn’t help with that but that’s easy to fix with FluentScheduler.

Topshelf

FluentScheduler is yet another great library available at NuGet which makes scheduling a breeze. No need to fiddle with timers, it can be defined very easily.

And here is the sample code:

Resources

dev git

If you have multiple accounts for git providers (i.e multiple accounts on Github and/or Bitbucket) then you’d need to update your SSH configuration to be able to access all your repositories seamlessly. Of course you can use HTTPS but then you’d have to enter username and password every time.

If you don’t specify which key to use for each account SSH agent will try the default key if there is one (id_rsa) and will most likely fail if you didn’t grant access to that key in your git provider settings.

SSH Access Denied

To resolve the issue you need to create a config file under .ssh folder that looks like this:

SSH Config

If you are just using one account per provider you don’t need to create multiple keys, you can just use id_rsa for both accounts. But if you have multiple accounts for a provider you’d need a key for each account. In the example configuration above I used a new key for BitBucket anyway. After creating the config file and adding the keys to your accounts you can start cloning repositories from various sources.

Final step to accomplish this is to use the hostname you set in the config file when cloning the repository. For example when you copy the SSL clone URL it looks something like this: git@github.com:{account name}/{repository name}.git. So let’s say it’s a repository from the corporate account in my sample config file then I’d have to modify the URL as follows: git@github-corporate:{account name}/{repository name}.git so that the correct host name and RSA file can be used.

SSH Success

Resources