﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel><title>Michael Whibley Blog</title>
<description>Thoughts on technology and life</description>
<generator>Mw.Miniblog</generator>
<link>https://michaelwhibley.com/</link>
<item>
  <title>Decrypt string with RSA public key</title>
  <link>https://michaelwhibley.com/blog/decrypt-with-rsa-public-key/</link>
  <description>&lt;p&gt;Using an RSA public key to decrypt an RSA private key encrypted string is an uncommon scenario since the public key is more commonly used to encrypt and the private key is used to decrypt, but sometimes a client is unable to accommodate best practices and adaption is needed.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a C# code snippet that was helpful:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;public static X509Certificate2 GetCertificate()&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return new X509Certificate2(CertPath, CertPassword, X509KeyStorageFlags.DefaultKeySet | X509KeyStorageFlags.Exportable);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;public static string Decrypt(string base64Encrypted)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp;var outBytes = Convert.FromBase64String(base64Encrypted); // in this scenario, the string is passed in with base64 encryption&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp;var cert = GetCertificate();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp;var rsaPublicKey = Org.BouncyCastle.Security.DotNetUtilities.GetRsaPublicKey(cert.GetRSAPublicKey());&lt;/code&gt;&lt;code&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;var pkcs1Encoding = new Pkcs1Encoding(new RsaEngine());&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp;pkcs1Encoding.Init(false, rsaPublicKey);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp;var decrypted = Encoding.UTF8.GetString(pkcs1Encoding.ProcessBlock(outBytes, 0, outBytes.Length));&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp;return decrypted;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
  <author>test@example.com</author>
  <category>c#</category>
  <category>rsa</category>
  <category>encryption</category>
  <category>decryption</category>
  <guid isPermaLink="false">https://michaelwhibley.com/blog/decrypt-with-rsa-public-key/</guid>
  <pubDate>Sat, 16 Oct 2021 19:09:03 GMT</pubDate>
</item>
<item>
  <title>Create .net core global tool</title>
  <link>https://michaelwhibley.com/blog/create-net-core-global-tool/</link>
  <description>&lt;p&gt;[youtube:Ik9O954AlsE]&lt;/p&gt;
&lt;p&gt;.NET core applications can be packaged (nuget packaged) and installed as global tools.&amp;nbsp; Global tools are a step-up from &lt;a title="Setting up environment variables on windows" href="http://michaelwhibley.com/blog/set-up-enviornment-variables-on-windows/"&gt;using environment variables&lt;/a&gt;&amp;nbsp;by using custom command names.&amp;nbsp; It makes .net core apps just as powerful as Microsoft's dotnet cli commands.&amp;nbsp; The&amp;nbsp;&lt;a title="How to Create .NET Core Global Tool with .NET Core CLI" href="https://www.youtube.com/watch?v=Ik9O954AlsE"&gt;screencast&lt;/a&gt; shows steps for creation and docs show &lt;a title="How to update or reinstall global tools" href="https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools#other-cli-commands"&gt;how to update&lt;/a&gt; and &lt;a title="How to remove .net core global tools" href="https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create"&gt;remove&lt;/a&gt; global tools.&lt;/p&gt;</description>
  <author>test@example.com</author>
  <category>.net</category>
  <category>core</category>
  <category>dotnet cli</category>
  <guid isPermaLink="false">https://michaelwhibley.com/blog/create-net-core-global-tool/</guid>
  <pubDate>Thu, 09 Jan 2020 01:08:36 GMT</pubDate>
</item>
<item>
  <title>Setting up environment variables on windows</title>
  <link>https://michaelwhibley.com/blog/set-up-enviornment-variables-on-windows/</link>
  <description>&lt;p&gt;[youtube:Vp_hDe7sxEk]&lt;/p&gt;
&lt;p class="MsoNormal"&gt;I create custom software.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Sometimes I need software to run on demand at random times.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;In the past I would need to navigate to the directory that contains that application and run the executable, or worse, run from within the Visual Studio IDE.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;I&amp;rsquo;ve since learned about the &lt;a title=".NET Core CLI Documentation" href="https://docs.microsoft.com/en-us/dotnet/core/tools/?tabs=netcore2x"&gt;.NET Core CLI&lt;/a&gt; (Command Line Interface) which allows programs to be run from the command-line; this works well for .net core apps, but I have a few legacy apps that use the full .net framework &amp;ndash; how can I run them from anywhere on my computer without having to remember where they&amp;rsquo;re saved?&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;By registering the path to the executable directory as an environment variable!&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Steps are shown in the above screencast.&lt;/p&gt;</description>
  <author>test@example.com</author>
  <category>environment variables</category>
  <category>cli</category>
  <category>.net framework</category>
  <guid isPermaLink="false">https://michaelwhibley.com/blog/set-up-enviornment-variables-on-windows/</guid>
  <pubDate>Wed, 08 Jan 2020 02:15:04 GMT</pubDate>
</item>
<item>
  <title>Nuxt: window is not defined</title>
  <link>https://michaelwhibley.com/blog/nuxt-window-is-not-defined/</link>
  <description>&lt;h1&gt;How to Resolve Nuxt Error: Window is Not Defined&lt;/h1&gt;
&lt;p&gt;[youtube:tnP2xtG8lGs]&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m still enjoying using Nuxt &amp;ndash; it has been a great framework organizing Vue.js apps.&lt;/p&gt;
&lt;p&gt;I came across an issue today when I was trying to use a 3rd party plugin vue2-scrollspy; I was continually getting &amp;ldquo;window is not defined&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;After executing the package installation command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npm install vue2-scrollspy &amp;ndash;save&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I referenced the component in my code:&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family: monospace;"&gt;import Scrollspy from 'vue2-scrollspy';&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: monospace;"&gt;export default {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: monospace;"&gt;&amp;nbsp; components: {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: monospace;"&gt;&amp;nbsp; &amp;nbsp; ScrollSpy&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: monospace;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: monospace;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The error only occurred when I was in 'universal' mode (specified in the nuxt.config.js file); in 'spa' mode, no issue. This tipped me off to realize it probably had something to do with Nuxt server-side rendering; it appeared to be trying to reference the 'window' which wouldn&amp;rsquo;t exist on the server.&lt;/p&gt;
&lt;p&gt;I registered the plugin in the plugins folder as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;plugins: [&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp; { src: '~/plugins/vue2-scrollspy', ssr: false }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; ],&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After restarting the development server I was able to use the plugin with no issues.&lt;code&gt;&lt;/code&gt;&lt;/p&gt;</description>
  <author>test@example.com</author>
  <category>error</category>
  <category>nuxt</category>
  <category>ssr</category>
  <category>vue2-scrollspy</category>
  <category>vuejs</category>
  <guid isPermaLink="false">https://michaelwhibley.com/blog/nuxt-window-is-not-defined/</guid>
  <pubDate>Fri, 16 Nov 2018 00:00:24 GMT</pubDate>
</item>
<item>
  <title>How to create an Azure VM with Sql Server installed</title>
  <link>https://michaelwhibley.com/blog/sql-server-developer-edition-on-azure-vm/</link>
  <description>&lt;p&gt;[youtube:2wy3Jgpc-oU]&lt;/p&gt;
&lt;h2&gt;Make it right&amp;hellip; the first time&lt;/h2&gt;
&lt;p&gt;I was recently involved in an extensive home renovation.&amp;nbsp; As we pulled away the 70&amp;rsquo;s panel-board and lifted basement sub-floor we were shocked to see the shoddy the workmanship.&amp;nbsp; I&amp;rsquo;m not a carpenter and don&amp;rsquo;t have much experience in construction, but even I could see that so many issues could have been avoid if construction was better planned.&amp;nbsp; For direction, I picked up a book by&amp;nbsp;&lt;a href="http://amzn.to/2yEpfOB"&gt;Mike Homes&lt;/a&gt;&amp;nbsp;titled&lt;a href="http://amzn.to/2zWxIAQ"&gt;&amp;nbsp;Make it Right&lt;/a&gt;!&amp;nbsp; Although my carpenter friends were not impressed that I would consider taking advice from such a book, I found a good theme throughout: you will save so much time, headaches, and money if you just do things right the first time!&amp;nbsp; I think the same principle can be applied to software development, and in this case, setting up a vm with sql server on Azure.&lt;/p&gt;
&lt;h2&gt;Let Azure do the heavy lifting&lt;/h2&gt;
&lt;p&gt;There might be a use case where you need to spin up a vanilla VM and install Sql Server manually; I haven&amp;rsquo;t come across it yet.&amp;nbsp; The firewall and remote connectivity configuration are enough motivation to make it work with a Sql Server VM.&lt;/p&gt;
&lt;p&gt;From my preamble, the first recommendation shouldn&amp;rsquo;t be a surprise: when creating an Azure VM, select a configuration that comes with a SQL Server installed.&amp;nbsp; Concerned about Sql Server versions?&amp;nbsp; There are various versions of Sql Server that come with a VM &amp;ndash; even the free express and developer editions.&amp;nbsp; Picking a version with Sql Server installed helps reduce the time it would take to get the install files on the VM and then do perform the install manually.&amp;nbsp; On top of that, there is firewall and sql login settings that need to be configured &amp;ndash; one of the main reasons I&amp;rsquo;ve moved to the managed cloud is so that I don&amp;rsquo;t get stuck in a configuration time trap and I can focus on what I like to do; coding!&lt;/p&gt;
&lt;h2&gt;Additional Steps for Sql Server Express and Developer Editions&lt;/h2&gt;
&lt;p&gt;Azure does not enable the needed TCP/IP listening service; this is needed so remote connections can connect to a data source.&amp;nbsp; Luckily it is easily configured; watch&amp;nbsp;&lt;a href="https://youtu.be/2wy3Jgpc-oU"&gt;my demo video&lt;/a&gt;&amp;nbsp;or login to your virtual server and follow the&amp;nbsp;&lt;a href="https://technet.microsoft.com/en-us/library/hh231672(v=sql.110).aspx"&gt;enabling TCP/IP Network protocol for Sql Server&lt;/a&gt;&amp;nbsp;instructions.&lt;/p&gt;</description>
  <author>test@example.com</author>
  <category>azure</category>
  <category>azure vm</category>
  <category>sqlsserver</category>
  <category>sql server developer</category>
  <category>sql server express</category>
  <guid isPermaLink="false">https://michaelwhibley.com/blog/sql-server-developer-edition-on-azure-vm/</guid>
  <pubDate>Wed, 15 Nov 2017 00:42:12 GMT</pubDate>
</item>
<item>
  <title>How to Test a SQL Server Connection</title>
  <link>https://michaelwhibley.com/blog/how-to-test-sql-server-connection/</link>
  <description>&lt;h1&gt;How to Test a SQL Server Connection&lt;/h1&gt;
&lt;p&gt;[youtube:LEQlXaoq4A8]&lt;/p&gt;
&lt;p&gt;The fastest and easiest way I&amp;rsquo;ve learned to test if I have a SQL Server connection configured property is to use a Universal Data Link (UDL) file.&amp;nbsp; Not only can the connectivity be confirmed, the tested connections string can be extracted by opening the UDL in a text editor and copied to an application; no more mistyping a connection string!&amp;nbsp; Here&amp;rsquo;s a quick demo of how to use it.&lt;/p&gt;</description>
  <author>test@example.com</author>
  <category>connection</category>
  <category>sql server</category>
  <category>testing</category>
  <category>udl</category>
  <guid isPermaLink="false">https://michaelwhibley.com/blog/how-to-test-sql-server-connection/</guid>
  <pubDate>Wed, 15 Nov 2017 00:35:19 GMT</pubDate>
</item>
<item>
  <title>To begin or not to begin</title>
  <link>https://michaelwhibley.com/blog/to-begin-or-not-to-begin/</link>
  <description>&lt;h1&gt;A journey of a thousand miles&amp;hellip;&lt;/h1&gt;
&lt;p&gt;There are so many expressions to illustrate the start of a major undertaking; from eating an elephant one bite at a time, or watching one take its first steps&amp;hellip; you get the point.&amp;nbsp; For me, beginning a blog is in that same category.&lt;/p&gt;
&lt;h2&gt;Why blog?&lt;/h2&gt;
&lt;h3&gt;Remember!&lt;/h3&gt;
&lt;p&gt;I hate it when I make the same mistakes over and over again.&amp;nbsp; I&amp;rsquo;ve often repeated a phase I heard years ago: &amp;ldquo;This experience was worth a million dollars, but I wouldn&amp;rsquo;t give 2-cents to do it again!&amp;rdquo; I&amp;rsquo;m hoping a blog will help me internalize lessons learned by experience and allow me to replete successes and avoid failures.&lt;/p&gt;
&lt;h3&gt;Record successful patterns&lt;/h3&gt;
&lt;p&gt;I usually change my car brakes every couple years.&amp;nbsp; You would think the task would get easier, but every-time I pull off the tires I wonder &amp;ldquo;this doesn&amp;rsquo;t look familiar&amp;hellip; have I changed these brakes before?&amp;rdquo;&amp;nbsp; To help with memory limitations, a searchable blog should come in handy.&amp;nbsp; Who knows, maybe I&amp;rsquo;ll have a post about changing brakes from an amateur.&lt;/p&gt;
&lt;h3&gt;Help me please!&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve found some of the most useful blog content is found in the comments.&amp;nbsp; Perhaps the one or two readers that stumble on this site will be able to contribute something helpful.&amp;nbsp; I don&amp;rsquo;t have corner on good ideas; all are welcome here.&lt;/p&gt;
&lt;h3&gt;More reasons to blog&lt;/h3&gt;
&lt;p&gt;There are&amp;nbsp;&lt;a href="https://howtostartablogonline.net/why-blog/"&gt;so many reasons to blog&lt;/a&gt;&amp;nbsp;if you&amp;rsquo;re on the fence do a quick online search and you might be convinced to start your own!&lt;/p&gt;
&lt;h2&gt;Blog topics&lt;/h2&gt;
&lt;p&gt;What will I blog about?&amp;nbsp; Whatever I feel like!:)&amp;nbsp;&amp;nbsp; I spend a lot of time developing software, so I expect most of my posts will have technical content.&amp;nbsp; I&amp;rsquo;m also a husband and father of 3 with all the challenges that come with family life.&amp;nbsp; I live in Canada so you might see posts of moose in polar bear in my backyard&amp;hellip; although I&amp;rsquo;ve only seen moose so far&amp;hellip; still hoping for the polar bear.&amp;nbsp; If a topic is important to me and I think it might be useful to remember; I&amp;rsquo;ll blog about it.&amp;nbsp; In a nut-shell, I&amp;rsquo;m not going to limit the blog content to a single topic.&lt;/p&gt;
&lt;h2&gt;Don&amp;rsquo;t like my content?&lt;/h2&gt;
&lt;p&gt;As much as I think my ideas are the best, I&amp;rsquo;ve been proven wrong&amp;nbsp;once&amp;nbsp;before.&amp;nbsp; Comments are welcome; those in agreement and those that offer a different view.&amp;nbsp; Just be respectful and explain your reasoning with some sort of reliable evidence and I&amp;rsquo;ll be happy to include it&amp;nbsp;:)&lt;/p&gt;
&lt;h2&gt;Here we go!&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;a href="https://www.martinellis.com/"&gt;Martinelli&amp;rsquo;s&lt;/a&gt;&amp;nbsp;have been smashed over the blog&amp;rsquo;s bow and the great ship bloggy has set sail; YEE-HAW!&lt;/p&gt;</description>
  <author>test@example.com</author>
  <category>first post</category>
  <guid isPermaLink="false">https://michaelwhibley.com/blog/to-begin-or-not-to-begin/</guid>
  <pubDate>Wed, 08 Nov 2017 00:47:36 GMT</pubDate>
</item></channel>
</rss>