<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>2018-04 on Funky Si's Test</title><link>https://blog-test.funkysi1701.com/2018/04/</link><description>Recent content in 2018-04 on Funky Si's Test</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>funkysi1701@gmail.com (Simon Foster)</managingEditor><webMaster>funkysi1701@gmail.com (Simon Foster)</webMaster><lastBuildDate>Mon, 30 Apr 2018 00:00:00 +0000</lastBuildDate><atom:link href="https://blog-test.funkysi1701.com/2018/04/index.xml" rel="self" type="application/rss+xml"/><item><title>Let’s Encrypt is awesome</title><link>https://blog-test.funkysi1701.com/posts/2018/lets-encrypt-is-awesome/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Mon, 30 Apr 2018 00:00:00 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2018/lets-encrypt-is-awesome/</guid><category term="DevOps">DevOps</category><category term="SSL">SSL</category><category term="Security">Security</category><description>&lt;p&gt;Let’s Encrypt is a free way to get a SSL certificate onto your website and until recently I had never tried it. It is very easy and I think it is awesome.&lt;/p&gt;
&lt;p&gt;IIS is the web server software the Microsoft include with Windows 10 and Windows Server. I have it installed on my laptop and it displays the default IIS page.&lt;/p&gt;
&lt;p&gt;
&lt;img class="img-fluid" alt="Default welcome page for IIS on Windows" src="https://blog-test.funkysi1701.com/images/2018/iis.jpg" loading="lazy"
width="2170" height="1311"
/&gt;
&lt;/p&gt;
&lt;p&gt;It is not really a good idea to host websites on your laptop, use a dedicated web server, or host with a hosting company, however the techniques are the same and it gives me something to write about!&lt;/p&gt;
&lt;p&gt;In order to point a domain name at what IIS on my machine was serving up I did the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Do a google search for “whats my IP”, this will return your public IP. Most residential ISPs use dynamic IPs so it may change over time, (which is another reason not to host a website on your laptop!)&lt;/li&gt;
&lt;li&gt;Add an A record on a domain with the IP address you have just got&lt;/li&gt;
&lt;li&gt;Your public IP most likely points at your router not your laptop so enable port forwarding of port 80 and port 443 to the internal IP of your laptop (something like 192.168.0.11 etc)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now comes the fun Let’s Encrypt stuff!&lt;/p&gt;
&lt;p&gt;First you need a Let’s Encrypt client, there are a lot of them out there mostly for linux flavours, however a bit of googling found a windows one. Go to &lt;a href="https://github.com/PKISharp/win-acme/releases" target="_blank" rel="noopener noreferrer"&gt;https://github.com/PKISharp/win-acme/releases&lt;/a&gt;
and download the zip file and unzip it.&lt;/p&gt;
&lt;p&gt;Run the executable from the zip file and follow the onscreen prompts.&lt;/p&gt;
&lt;p&gt;
&lt;img class="img-fluid" alt="win-acme client prompt to create a new Let&amp;rsquo;s Encrypt certificate" src="https://blog-test.funkysi1701.com/images/2018/letsencrypt.jpg" loading="lazy"
width="1174" height="733"
/&gt;
&lt;/p&gt;
&lt;p&gt;Press N to create a new certificate.&lt;/p&gt;
&lt;p&gt;Then press 1 to bind to single website found in your IIS setup&lt;/p&gt;
&lt;p&gt;
&lt;img class="img-fluid" alt="win-acme client prompt to bind a certificate to an IIS website" src="https://blog-test.funkysi1701.com/images/2018/letsencrypt2.jpg" loading="lazy"
width="1147" height="1024"
/&gt;
&lt;/p&gt;
&lt;p&gt;And now magically Let’s Encrypt knows what you have setup in IIS.&lt;/p&gt;
&lt;p&gt;Now all you need to do is enter an email address incase a renewal fails and agree to the let’s encrypt terms and you are all setup.&lt;/p&gt;
&lt;p&gt;
&lt;img class="img-fluid" alt="win-acme client confirming Let&amp;rsquo;s Encrypt certificate setup" src="https://blog-test.funkysi1701.com/images/2018/letsencrypt3.jpg" loading="lazy"
width="957" height="1147"
/&gt;
&lt;/p&gt;
&lt;p&gt;How awesome and easy is that for getting your websites working with a SSL certificate. If you have IIS configured on a server, give it a try and you can SSL all your things.&lt;/p&gt;</description></item><item><title>DNS for Developers</title><link>https://blog-test.funkysi1701.com/posts/2018/dns-for-developers/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Mon, 09 Apr 2018 00:00:00 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2018/dns-for-developers/</guid><category term="DNS">DNS</category><category term="DevOps">DevOps</category><description>&lt;p&gt;DNS is the backbone of the internet and as such I believe every developer should know something about the basics and not just leave it for the sysadmin to sort.&lt;/p&gt;
&lt;h2 id="what-is-dns"&gt;What is DNS?&lt;a class="anchor ms-1" href="#what-is-dns" aria-label="Permalink: What is DNS?"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;DNS or Domain Name System is what translates Domain names to IP addresses and vice versa.&lt;/p&gt;
&lt;h2 id="wait-what-is-an-ip-address-and-what-are-domain-names"&gt;Wait what is an IP address and what are domain names?&lt;a class="anchor ms-1" href="#wait-what-is-an-ip-address-and-what-are-domain-names" aria-label="Permalink: Wait what is an IP address and what are domain names?"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You do realise this is a developer blog? An IP address is a unique address on the internet and a domain name is a user friendly label for one or more of these.&lt;/p&gt;
&lt;p&gt;An example might be google.com which for me resolves to 216.58.204.14&lt;/p&gt;
&lt;h2 id="how-it-works"&gt;How it works&lt;a class="anchor ms-1" href="#how-it-works" aria-label="Permalink: How it works"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;
&lt;img class="img-fluid" alt="DNS lookup flow diagram showing how a browser resolves a domain name" src="https://blog-test.funkysi1701.com/images/2018/dns-rev-1.gif" loading="lazy"
width="360" height="320"
/&gt;
When your browser makes a request to google.com it makes a request to your ISPs DNS Servers. This resolves google.com to 216.58.204.14&lt;/p&gt;
&lt;p&gt;In more detail your ISPs DNS server will forward the DNS query to another DNS server and will cache the results for a set amount of time. This is the TTL or Time To Live. Next time the ISP DNS Server will be able to reply directly without needing to forward requests.&lt;/p&gt;
&lt;p&gt;This forwarding and caching is what makes making a DNS change not instantaneous. The TTL needs to be reached so that no results are still being fetched from the cache of DNS servers across the globe.&lt;/p&gt;
&lt;h2 id="dns-records"&gt;DNS Records&lt;a class="anchor ms-1" href="#dns-records" aria-label="Permalink: DNS Records"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Now we know roughly how DNS works let’s look at the most common type of records&lt;/p&gt;
&lt;h3 id="a"&gt;A&lt;a class="anchor ms-1" href="#a" aria-label="Permalink: A"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A (Host) records are the most simple records which translate domain names to IPs&lt;/p&gt;
&lt;p&gt;eg &lt;a href="https://www.google.com" target="_blank" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt;
to 216.58.204.14&lt;/p&gt;
&lt;h3 id="cname"&gt;CNAME&lt;a class="anchor ms-1" href="#cname" aria-label="Permalink: CNAME"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A CNAME (Canonical Name) record is different to an A record in that it maps a domain name to another domain name when no A record exists.&lt;/p&gt;
&lt;p&gt;eg &lt;a href="https://www.google.com" target="_blank" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt;
to somethingelse.google.com&lt;/p&gt;
&lt;p&gt;Typically Azure makes use of CNAMEs for many of its services especially adding a custom domain name&lt;/p&gt;
&lt;h3 id="mx"&gt;MX&lt;a class="anchor ms-1" href="#mx" aria-label="Permalink: MX"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;MX stands for Mail Exchange and is used for configuring email&lt;/p&gt;
&lt;h3 id="name-server"&gt;Name Server&lt;a class="anchor ms-1" href="#name-server" aria-label="Permalink: Name Server"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Every domain has a number of Name Servers which tells you what servers control the DNS settings for that domain. If you change your Name Servers then the new Name servers will be where you can change your DNS settings.&lt;/p&gt;
&lt;p&gt;If you want to use a service like &lt;a href="https://dnsimple.com/" target="_blank" rel="noopener noreferrer"&gt;DNSimple&lt;/a&gt;
instead of &lt;a href="https://www.123-reg.co.uk/" target="_blank" rel="noopener noreferrer"&gt;123reg&lt;/a&gt;
or where ever you registered your domain then all you need to do is change your Name servers.&lt;/p&gt;
&lt;h3 id="aaaa"&gt;AAAA&lt;a class="anchor ms-1" href="#aaaa" aria-label="Permalink: AAAA"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Like A record but for ipv6&lt;/p&gt;
&lt;h2 id="what-next"&gt;What next?&lt;a class="anchor ms-1" href="#what-next" aria-label="Permalink: What next?"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Want to put some different DNS records into practise? Buy a domain name and publish some content to it. Check out my previous post about &lt;a href="https://www.funkysi1701.com/posts/2017/creating-dns-records-programmatically/" target="_blank" rel="noopener noreferrer"&gt;programmatically adding records&lt;/a&gt;
. Want an SSL certificate? Get a wildcard one and then you can apply it to any subdomain you add to your domain.&lt;/p&gt;
&lt;p&gt;If you have a new website you want to publish consider which of the following is better:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;https://www.example.com/newsite&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;https://newsite.example.com&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I much prefer the second option, it looks cleaner, there is no potential conflict with the parent site, no subfolder issues between production and development.&lt;/p&gt;</description></item><item><title>Code Reviews</title><link>https://blog-test.funkysi1701.com/posts/2018/codereviews/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Mon, 02 Apr 2018 00:00:00 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2018/codereviews/</guid><category term="Git">Git</category><category term="VisualStudio">VisualStudio</category><description>&lt;p&gt;Reviewing code is a great habit to get into. Code reviews help share knowledge between your team members and help catch bugs before they get into production. But how do you get into the habit of reviewing and avoid the we don’t have time to do this mentality?&lt;/p&gt;
&lt;p&gt;Visual Studio Team Services (VSTS) has some great options that can help make code reviews second nature.&lt;/p&gt;
&lt;h2 id="pull-requests"&gt;Pull Requests&lt;a class="anchor ms-1" href="#pull-requests" aria-label="Permalink: Pull Requests"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A lot of source control systems have the concept of pull requests. This is where you request others to review your code usually in a branch and if they approve it, merge it into a main branch.&lt;/p&gt;
&lt;p&gt;To create a pull request in VSTS go to the Code section and select Pull Requests. Often VSTS will make a suggestion of what branch to make a pull request for, if you don’t see this just click the New Pull request button.&lt;/p&gt;
&lt;p&gt;Select a branch you want to merge from and a branch that should be merged into (usually you merge into master from a feature branch). Give your pull request a title and description and select who should review your code, this can either be an individual or a group of people. You can also review all the changes that will be reviewed so you can make any last minute changes before it is reviewed.&lt;/p&gt;
&lt;p&gt;Now if you are anything like me you want your code merged in as soon as you have created your pull request and there is nothing stopping you reviewing your own code and clicking approve and merge on your own pull request. However &lt;a href="https://docs.microsoft.com/en-us/vsts/git/branch-policies?view=vsts" target="_blank" rel="noopener noreferrer"&gt;branch policies&lt;/a&gt;
is a way around this problem.&lt;/p&gt;
&lt;h2 id="branch-policies"&gt;Branch Policies&lt;a class="anchor ms-1" href="#branch-policies" aria-label="Permalink: Branch Policies"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;
&lt;img class="img-fluid" alt="Branch Policy" src="https://blog-test.funkysi1701.com/images/2018/save-policy-changes.png" loading="lazy"
width="599" height="901"
/&gt;
&lt;/p&gt;
&lt;p&gt;Branch policies allow you to specify how your code gets merged in.&lt;/p&gt;
&lt;p&gt;Go to the list of branches in VSTS and select branch policy and you will see a whole host of options to customise the merge process. If you do this on the master branch you will not be able to commit any changes to master without it going through a pull request.&lt;/p&gt;
&lt;p&gt;The first option enables you to select how many reviewers are needed on your code. If no one else works on your project best not setting this, but for everyone else setting at least one person to review your code is a great practice.&lt;/p&gt;
&lt;p&gt;Next you can ensure that your pull request is linked to a work item, this helps keep ensure you are actually fixing issues and not just making change for the sake of it.&lt;/p&gt;
&lt;p&gt;Check for comment resolution is a good setting to enable. This ensures that if your reviewer has commented about you needing to change this line here, it ensures that you do.&lt;/p&gt;
&lt;p&gt;Enforce merge strategy allows you to choose between fast forward merge or squash merge.&lt;/p&gt;
&lt;p&gt;Build validation enables the code to be built using a build definition you have configured. This is a great way to check code builds or tests pass before it gets merged in.&lt;/p&gt;
&lt;p&gt;The last two options allow you to specify code reviewers and third party external services.&lt;/p&gt;</description></item></channel></rss>