devops chocolatey

When moving to a new machine, re-installing all the applications is sounds a very daunting task. Linux distros have been enjoying the ease of package repositories for quite a long time and users can install almost everything they need by package manager applications like apt-get and yum. Chocolatey aims to bring the same convenience to Windows.

Easy Install Indeed!

Installation is a breeze as shown in their website. By using some Powershell and NuGet magic you download a script which then downloads Chocolatey package from the repository. You may have noticed the URL is very similar to nuget.org’s package path. That’s simply because it uses NuGet under the hood. Even the user interface is just a skinned version of NuGet Gallery (which is open source and can be downloaded from GitHub).

Chocolatey-Install

Automate all installations

After Chocolatey is installed all you have to do is browse the packages and select the ones you want to install with an easy command such as:

choco install atom

And after a bunch of colourful messages you’re good to go.

Chocolatey-Install

Are we done?

Most core tools for development and everyday use (SysInternals, Fiddler, Chrome, FireFox, NodeJS, Python, VLC, Paint.NET etc.) can be installed automatically using Chocolatey. The major applications such as Visual Studio and SQL Server still need some love and your caring hands but I think automating installation of tens of applications in such an easy way is priceless.

Resources

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