gordon

About gordon

This author has not yet filled in any details.
So far gordon has created 107 entries.

Microsoft Azure Blueprints

The azure team at Microsoft has put together quick scenario based diagrams to help put together solutions, from BI to DevOps and Live Media Streaming scenarios, you can review them by clicking here.

 

By |July 26th, 2016|Azure|0 Comments

The definitive guide to form based web authentication

If you are using form based authentication, here is a great stack overflow post that provides some guidelines on how to implement form based authentication properly: http://stackoverflow.com/questions/549/the-definitive-guide-to-form-based-website-authentication

By |July 22nd, 2016|Coding|0 Comments

OWIN WsFederation custom authentication and authorization

I recently setup OWIN WsFederation in my app, but I needed a way to perform an additional check against my local database to validate the user. For example the user authenticating from the STS may not be allowed to authenticate to the app, because of their department, etc. So in order to perform this additional authorization check I needed to setup a “notification”. In this case the notification is called “SecurityTokenValidated”, here is a sample implementation:

By |June 20th, 2016|Coding|0 Comments

Set default startup directory in Cmder for admin powershell task

To set the default startup directory when executing admin power shell, use the following command (currently I have my directory set to c:\dropbox\dev)

Make sure to make the change on the tasks tab:

2016-04-20_1108

 

Then set that task as your startup

2016-04-20_1109

By |April 20th, 2016|Windows|0 Comments

My experience at Build 2016

Now that Build is over I had some time to reflect on the experience. This was my first time at a major developer conference. I’d like to thank my employer for sending me to this awesome event. The theme at this conference has been creating a better developer experience. If you haven’t seen the videos I encourage you to take a look at: https://channel9.msdn.com/events/build/2016

Some of the key announcements at this event:

  • Bash on Windows: This is incredible news. It’s not a full linux system, it’s not a VM, it’s 100% native. You get all the great dev tools that’s on Linux such as awk, grep. Launch vim (or emacs), imagine the ability to launch a bash command and use apt-get.
  • Xamarin is now free: That’s right, 100% free. For all versions of Visual Studio 2015, even community edition.
  • Windows Anniversary edition: Bio-metric security integration for apps and edge, Ink improvements

My favorite sessions:

Introducing ASP.NET Core 1.0: A breif overview of things to come in .NET Core 1.0. Hanselman did a live demo showing off the power of ASP.NET Core, running on docker containers on Azure, AWS, etc.


Power BI Embedded: You now have the ability to integrate Power BI directly into your apps, for some sample code click here.

As I have time I will continue to update this list.

 

 

By |April 2nd, 2016|Coding|0 Comments

Windows 10 – Broken start button and missing icons for Edge and Windows Store

I’ve been using Windows 10 for a couple months now. I have one issue and it’s very annoying.  My start button no longer works. Yes, you heard that right. The start button no longer works and some other symptoms appear as well:

  • Windows store, Edge icons disappears from the task bar.
  • The CPU becomes extremely slow, it takes about a min to launch windows explorer.

After some google searches it seems I am not the only one experiencing this issue. What seems to have worked for me is reinstalling all the windows apps (not your personal apps, but the ones come built into windows). This may sound like a daunting tasks. Fortunately all you need to do is run a powershell script:

Let’s get started, obviously the start button doesn’t work so we have to find an alternative way to launch powershell.

  • Right click on your taskbar and hit Task Manager, you might have to wait a couple seconds.
  • In Task manager click File then Run New Task.
  • In the textbox type powershell, before hitting enter make sure to check “Create this task with administrative privileges.”
  • After powershell opens, type the following command:

You might have to wait for a little, don’t worry about all the red error messages, this is normal. After everything finishes, restart your computer, you should now have access to your start menu again.

If you’re still having issues, create a comment with your symptoms and we can try to help.

 

By |February 11th, 2016|Windows|1 Comment

Restoring files from Synology CloudSync

After using the Synology CloudSync package to upload 250GB of ENCRYPTED data to Amazon Cloud Drive I quickly realized there was no interface to actually restore these encrypted files from CloudSync itself. After some research I found Cloud Sync Decryption tool provided by Synology.

Some more documentation on the tool can be found by clicking here.

To decrypt the files simply download the files from Amazon or whatever provide you are using, place them in a folder and run the following command:

This will decrypt all your files and place them in an output folder using the password you used to setup the cloud sync backup service.

If you have any questions feel free to contact me!

By |December 14th, 2015|Uncategorized|0 Comments

Setting the time zone for an azure web app

If you need to set the timezone for your azure web app, you now have an option to create an app setting. You can do this via the azure portal:

Click on “Application Settings” then add a new key/value under the app settings section, for example:

Key: WEBSITE_TIME_ZONE

Value: Eastern Standard Time

2015-11-23_2051

 

By |November 24th, 2015|Coding|0 Comments

Undo almost anything in Git

A great blog post on how to undo almost anything in Git:

 

https://github.com/blog/2019-how-to-undo-almost-anything-with-git

By |June 8th, 2015|Coding|0 Comments

Creating and publishing nuget packages

Ever since the initial release of Nuget Package Manager in 2010 its helped thousands of .NET developers easily integrate third party libraries into their existing project. It has also helped reduce “DLL hell”. But how do you create one of these packages and publish it to Nuget.org or a private nuget server?

It’s actually very easy. Lets start with a simple real world project.

I have a simple c# solution called “SampleNugetLib” that contains two projects: (C# class library called “SampleNugetLib” and a Test project called “SampleNugetLib.Tests”), our goals are:

  1. Use MSBuild to compile the C# library.
  2. Create/publish nuget package.

 

Download

Download Sample Project

Make sure to grab a copy of the sample project from my github repo so you can follow along.

Download

Use MSBuild to compile the C# library

Open the file src/_build/build.proj. This is your basic Visual Studio project file. This file was created specifically for compiling and publishing our nuget package. With a help of a powershell script we can create and pass in the parameters such as the solution name, nuget api key and build mode to decouple ourselves from the vs project file.

Everything starts in the root, open the file src/build.ps1, this is your basic powershell script, this will be the file that we execute to get everything started.

Here is the contents of this file:

As you can see we are simply passing along project file and some parameters for msbuild.

Take note: You will need your own API Key ($nuget_apikey), and a unique name for the nuget package ($nuget_packageName) because “SampleNugetLib” already exists under my nuget.org account (https://www.nuget.org/packages/SampleNugetLib).

 

Create/publish nuget package

Now lets take a closer look at what is going on in src/_build/build.proj. At first glance you can see a property group for all the parameters we are passing in:

Easy enough right? Lets take a look at the target that actually creates the nuget package:

We have a nuget spec file already created at src/_build/BaseNugetSpec.nuspec this contains all the meta data about the nuget package, take a look at the files node, we are including a file called “SampleNugetLib.dll”, lets take a look at the msbuild project to see how it all comes together:

This is somewhat self explanatory by looking at the target steps:

  • Delete two folders: “Published” and “Artifacts” – The publish folder should hold all your assembly files, the artifacts folder should hold the final file, in this case a nuget package.
  • Recreate these two folders
  • Display some diagnostics information
  • Restore nuget packages for the solution
  • Build the solution and set the output path to the published folder
  • Take a copy of the BaseNugetSpec.nuspec file and place it in the published folder, remember the files node we looked at earlier in the nuspec file? Well now this DLL should be in that published folder as well.
  • Call the “nuget pack” command line, this creates the nuget package (.nupkg)
  • Call the “nuget push” command line, this publishes the newly created nuget package to the nuget server specified in the powershell script.

For more documentation on nuget pack and push command lines take a look here: https://docs.nuget.org/consume/command-line-reference

Putting it all together

Ok now that we reviewed the process and code, lets execute the powershell script. Please make sure to have msbuild in your PATH variable, see this link for more information: http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1

Open up a windows powershell console, browse to the src folder and run the command:

Easy enough right? Please feel free to submit pull requests to make this code better. I am also available on twitter @tekguy

By |April 23rd, 2015|Coding|0 Comments