Archive
HowTo: HTTPS on IIS website with free auto-renewing certificate
Below is an image-based walk-through on how to configure HTTPS on an IIS website, making use of a free certificate for encryption from the non-profit Let’s Encrypt certificate authority, also configuring autorenewal of the certificate.
1) Download the win-acme client application (for the command-line).
There’s also a GUI app called IIS Crypto if you prefer. However, this article uses win-acme tool.
2) Run wacs.exe from the folder where win-acme tool is unpacked.
3) Follow same steps as below selecting your own site and binding.
Just press Q when finished and you’re done. No need to worry about next renewal (mentioned on the screen), will be done automatically.
HowTo: Free up some disk space by disabling hibernation on Windows 10
I have a small older Tablet PC (Lenovo S10-3t) that I’m running Windows 10 on, having replaced its internal classic SATA hard disk with an SSD one, and since SSD space is scarce (being more expensive I got a smaller in size disk than the original one), I needed to make free space.
Since that machine is always connected to power, connected to a monitor mounted on the wall (and turned into tent mode in front and under the main monitor, to use it as a second touch-enabled screen for app testing), I don’t really need to use hibernation (after all its battery has gone dead, so hibernation won’t get a chance to occur in the case of an electrical network power down anyway).
That could save some extra disk space, since when hibernation is enabled, you end up with a hiberfil.sys file in the root folder of the boot disk that has around the size of the memory on your computer (or at least that was the case before Windows 10, since I was seeing an 850MB file although the computer has 2GB memory).
To cut it short, I looked it up and found this relevant Microsoft article:
https://support.microsoft.com/en-us/kb/920730
However, the automated way it suggests (the FixIt app) doesn’t seem to work on Windows 10 (probably neither on Windows 8, it doesn’t list it at the bottom of the page anyway) and one has to use the manual way. On Windows 10 the quickest way (based a bit on the suggestions in that article), is to right click the start menu button at the bottom-left of your screen and select “Command Prompt (Admin)” at the popup menu. Then reply affirmatively at the User Access Control (UAC) prompt shown and at the command prompt (a dark console window) that appears, type powercfg.exe /hibernate off and press the ENTER key. Then just close the console window and check the “This PC” node at the File Explorer to confirm that you saved some extra hard disk space.
Font Collection sites (many free)
There are various font collection sites where you can find nice typefaces you can preview and download:
Make sure you check the license for each font you download before using it in some project (some are only free for personal use, others are free for commercial use too).
Also take a trip http://www.deviantart.com/ for lots of artistic stuff that sometimes includes fonts too.
And finally checkout some nice hand-picked thematic font collections that point to FontSpace and other font download sites:
http://naldzgraphics.net/freebies/futuristic-fonts/
http://naldzgraphics.net/freebies/kid-fonts/
Combinatorics library (Silverlight for Windows Phone)
I recently found a very nice article at CodeProject on Combinatorics algorithms implementation (specifically Permutations, Combinations and Variations with Repetition option) using C# Generics:
http://www.codeproject.com/KB/recipes/Combinatorics.aspx
It uses a lexicographic algorithm, so it allows one to ask for “next” permutation/combination/variation from the collection of all possible ones, in the spirit of C++ Standard Library’s (STL) “next_permutation” algorithm.
My Anagram app for Windows Phone 7 is using this code (packed it in a Silverlight library)
I packed the files in a Silverlight for Windows Phone class library (named Combinatorics) and modification I had to do was to:
- make the IMetaCollection interface public so that I could abstract the use of any combinatorics operation based on user selection
- add CombinatoricsOp class to help with using any combinatorics operation via one entry point
- As a bonus there is also a Combinatorics.cd there (class diagram)
You can download the library to use with your WP7 Silverlight apps (Portable [PCL] version also available now) from http://github.com/zoomicon/Combinatorics
Please give due credit to original author of Combinatorics code (and myself if you use my additions too).
The code for CombinatoricsOp class I added is below. Just call GetCombinatoricsOp to get a Permutations, Combinations or Variations class instance (all implement IMetaCollection interface) and then use the enumerator (with extra method to get count of items without counting them one-by-one) as described in the CodeProject article mentioned above.
//Version: 20111119 //Author: George Birbilis (birbilis@kagi.com) using System; using System.Collections.Generic; namespace Facet.Combinatorics { public static class CombinatoricsOp { public enum CombinatoricsOpType { Permutations = 0, PermutationsWithRepetition = 1, //--- Combinations = 2, CombinationsWithRepetition = 3, //--- Variations = 4, VariationsWithRepetition = 5 } public static IMetaCollection<string> GetCombinatoricsOp( IList<string> values, CombinatoricsOpType opType, int take){ switch (opType) { case CombinatoricsOpType.Permutations: return new Permutations<string>(values);
case CombinatoricsOpType.PermutationsWithRepetition: return new Permutations<string>(values,GenerateOption.WithRepetition); case CombinatoricsOpType.Combinations: return new Combinations<string>(values, take); case CombinatoricsOpType.CombinationsWithRepetition: return new Combinations<string>(
values, take, GenerateOption.WithRepetition); case CombinatoricsOpType.Variations: return new Variations<string>(values, take); case CombinatoricsOpType.VariationsWithRepetition: return new Variations<string>(
values, take, GenerateOption.WithRepetition); default: throw new NotImplementedException(); } } } }