<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts on Ramblings of a cloud engineer</title><link>https://skarlso.github.io/posts/</link><description>Recent content in Posts on Ramblings of a cloud engineer</description><generator>Hugo -- 0.136.0</generator><language>en</language><lastBuildDate>Tue, 17 Feb 2026 01:01:00 +0100</lastBuildDate><atom:link href="https://skarlso.github.io/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>How to use ai efficiently without going brain dead</title><link>https://skarlso.github.io/2026/02/17/how-to-use-ai-efficiently-without-going-braindead/</link><pubDate>Tue, 17 Feb 2026 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2026/02/17/how-to-use-ai-efficiently-without-going-braindead/</guid><description>&lt;p>I know I &lt;a href="https://skarlso.github.io/2025/06/07/re-my-ai-skeptic-friends-are-all-nuts/">spoke out&lt;/a> against AI in the past, and I still think those thoughts are warranted. That&amp;rsquo;s why I would like to write down how we actually should use AI to do the things we want to do without losing our critical thinking in the process.&lt;/p>
&lt;p>Here&amp;rsquo;s my flow&amp;hellip;&lt;/p>
&lt;h2 id="how-to-use-llms-responsibly">How to use LLMs responsibly&lt;/h2>
&lt;p>There always needs to be feedback. Don&amp;rsquo;t use it to think, use it to ask questions, verify, check, expanding your understanding, your knowledge.&lt;/p></description></item><item><title>Adventures in The Forge - Part 1</title><link>https://skarlso.github.io/2025/12/12/adventures-in-the-forge-part-1/</link><pubDate>Fri, 12 Dec 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/12/12/adventures-in-the-forge-part-1/</guid><description>&lt;h1 id="adventures-in-the-forge---part-1">Adventures in The Forge - Part 1&lt;/h1>
&lt;p>And so it begins. The ship coasted out of the gate breaking hard so as to not run into an ambush blind. The gravimetric dampeners worked overtime on cancelling out the Gs of the break. The robot gently, but firmly held the baby in place. His final and ultimate task whirled around in his tiny mechanical brain. Protect him at all costs.&lt;/p>
&lt;p>The Forge. A promised land. Their old home left an uninhabitable wasteland by the creatures from The Forge. They are lurking around here somewhere. No matter. The little bot will keep the baby safe. Raise him. And then they will raise hell on them together.&lt;/p></description></item><item><title>Choose your own slide adventure</title><link>https://skarlso.github.io/2025/11/23/choose-your-own-slide-adventure/</link><pubDate>Sun, 23 Nov 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/11/23/choose-your-own-slide-adventure/</guid><description>&lt;h1 id="choose-your-own-slide-adventure">Choose your own slide adventure&lt;/h1>
&lt;p>I got bored of presentations that just drone on and on about something that barely interests me.
I wanted something more interactive.&lt;/p>
&lt;p>I&amp;rsquo;m well aware about Prezi and slido, but they both lack certain features I needed and are also not free.&lt;/p>
&lt;p>I believe in open source, and I believe in helping humanity go further and be more successful. So what did I create?&lt;/p>
&lt;h2 id="choose-your-own-adventure-but-with-slides">Choose your own adventure, but with slides&lt;/h2>
&lt;p>I love &lt;a href="https://www.cyoa.com/">Choose your own adventure&lt;/a> books. I grew up on Ian Livingstone and Steve Jackson&amp;rsquo;s
adventures. These books were everything to me. They got me into TTRPGs and the rest of the world.&lt;/p></description></item><item><title>CTY now supports using a custom CSS for the HTML output</title><link>https://skarlso.github.io/2025/08/09/crd-to-sample-yaml-with-custom-css/</link><pubDate>Sat, 09 Aug 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/08/09/crd-to-sample-yaml-with-custom-css/</guid><description>&lt;h1 id="cty-now-supports-using-a-custom-css-for-the-html-output">CTY now supports using a custom CSS for the HTML output&lt;/h1>
&lt;p>Hey folks.&lt;/p>
&lt;p>My tool, cty&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> now supports adding custom CSS to the HTML output. In an effort to prevent cross-site scripting
and other CSS nasties the CSS is pretty limited, sanitized and escaped.&lt;/p>
&lt;p>Using &lt;code>--css-file&lt;/code> now, it&amp;rsquo;s possible to give it a CSS file that will overwrite everything inside the main HTML file.
This allows you to add any customization that you would like to apply to the end result during generation. No more
post processing, post editing necessary.&lt;/p></description></item><item><title>Updated Google OAuth Go Sample - Modern Authentication with Improved UI</title><link>https://skarlso.github.io/2025/08/07/updated-google-oauth-go-sample/</link><pubDate>Thu, 07 Aug 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/08/07/updated-google-oauth-go-sample/</guid><description>&lt;h1 id="updated-google-oauth-go-sample">Updated Google OAuth Go Sample&lt;/h1>
&lt;p>Hello.&lt;/p>
&lt;p>I&amp;rsquo;ve recently updated my Google OAuth Go sample application&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> to follow modern standards and practices.&lt;/p>
&lt;p>The update brings several improvements including a cleaner UI, better error handling, and more robust authentication flows.&lt;/p>
&lt;h2 id="whats-new">What&amp;rsquo;s New&lt;/h2>
&lt;p>New interface for the login side:&lt;/p>
&lt;p>&lt;img alt="Welcome Screen" loading="lazy" src="https://skarlso.github.io/img/2025/08/welcome.png">&lt;/p>
&lt;p>Nicer errors:&lt;/p>
&lt;p>&lt;img alt="Error Screen" loading="lazy" src="https://skarlso.github.io/img/2025/08/error.png">&lt;/p>
&lt;p>Welcome message:&lt;/p>
&lt;p>&lt;img alt="Logged In Screen" loading="lazy" src="https://skarlso.github.io/img/2025/08/logged-in.png">&lt;/p>
&lt;p>Battle arena:&lt;/p>
&lt;p>&lt;img alt="Battle Arena" loading="lazy" src="https://skarlso.github.io/img/2025/08/battle-arena.png">&lt;/p>
&lt;p>And lastly, logout:&lt;/p>
&lt;p>&lt;img alt="Logout Screen" loading="lazy" src="https://skarlso.github.io/img/2025/08/logout.png">&lt;/p>
&lt;h2 id="technical-updates">Technical Updates&lt;/h2>
&lt;p>I added OAuth 2.0 best practices and some proper flows with auth middleware.&lt;/p></description></item><item><title>Tilt.dev with server side apply</title><link>https://skarlso.github.io/2025/08/02/tilt-with-server-side-apply/</link><pubDate>Sat, 02 Aug 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/08/02/tilt-with-server-side-apply/</guid><description>&lt;h1 id="tiltdev-with-server-side-apply">Tilt.dev with server-side apply&lt;/h1>
&lt;p>Hey folks. This will be a quick one. Recently, &lt;a href="https://external-secrets.io/latest/">ESO&lt;/a> reached the CRD limit
of 256KB which means that every time there is an apply of the CRDs it needs to be a &lt;a href="https://kubernetes.io/docs/reference/using-api/server-side-apply/">Server Side Apply&lt;/a>. This isn&amp;rsquo;t something new.&lt;/p>
&lt;p>However, &lt;a href="https://tilt.dev/">Tilt&lt;/a> doesn&amp;rsquo;t really have a clear documentation in this case. And since ESO is using Tilt, or at least
I&amp;rsquo;m using Tilt with ESO, I also had to fix tilt. A little bit of back-and-forth with the documentation and I decided to use
&lt;a href="https://docs.tilt.dev/api.html#api.k8s_custom_deploy">k8s_custom_deploy&lt;/a>.&lt;/p></description></item><item><title>Re: My AI Skeptic Friends Are All Nuts</title><link>https://skarlso.github.io/2025/06/07/re-my-ai-skeptic-friends-are-all-nuts/</link><pubDate>Sat, 07 Jun 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/06/07/re-my-ai-skeptic-friends-are-all-nuts/</guid><description>&lt;h1 id="re-my-ai-skeptic-friends-are-all-nuts">Re: My AI Skeptic Friends Are All Nuts&lt;/h1>
&lt;p>There was a post recently that was &lt;a href="https://fly.io/blog/youre-all-nuts/">dissing AI Skeptics&lt;/a>. While the post is funny at times, I feel like it&amp;rsquo;s absolutely and completely missing the point of the skepticism. Or at least I feel that it is glossing over some massive pain points of said skepticism.&lt;/p>
&lt;p>Let&amp;rsquo;s go over some of the points and the things that stuck out to me as problematic.&lt;/p></description></item><item><title>MFA generator in External Secrets Operator</title><link>https://skarlso.github.io/2025/05/18/mfa-generator-in-eso/</link><pubDate>Sun, 18 May 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/05/18/mfa-generator-in-eso/</guid><description>&lt;h1 id="mfa-generator-in-external-secrets-operator">MFA Generator in External Secrets Operator&lt;/h1>
&lt;p>Today, I&amp;rsquo;m happy to announce that &lt;a href="https://github.com/external-secrets/external-secrets">external-secrets-operator&lt;/a> will have an MFA / TOTP token generator once
&lt;a href="https://github.com/external-secrets/external-secrets/pull/4790">this&lt;/a> PR is merged and released. This opens up some exciting new features.&lt;/p>
&lt;p>For example, imagine having an AWS session that requires MFA, or you have an Azure flow that requires a TOTP token. Now, you can achieve that using automation
and an MFA generated in a secret.&lt;/p>
&lt;p>Just define a generator:&lt;/p></description></item><item><title>In-depth look at CRDs and how they work under the hood</title><link>https://skarlso.github.io/2025/05/12/in-depth-look-at-crds-and-how-they-work-under-the-hood/</link><pubDate>Mon, 12 May 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/05/12/in-depth-look-at-crds-and-how-they-work-under-the-hood/</guid><description>&lt;h1 id="in-depth-look-at-crds-and-how-they-work-under-the-hood">In-depth look at CRDs and how they work under the hood&lt;/h1>
&lt;p>Today, we are going to walk through how a CRD looks like, what it does, what it contains, how it works and how it alters Kubernetes.
The design, the api extension and links and snippets to the code ( accurate at the time of writing ) where it happens.&lt;/p>
&lt;p>Let&amp;rsquo;s dive in.&lt;/p>
&lt;h2 id="what-are-crds">What are CRDs&lt;/h2>
&lt;p>CRDs as described in the official &lt;a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">Kubernetes Documentation page&lt;/a> are objects that can extend the API of Kubernetes.&lt;/p></description></item><item><title>CNCF Project Showcases</title><link>https://skarlso.github.io/2025/05/10/cncf-landscape-showcase/</link><pubDate>Sat, 10 May 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/05/10/cncf-landscape-showcase/</guid><description>&lt;h1 id="cncf-project-showcases">CNCF Project Showcases&lt;/h1>
&lt;p>Hi there, hello. Long time no see. I was very busy these past months.&lt;/p>
&lt;p>I thought about a series though that I would like to lead.&lt;/p>
&lt;p>Every week or month or so, I&amp;rsquo;m going to randomly pick a CNCF project for this &lt;a href="https://landscape.cncf.io/docs/projects.csv">CSV - CNCF Projects&lt;/a>.&lt;/p>
&lt;p>I will explore it and write about it. See what it does, why, how, and for what reason.&lt;/p>
&lt;p>I know some folks that already do this, but I don&amp;rsquo;t care. I&amp;rsquo;m doing it for myself.&lt;/p></description></item><item><title>External Secrets Operator template rendering tool</title><link>https://skarlso.github.io/2025/01/11/eso-with-template-renderer-tool/</link><pubDate>Sat, 11 Jan 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/01/11/eso-with-template-renderer-tool/</guid><description>&lt;h1 id="external-secrets-operator-template-rendering-tool">External Secrets Operator template rendering tool&lt;/h1>
&lt;p>Once this&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> pull request is merged, ESO will be extended with a tool that has the ability to render
templates in an object.&lt;/p>
&lt;p>Let&amp;rsquo;s step back a little&amp;hellip; what are templates even? But&amp;hellip; what is ESO even?&lt;/p>
&lt;p>Okay, so&amp;hellip; ESO is &lt;em>external-secrets-operator&lt;/em>&lt;sup id="fnref:2">&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref">2&lt;/a>&lt;/sup>. It&amp;rsquo;s Kubernetes operator than can sync secrets between an external
provider, like AWS Parameter/Secret Store, and a cluster. This is bi-directional. Meaning ESO can sync the secret back
as well using something called a &lt;code>PushSecret&lt;/code>&lt;sup id="fnref:3">&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref">3&lt;/a>&lt;/sup>. The secret will then be pushed to the provider. This way, secrets can
be backed up or straight Generated&lt;sup id="fnref:4">&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref">4&lt;/a>&lt;/sup> to provide ephemeral access to certain resources.&lt;/p></description></item><item><title>Missing out on jobs because of LeetCode</title><link>https://skarlso.github.io/2025/01/08/missing-out-on-jobs-because-of-leetcode/</link><pubDate>Thu, 09 Jan 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/01/08/missing-out-on-jobs-because-of-leetcode/</guid><description>&lt;h1 id="missing-out-of-jobs-because-of-leetcode">Missing out of jobs because of LeetCode&lt;/h1>
&lt;p>At the end of the last year, my previous workplace ( Weaveworks ) went bankrupt. I found myself without a job.
I didn&amp;rsquo;t have to interview for a long time and I certainly wasn&amp;rsquo;t planning on it any time soon. I enjoyed my
work.&lt;/p>
&lt;p>Thus, I started to learn a bit because I forgot how to interview. I refreshed my knowledge on LeetCode, I
did some exercises, I read some books, post, whatever. I refreshed my algo knowledge because that&amp;rsquo;s what people
most likely will ask, right?&lt;/p></description></item><item><title>Notetaking with ADHD</title><link>https://skarlso.github.io/2025/01/07/corscapade/</link><pubDate>Wed, 08 Jan 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/01/07/corscapade/</guid><description>&lt;h1 id="notetaking-with-adhd">Notetaking with ADHD&lt;/h1>
&lt;p>After several years, I finally have my official diagnosis. ADHD. I had it as a kid as well, in hindsight, it was pretty
fucking obvious. I could reminisce about those days for a long time. How things now fit together, how everything suddenly
fell into place. Why the things happened to me as they did and how I was always &lt;em>always&lt;/em> in the middle of every shit-storm.&lt;/p></description></item><item><title>CORScapade; the story why cty doesn't support git flow on web</title><link>https://skarlso.github.io/2025/01/07/corscapade/</link><pubDate>Tue, 07 Jan 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/01/07/corscapade/</guid><description>&lt;h1 id="corscapade-the-story-why-cty-doesnt-support-git-flow-on-web">CORScapade; the story why cty doesn&amp;rsquo;t support git flow on web&lt;/h1>
&lt;p>Recently, I implemented git based discovery for &lt;a href="https://github.com/Skarlso/crd-to-sample-yaml">cty&lt;/a>. It means, that the user can provide
a git repo URL and cty will clone the content and look for any valid CRDs and discover them.&lt;/p>
&lt;p>I wanted ot provide this through the front-end as well. However, I ran into some issues&amp;hellip;&lt;/p>
&lt;h2 id="cors">CORS&lt;/h2>
&lt;p>Plain HTTP requests are working fine only if &lt;code>raw.githubusercontent.com&lt;/code> is being used. That service doesn&amp;rsquo;t have CORS.&lt;/p></description></item><item><title>Using ORAS as a library to interact with OCI repositories</title><link>https://skarlso.github.io/2025/01/06/using-oras-as-a-library-to-interact-with-oci-repositories/</link><pubDate>Mon, 06 Jan 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/01/06/using-oras-as-a-library-to-interact-with-oci-repositories/</guid><description>&lt;h1 id="introducing-oras-into-a-library">Introducing ORAS into a Library&lt;/h1>
&lt;p>This post talks about using &lt;a href="https://github.com/oras-project/oras-go/">ORAS&lt;/a> as a library to interact with OCI repositories.&lt;/p>
&lt;p>First and foremost I like to keep things simple. I was seeing basic usages around the project I&amp;rsquo;m working in and some
common behaviour that started to emerge. Looking at that behaviour I drawn a preliminary interface. This interface is
also something similar that docker remote implementation has in containerd.&lt;/p>
&lt;p>Looks something like this:&lt;/p></description></item><item><title>Write something every day</title><link>https://skarlso.github.io/2025/01/05/write-something-every-day/</link><pubDate>Sun, 05 Jan 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/01/05/write-something-every-day/</guid><description>&lt;p>This year I want to do somerhinf different. For the whole year I&amp;rsquo;ll attempt to write a blogpost everyday. I might miss a day during holiday or being sick or something but the point is that by the end of the year I should have at least 365 blog posts.&lt;/p>
&lt;p>I also want them to be somewhat meaningful so be about some kind of technology or discovery or whatever. So posts like &amp;lsquo;This is a post&amp;rsquo; are not valid.&lt;/p></description></item><item><title>Add Suggest Edit to Posts</title><link>https://skarlso.github.io/2025/01/02/add-suggest-edit-to-posts/</link><pubDate>Thu, 02 Jan 2025 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2025/01/02/add-suggest-edit-to-posts/</guid><description>&lt;h1 id="added-suggest-edit-to-post-link-to-all-my-posts">Added Suggest Edit to Post link to all my posts&lt;/h1>
&lt;p>I added &amp;ldquo;Suggest edit&amp;rdquo; to all my posts in a way to open my blob to the community.
I accept all kinds of contriubtions be they simple grammar fixes or more accurate descriptions
of something.&lt;/p>
&lt;p>Feel free to suggest changes. I&amp;rsquo;m also toying with the idea of accepting completely new content
but that remains to be seen.&lt;/p>
&lt;p>Thank you, and have a happy new year!&lt;/p></description></item><item><title>Quickly delete all packages from GitHub registry using a blob</title><link>https://skarlso.github.io/2024/12/10/quickly-delete-all-packages-from-github-registry/</link><pubDate>Tue, 10 Dec 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/12/10/quickly-delete-all-packages-from-github-registry/</guid><description>&lt;h1 id="script-to-remove-github-registry-images">Script to remove GitHub registry images&lt;/h1>
&lt;p>Hey, though I quickly just share a script to get rid of packages you don&amp;rsquo;t want anymore
from your GitHub registry.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">#!/bin/bash
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>set -e
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Variables&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>OWNER&lt;span style="color:#f92672">=&lt;/span>$1 &lt;span style="color:#75715e"># Replace with your GitHub username or organization name&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>PACKAGE_GLOB&lt;span style="color:#f92672">=&lt;/span>$2 &lt;span style="color:#75715e"># Glob pattern for package names passed as an argument (e.g., &amp;#34;package*&amp;#34; to match all)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># makes sure that important packages are not removed by accident&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>contains&lt;span style="color:#f92672">()&lt;/span> &lt;span style="color:#f92672">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> found&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> array&lt;span style="color:#f92672">=(&lt;/span>place-very-important-packages-here-to-make-sure-they-are-not-deleted&lt;span style="color:#f92672">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> v in &lt;span style="color:#e6db74">&amp;#34;&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>array[@]&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">do&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#f92672">[[&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$1&lt;span style="color:#e6db74">&amp;#34;&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$v&lt;span style="color:#e6db74">&amp;#34;&lt;/span> &lt;span style="color:#f92672">]]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> echo &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$v&lt;span style="color:#e6db74"> found not deleting&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> found&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">0&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> break
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">done&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Function to delete a package version&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>delete_package_version&lt;span style="color:#f92672">()&lt;/span> &lt;span style="color:#f92672">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> contains &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$1&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># echo &amp;#34;found: $found&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#f92672">[[&lt;/span> $found -eq &lt;span style="color:#ae81ff">1&lt;/span> &lt;span style="color:#f92672">]]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> name&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>1//&lt;span style="color:#ae81ff">\/&lt;/span>/%2F&lt;span style="color:#e6db74">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> echo &lt;span style="color:#e6db74">&amp;#34;deleting package with name: &lt;/span>$name&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> gh api -X DELETE &lt;span style="color:#e6db74">&amp;#34;/user/packages/container/&lt;/span>$name&lt;span style="color:#e6db74">&amp;#34;&lt;/span> --silent
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Fetch the list of all available packages for the user/organization&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>echo &lt;span style="color:#e6db74">&amp;#34;Fetching packages matching the glob pattern &amp;#39;&lt;/span>$PACKAGE_GLOB&lt;span style="color:#e6db74">&amp;#39;...&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Fetch all package names and filter with globbing&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Change `/users/` to `organization` if you are looking at organization packages.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ALL_PACKAGES&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">$(&lt;/span>gh api &lt;span style="color:#e6db74">&amp;#34;/users/&lt;/span>$OWNER&lt;span style="color:#e6db74">/packages?package_type=container&amp;#34;&lt;/span> --jq &lt;span style="color:#e6db74">&amp;#39;.[].name&amp;#39;&lt;/span> --paginate&lt;span style="color:#66d9ef">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>MATCHED_PACKAGES&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">$(&lt;/span>echo &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$ALL_PACKAGES&lt;span style="color:#e6db74">&amp;#34;&lt;/span> | grep &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$PACKAGE_GLOB&lt;span style="color:#e6db74">&amp;#34;&lt;/span>&lt;span style="color:#66d9ef">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#f92672">[[&lt;/span> -z &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$MATCHED_PACKAGES&lt;span style="color:#e6db74">&amp;#34;&lt;/span> &lt;span style="color:#f92672">]]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> echo &lt;span style="color:#e6db74">&amp;#34;No packages found matching the pattern &amp;#39;&lt;/span>$PACKAGE_GLOB&lt;span style="color:#e6db74">&amp;#39;.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> exit &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># echo &amp;#34;Deleting the following packages: ${MATCHED_PACKAGES}&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Loop through matched packages and delete them&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>SAVEIFS&lt;span style="color:#f92672">=&lt;/span>$IFS &lt;span style="color:#75715e"># Save current IFS (Internal Field Separator)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>IFS&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">$&amp;#39;\n&amp;#39;&lt;/span> &lt;span style="color:#75715e"># Change IFS to newline char&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>packages&lt;span style="color:#f92672">=(&lt;/span>$MATCHED_PACKAGES&lt;span style="color:#f92672">)&lt;/span> &lt;span style="color:#75715e"># split the `names` string into an array by the same name&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>IFS&lt;span style="color:#f92672">=&lt;/span>$SAVEIFS &lt;span style="color:#75715e"># Restore original IFS&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#f92672">((&lt;/span> i&lt;span style="color:#f92672">=&lt;/span>0; i&amp;lt;&lt;span style="color:#e6db74">${#&lt;/span>packages[@]&lt;span style="color:#e6db74">}&lt;/span>; i++ &lt;span style="color:#f92672">))&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">do&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> delete_package_version &lt;span style="color:#e6db74">&amp;#34;&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>packages[$i]&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">done&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>echo &lt;span style="color:#e6db74">&amp;#34;All matching packages deleted!&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>That is all.&lt;/p></description></item><item><title>Test Post - Please ignore</title><link>https://skarlso.github.io/2024/11/14/testing-my-new-hugo-build/</link><pubDate>Thu, 14 Nov 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/11/14/testing-my-new-hugo-build/</guid><description>&lt;h1 id="hello">Hello&lt;/h1>
&lt;p>This is just a test post to see if I did my hugo build correctly.&lt;/p></description></item><item><title>How I track tasks with Obsidian</title><link>https://skarlso.github.io/2024/09/17/how-i-track-tasks-with-obsidian/</link><pubDate>Tue, 17 Sep 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/09/17/how-i-track-tasks-with-obsidian/</guid><description>&lt;h1 id="how-i-track-tasks-with-obsidian">How I track tasks with Obsidian&lt;/h1>
&lt;p>Hello. This will be a run-down on how I track tasks and projects and long-term things, like
reading a book, tracking a project or traveling using the &lt;a href="https://fortelabs.com/blog/para/">PARA&lt;/a> method.&lt;/p>
&lt;p>Let&amp;rsquo;s get to it!&lt;/p>
&lt;h2 id="task-tracking-queue">Task tracking queue&lt;/h2>
&lt;p>&lt;img alt="task-list" loading="lazy" src="https://skarlso.github.io/img/2024/09/19/task-list.png">&lt;/p>
&lt;p>The way I track tasks is through a queuing system. To not get overloaded by tasks, I just simply
put the next task into the queue and take out the top recent if I&amp;rsquo;m done. Unless something really urgent comes
along I don&amp;rsquo;t disrupt this flow. Meaning, once I have a task out and &lt;code>#active&lt;/code> that&amp;rsquo;s the task I&amp;rsquo;m going
to be working on!&lt;/p></description></item><item><title>Update your CRDs with confidence</title><link>https://skarlso.github.io/2024/08/21/update-your-crds-with-confidence/</link><pubDate>Wed, 21 Aug 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/08/21/update-your-crds-with-confidence/</guid><description>&lt;h1 id="update-your-crds-with-confidence">Update your CRDs with confidence&lt;/h1>
&lt;p>Hello.&lt;/p>
&lt;p>I would like to write about a release for crd-to-sample-yaml&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>. It&amp;rsquo;s the release version v0.8.0&lt;sup id="fnref:2">&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref">2&lt;/a>&lt;/sup>.&lt;/p>
&lt;p>This version brings with it a feature to test the validity of your CRD changes.&lt;/p>
&lt;p>It means that if you change your CRD it will test if the changes do not break working samples of that version.&lt;/p>
&lt;p>This is achieved by a helm unittest type of YAML based test scenarios and snapshot generation.&lt;/p></description></item><item><title>Using cert-manager as a subchart for your own Helm Chart</title><link>https://skarlso.github.io/2024/07/02/using-cert-manager-as-a-subchart-with-helm/</link><pubDate>Tue, 02 Jul 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/07/02/using-cert-manager-as-a-subchart-with-helm/</guid><description>&lt;h1 id="using-cert-manager-as-a-subchart">Using cert-manager as a subchart&lt;/h1>
&lt;p>Hello.&lt;/p>
&lt;p>In today&amp;rsquo;s post, I would like to show how to set up cert-manager as a subchart. Not only that,
but also, how to add a &lt;code>Job&lt;/code> to make sure that cert-manager is installed and its webhook is
up and running so it can process any &lt;code>Issuers&lt;/code> that are going to be applied with your own chart.&lt;/p>
&lt;p>Let&amp;rsquo;s get to it.&lt;/p>
&lt;h2 id="defining-a-subchart">Defining a subchart&lt;/h2>
&lt;p>To define a subchart, simply add it as a dependency in your &lt;code>Charts.yaml&lt;/code> like this:&lt;/p></description></item><item><title>Discoverable functional options pattern</title><link>https://skarlso.github.io/2024/07/01/discoverable-functional-options/</link><pubDate>Mon, 01 Jul 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/07/01/discoverable-functional-options/</guid><description>&lt;p>Hello.&lt;/p>
&lt;p>Today&amp;rsquo;s will be a quick post. Everyone knows and loves/hates functional options&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> in Go.&lt;/p>
&lt;p>The biggest gripe people get with it is, that the options aren&amp;rsquo;t discoverable and that there
is no IDE support for nicely auto-completing options.&lt;/p>
&lt;p>My thought about this was that, what if we would just hang it on a struct? Let&amp;rsquo;s see how that
looks.&lt;/p>
&lt;p>Consider this normal server builder with options:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">Server&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Name&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Address&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Port&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">WithName&lt;/span>(&lt;span style="color:#a6e22e">name&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) &lt;span style="color:#a6e22e">ServerOptFn&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">func&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Server&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">Name&lt;/span> = &lt;span style="color:#a6e22e">name&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">WithAddress&lt;/span>(&lt;span style="color:#a6e22e">address&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) &lt;span style="color:#a6e22e">ServerOptFn&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">func&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Server&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">Address&lt;/span> = &lt;span style="color:#a6e22e">address&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">WithPort&lt;/span>(&lt;span style="color:#a6e22e">port&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) &lt;span style="color:#a6e22e">ServerOptFn&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">func&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Server&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">Port&lt;/span> = &lt;span style="color:#a6e22e">port&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">ServerOptFn&lt;/span> &lt;span style="color:#66d9ef">func&lt;/span>(&lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Server&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">NewServer&lt;/span>(&lt;span style="color:#a6e22e">opts&lt;/span> &lt;span style="color:#f92672">...&lt;/span>&lt;span style="color:#a6e22e">ServerOptFn&lt;/span>) &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Server&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">Server&lt;/span>{}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">o&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">opts&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">o&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now, what if you would like to retain the niceness of the clean options pattern where you
don&amp;rsquo;t have to specify and empty struct but still could use a struct to gather the options
together?&lt;/p></description></item><item><title>Journey from Testing into Software Development</title><link>https://skarlso.github.io/2024/05/23/journey-from-tester-to-software-developer/</link><pubDate>Thu, 23 May 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/05/23/journey-from-tester-to-software-developer/</guid><description>&lt;p>Hello, Dear Reader!&lt;/p>
&lt;p>Settle in for a long one this time. I would like to write about my journey from being a Tester back in 2004 to being
a software engineer today ( 2024 ). A mere 20 year long journey. I&amp;rsquo;m going to write down how I got this far, what it
took, the sacrifices, fears, doubts and all the things in between. Let&amp;rsquo;s get started.&lt;/p>
&lt;h2 id="the-early-days">The early days&lt;/h2>
&lt;p>Around 2002, I became a student for a two year long certificate study for a position called Software Programmer.
It was a paid course. My mother paid for the two years, it was the cheapest options at that time in Hungary.
The school, SZAMALK, was 80km from where I lived, so I had to travel everyday. The bus ride took about 1.5 hours that I
mostly managed to sleep through. Then school until 2pm-ish and then travel back home. Another 1.5 hours. I woke up at
5AM to get to school on time. It was quite rough. I mostly slept through my classes.&lt;/p></description></item><item><title>crd-to-yaml now supports HTML as an output format</title><link>https://skarlso.github.io/2024/05/09/crd-to-yaml-html-output/</link><pubDate>Thu, 09 May 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/05/09/crd-to-yaml-html-output/</guid><description>&lt;p>Hello!&lt;/p>
&lt;p>Just wanted to give an update to my crd-to-sample-yaml tool. It, now, supports creating a standalone HTML output.&lt;/p>
&lt;p>Why, you may ask? Well, now you can host the generated content as a static page on your website. That&amp;rsquo;s pretty handy.&lt;/p>
&lt;p>Here is a sample output:&lt;/p>
&lt;p>&lt;img alt="crd to yaml" loading="lazy" src="https://skarlso.github.io/img/2024/05/09/crd-to-yaml-sample-html-output.png">&lt;/p>
&lt;p>Go and get it while it&amp;rsquo;s hot in version &lt;a href="https://github.com/Skarlso/crd-to-sample-yaml/releases/tag/v0.4.0">v0.4.0&lt;/a>.&lt;/p>
&lt;p>That&amp;rsquo;s all. Thanks for reading!&lt;/p></description></item><item><title>Generic dig for map key using typed parameters</title><link>https://skarlso.github.io/2024/02/27/generic-map-dig/</link><pubDate>Tue, 27 Feb 2024 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2024/02/27/generic-map-dig/</guid><description>&lt;h1 id="generic-dig-for-map-key-using-typed-parameters">Generic dig for map key using typed parameters&lt;/h1>
&lt;p>Hello!&lt;/p>
&lt;p>I was fiddling with a way of getting out values from a map that is of format &lt;code>map[string]any&lt;/code>.
But I wanted my type safety as well. This was coming from digging out keys from a Metadata field.&lt;/p>
&lt;p>The metadata was in a JSON format.&lt;/p>
&lt;p>This is what I came up with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">/&lt;/span> &lt;span style="color:#a6e22e">FetchValueFromMetadata&lt;/span> &lt;span style="color:#a6e22e">fetches&lt;/span> &lt;span style="color:#a6e22e">a&lt;/span> &lt;span style="color:#a6e22e">key&lt;/span> &lt;span style="color:#a6e22e">from&lt;/span> &lt;span style="color:#a6e22e">a&lt;/span> &lt;span style="color:#a6e22e">metadata&lt;/span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">it&lt;/span> &lt;span style="color:#a6e22e">exists&lt;/span>. &lt;span style="color:#a6e22e">It&lt;/span> &lt;span style="color:#a6e22e">will&lt;/span> &lt;span style="color:#a6e22e">recursively&lt;/span> &lt;span style="color:#a6e22e">look&lt;/span> &lt;span style="color:#a6e22e">in&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// embedded values as well. Must be a unique key, otherwise it will just return the first
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// occurrence.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">FetchValueFromMetadata&lt;/span>[&lt;span style="color:#a6e22e">T&lt;/span> &lt;span style="color:#a6e22e">any&lt;/span>](&lt;span style="color:#a6e22e">key&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">data&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">apiextensionsv1&lt;/span>.&lt;span style="color:#a6e22e">JSON&lt;/span>, &lt;span style="color:#a6e22e">def&lt;/span> &lt;span style="color:#a6e22e">T&lt;/span>) (&lt;span style="color:#a6e22e">t&lt;/span> &lt;span style="color:#a6e22e">T&lt;/span>, &lt;span style="color:#a6e22e">_&lt;/span> &lt;span style="color:#66d9ef">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">data&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">def&lt;/span>, &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">m&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">string&lt;/span>]&lt;span style="color:#a6e22e">any&lt;/span>{}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">json&lt;/span>.&lt;span style="color:#a6e22e">Unmarshal&lt;/span>(&lt;span style="color:#a6e22e">data&lt;/span>.&lt;span style="color:#a6e22e">Raw&lt;/span>, &lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">m&lt;/span>); &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">t&lt;/span>, &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Errorf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;failed to parse JSON raw data: %w&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">v&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">dig&lt;/span>[&lt;span style="color:#a6e22e">T&lt;/span>](&lt;span style="color:#a6e22e">key&lt;/span>, &lt;span style="color:#a6e22e">m&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">errors&lt;/span>.&lt;span style="color:#a6e22e">Is&lt;/span>(&lt;span style="color:#a6e22e">err&lt;/span>, &lt;span style="color:#a6e22e">errKeyNotFound&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">def&lt;/span>, &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span>, &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">dig&lt;/span>[&lt;span style="color:#a6e22e">T&lt;/span> &lt;span style="color:#a6e22e">any&lt;/span>](&lt;span style="color:#a6e22e">key&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">data&lt;/span> &lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">string&lt;/span>]&lt;span style="color:#a6e22e">any&lt;/span>) (&lt;span style="color:#a6e22e">t&lt;/span> &lt;span style="color:#a6e22e">T&lt;/span>, &lt;span style="color:#a6e22e">_&lt;/span> &lt;span style="color:#66d9ef">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span>, &lt;span style="color:#a6e22e">ok&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">data&lt;/span>[&lt;span style="color:#a6e22e">key&lt;/span>]; &lt;span style="color:#a6e22e">ok&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">c&lt;/span>, &lt;span style="color:#a6e22e">k&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span>.(&lt;span style="color:#a6e22e">T&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> !&lt;span style="color:#a6e22e">k&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">t&lt;/span>, &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Errorf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;failed to convert value to the desired type; was: %T&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">v&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">c&lt;/span>, &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">v&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">data&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">ty&lt;/span>, &lt;span style="color:#a6e22e">ok&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span>.(&lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">string&lt;/span>]&lt;span style="color:#a6e22e">any&lt;/span>); &lt;span style="color:#a6e22e">ok&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">dig&lt;/span>[&lt;span style="color:#a6e22e">T&lt;/span>](&lt;span style="color:#a6e22e">key&lt;/span>, &lt;span style="color:#a6e22e">ty&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">t&lt;/span>, &lt;span style="color:#a6e22e">errKeyNotFound&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The interesting part is the &lt;code>dig&lt;/code> method and the type assert to the desired part. Calling this with something like:&lt;/p></description></item><item><title>CRD to YAML as WASM website</title><link>https://skarlso.github.io/2023/12/01/crd-to-yaml-as-wasm-website/</link><pubDate>Fri, 01 Dec 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/12/01/crd-to-yaml-as-wasm-website/</guid><description>&lt;h1 id="crd-to-yaml-as-wasm-website">CRD to YAML as WASM website&lt;/h1>
&lt;p>&lt;img alt="logo" loading="lazy" src="https://skarlso.github.io/img/2023/12/01/crdtoyamllogo.png">&lt;/p>
&lt;p>A while ago, I wrote about &lt;a href="https://skarlso.github.io/2022/10/19/crd-to-yaml/">Generating Sample YAML files from CRDs&lt;/a>.&lt;/p>
&lt;p>It&amp;rsquo;s a tool I created that lives &lt;a href="https://github.com/skarlso/crd-to-sample-yaml">here&lt;/a>. It has a front-end service as
well for convenience.&lt;/p>
&lt;p>I wrote it in a traditional client-server manner. It&amp;rsquo;s running from a Docker Swarm container.&lt;/p>
&lt;p>But, as I was thinking about it, nothing in this service requires interaction with a server. It gets some user input,
processes it, and has some output. I could have written it in plain Javascript. But, since I don&amp;rsquo;t know JavaScript, or
don&amp;rsquo;t know it well enough, and I do know GO, and I wanted to become more familiar with WASM, this was the perfect
learning opportunity.&lt;/p></description></item><item><title>Self-Signed locally trusted certificates with cert-manager</title><link>https://skarlso.github.io/2023/10/25/self-signed-locally-trusted-certificates-with-cert-manager/</link><pubDate>Wed, 25 Oct 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/10/25/self-signed-locally-trusted-certificates-with-cert-manager/</guid><description>&lt;h1 id="self-signed-locally-trusted-certificates-with-cert-manager">Self-Signed locally trusted certificates with cert-manager&lt;/h1>
&lt;p>We are going to discuss how to set up a Kubernetes environment where components can run using HTTPS without pain.&lt;/p>
&lt;h2 id="premise">Premise&lt;/h2>
&lt;p>Usually, people either generate certificates outside the cluster using either openssl, or mkcert, then mount them in or
use those as seeds for further generation. This poses a number of problems during testing and distribution of these
certificates. And then, switching to production, it proves that local certs will either no longer work or pose even
more problems in getting them properly distributed again.&lt;/p></description></item><item><title>Diff check and Manifest generation in GitHub Actions</title><link>https://skarlso.github.io/2023/08/11/diff-check/</link><pubDate>Fri, 11 Aug 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/08/11/diff-check/</guid><description>&lt;h1 id="diff-check-and-manifest-generation-github-actions">Diff check and manifest generation GitHub Actions&lt;/h1>
&lt;p>For Go projects it&amp;rsquo;s crucial that you don&amp;rsquo;t forget to run &lt;code>go mod tidy&lt;/code> from time to time. Combine that with a project
that includes Kubernetes controllers and the other thing people tend to forget is running &lt;code>make manifest &amp;amp;&amp;amp; make generate&lt;/code>.&lt;/p>
&lt;p>To check for these I added a small GitHub action that looks like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Check for diff after manifest and generated targets&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">on&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">pull_request&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">jobs&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">diff-check-manifests&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Check for diff&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">runs-on&lt;/span>: &lt;span style="color:#ae81ff">ubuntu-latest&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">steps&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Checkout&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">uses&lt;/span>: &lt;span style="color:#ae81ff">actions/checkout@v3&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">with&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">fetch-depth&lt;/span>: &lt;span style="color:#ae81ff">0&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Make manifests &amp;amp;&amp;amp; generate&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">run&lt;/span>: |&lt;span style="color:#e6db74">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74"> make manifests &amp;amp;&amp;amp; make generate&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Setup Go&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">uses&lt;/span>: &lt;span style="color:#ae81ff">actions/setup-go@v3&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">with&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">go-version-file&lt;/span>: &lt;span style="color:#e6db74">&amp;#39;${{ github.workspace }}/go.mod&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Restore Go cache&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">uses&lt;/span>: &lt;span style="color:#ae81ff">actions/cache@v3&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">with&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">path&lt;/span>: &lt;span style="color:#ae81ff">/home/runner/work/_temp/_github_home/go/pkg/mod&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">key&lt;/span>: &lt;span style="color:#ae81ff">${{ runner.os }}-go-${{ hashFiles(&amp;#39;**/go.sum&amp;#39;) }}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">restore-keys&lt;/span>: |&lt;span style="color:#e6db74">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74"> ${{ runner.os }}-go-&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">go mod tidy&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">run&lt;/span>: |&lt;span style="color:#e6db74">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74"> go mod tidy&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Check for diff&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">run&lt;/span>: |&lt;span style="color:#e6db74">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74"> git diff --exit-code --shortstat&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Small but effective and saved my behind a couple times now.&lt;/p></description></item><item><title>Digital and Analog notes together</title><link>https://skarlso.github.io/2023/07/28/digital-and-analog-notes-together/</link><pubDate>Fri, 28 Jul 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/07/28/digital-and-analog-notes-together/</guid><description>&lt;h1 id="digital-and-analog-notes-together">Digital and analog notes together&lt;/h1>
&lt;p>This fight is as old as time itself. Okay, maybe not &lt;em>that&lt;/em> old. But as soon as viable digital note-taking tools appeared
it was &lt;em>on&lt;/em>. Since then, many solutions that live together have appeared. PKM tools like Second Brain running hand-in-hand
with &lt;a href="https://zettelkasten.de/posts/building-a-second-brain-and-zettelkasten/">Zettelkasten&lt;/a> or &lt;a href="https://bulletjournal.com/blogs/bulletjournalist/building-a-second-brain-an-interview-with-tiago-forte">BuJo&lt;/a>
have opened my eyes to combining them in a way that makes the outcome more powerful than each alone would be.&lt;/p>
&lt;p>I&amp;rsquo;m going to write down a day of mine using these methods together and show you my journey.&lt;/p></description></item><item><title>How to add a self-signed certificate to the GitHub action runner</title><link>https://skarlso.github.io/2023/07/04/how-to-add-self-signed-certificates-to-github-action-runner-using-mkcert/</link><pubDate>Tue, 04 Jul 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/07/04/how-to-add-self-signed-certificates-to-github-action-runner-using-mkcert/</guid><description>&lt;h1 id="adding-a-certificate-to-a-github-runner">Adding a certificate to a GitHub runner&lt;/h1>
&lt;p>Imagine having a project where you have a server that you would like to run with TLS. Let&amp;rsquo;s say, you want to run a
Docker registry in a cluster using TLS. You need the generated certificate&amp;rsquo;s root certificate in the trust store of the
GitHub action runner.&lt;/p>
&lt;p>This is simple with &lt;a href="https://github.com/FiloSottile/mkcert">mkcert&lt;/a>.&lt;/p>
&lt;p>The action is simple:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">tests&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">on&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">pull_request&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">paths-ignore&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#e6db74">&amp;#39;CODE_OF_CONDUCT.md&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#e6db74">&amp;#39;README.md&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#e6db74">&amp;#39;Contributing.md&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">workflow_call&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">push&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">branches&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ae81ff">main&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">permissions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">contents&lt;/span>: &lt;span style="color:#ae81ff">read&lt;/span> &lt;span style="color:#75715e"># for actions/checkout to fetch code&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">jobs&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">run-test-suite&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">runs-on&lt;/span>: &lt;span style="color:#ae81ff">ubuntu-latest&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">steps&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Checkout&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">uses&lt;/span>: &lt;span style="color:#ae81ff">actions/checkout@v3&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Setup Go&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">uses&lt;/span>: &lt;span style="color:#ae81ff">actions/setup-go@v3&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">with&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">go-version-file&lt;/span>: &lt;span style="color:#e6db74">&amp;#39;${{ github.workspace }}/go.mod&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Restore Go cache&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">uses&lt;/span>: &lt;span style="color:#ae81ff">actions/cache@v3&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">with&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">path&lt;/span>: &lt;span style="color:#ae81ff">/home/runner/work/_temp/_github_home/go/pkg/mod&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">key&lt;/span>: &lt;span style="color:#ae81ff">${{ runner.os }}-go-${{ hashFiles(&amp;#39;**/go.sum&amp;#39;) }}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">restore-keys&lt;/span>: |&lt;span style="color:#e6db74">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74"> ${{ runner.os }}-go-&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Run e2e&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">run&lt;/span>: &lt;span style="color:#ae81ff">make e2e&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is nothing fancy. The fancy thing is coming from the &lt;code>make e2e&lt;/code> part.&lt;/p></description></item><item><title>Comments are back</title><link>https://skarlso.github.io/2023/05/11/comments-are-back/</link><pubDate>Thu, 11 May 2023 02:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/05/11/comments-are-back/</guid><description>&lt;p>Well, the previous post was a lie ( or rather a copy and paste error ).&lt;/p></description></item><item><title>Test comments</title><link>https://skarlso.github.io/2023/05/11/test-comments/</link><pubDate>Thu, 11 May 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/05/11/test-comments/</guid><description>&lt;p>Hello dear reader.&lt;/p>
&lt;p>I switched to a new theme that has Dark Mode. I&amp;rsquo;m hoping nothing changed regarding the RSS functionality.&lt;/p>
&lt;p>I removed the comments because I rarely used them.&lt;/p>
&lt;p>Also disabled any sort of tracking.&lt;/p>
&lt;p>Enjoy,
Gergely.&lt;/p></description></item><item><title>Dark mode and a new theme</title><link>https://skarlso.github.io/2023/05/10/dark-mode/</link><pubDate>Wed, 10 May 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/05/10/dark-mode/</guid><description>&lt;p>Hello dear reader.&lt;/p>
&lt;p>I switched to a new theme that has Dark Mode. I&amp;rsquo;m hoping nothing changed regarding the RSS functionality.&lt;/p>
&lt;p>I removed the comments because I rarely used them.&lt;/p>
&lt;p>Also disabled any sort of tracking.&lt;/p>
&lt;p>Enjoy,
Gergely.&lt;/p></description></item><item><title>Painless controller testing with e2e-framework and tilt</title><link>https://skarlso.github.io/2023/03/12/painless-controller-testing-with-e2e-framework-tilt/</link><pubDate>Sun, 12 Mar 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/03/12/painless-controller-testing-with-e2e-framework-tilt/</guid><description>&lt;p>Welcome dear reader.&lt;/p>
&lt;p>When &lt;a href="https://skarlso.github.io/2023/02/25/rapid-controller-development-with-tilt/">last&lt;/a> we met, we talked a lot about setting up Tilt
for rapid controller development.&lt;/p>
&lt;p>Now, let&amp;rsquo;s see how powerful Tilt can be once we bring it together with Kubernetes&amp;rsquo; &lt;a href="https://github.com/kubernetes-sigs/e2e-framework">e2e-framework&lt;/a>.&lt;/p>
&lt;h1 id="controller-e2e-framework">Controller E2E Framework&lt;/h1>
&lt;p>I&amp;rsquo;d like to present my &lt;a href="https://github.com/controller-e2e-framework">controller-e2e-framework&lt;/a> which brings Tilt and e2e-framework together to easily write and run
tests for controllers that work together.&lt;/p>
&lt;p>This framework can be used to integration test or e2e test controllers that work together. They set up some kind of
ref connection between certain objects and perform some operation on said object.&lt;/p></description></item><item><title>Rapid Kubernetes Controller Development with Tilt</title><link>https://skarlso.github.io/2023/02/25/rapid-controller-development-with-tilt/</link><pubDate>Sat, 25 Feb 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/02/25/rapid-controller-development-with-tilt/</guid><description>&lt;p>Welcome dear reader.&lt;/p>
&lt;p>Today, we are going to dive into how to use &lt;a href="https://tilt.dev">Tilt&lt;/a> to speed up the feedback loop of developing a
Kubernetes controller. We are going to do that using an open-source project called &lt;a href="https://ocm.software">OCM&lt;/a> which has
a controller called &lt;a href="github.com/open-component-model/ocm-controller">ocm-controller&lt;/a>. I&amp;rsquo;m going to walk through the
following process:&lt;/p>
&lt;ul>
&lt;li>researching tilt&lt;/li>
&lt;li>what it could do for me&lt;/li>
&lt;li>understanding the Tilt file&lt;/li>
&lt;li>trivial mapping of the developer process&lt;/li>
&lt;li>understanding Starlark&lt;/li>
&lt;li>adding more features&lt;/li>
&lt;li>tackling hot swapping&lt;/li>
&lt;li>troubleshooting&lt;/li>
&lt;/ul>
&lt;p>Let&amp;rsquo;s dive in.&lt;/p></description></item><item><title>Forming the habit of analog journaling - Why the digital format did not work for me</title><link>https://skarlso.github.io/2023/01/04/forming-the-habit-of-journaling/</link><pubDate>Wed, 04 Jan 2023 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2023/01/04/forming-the-habit-of-journaling/</guid><description>&lt;p>You can see, I wasn&amp;rsquo;t able to decide on a title. That&amp;rsquo;s because I wanted to express more than a &amp;ldquo;How to get started
with Journaling&amp;rdquo; kind of vibe. There are a &lt;em>lot&lt;/em> of posts about that already. Rather, this post depicts my struggle to get
into this habit.&lt;/p>
&lt;p>TL;DR&lt;/p>
&lt;p>It turned out that it took way too long to get into writing a simple entry with too many steps. Taking out a notebook
and starting to write is a lot faster and cheaper.&lt;/p></description></item><item><title>Generate a sample YAML file from a CRD</title><link>https://skarlso.github.io/2022/10/19/crd-to-yaml/</link><pubDate>Wed, 19 Oct 2022 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2022/10/19/crd-to-yaml/</guid><description>&lt;p>Hello.&lt;/p>
&lt;p>This one is a quick update. Just a showcase really.&lt;/p>
&lt;p>I wrote a tool to generate a sample YAML file from a CRD.&lt;/p>
&lt;p>Given a CRD like &lt;a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/b58d6141229f49201e3e2abbde3453c5d420037a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml">this&lt;/a> one, it would output a generate yaml sample like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">apiVersion&lt;/span>: &lt;span style="color:#ae81ff">infrastructure.cluster.x-k8s.io/v1beta1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">kind&lt;/span>: &lt;span style="color:#ae81ff">AWSCluster&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">metadata&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">additionalTags&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">bastion&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">allowedCIDRBlocks&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">ami&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">disableIngressRules&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">enabled&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">instanceType&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">controlPlaneEndpoint&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">host&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">port&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">controlPlaneLoadBalancer&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">additionalSecurityGroups&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">crossZoneLoadBalancing&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">healthCheckProtocol&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">scheme&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">subnets&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">identityRef&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">kind&lt;/span>: &lt;span style="color:#ae81ff">AWSCluster&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">imageLookupBaseOS&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">imageLookupFormat&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">imageLookupOrg&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">network&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">cni&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">cniIngressRules&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">description&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">fromPort&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">protocol&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">toPort&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">securityGroupOverrides&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">subnets&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">availabilityZone&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">cidrBlock&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">id&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">ipv6CidrBlock&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">isIpv6&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">isPublic&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">natGatewayId&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">routeTableId&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">tags&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">vpc&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">availabilityZoneSelection&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">availabilityZoneUsageLimit&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">cidrBlock&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">id&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">internetGatewayId&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">ipv6&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">cidrBlock&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">egressOnlyInternetGatewayId&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">poolId&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">tags&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">region&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">s3Bucket&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">controlPlaneIAMInstanceProfile&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">nodesIAMInstanceProfiles&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">sshKeyName&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">status&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">bastion&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">addresses&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">address&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">type&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">availabilityZone&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">ebsOptimized&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">enaSupport&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">iamProfile&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">id&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">imageId&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">instanceState&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">networkInterfaces&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">nonRootVolumes&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">deviceName&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">encrypted&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">encryptionKey&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">iops&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">size&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">throughput&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">type&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">privateIp&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">publicIp&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">rootVolume&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">deviceName&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">encrypted&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">encryptionKey&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">iops&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">size&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">throughput&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">type&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">securityGroupIds&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">spotMarketOptions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">maxPrice&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">sshKeyName&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">subnetId&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">tags&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">tenancy&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">type&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">userData&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">volumeIDs&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">conditions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">lastTransitionTime&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">message&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">reason&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">severity&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">status&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">type&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">failureDomains&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">networkStatus&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">apiServerElb&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">attributes&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">crossZoneLoadBalancing&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">idleTimeout&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">availabilityZones&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">dnsName&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">healthChecks&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">healthyThreshold&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">interval&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">target&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">timeout&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">unhealthyThreshold&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">listeners&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">instancePort&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">instanceProtocol&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">port&lt;/span>: &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">protocol&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">scheme&lt;/span>: &lt;span style="color:#ae81ff">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">securityGroupIds&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">subnetIds&lt;/span>: [&lt;span style="color:#e6db74">&amp;#34;string&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">tags&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">securityGroups&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">ready&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The link to the repo is &lt;a href="https://github.com/Skarlso/crd-to-sample-yaml">here&lt;/a>. Enjoy.&lt;/p></description></item><item><title>Summary of Common Sense guide to Data Structures and Algorithms</title><link>https://skarlso.github.io/2022/09/25/data-structures-and-algorithms/</link><pubDate>Sun, 25 Sep 2022 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2022/09/25/data-structures-and-algorithms/</guid><description>&lt;p>Hello!&lt;/p>
&lt;p>I&amp;rsquo;ve been working on something extensive these days. Like my &lt;a href="https://skarlso.github.io/2022/01/26/readers-digest/#grokking-algorithms">Grokking Algorithms&lt;/a> summary, I now moved on to read
&lt;a href="https://www.amazon.com/Common-Sense-Guide-Structures-Algorithms-Second/dp/1680507222/">Common-Sense Guide to Data Structures and Algorithms&lt;/a>.&lt;/p>
&lt;p>As with Grokking, I created a Go based repo and added notes for each chapter.&lt;/p>
&lt;p>The repo can be located &lt;a href="https://github.com/Skarlso/data-structures-and-algorithms">here&lt;/a>.&lt;/p>
&lt;p>Enjoy,
and thanks for reading.
Gergely.&lt;/p></description></item><item><title>How to contribute to a new repository</title><link>https://skarlso.github.io/2022/07/01/how-to-contribute-to-a-new-repository/</link><pubDate>Fri, 01 Jul 2022 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2022/07/01/how-to-contribute-to-a-new-repository/</guid><description>&lt;h1 id="how-to-contribute-to-a-new-repository">How to contribute to a new repository&lt;/h1>
&lt;p>Hello Dear readers.&lt;/p>
&lt;p>Today, I&amp;rsquo;m going to walk you through a process of contributing into a new repository. If you are new to Go development
and would like to contribute somewhere but are at a loss in large repositories, this post will be for you.&lt;/p>
&lt;p>I selected the top repository in trending Go today. Which is &lt;a href="https://github.com/istio/istio">istio&lt;/a>. I think that&amp;rsquo;s
sufficiently large and I have no idea about the repository, so I&amp;rsquo;m going to walk you through my process. I did choose
a repo that is in the area of my expertise though so I have an easier time deciphering what it is trying to do in the
first place.&lt;/p></description></item><item><title>Hacking on CAPA - The journey of implementing a nontrivial feature in a barely known codebase</title><link>https://skarlso.github.io/2022/06/26/hacking-on-capa/</link><pubDate>Sun, 26 Jun 2022 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2022/06/26/hacking-on-capa/</guid><description>&lt;h1 id="hacking-on-capa---the-journey-of-implementing-a-nontrivial-feature-in-a-barely-known-codebase">Hacking on CAPA - The journey of implementing a nontrivial feature in a barely known codebase&lt;/h1>
&lt;p>Hello Dear readers.&lt;/p>
&lt;p>Today, I would like to write about a project I&amp;rsquo;ve been working on these past months or so. This is a longer story
and hopefully an interesting one to read.&lt;/p>
&lt;p>I&amp;rsquo;m going to write about the journey I took while trying to implement IPv6 based Kubernetes cluster for &lt;a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws">CAPA&lt;/a>
and EKS.&lt;/p>
&lt;p>The interesting points of this journey are twofold. First, understanding IPv6 in AWS land and how it&amp;rsquo;s configured
and how it works. What are it&amp;rsquo;s limitations and requirements? Topology, routing, security groups, launch configuration,
IAM roles, node policies&amp;hellip; etc.&lt;/p></description></item><item><title>Dependabot Bundler</title><link>https://skarlso.github.io/2022/05/16/dependabot-bundler/</link><pubDate>Mon, 16 May 2022 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2022/05/16/dependabot-bundler/</guid><description>&lt;p>Hello Dear readers.&lt;/p>
&lt;p>Today, I would like to write about a small pet project of mine called &lt;a href="https://github.com/Skarlso/dependabot-bundler">Dependabot Bundler&lt;/a>.&lt;/p>
&lt;p>We&amp;rsquo;ve all been here:&lt;/p>
&lt;p>&lt;img alt="prs" loading="lazy" src="https://skarlso.github.io/img/2022/05/16/multiple_prs.png">&lt;/p>
&lt;p>You would like to review these individually, of course, however, having to individually merge them is quite the pain.&lt;/p>
&lt;p>Isn&amp;rsquo;t it a lot better to do this instead?&lt;/p>
&lt;p>&lt;img alt="prs" loading="lazy" src="https://skarlso.github.io/img/2022/05/16/single_pr.png">&lt;/p>
&lt;p>A lot nicer and more comfortable, isn&amp;rsquo;t it?&lt;/p>
&lt;p>This is done by running dependabot-bundler with the following command:&lt;/p></description></item><item><title>Reader's Digest - January with Grokking Algorithms Go Generics Repository</title><link>https://skarlso.github.io/2022/01/26/readers-digest/</link><pubDate>Wed, 26 Jan 2022 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2022/01/26/readers-digest/</guid><description>&lt;p>Hello Dear readers.&lt;/p>
&lt;p>Today&amp;rsquo;s reader&amp;rsquo;s digest comes with a repo and some code too! Let&amp;rsquo;s dive in.&lt;/p>
&lt;h1 id="readers-digest---january">Reader&amp;rsquo;s Digest - January&lt;/h1>
&lt;h2 id="immune">Immune&lt;/h2>
&lt;p>&lt;a href="https://www.amazon.com/Immune-Journey-Mysterious-System-Keeps/dp/0593241312">Immune&lt;/a> is an absolutely fabulous book. It&amp;rsquo;s amazing
and in time of this pandemic a healthy read to boot. I love biology, but never went too deep into it. This book fascinated
me with its colorful images, the style of Kurzgesagt story telling and the man himself, who is the voice of Kurzgesagt.
I&amp;rsquo;ve read it all with his voice in my head.&lt;/p></description></item><item><title>Providers Pattern</title><link>https://skarlso.github.io/2021/12/21/providers-pattern/</link><pubDate>Tue, 21 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/21/providers-pattern/</guid><description>&lt;p>Hello Dear readers.&lt;/p>
&lt;p>Today, I would like to write about a project design pattern I&amp;rsquo;ve been using successfully over the past years for
various projects. It has many variations and it has some design patterns that are commonly found in the wild, so there
is nothing really special about it.&lt;/p>
&lt;p>Let&amp;rsquo;s begin.&lt;/p>
&lt;h1 id="providers-pattern">Providers Pattern&lt;/h1>
&lt;p>What is this pattern anyways? It&amp;rsquo;s a pattern I learned while working at &lt;a href="https://www.arangodb.com/">ArangoDB&lt;/a>. It&amp;rsquo;s
quite nice and defines package abstractions wonderfully. It somewhat resembles the Repository pattern from DDD and also
uses Chain of Responsibility to setup multiple providers for a given functionality. Like a fallback, in case a Provider
does not understand the current thing it got. In that case, it will delegate to &lt;code>Next&lt;/code>.&lt;/p></description></item><item><title>Advent Of Code - Day 12 - Updated</title><link>https://skarlso.github.io/2021/12/17/aoc-day12-updated/</link><pubDate>Fri, 17 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/17/aoc-day12-updated/</guid><description>&lt;h1 id="advent-of-code---day-12---updated">Advent Of Code - Day 12 - Updated&lt;/h1>
&lt;p>A comment from one of my readers prompted me to revise my solution on this trying to do part 2. The suggestions was that
instead of using a &lt;code>struct&lt;/code> as seen, use &lt;code>int&lt;/code> and keep track of the count for small caves that way. I started to do
that but got into various problems along the way when I got frustrated with my code, deleted the whole thing and begun
again. But this lead me to a small, and better code than before which actually worked.&lt;/p></description></item><item><title>Advent Of Code - Day 15</title><link>https://skarlso.github.io/2021/12/15/aoc-day15/</link><pubDate>Wed, 15 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/15/aoc-day15/</guid><description>&lt;h1 id="advent-of-code---day-15">Advent Of Code - Day 15&lt;/h1>
&lt;p>Today, again, we open up &lt;a href="https://www.redblobgames.com/pathfinding/a-star/introduction.html">Red Blob Games&lt;/a>.
It is a great source of information and descriptions. Especially, since this scenario is right up Red Blob&amp;rsquo;s ally.
We need some weighted path finding. And Red Blob has a lovely post on that using the ever famous &lt;a href="https://www.redblobgames.com/pathfinding/a-star/introduction.html#dijkstra">Dijkstra&lt;/a> algorithm with a Priority Queue.&lt;/p>
&lt;h2 id="day-15---part-1">Day 15 - Part 1&lt;/h2>
&lt;p>Let&amp;rsquo;s get to it. After refreshing my memory about priority queues, I remembered that there is a package and some sample
code in Go which implements priority queues using the &lt;code>container/heap&lt;/code> package &lt;a href="https://pkg.go.dev/container/heap#example-package-PriorityQueue">here&lt;/a>.&lt;/p></description></item><item><title>Advent Of Code - Day 14</title><link>https://skarlso.github.io/2021/12/14/aoc-day14/</link><pubDate>Tue, 14 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/14/aoc-day14/</guid><description>&lt;h1 id="advent-of-code---day-14">Advent Of Code - Day 14&lt;/h1>
&lt;p>Now we have to do some chemistry. Santa is pretty cool this way. They have a lot of skills mastered and read manuals
like an expert. But this also means that manuals are always faulty. But Santa manages to work around these problems
rather well.&lt;/p>
&lt;h2 id="day-14---part-1">Day 14 - Part 1&lt;/h2>
&lt;p>So, by reading the description and looking at the outcome, that a string only after 5 iterations will be this big, begs
the question if we should build a primitive solution for this. Well, yes, I think we should. Part 2 will most likely be
about something like, okay, now do this, but longer. I suspect this will be like the lanterfish thing. But let&amp;rsquo;s do it
anyways.&lt;/p></description></item><item><title>Advent Of Code - Day 13</title><link>https://skarlso.github.io/2021/12/13/aoc-day13/</link><pubDate>Mon, 13 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/13/aoc-day13/</guid><description>&lt;h1 id="advent-of-code---day-13">Advent Of Code - Day 13&lt;/h1>
&lt;p>This one was a lot of fun! Matrix folding was a bit fiddly but nothing too serious&amp;hellip;&lt;/p>
&lt;h2 id="day13---part-1">Day13 - Part 1&lt;/h2>
&lt;p>By solving this part, I actually solved both parts. I had to butcher it to not solve both parts because I already dealt
with folding both ways. First, we parse our input.&lt;/p>
&lt;p>We read out both the folding and the numbers first for easy handling later:&lt;/p></description></item><item><title>Advent Of Code - Day 12</title><link>https://skarlso.github.io/2021/12/12/aoc-day12/</link><pubDate>Sun, 12 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/12/aoc-day12/</guid><description>&lt;h1 id="advent-of-code---day-12">Advent Of Code - Day 12&lt;/h1>
&lt;p>&lt;strong>EDIT&lt;/strong>: I revisited this problem and completely revised my solution to it: &lt;a href="https://skarlso.github.io/2021/12/17/aoc-day12-updated/">Day 12 Updated&lt;/a>&lt;/p>
&lt;p>This one is a bit different from our little BFS walk the other day. I didn&amp;rsquo;t quite remember how DFS works, so I looked
at the &lt;a href="https://en.wikipedia.org/wiki/Depth-first_search">Wikipedia&lt;/a> a bit. Then I remembered that I implemented this
previously at some point in a later year.&lt;/p>
&lt;p>&lt;em>Disclaimer&lt;/em>: I didn&amp;rsquo;t manage to finish part 2. I&amp;rsquo;m not sure what the bug is, but I moved on. When I&amp;rsquo;ll have the
inspiration, I&amp;rsquo;ll figure it out. Unless, someone has an idea what&amp;rsquo;s going on.&lt;/p></description></item><item><title>Advent Of Code - Day 11</title><link>https://skarlso.github.io/2021/12/11/aoc-day11/</link><pubDate>Sat, 11 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/11/aoc-day11/</guid><description>&lt;h1 id="advent-of-code---day-11">Advent Of Code - Day 11&lt;/h1>
&lt;p>Today was an easier one again. It&amp;rsquo;s been a while since I last did some recursion anyway. At least, that&amp;rsquo;s how I solved
this. I&amp;rsquo;m pretty sure my solution isn&amp;rsquo;t the most efficient one, but at least it&amp;rsquo;s working and it&amp;rsquo;s not horrible.&lt;/p>
&lt;h2 id="day-11---part-1">Day 11 - Part 1&lt;/h2>
&lt;p>We have some number tracking to do again. This time, instead of fishes, we find ourself an bioluminescent octopus!
This time, the rules are neatly outlined to us in a straight forward list. It sort of is like a Conway&amp;rsquo;s Game of Life
scenario in which the current point affects its neighbours.&lt;/p></description></item><item><title>Advent Of Code - Day 10</title><link>https://skarlso.github.io/2021/12/10/aoc-day10/</link><pubDate>Fri, 10 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/10/aoc-day10/</guid><description>&lt;h1 id="advent-of-code---day-10">Advent Of Code - Day 10&lt;/h1>
&lt;p>Again, a bit of breathing time with an easier one. Although, it can be difficult, if you go down the path of trying to do
it via recursion.&lt;/p>
&lt;h2 id="day-10---part-1">Day 10 - Part 1&lt;/h2>
&lt;p>We have to match brackets. There can be a bit of a hassle if you go off on the wrong foot and try to implement it using
recursion. But that works perfectly fine as well. But, there is a more elegant solution in which we just use a stack or
try matching the last by updating it constantly. The stack is a heck of a lot easier. And considering part 2, it&amp;rsquo;s also
more convenient.&lt;/p></description></item><item><title>Advent Of Code - Day 9</title><link>https://skarlso.github.io/2021/12/09/aoc-day9/</link><pubDate>Thu, 09 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/09/aoc-day9/</guid><description>&lt;h1 id="advent-of-code---day-9">Advent Of Code - Day 9&lt;/h1>
&lt;p>This one was an interesting one, and a step up from previous days. I used a BFS here and I have a fantastic link for the
description, usage and appliance of BFS and others like A*. Pop over to &lt;a href="https://www.redblobgames.com/pathfinding/a-star/introduction.html">Red Blog Games&lt;/a> for
all the good stuff. There are fantastic articles about all sorts of path finding and walking algorithms.&lt;/p>
&lt;h2 id="day-9---part-1">Day 9 - Part 1&lt;/h2>
&lt;p>We start off again with something easy. Basically, just walk through a map, and find lowest values in it compared to
neighbors of a cell. Here, we get to know a thing called direction calculation. In Go I have a list of points for that
which will come in handy in other situations. But first, let&amp;rsquo;s parse our input. This time, I actually have a neat little
trick on Go to create a slice of numbers from a slice of string numbers:&lt;/p></description></item><item><title>Advent Of Code - Day 8</title><link>https://skarlso.github.io/2021/12/08/aoc-day8/</link><pubDate>Wed, 08 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/08/aoc-day8/</guid><description>&lt;h1 id="advent-of-code---day-8">Advent Of Code - Day 8&lt;/h1>
&lt;p>If yesterday was a bit of a respite from adventuring, today was the boss fight for which we geared up for. The wall of
text that hit us in the face, nearly depleted all of our HP. Let&amp;rsquo;s hope tomorrow brings some potions.&lt;/p>
&lt;h2 id="day-8---part-1">Day 8 - Part 1&lt;/h2>
&lt;p>We start off relatively easy&amp;hellip; We have to deal with old school number displays that use segments to display numbers.
Luckily, for part one, all we are interested about is to find numbers in the output which are a definitive match
against numbers which are displayed using the segmented display system.&lt;/p></description></item><item><title>Advent Of Code - Day 7</title><link>https://skarlso.github.io/2021/12/07/aoc-day7/</link><pubDate>Tue, 07 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/07/aoc-day7/</guid><description>&lt;h1 id="advent-of-code---day-7">Advent Of Code - Day 7&lt;/h1>
&lt;h2 id="day-7---part-1">Day 7 - Part 1&lt;/h2>
&lt;p>Today we got a bit of respite with an easy one. Sort of like a Dark Souls bonfire.&lt;/p>
&lt;p>&lt;img alt="campfire" loading="lazy" src="https://skarlso.github.io/img/2021/12/07/bonfire.jpeg">&lt;/p>
&lt;p>Let&amp;rsquo;s list our constraints.&lt;/p>
&lt;p>Today, we face a giant whale and some crabs in submarines which are less than effective. If they only move horizontally
I have no idea how they&amp;rsquo;ve gotten as far as you. Maybe they pivot from time to time. Or they are indigenous to this
region only.&lt;/p></description></item><item><title>Advent Of Code - Day 6</title><link>https://skarlso.github.io/2021/12/06/aoc-day6/</link><pubDate>Mon, 06 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/06/aoc-day6/</guid><description>&lt;h1 id="advent-of-code---day-6">Advent Of Code - Day 6&lt;/h1>
&lt;p>Alright. This time, we are going to learn something that AOC does from time to time&amp;hellip; Let&amp;rsquo;s break it down.&lt;/p>
&lt;h2 id="day-6---part-1">Day 6 - Part 1&lt;/h2>
&lt;p>We start off really easy. We venture around in the sea, looking for nothing but trouble. We have our squid friend with
us, whom we were telling everything about vents on the sea floor. Which happen to line up perfectly straight for some
weird reason.&lt;/p></description></item><item><title>Advent Of Code - Day 5</title><link>https://skarlso.github.io/2021/12/05/aoc-day5/</link><pubDate>Sun, 05 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/05/aoc-day5/</guid><description>&lt;h1 id="advent-of-code---day-5">Advent of Code - Day 5&lt;/h1>
&lt;p>Alright. Today, we are going to learn something that will be useful to us in the coming days.&lt;/p>
&lt;p>Let&amp;rsquo;s see what we are dealing with.&lt;/p>
&lt;p>&lt;em>Edit&lt;/em>: An interesting algorithm to read up on is &lt;a href="https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm">Bresenham&amp;rsquo;s line algorithm&lt;/a>.&lt;/p>
&lt;h2 id="day-5---part-1">Day 5 - Part 1&lt;/h2>
&lt;p>We deal with vents today. The sea is a dangerous place after all. Fortunately for us, these vents line up perfectly so
Santa can dodge them easily. We get a bunch of coordinates which form lines basically. The wording is pretty weird, says one
end and the other. But these are just begin and end coordinates in a 2D grid.&lt;/p></description></item><item><title>Advent Of Code - Day 4</title><link>https://skarlso.github.io/2021/12/04/aoc-day4/</link><pubDate>Sat, 04 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/04/aoc-day4/</guid><description>&lt;h1 id="advent-of-code---day-4">Advent of Code - Day 4&lt;/h1>
&lt;p>&lt;strong>Disclaimer&lt;/strong>: There is surely a better solution than this one. But I&amp;rsquo;m fairly okay with this one. And I wrote it, so&amp;hellip;&lt;/p>
&lt;p>Okay, this day was a bit more complex now. But not in understanding what needed to be done, but implementing it. And
then, part two of course.&lt;/p>
&lt;h2 id="day-4---part-1">Day 4 - Part 1&lt;/h2>
&lt;p>We met a squid this day and decided to play a round of Bingo with it. Because, why not? Bingo is a simple game. You have
several papers on which there are a couple numbers in a square. Someone draws a number, and you need to find that number
on your boards, cards, slips, whatevers. Once you have marked 5 numbers in a row, or a column ( or, in the original game
diagonal also goes ) you win.&lt;/p></description></item><item><title>Advent Of Code - Day 3</title><link>https://skarlso.github.io/2021/12/03/aoc-day3/</link><pubDate>Fri, 03 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/03/aoc-day3/</guid><description>&lt;h1 id="advent-of-code---day-3">Advent Of Code - Day 3&lt;/h1>
&lt;p>Here we go for day 3!&lt;/p>
&lt;p>This day was a tiny bit more complex. A lot of more things to read for sure! But all the more exciting!&lt;/p>
&lt;p>Let&amp;rsquo;s get to it!&lt;/p>
&lt;h2 id="day-3---part-1">Day 3 - Part 1&lt;/h2>
&lt;p>We are dealing with binary numbers. At fist glance it can be daunting, but it&amp;rsquo;s actually not that complicated.
We have to find two numbers. &lt;code>gamma rate&lt;/code> and &lt;code>epsilon rate&lt;/code>. To do that, we have to parse some binary numbers
and then convert them to decimal. The two numbers can be found by looking for the most common bit at a given
position in all of the numbers and the least common one at a given position in all of the given numbers. Better
put, as we read on, find the bit that occurs most of the time and the one that occurs least of the time in all
numbers and put them together. That&amp;rsquo;s your new number.&lt;/p></description></item><item><title>Advent Of Code - Day 2</title><link>https://skarlso.github.io/2021/12/02/aoc-day2/</link><pubDate>Thu, 02 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/02/aoc-day2/</guid><description>&lt;h1 id="advent-of-code---day-2">Advent Of Code - Day 2&lt;/h1>
&lt;p>Here we go for day 2!&lt;/p>
&lt;p>These first couple of problems prepare you on how to deal with input mainly. Learn and get used to parsing lines, and
get comfortable with data structures.&lt;/p>
&lt;h2 id="day-2---part-1">Day 2 - Part 1&lt;/h2>
&lt;p>We continue the story of Santa and the submarine. This time, he has the task of trying to steer the thing.
The task is straightforward. You get a couple of instructions and based on a value you increase or decrease a positions.&lt;/p></description></item><item><title>Advent Of Code - Day 1</title><link>https://skarlso.github.io/2021/12/01/aoc-day1/</link><pubDate>Wed, 01 Dec 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/12/01/aoc-day1/</guid><description>&lt;h1 id="advent-of-code---day-1">Advent Of Code - Day 1&lt;/h1>
&lt;p>Since 2015, &lt;a href="https://adventofcode.com/">Advent Of Code&lt;/a> has been a part of my life. I&amp;rsquo;ve done various posts on it already, but this year will be different.
I&amp;rsquo;m going to blog every day every solution, why and how I&amp;rsquo;ve gotten to that solution.&lt;/p>
&lt;p>This isn&amp;rsquo;t going to be ever December, because I&amp;rsquo;m usually unable to solve a problem on a single day in the later days from day 10 or so. It takes more time then I have.
But I will solve all of them. At the time of this writing, I have completed almost all puzzles except for year 2019 which I didn&amp;rsquo;t much enjoy to be honest.&lt;/p></description></item><item><title>Summary of Programmer's Brain</title><link>https://skarlso.github.io/2021/11/27/summary-of-programmers-brain/</link><pubDate>Sat, 27 Nov 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/11/27/summary-of-programmers-brain/</guid><description>&lt;h1 id="prologue">Prologue&lt;/h1>
&lt;p>Hello all.&lt;/p>
&lt;p>This is a summary of the book &lt;a href="https://www.manning.com/books/the-programmers-brain">Programmer&amp;rsquo;s Brain&lt;/a>. Let me begin by saying the book is fantastic and you should definitely read it. The research put into it is phenomenal, and the many linked notes, data and reference make for an amazing and compelling read!&lt;/p>
&lt;p>Not to mention that it is fantastic that someone put actual effort and data into finding out how programmers operate, think and behave. And most of all, how our code behaves and reading, and dealing with code is not just about understanding algorithms and finding the best possible and most optimized code ever.&lt;/p></description></item><item><title>Reader's Digest 2021-07</title><link>https://skarlso.github.io/2021/07/31/readers-digest/</link><pubDate>Sat, 31 Jul 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/07/31/readers-digest/</guid><description>&lt;h1 id="readers-digest">Reader&amp;rsquo;s Digest&lt;/h1>
&lt;p>I thought it would a cool idea if I kept a summary of the things I&amp;rsquo;ve read or listened to on a monthly
basis. Here is July of 2021 so far. Enjoy.&lt;/p>
&lt;h1 id="ultimate-go">Ultimate Go&lt;/h1>
&lt;p>&lt;a href="https://www.amazon.com/Ultimate-Go-Notebook-William-Kennedy/dp/1737384426/ref=sr_1_3?crid=3EYE58E3G0EO3&amp;dchild=1&amp;keywords=go+ultimate+notebook&amp;qid=1630309494&amp;sprefix=go+ultimate+%2Caps%2C244&amp;sr=8-3">This&lt;/a> book is a culmination of Bill Kennedy&amp;rsquo;s &lt;a href="https://www.oreilly.com/library/view/ultimate-go-programming/9780135261651/">Ultimate Go course&lt;/a> and notes
which were spawned from them by &lt;a href="https://hoanhan.co/">Hoanh An&lt;/a>. Bill Kennedy set out to put everything together and create
a notebook which can be read and followed like the personal notes of a student.&lt;/p></description></item><item><title>Reader's Digest 2021-06</title><link>https://skarlso.github.io/2021/06/30/readers-digest/</link><pubDate>Wed, 30 Jun 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/06/30/readers-digest/</guid><description>&lt;h1 id="readers-digest">Reader&amp;rsquo;s Digest&lt;/h1>
&lt;p>I thought it would a cool idea if I kept a summary of the things I&amp;rsquo;ve read or listened to on a monthly
basis. Here is June of 2021 so far. Enjoy.&lt;/p>
&lt;h2 id="hell-divers-6-allegiance">Hell Divers 6: Allegiance&lt;/h2>
&lt;p>I love the Hell Divers series. I listened to this one on audible as always and it was fantastic, as always.
King Xavier Rodriguez. That sounds as bad ass as it is. We follow King Xavier and Rhino, his trusted subordinate into
battle with a new threat called Skin Walkers and of course the machines, the defectors which are trying to kill everyone.
Also, there is now a signal from a possible group of people who are surviving on the surface for more than 200 years!
Xavier hates being king but does anything to keep the peace and humanity alive. Sadly, not all of his people agree to that
especially not after what they did to their people. The people of the metal island, the cannibals are harsh people. And
they don&amp;rsquo;t get along nicely all the time.&lt;/p></description></item><item><title>Blog refactor</title><link>https://skarlso.github.io/2021/05/25/blog-refactor/</link><pubDate>Tue, 25 May 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/05/25/blog-refactor/</guid><description>&lt;h1 id="blog-refactor">Blog Refactor&lt;/h1>
&lt;p>Finally, I went back and fixed a lot of old posts and old code entries. I tried to fix and repair links and images, but some are lost forever on some obscure WordPress blog which I used to use.&lt;/p>
&lt;p>I&amp;rsquo;m glad though that the code is intact and I could re-read a lot of my old stuff. It&amp;rsquo;s interesting to see how much I evolved, how much my writing evolved. I used to write a lot of groovy and python and java and bash and ruby.&lt;/p></description></item><item><title>Reader's Digest 2021-04</title><link>https://skarlso.github.io/2021/04/21/readers-digest/</link><pubDate>Wed, 21 Apr 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/04/21/readers-digest/</guid><description>&lt;h1 id="readers-digest">Reader&amp;rsquo;s Digest&lt;/h1>
&lt;p>I thought it would a cool idea if I kept a summary of the things I&amp;rsquo;ve read or listened to on a monthly
basis. Here is April of 2021 so far. Enjoy.&lt;/p>
&lt;h2 id="invincible">Invincible&lt;/h2>
&lt;p>After seeing it air on Amazon Prime, I had to go and read the comic. It&amp;rsquo;s quite a lot, but I assure you it&amp;rsquo;s worth it.
Some spoiler alerts&amp;hellip;&lt;/p>
&lt;p>Okay, so we follow this guy, Mark Grayson. He&amp;rsquo;s Invincible. He is also and alien, called a Viltrumite. I can hardly
summaries over 3000 pages of comic books so I&amp;rsquo;ll try to be brief.&lt;/p></description></item><item><title>Reader's Digest 2021-03</title><link>https://skarlso.github.io/2021/03/23/readers-digest/</link><pubDate>Tue, 23 Mar 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/03/23/readers-digest/</guid><description>&lt;h1 id="readers-digest">Reader&amp;rsquo;s Digest&lt;/h1>
&lt;p>I thought it would a cool idea if I kept a summary of the things I&amp;rsquo;ve read or listened to on a monthly
basis. Here is March of 2021 so far. Enjoy.&lt;/p>
&lt;h2 id="the-aurora-database-paper">The Aurora Database paper&lt;/h2>
&lt;p>The paper about Aurora database from AWS can be found here: &lt;a href="http://nil.csail.mit.edu/6.824/2020/papers/aurora.pdf">Paper&lt;/a>.
It details the design decision taken to support a highly available, fault tolerant, fast replicating
database. They take the following approach&amp;hellip; They modified mysql database such as that they only send
around the redo log and the redo log is enough to recover / replicate in order to achieve write and
read consistency. They separate the data into Protected Groups and speed up terabytes of recovery by
doing 10 Gigabyte segments in parallel. The database IS the logs. By only replicating the log instead
of the data and the data page, they save millions in networks costs. The main gain however, is that
the storage was modified to understand the application. Instead of using General store they use a storage
which understand the data. In this case, decoupling storage from the database, as so many do, was actually
a drawback.&lt;/p></description></item><item><title>Reader's Digest 2021-01</title><link>https://skarlso.github.io/2021/02/01/readers-digest/</link><pubDate>Mon, 01 Feb 2021 01:01:00 +0100</pubDate><guid>https://skarlso.github.io/2021/02/01/readers-digest/</guid><description>&lt;h1 id="readers-digest">Reader&amp;rsquo;s Digest&lt;/h1>
&lt;p>I thought it would a cool idea if I kept a summary of the things I&amp;rsquo;ve read or listened to on a monthly
basis. Here is January of 2021 so far. Enjoy.&lt;/p>
&lt;h2 id="all-systems-red---murderbot">All systems red - Murderbot&lt;/h2>
&lt;p>This book is SHORT. It&amp;rsquo;s little over 3 hours of listening time. I&amp;rsquo;m listening at 1.30 so it&amp;rsquo;s just short of 2 hours.
But it&amp;rsquo;s entertaining. The murderbot series is following a rouge security bot which hacked its own governor module
and is self aware and free. But&amp;hellip; it kind of hates humans and interacting with them. It just calls itself murderbot
but has no intention of killing all humans. Instead, all its wants to do is basically&amp;hellip; watch movies and various series on something called a Feed. In the first book of the series, this one, we follow Murderbot protect a few humans
that it gets to short of like after an attempt on their lives.&lt;/p></description></item><item><title>How to deploy a Go (Golang) backend with a React frontend separately on Kubernetes - Part One</title><link>https://skarlso.github.io/2020/07/23/kubernetes-deploy-golang-react-apps-separately-part1/</link><pubDate>Thu, 23 Jul 2020 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2020/07/23/kubernetes-deploy-golang-react-apps-separately-part1/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Welcome. This is a longer post about how to deploy a Go backend with a React frontend
on Kubernetes as separate entities. Instead of the usual compiled together single binary Go
application, we are going to separate the two. Why? Because usually a React frontend is just a &amp;ldquo;static&amp;rdquo;
SPA app with very little requirements in terms of resources, while the Go backend does most of the
leg work, requiring a lot more resources.&lt;/p></description></item><item><title>How to do a good code review</title><link>https://skarlso.github.io/2020/05/11/good-code-reviews/</link><pubDate>Mon, 11 May 2020 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2020/05/11/good-code-reviews/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>This time, I would like to talk a little bit about code reviews.&lt;/p>
&lt;p>How do you do code reviews? Don&amp;rsquo;t hesitate to share it in the comments.&lt;/p>
&lt;p>How do I do code reviews? Well read on if you would like to know.&lt;/p>
&lt;h1 id="the-top-down-approach">The Top Down approach&lt;/h1>
&lt;p>If I&amp;rsquo;m dealing with a small code change, a couple of lines here and there in the odd file
first, I&amp;rsquo;ll try to understand why the review is there? What was it trying to achieve? What&amp;rsquo;s
the goal of the change? Is there a ticket/issue I can read for background info? Or an RFC?&lt;/p></description></item><item><title>How to Make SPA refresh work with a Go backend</title><link>https://skarlso.github.io/2020/02/17/making-spa-refresh-work-with-go-backend/</link><pubDate>Mon, 17 Feb 2020 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2020/02/17/making-spa-refresh-work-with-go-backend/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>Today I would like to share a quick &amp;ldquo;fix&amp;rdquo; for a problem I&amp;rsquo;ve seen popping up here and there.&lt;/p>
&lt;p>That is, if you have a react frontend which is a SPA app but you still want refresh to work.
What do I mean by that? Consider the following&amp;hellip;&lt;/p>
&lt;h1 id="the-problem">The problem&lt;/h1>
&lt;p>You have a SPA app with a react router which navigates the user around. The app calls to a backend
api which serves content of some kind. You have the following routes&amp;hellip;. login, signup, reset, archive.&lt;/p></description></item><item><title>Using a Kubernetes based Cluster for Various Services with auto HTTPS - Part 2</title><link>https://skarlso.github.io/2019/10/15/kubernetes-cluster-part2/</link><pubDate>Tue, 15 Oct 2019 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/10/15/kubernetes-cluster-part2/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>This is a continuation of the previous post about my Kubernetes infrastructure located &lt;a href="https://skarlso.github.io/2019/09/21/kubernetes-cluster/">here&lt;/a>. The two remaining points are to deploy Athens Go proxy and setting up monitoring.&lt;/p>
&lt;h1 id="athens">Athens&lt;/h1>
&lt;p>&lt;img alt="Athens" loading="lazy" src="https://skarlso.github.io/img/hosting/athens.png">&lt;/p>
&lt;p>Let&amp;rsquo;s start with &lt;a href="https://github.com/gomods/athens">Athens&lt;/a>.&lt;/p>
&lt;p>First of all if you are a helm user, Athens has an awesome set of helm charts which you can use to deploy it in your cluster.
Located &lt;a href="https://github.com/gomods/athens/tree/master/charts/athens-proxy">here&lt;/a>.&lt;/p>
&lt;p>I prefer to deploy my own config files, but that&amp;rsquo;s me. So here is my preferred way of deploying Athens.&lt;/p></description></item><item><title>Summary of Practical Go workshop from Dave Cheney</title><link>https://skarlso.github.io/2019/10/10/practical-go-summary/</link><pubDate>Thu, 10 Oct 2019 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/10/10/practical-go-summary/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>So there is &lt;a href="https://dave.cheney.net/practical-go/presentations/qcon-china.html">this&lt;/a> workshop from &lt;a href="https://twitter.com/davecheney">Dave Cheney&lt;/a>.&lt;/p>
&lt;p>And I thought I&amp;rsquo;d draw a sort of summary of that workshop.&lt;/p>
&lt;p>&lt;img alt="enjoy" loading="lazy" src="https://skarlso.github.io/img/practical_go.png">&lt;/p>
&lt;p>Right-click-&amp;gt;Open Image for higher resolution.&lt;/p>
&lt;p>Cheers,
Gergely.&lt;/p></description></item><item><title>How I killed my entire Kubernetes cluster</title><link>https://skarlso.github.io/2019/10/01/killing-kubernetes-cluster/</link><pubDate>Tue, 01 Oct 2019 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/10/01/killing-kubernetes-cluster/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>One morning I woke up and tried to access my gitea just to find that it wasn&amp;rsquo;t running.&lt;/p>
&lt;p>&lt;img alt="dead kube" loading="lazy" src="https://skarlso.github.io/img/kube_dead.png">&lt;/p>
&lt;p>I checked my cluster and found that the whole thing was dead as meat. I quickly jumped in and ran &lt;code>k get pods -A&lt;/code> to see what&amp;rsquo;s
going on. None of my services worked.&lt;/p>
&lt;p>What immediately struck my eye was a 100+ pods of my fork_updater cronjob. The fork_updater cronjob which runs once a month, looks
like this:&lt;/p></description></item><item><title>Using a Kubernetes based Cluster for Various Services with auto HTTPS</title><link>https://skarlso.github.io/2019/09/21/kubernetes-cluster/</link><pubDate>Sat, 21 Sep 2019 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/09/21/kubernetes-cluster/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>Today, I would like to show you how my infrastructure is deployed and managed. Spoiler alert, I&amp;rsquo;m using Kubernetes to do that.&lt;/p>
&lt;p>I know&amp;hellip; What a twist!&lt;/p>
&lt;p>Let&amp;rsquo;s get to it.&lt;/p>
&lt;h1 id="what">What&lt;/h1>
&lt;p>&lt;img alt="kube-architecture" loading="lazy" src="https://skarlso.github.io/img/hosting/kube-architecture.png">&lt;/p>
&lt;p>What services am I running exactly? Here is a list I&amp;rsquo;m running at the time of this writing:&lt;/p>
&lt;ul>
&lt;li>Athens Go Proxy&lt;/li>
&lt;li>Gitea&lt;/li>
&lt;li>The Lounge (IRC bouncer)&lt;/li>
&lt;li>Two CronJobs
&lt;ul>
&lt;li>Fork Updater&lt;/li>
&lt;li>IDLE RPG online checker&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>My WebSite (gergelybrautigam.com)&lt;/li>
&lt;li>Monitoring&lt;/li>
&lt;/ul>
&lt;p>And it&amp;rsquo;s really simple to add more.&lt;/p></description></item><item><title>Updated Face-recog architecture drawing</title><link>https://skarlso.github.io/2019/09/19/updated-face-recog-drawing/</link><pubDate>Thu, 19 Sep 2019 13:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/09/19/updated-face-recog-drawing/</guid><description>&lt;p>I had a lot of fun using &lt;a href="https://procreate.art">Procreate&lt;/a> to re-draw the architecture image I&amp;rsquo;ve drawn for my distribute face recognition application detailed in this post &lt;a href="https://skarlso.github.io/2018/03/15/kubernetes-distributed-application/">Distributed Face-Recognition App&lt;/a>.&lt;/p>
&lt;p>Without much fanfare, here is the drawing:&lt;/p>
&lt;p>&lt;img alt="kube_architecture.png" loading="lazy" src="https://skarlso.github.io/img/kube/kube_architecture.png">&lt;/p>
&lt;p>Thanks,
Gergely.&lt;/p></description></item><item><title>Efferent and Afferent metrics in Go</title><link>https://skarlso.github.io/2019/04/21/efferent-and-afferent-metrics-in-go/</link><pubDate>Sun, 21 Apr 2019 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/04/21/efferent-and-afferent-metrics-in-go/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks!&lt;/p>
&lt;p>Today I would like to write about a metric that I read in a book called Clean Architecture from Robert Cecil Martin ( Uncle Bob ).&lt;/p>
&lt;h1 id="abstract">Abstract&lt;/h1>
&lt;p>The metrics I mean are &lt;a href="https://en.wikipedia.org/wiki/Software_package_metrics">Efferent&lt;/a> and &lt;a href="https://en.wikipedia.org/wiki/Software_package_metrics">Afferent&lt;/a> coupling in packages. So you, dear reader, don&amp;rsquo;t have to navigate away from this page, here are the descriptions pasted in:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Afferent couplings (Ca): The number of classes in other packages that depend upon classes within the package is an indicator of the package&amp;rsquo;s responsibility. Afferent couplings signal inward. (Affected by this package) (Fan-In).&lt;/p></description></item><item><title>Living with a new Parser for a year</title><link>https://skarlso.github.io/2019/04/12/living-with-a-parser/</link><pubDate>Fri, 12 Apr 2019 08:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/04/12/living-with-a-parser/</guid><description>Living with a Parser</description></item><item><title>Deploy a Hugo Blog Github Actions</title><link>https://skarlso.github.io/2019/03/19/deploy-hugo-blog-github-actions/</link><pubDate>Tue, 19 Mar 2019 22:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/03/19/deploy-hugo-blog-github-actions/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>Today I thought I show you how you can use &lt;a href="https://github.com/features/actions">Github Actions&lt;/a> to deploy a hugo based blog like this one.&lt;/p>
&lt;p>Let&amp;rsquo;s dive in.&lt;/p>
&lt;h1 id="actions">Actions&lt;/h1>
&lt;p>What are actions? If you read the above linked document they are basically steps performed in containers based on some events that happened with your repository. Events can be such as pushing, creating a PR or creating/closing an issue etc.&lt;/p>
&lt;p>We need an even on a push.&lt;/p></description></item><item><title>Cronohub: Archive from anywhere to anywhere</title><link>https://skarlso.github.io/2019/03/19/cronohub/</link><pubDate>Tue, 19 Mar 2019 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/03/19/cronohub/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Good afternoon folks.&lt;/p>
&lt;p>Today, I would like to talk a little bit about &lt;a href="https://github.com/cronohub/cronohub">Cronohub&lt;/a>. It&amp;rsquo;s a Python application
which you can use to archive anything from anywhere to anywhere. It uses plugins to archive this versatility.&lt;/p>
&lt;p>Let me show you some of its features.&lt;/p>
&lt;h1 id="main-usage">Main Usage&lt;/h1>
&lt;p>Cronohub is a python application which uses the power and ease of usage of Python to give the user a
framework. This Framework can then be used to implement concrete functionality in the form of plugins.&lt;/p></description></item><item><title>Deploy a Hugo Blog with Travis on Git Push</title><link>https://skarlso.github.io/2019/03/18/hugo-blog-with-travis-deployment/</link><pubDate>Mon, 18 Mar 2019 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/03/18/hugo-blog-with-travis-deployment/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>I&amp;rsquo;ve been using the Hugo build for wercker for a long time now. Recent problems occurred though where I did not understand at first
what the problem was. It was quite difficult to debug since I did not have too much insight on the wercker build itself. Turned
out that I deleted the GITHUB token that the process was using. However, the error message was telling me that a function failed
to load some other function. Which was totally unrelated.&lt;/p></description></item><item><title>Go SSH with Host Key Verification</title><link>https://skarlso.github.io/2019/02/17/go-ssh-with-host-key-verification/</link><pubDate>Sun, 17 Feb 2019 21:01:00 +0100</pubDate><guid>https://skarlso.github.io/2019/02/17/go-ssh-with-host-key-verification/</guid><description>Go SSH with Host Key Verification</description></item><item><title>Extensive tutorial on go-plugin.</title><link>https://skarlso.github.io/2018/10/29/go-plugin-tutorial/</link><pubDate>Mon, 29 Oct 2018 07:01:00 +0100</pubDate><guid>https://skarlso.github.io/2018/10/29/go-plugin-tutorial/</guid><description>go-plugin tutorial</description></item><item><title>Furnace with a new Plugin System</title><link>https://skarlso.github.io/2018/09/17/furnace-plugin-update/</link><pubDate>Mon, 17 Sep 2018 07:01:00 +0100</pubDate><guid>https://skarlso.github.io/2018/09/17/furnace-plugin-update/</guid><description>Furnace plugins</description></item><item><title>TOTP generator with account handling for multiple tokens</title><link>https://skarlso.github.io/2018/09/13/gotp/</link><pubDate>Thu, 13 Sep 2018 08:01:00 +0100</pubDate><guid>https://skarlso.github.io/2018/09/13/gotp/</guid><description>Gotp</description></item><item><title>Keep your git forks updated all the time</title><link>https://skarlso.github.io/2018/06/08/fork-updater/</link><pubDate>Fri, 08 Jun 2018 08:01:00 +0100</pubDate><guid>https://skarlso.github.io/2018/06/08/fork-updater/</guid><description>Keep your git forks updated</description></item><item><title>Kubernetes distributed application deployment with sample Face Recognition App</title><link>https://skarlso.github.io/2018/03/15/kubernetes-distributed-application/</link><pubDate>Thu, 15 Mar 2018 23:01:00 +0100</pubDate><guid>https://skarlso.github.io/2018/03/15/kubernetes-distributed-application/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Alright folks. Settle in and get comfortable. This is going to be a long, but hopefully, fun ride.&lt;/p>
&lt;p>I&amp;rsquo;m going to deploy a distributed application with &lt;a href="https://kubernetes.io/">Kubernetes&lt;/a>. I attempted to create an application that I thought resembled a real world app. Obviously I had to cut some corners due to time and energy constraints.&lt;/p>
&lt;p>My focus will be on Kubernetes and deployment.&lt;/p>
&lt;p>Shall we delve right in?&lt;/p>
&lt;h1 id="the-application">The Application&lt;/h1>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>&lt;img alt="kube overview" loading="lazy" src="https://skarlso.github.io/img/kube_overview.png">&lt;/p></description></item><item><title>Go Budapest Meetup</title><link>https://skarlso.github.io/2018/02/06/go-budapest-meetup/</link><pubDate>Tue, 06 Feb 2018 23:01:00 +0100</pubDate><guid>https://skarlso.github.io/2018/02/06/go-budapest-meetup/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>So I was at &lt;a href="https://www.meetup.com/go-budapest">Go Budapest Meetup&lt;/a> yesterday, where the brilliant &lt;a href="https://jbrandhorst.com/">Johan Brandhorst&lt;/a>
gave a talk about his project based on &lt;a href="https://grpc.io/">gRPC&lt;/a> using &lt;a href="https://github.com/improbable-eng/grpc-web">gRPC-web&lt;/a> +
&lt;a href="https://github.com/gopherjs/gopherjs">GopherJS&lt;/a> + &lt;a href="https://github.com/google/protobuf">protobuf&lt;/a>. He also has some Go
contributions and check out his project here: &lt;a href="https://github.com/johanbrandhorst/protobuf">Protobuf&lt;/a>. It&amp;rsquo;s GopherJS Bindings for
ProtobufJS and gRPC-Web.&lt;/p>
&lt;p>It was interesting to see where these projects could lead and I see the potential in them. I liked the usage of Protobuf and gRPC,
I don&amp;rsquo;t have THAT much experience with them. However after yesterday, I&amp;rsquo;m eager to find an excuse to do something with these libraries.
I used gRPC indirectly, well, the result of it, when dealing with Google Cloud Platform&amp;rsquo;s API. Which is largely generated code through
gRPC and protobuf.&lt;/p></description></item><item><title>Ansible + Nginx + LetsEncrypt + Wiki + Nagios</title><link>https://skarlso.github.io/2018/01/23/nginx-certbot-ansible/</link><pubDate>Tue, 23 Jan 2018 22:34:00 +0100</pubDate><guid>https://skarlso.github.io/2018/01/23/nginx-certbot-ansible/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>Today, I would like demonstrate how to use &lt;a href="https://www.ansible.com/">Ansible&lt;/a> in order to construct a server hosting multiple HTTPS domains with &lt;a href="https://www.nginx.com/">Nginx&lt;/a> and &lt;a href="https://letsencrypt.org/">LetsEncrypt&lt;/a>. Are you ready? Let&amp;rsquo;s dive in.&lt;/p>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>&lt;img alt="playbook" loading="lazy" src="https://skarlso.github.io/img/ansible.svg">&lt;/p>
&lt;h2 id="what-you-will-need">What you will need&lt;/h2>
&lt;p>There is really only one thing you need in order for this to work and that is Ansible. If you would like to run local tests without a remote server, than you will need &lt;a href="https://www.vagrantup.com/">Vagrant&lt;/a> and &lt;a href="https://www.virtualbox.org/wiki/Downloads">VirtualBox&lt;/a>. But those two are optional.&lt;/p></description></item><item><title>Huge Furnace Update</title><link>https://skarlso.github.io/2018/01/13/furnace-massive-update/</link><pubDate>Sat, 13 Jan 2018 22:34:00 +0100</pubDate><guid>https://skarlso.github.io/2018/01/13/furnace-massive-update/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>In the past couple of months I&amp;rsquo;ve been slowly updating &lt;a href="https://github.com/Skarlso/go-furnace">Furnace&lt;/a>.&lt;/p>
&lt;p>There are three major changes that happened. Let&amp;rsquo;s take a look at them, shall we?&lt;/p>
&lt;h2 id="google-cloud-platform">Google Cloud Platform&lt;/h2>
&lt;p>Furnace now supports &lt;a href="https://cloud.google.com">Google Cloud Platform (GCP)&lt;/a>. It provides the same API to handle GCP resource as with AWS. Namely, &lt;code>create&lt;/code>, &lt;code>delete&lt;/code>, &lt;code>status&lt;/code>, &lt;code>update&lt;/code>. I opted to leave out &lt;code>push&lt;/code> because Google mostly works with git based repositories, meaning a push is literary just a push, than Google handles distributing the new code by itself.&lt;/p></description></item><item><title>Commit-Build-Deploy With AWS CodeBuild and Lambda</title><link>https://skarlso.github.io/2017/12/04/commit-build-deploy/</link><pubDate>Mon, 04 Dec 2017 22:34:00 +0100</pubDate><guid>https://skarlso.github.io/2017/12/04/commit-build-deploy/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi All.&lt;/p>
&lt;p>Today I would like to write about an AWS finger practice.&lt;/p>
&lt;p>Previously, I wrote about how I build and deploy my blog with &lt;a href="www.wercker.com">Wercker&lt;/a>. Since, I&amp;rsquo;m a cloud engineer and I dislike Oracle and it&amp;rsquo;s ever expending tenctacles into the abyss, I wanted to switch to use something else.&lt;/p>
&lt;p>My build and deploy cycle is simple.&lt;/p>
&lt;p>Commit to Blogsource Repo -&amp;gt; Wercker WebHook -&amp;gt; Builds my blog using Hugo -&amp;gt; Pushed to a Different Repository which my Github Blog.&lt;/p></description></item><item><title>Furnace Ikea Manual</title><link>https://skarlso.github.io/2017/11/06/furnace-ikea-manual/</link><pubDate>Mon, 06 Nov 2017 20:34:00 +0100</pubDate><guid>https://skarlso.github.io/2017/11/06/furnace-ikea-manual/</guid><description>&lt;p>Hi there folks.&lt;/p>
&lt;p>Just a quick post, of how I went on and created an IKEA manual about &lt;a href="https://github.com/Skarlso/go-furnace">Furnace&lt;/a>.&lt;/p>
&lt;p>Page 1: &lt;img alt="Page 1" loading="lazy" src="https://skarlso.github.io/img/ikea-furnace-1.png">.
Page 2: &lt;img alt="Page 2" loading="lazy" src="https://skarlso.github.io/img/ikea-furnace-2.png">.&lt;/p>
&lt;p>I drew these using &lt;a href="https://krita.org/en/">Krita&lt;/a>. I mostly used a mouse but I also used a Wacom Bamboo drawing tabled, for sketches and such.&lt;/p>
&lt;p>Thanks,
Gergely.&lt;/p></description></item><item><title>Furnace Binaries</title><link>https://skarlso.github.io/2017/09/03/furnace-binaries/</link><pubDate>Sun, 03 Sep 2017 10:34:00 +0100</pubDate><guid>https://skarlso.github.io/2017/09/03/furnace-binaries/</guid><description>&lt;p>Hey folks.&lt;/p>
&lt;p>Quick note. Furnace now comes pre-compiled easy to access binaries which you can download and use out of the box.&lt;/p>
&lt;p>No need to install anything, or compile the source. Just download, unzip and use.&lt;/p>
&lt;p>Here is the website: &lt;a href="https://skarlso.github.io/furnace-web">Furnace Website&lt;/a>.&lt;/p>
&lt;p>Enjoy,
Cheers,
Gergely.&lt;/p></description></item><item><title>Notetaking</title><link>https://skarlso.github.io/2017/05/31/notetaking/</link><pubDate>Wed, 31 May 2017 06:23:00 +0100</pubDate><guid>https://skarlso.github.io/2017/05/31/notetaking/</guid><description>&lt;p>&lt;img alt="Page1" loading="lazy" src="https://skarlso.github.io/img/page1.jpeg">&lt;/p>
&lt;p>&lt;img alt="Page2" loading="lazy" src="https://skarlso.github.io/img/page2.jpeg">&lt;/p></description></item><item><title>Replacing Eval with Object.send and a self written Parser</title><link>https://skarlso.github.io/2017/05/28/replace-eval-with-object-send-and-a-parser/</link><pubDate>Sun, 28 May 2017 19:23:00 +0100</pubDate><guid>https://skarlso.github.io/2017/05/28/replace-eval-with-object-send-and-a-parser/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>A while ago, I was added as a curator for a Gem called &lt;a href="https://github.com/joshbuddy/jsonpath">JsonPath&lt;/a>. It&amp;rsquo;s a small but very useful and brilliant gem. It had a couple of problems which I fixed, but the hardest to eliminate proved to be a series of evals throughout the code.&lt;/p>
&lt;p>You could opt in using &lt;code>eval&lt;/code> with a constructor parameter, but generally, it was considered to be unsafe. Thus, normally when a project was using it, like &lt;a href="https://github.com/huginn/huginn">Huginn&lt;/a> they had to opt out by default, thus missing out on sweet parsing like this: &lt;code>$..book[?(@['price'] &amp;gt; 20)]&lt;/code>.&lt;/p></description></item><item><title>Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 4</title><link>https://skarlso.github.io/2017/04/16/building-furnace-part-4/</link><pubDate>Sun, 16 Apr 2017 09:23:00 +0100</pubDate><guid>https://skarlso.github.io/2017/04/16/building-furnace-part-4/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>Previously on this blog: &lt;a href="https://skarlso.github.io/2017/03/16/building-furnace-part-1/">Part 1&lt;/a>. &lt;a href="https://skarlso.github.io/2017/03/19/building-furnace-part-2/">Part 2&lt;/a>. &lt;a href="https://skarlso.github.io/2017/03/22/building-furnace-part-3/">Part 3&lt;/a>.&lt;/p>
&lt;p>In this part we are going to talk about Unit Testing Furnace and how to work some magic with AWS and Go.&lt;/p>
&lt;h1 id="mock-stub-fake-dummy-canned-insert-name-here">Mock Stub Fake Dummy Canned &lt;Insert Name Here>&lt;/h1>
&lt;p>Unit testing in Go usually follows the Dependency Injection model of dealing with Mocks and Stubs.&lt;/p>
&lt;p>## DI&lt;/p>
&lt;p>Dependency Inject in short is one object supplying the dependencies of another object. In a longer description, it&amp;rsquo;s ideal to be used
for removing the lock on a third party library, like the AWS client. Imaging having code which solely depends on the AWS client. How
would you unit test that code without having to ACTUALLY connect to AWS? You couldn&amp;rsquo;t. Every time you try to test the code it would run
the live code and it would try and connect to AWS and perform the operations it&amp;rsquo;s design to do. The Ruby library with it&amp;rsquo;s metaprogramming
allows you to set the client globally to stub responses, but, alas, this is not the world of Ruby.&lt;/p></description></item><item><title>Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 3</title><link>https://skarlso.github.io/2017/03/22/building-furnace-part-3/</link><pubDate>Wed, 22 Mar 2017 12:03:00 +0100</pubDate><guid>https://skarlso.github.io/2017/03/22/building-furnace-part-3/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>Previously on this blog: &lt;a href="http://skarlso.github.io/2017/03/16/building-furnace-part-1/">Part 1&lt;/a>. &lt;a href="https://skarlso.github.io/2017/03/19/building-furnace-part-2/">Part 2&lt;/a>. &lt;a href="https://skarlso.github.io/2017/04/16/building-furnace-part-4/">Part 4&lt;/a>.&lt;/p>
&lt;p>In this part, I&amp;rsquo;m going to talk about the experimental plugin system of Furnace.&lt;/p>
&lt;h1 id="go-experimental-plugins">Go Experimental Plugins&lt;/h1>
&lt;p>Since Go 1.8 was released, an exciting and new feature was introduced called a Plug-in system. This system works with dynamic
libraries built with a special switch to &lt;code>go build&lt;/code>. These libraries, &lt;code>.so&lt;/code> or &lt;code>.dylib&lt;/code> (later), are than loaded and once that
succeeds, specific functions can be called from them (symbol resolution).&lt;/p></description></item><item><title>Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 2</title><link>https://skarlso.github.io/2017/03/19/building-furnace-part-2/</link><pubDate>Sun, 19 Mar 2017 12:03:00 +0100</pubDate><guid>https://skarlso.github.io/2017/03/19/building-furnace-part-2/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>Previously on this blog: &lt;a href="https://skarlso.github.io/2017/03/16/building-furnace-part-1/">Part 1&lt;/a>, &lt;a href="https://skarlso.github.io/2017/03/22/building-furnace-part-3/">Part 3&lt;/a>, &lt;a href="https://skarlso.github.io/2017/04/16/building-furnace-part-4/">Part 4&lt;/a>&lt;/p>
&lt;p>In this part, I&amp;rsquo;m going to talk about the AWS Go SDK and begin do dissect the intricacies of Furnace.&lt;/p>
&lt;h1 id="aws-sdk">AWS SDK&lt;/h1>
&lt;p>Fortunately, the Go SDK for AWS is quiet verbose and littered with examples of all sorts. But that doesn&amp;rsquo;t make it less complex
and less cryptic at times. I&amp;rsquo;m here to lift some of the early confusions, in hopes that I can help someone to avoid wasting time.&lt;/p></description></item><item><title>Testing new Hugo if posts are generated properly</title><link>https://skarlso.github.io/2017/03/17/test-new-hugo/</link><pubDate>Fri, 17 Mar 2017 09:09:00 +0100</pubDate><guid>https://skarlso.github.io/2017/03/17/test-new-hugo/</guid><description>&lt;p>Testing.&lt;/p></description></item><item><title>Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 1</title><link>https://skarlso.github.io/2017/03/16/building-furnace-part-1/</link><pubDate>Thu, 16 Mar 2017 21:49:00 +0100</pubDate><guid>https://skarlso.github.io/2017/03/16/building-furnace-part-1/</guid><description>&lt;h1 id="other-posts">Other posts:&lt;/h1>
&lt;p>&lt;a href="https://skarlso.github.io/2017/03/19/building-furnace-part-2/">Part 2&lt;/a>, &lt;a href="https://skarlso.github.io/2017/03/22/building-furnace-part-3/">Part 3&lt;/a>, &lt;a href="https://skarlso.github.io/2017/04/16/building-furnace-part-4/">Part 4&lt;/a>.&lt;/p>
&lt;h1 id="building-furnace-part-1">Building Furnace: Part 1&lt;/h1>
&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>This is the first part of a 4 part series which talks about the process of building a middlish sized project in Go,
with AWS. Including Unit testing and a experimental plugin feature.&lt;/p>
&lt;p>The first part will talk about the AWS services used in brief and will contain a basic description for those who are not familiar
with them. The second part will talk about the Go SDK and the project structure itself, how it can be used, improved, and how it can
help in everyday life. The third part will talk about the experimental plugin system, and finally, we will tackle unit testing AWS
in Go.&lt;/p></description></item><item><title>Images on older posts</title><link>https://skarlso.github.io/2017/03/03/images-on-old-posts/</link><pubDate>Fri, 03 Mar 2017 18:20:00 +0100</pubDate><guid>https://skarlso.github.io/2017/03/03/images-on-old-posts/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>Just a quick headsup, that older posts and images, may have been lost unfortunately, because I made the terrible mistake, when I
migrated over from my old blog, that I forgot to download all the images from the remote host.&lt;/p>
&lt;p>For lack of options, I deleted the images. :/ Sorry for the inconvencience!&lt;/p>
&lt;p>Gergely.&lt;/p></description></item><item><title>How to HTTPS with Hugo LetsEncrypt and HAProxy</title><link>https://skarlso.github.io/2017/02/15/how-to-https-with-hugo-letsencrypt-haproxy/</link><pubDate>Wed, 15 Feb 2017 19:20:00 +0100</pubDate><guid>https://skarlso.github.io/2017/02/15/how-to-https-with-hugo-letsencrypt-haproxy/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi folks.&lt;/p>
&lt;p>Today, I would like to write about how to do HTTPS for a website, without the need to buy a certificate and set it up via your DNS provider. Let&amp;rsquo;s begin.&lt;/p>
&lt;h2 id="abstract">Abstract&lt;/h2>
&lt;p>What you will achieve by the end of this post:&lt;/p>
&lt;ul>
&lt;li>Every call to HTTP will be redirected to HTTPS via &lt;a href="https://www.haproxy.com">haproxy&lt;/a>.&lt;/li>
&lt;li>HTTPS will be served with Haproxy and &lt;a href="https://letsencrypt.org">LetsEncrypt&lt;/a> as the Certificate provider.&lt;/li>
&lt;li>Automatically update the certificate before its expiration.&lt;/li>
&lt;li>No need for IPTable rules to route 8080 to 80.&lt;/li>
&lt;li>Traffic to and from your page will be encrypted.&lt;/li>
&lt;li>This all will cost you nothing.&lt;/li>
&lt;/ul>
&lt;p>I will use a static website generator for this called &lt;a href="https://gohugo.io">Hugo&lt;/a> which, if you know me, is my favorite generator tool. These instructions
are for haproxy and hugo, if you wish to use apache and nginx for example, you&amp;rsquo;ll have to dig for the corresponding settings for letsencrypt and certbot.&lt;/p></description></item><item><title>How to do Google Sign-In with Go - Part 2</title><link>https://skarlso.github.io/2016/11/02/google-signin-with-go-part2/</link><pubDate>Wed, 02 Nov 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/11/02/google-signin-with-go-part2/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hi Folks.&lt;/p>
&lt;p>This is a follow up on my previous post about Google Sign-In. In this post we will discover what to do with the information retrieved in the first encounter, which you can find here: &lt;a href="http://skarlso.github.io/2016/06/12/google-signin-with-go/">Google Sign-In Part 1&lt;/a>.&lt;/p>
&lt;h1 id="forewords">Forewords&lt;/h1>
&lt;h2 id="the-project">The Project&lt;/h2>
&lt;p>Everything I did in the first post, and that I&amp;rsquo;m going to do in this example, can be found in this project: &lt;a href="https://github.com/Skarlso/google-oauth-go-sample">Google-OAuth-Go-Sample&lt;/a>.&lt;/p>
&lt;p>Just to recap, we left off previously on the point where we successfully obtained information about the user, with a secure token and a session initiated with them. Google nicely enough provided us with some details which we can use. This information was in JSON format and looked something like this:&lt;/p></description></item><item><title>RScrap scraper</title><link>https://skarlso.github.io/2016/10/06/rscrap-ruby-scraping-with-cronjob-scripts/</link><pubDate>Thu, 06 Oct 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/10/06/rscrap-ruby-scraping-with-cronjob-scripts/</guid><description>&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Hey folks.&lt;/p>
&lt;p>So, there is this project called &lt;a href="https://github.com/cantino/huginn">Huginn&lt;/a> which I absolutely love.&lt;/p>
&lt;p>But the thing is, that for a couple of scrappers ( at least for me ), I don&amp;rsquo;t want to spin up a whole rails app.&lt;/p>
&lt;p>Hence, I&amp;rsquo;ve come up with &lt;a href="https://github.com/Skarlso/rscrap">RScrap&lt;/a>. Which is a bunch of Ruby scripts run as cron jobs on a raspberry pi. And because I dislike emails as well, and most of the time, I don&amp;rsquo;t read them, I opted for a nicer solution. Enter the world of &lt;a href="https://telegram.org">Telegram&lt;/a>. They provide you with the ability to create bots. You basically get an API key, and than using that key, you can send private messages, or even create an interactive bot which you can send messages too.&lt;/p></description></item><item><title>Budget Home Theather with a Headless Raspberry Pi and Flirc for Remote Controlling</title><link>https://skarlso.github.io/2016/09/17/simple-hometheater-with-remote-and-flirc/</link><pubDate>Sat, 17 Sep 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/09/17/simple-hometheater-with-remote-and-flirc/</guid><description>&lt;h2 id="intro">Intro&lt;/h2>
&lt;p>Hello folks.&lt;/p>
&lt;p>Today, I would like to tell you about my configuration for a low budget Home Theater setup.&lt;/p>
&lt;p>My tools are as follows:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://flirc.tv/">FLIRC&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.raspberrypi.org/products/raspberry-pi-2-model-b/">Raspberry Pi 2&lt;/a>&lt;/li>
&lt;li>500G SSD&lt;/li>
&lt;li>An a good &amp;lsquo;ol wifi&lt;/li>
&lt;/ul>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Use Flirc for remote control, &lt;code>omxplayer&lt;/code> for streaming the movie from an SSD on a headless PI controller via SSH and enjoy a nice, cold Lemon - Menta beer.&lt;/p>
&lt;h2 id="flirc">Flirc&lt;/h2>
&lt;p>First, the remote control. So, I like to sit in my couch and watch the movie from there. I hate getting up, or having a keyboard at arm length to control the pi. Flirc is a very easy way of doing just that with a simple remote control.&lt;/p></description></item><item><title>Always Go with []byte</title><link>https://skarlso.github.io/2016/08/19/always-go-with-bytes/</link><pubDate>Fri, 19 Aug 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/08/19/always-go-with-bytes/</guid><description>&lt;p>&lt;em>Update&lt;/em>: This post ignored the fact that this works for utf-8 characters only. Characters which are stored on more than 1 byte
will cause trouble. Look at this &lt;a href="https://go.dev/doc/effective_go#for">Effective Go Example&lt;/a>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">pos&lt;/span>, &lt;span style="color:#a6e22e">char&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#e6db74">&amp;#34;日本\x80語&amp;#34;&lt;/span> { &lt;span style="color:#75715e">// \x80 is an illegal UTF-8 encoding
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Printf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;character %#U starts at byte position %d\n&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">char&lt;/span>, &lt;span style="color:#a6e22e">pos&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Prints:&lt;/p>
&lt;pre tabindex="0">&lt;code>character U+65E5 &amp;#39;日&amp;#39; starts at byte position 0
character U+672C &amp;#39;本&amp;#39; starts at byte position 3
character U+FFFD &amp;#39;�&amp;#39; starts at byte position 6
character U+8A9E &amp;#39;語&amp;#39; starts at byte position 7
&lt;/code>&lt;/pre>&lt;p>Keep this in mind when working with strings.&lt;/p></description></item><item><title>Global variable for never changing regex</title><link>https://skarlso.github.io/2016/08/16/never-changing-regex/</link><pubDate>Tue, 16 Aug 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/08/16/never-changing-regex/</guid><description>&lt;p>Quick reminder. If you have a never changing regex in Go, do NOT put it into a frequently called function. ALWAYS put it into a global variable. I&amp;rsquo;ll show you why.&lt;/p>
&lt;p>Benchmark for code with a variable in a frequently called function:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>BenchmarkNumber-8 30000 &lt;span style="color:#ae81ff">41633&lt;/span> ns/op
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>BenchmarkAreaCode-8 50000 &lt;span style="color:#ae81ff">27736&lt;/span> ns/op
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>BenchmarkFormat-8 50000 &lt;span style="color:#ae81ff">29263&lt;/span> ns/op
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>PASS
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ok _/phone-number 5.110s
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Benchmark for code with the same variable outside in a global scope:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>BenchmarkNumber-8 300000 &lt;span style="color:#ae81ff">5618&lt;/span> ns/op
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>BenchmarkAreaCode-8 500000 &lt;span style="color:#ae81ff">3884&lt;/span> ns/op
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>BenchmarkFormat-8 300000 &lt;span style="color:#ae81ff">4696&lt;/span> ns/op
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>PASS
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ok _/phone-number 5.197s
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Notice the magnitude change in ns/op! That&amp;rsquo;s something to keep an eye out for.&lt;/p></description></item><item><title>Drupal missing ToolBar and settings not saving</title><link>https://skarlso.github.io/2016/08/13/drupal-missing-toolbar-and-settings-not-saving/</link><pubDate>Sat, 13 Aug 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/08/13/drupal-missing-toolbar-and-settings-not-saving/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>Quick gotcha, when working with Drupal. If you just freshly installed it, and everything seems to work fine, and yet you are experiencing things like, the admin toolbar is randomly disappearing, or configuration is not saved; than you might not have modrewrite enabled on your apache server.&lt;/p>
&lt;p>Because, by default, Drupal has clean url enabled, that needs URL rewriting on apache.&lt;/p>
&lt;p>So, step one.&lt;/p>
&lt;p>Have this in your .htaccess file:&lt;/p></description></item><item><title>Jenkins Best Practices Talk</title><link>https://skarlso.github.io/2016/07/28/jenkins-best-practices/</link><pubDate>Thu, 28 Jul 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/07/28/jenkins-best-practices/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>I wanted to take the time to share with you a talk that I recently did.&lt;/p>
&lt;p>The slides and the source I used, can be found here: &lt;a href="https://github.com/Skarlso/jenkinsbestpractices">Github&lt;/a>.&lt;/p>
&lt;p>And then, there is also a docker image which contains all the plugins, job configurations and all the practices which I did during the talk. Please feel free to have a go with it. &lt;a href="https://hub.docker.com/r/skarlso/jenkinsbestpractices">DockerHub - Jenkins Best Practices&lt;/a>.&lt;/p>
&lt;p>For easy access and reading, here are the slides on Slideshare: &lt;a href="http://www.slideshare.net/GergelyBrautigam/jenkins-best-practices-meetup-slides">Jenkins Best Practices Slides&lt;/a>.&lt;/p></description></item><item><title>Ruby Sieve</title><link>https://skarlso.github.io/2016/07/12/ruby-sieve/</link><pubDate>Tue, 12 Jul 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/07/12/ruby-sieve/</guid><description>&lt;p>Though it could be done better, I&amp;rsquo;m sure, but I&amp;rsquo;m actually pretty satisfied with this one. It loops only twice as opposed to filtered ranges and whatnot other solutions to the sieve. I was thinking of rather creating a list and deleting elements from it, but that&amp;rsquo;s already three loops.&lt;/p>
&lt;p>Maybe I&amp;rsquo;ll do a benchmark later on more solutions.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-ruby" data-lang="ruby">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Sieve contains a function to return a set of primes&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">Sieve&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">initialize&lt;/span>(n)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> @n &lt;span style="color:#f92672">=&lt;/span> n
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">end&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># Returns a list of primes up to a certain limit&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># @param n limit&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># @return list of primes&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">primes&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> marked &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#f92672">[]&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> primes &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#f92672">[]&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#ae81ff">2&lt;/span>&lt;span style="color:#f92672">..&lt;/span>@n)&lt;span style="color:#f92672">.&lt;/span>each &lt;span style="color:#66d9ef">do&lt;/span> &lt;span style="color:#f92672">|&lt;/span>e&lt;span style="color:#f92672">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">unless&lt;/span> marked&lt;span style="color:#f92672">.&lt;/span>include?(e)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> primes&lt;span style="color:#f92672">.&lt;/span>push e
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (e&lt;span style="color:#f92672">..&lt;/span>@n)&lt;span style="color:#f92672">.&lt;/span>step(e) { &lt;span style="color:#f92672">|&lt;/span>s&lt;span style="color:#f92672">|&lt;/span> marked&lt;span style="color:#f92672">.&lt;/span>push s }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">end&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">end&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> primes
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">end&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">end&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Cheers,
Gergely.&lt;/p></description></item><item><title>Simple hook to rid of trouble</title><link>https://skarlso.github.io/2016/07/12/simple-hook-to-rid-of-trouble/</link><pubDate>Tue, 12 Jul 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/07/12/simple-hook-to-rid-of-trouble/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>This is but a simple git hook to run a test in order to ensure you can push. It also ignores the vendor folder if you happen to have on in your directory.&lt;/p>
&lt;p>Edit the file under &lt;code>.git/hooks/pre-push.sample&lt;/code> and add this at the end before the &lt;code>exit 0&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>go test &lt;span style="color:#66d9ef">$(&lt;/span>go list ./... |grep -v vendor&lt;span style="color:#66d9ef">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>RESULT&lt;span style="color:#f92672">=&lt;/span>$?
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#f92672">[&lt;/span> $RESULT -ne &lt;span style="color:#ae81ff">0&lt;/span> &lt;span style="color:#f92672">]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> echo &lt;span style="color:#e6db74">&amp;#34;Failed test run. Disallowing push.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> exit &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>After this, rename the file to &lt;code>pre-push&lt;/code> removing the .sample from it.&lt;/p></description></item><item><title>How to do Google sign-in with Go</title><link>https://skarlso.github.io/2016/06/12/google-signin-with-go/</link><pubDate>Sun, 12 Jun 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/06/12/google-signin-with-go/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>Today, I would like to write up a step - by - step guide with a sample web app on how to do Google Sign-In and authorization.&lt;/p></description></item><item><title>Minecraft world automatic backup to AWS S3 bucket - Part 2 (Custom functions)</title><link>https://skarlso.github.io/2016/04/17/minecraft-server-aws-s3-backup-part2/</link><pubDate>Sun, 17 Apr 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/04/17/minecraft-server-aws-s3-backup-part2/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>Got an update for the backup script. This time, you&amp;rsquo;ll have the ability to implement your own upload capabilities. I provide a mock implementation for the required functions.&lt;/p>
&lt;p>Here is the script again, now modified and a bit cleaned up. I hope it&amp;rsquo;s helpful.&lt;/p></description></item><item><title>Minecraft world automatic backup to AWS S3 bucket</title><link>https://skarlso.github.io/2016/04/16/minecraft-server-aws-s3-backup/</link><pubDate>Sat, 16 Apr 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/04/16/minecraft-server-aws-s3-backup/</guid><description>&lt;p>Hi Folks.&lt;/p>
&lt;p>Previously we created a Minecraft server using Docker. After my server got popular in the family, and a lot of stuff started to pile up on it, as a good IT person, I&amp;rsquo;m backing up the world once in a while.&lt;/p>
&lt;p>For that, I&amp;rsquo;m using AWS S3 with the CLI and a little bash script which runs once a week.&lt;/p>
&lt;p>The script is really straightforward. I&amp;rsquo;m doing manual versioning, although S3 does provide one out of the box. However, amazon&amp;rsquo;s S3 versioning doesn&amp;rsquo;t allow limiting the number of versions being kept. And since I&amp;rsquo;m doing that anyways, might as well take care of the rest.&lt;/p></description></item><item><title>Minecraft Server with Docker on OSX + Mods</title><link>https://skarlso.github.io/2016/03/29/minecraft-server-with-docker-and-osx/</link><pubDate>Tue, 29 Mar 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/03/29/minecraft-server-with-docker-and-osx/</guid><description>&lt;p>Hi Folks.&lt;/p>
&lt;h1 id="intro">Intro&lt;/h1>
&lt;p>Today, I wanted to write about how to create a secure server in a container. Ideally, you don&amp;rsquo;t want to run your server on your own machine. Running it in a container gives you a much needed control and an extra layer of security.&lt;/p>
&lt;h1 id="docker-on-osx">Docker On OSX&lt;/h1>
&lt;p>While on a mac, you have a couple of options to run docker.&lt;/p>
&lt;h2 id="docker-machine">Docker-Machine&lt;/h2>
&lt;p>&lt;a href="https://docs.docker.com/machine/">Docker-Machine&lt;/a>&lt;/p>
&lt;p>Docker machine is very simple. It just creates a Linux vm in the background on the given driver, for us it will be &lt;a href="https://www.virtualbox.org/">VirtualBox&lt;/a>. Network, Memory and port-forwarding can all be managed through the VM directly. Then running and starting it is trivial through &lt;code>docker-machine start&lt;/code>.&lt;/p></description></item><item><title>Wercker Fixed</title><link>https://skarlso.github.io/2016/03/09/wercker-fixed/</link><pubDate>Wed, 09 Mar 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/03/09/wercker-fixed/</guid><description>&lt;p>Hi Folks.&lt;/p>
&lt;p>So Wercker was not working. After a minor modification it seems to be okay now. The config file needed for it to work looks like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>box: golang
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>build:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> steps:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - arjen/hugo-build:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> theme: redlounge
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>deploy:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> steps:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - install-packages:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> packages: git
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - leipert/git-push:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> gh_oauth: $GIT_TOKEN
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> repo: skarlso/skarlso.github.io
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> branch: master
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> basedir: public
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The modification is the box type to &lt;em>golang&lt;/em> and removed &lt;em>ssh-client&lt;/em> from &lt;em>packages&lt;/em>.&lt;/p></description></item><item><title>Wercker Test</title><link>https://skarlso.github.io/2016/03/04/wercker-test-2/</link><pubDate>Fri, 04 Mar 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/03/04/wercker-test-2/</guid><description>&lt;h2 id="basics">Basics&lt;/h2>
&lt;p>This is a wercker Test.&lt;/p></description></item><item><title>Hugo Autodeploy with Wercker and Github - Pages</title><link>https://skarlso.github.io/2016/02/10/hugo-autodeploy-with-wercker/</link><pubDate>Wed, 10 Feb 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/02/10/hugo-autodeploy-with-wercker/</guid><description>&lt;p>There already is a nice tutorial on how to create github-pages with Hugo &lt;a href="https://gohugo.io/tutorials/github-pages-blog/">Here&lt;/a> if you prefer deplying your pages to a different branch on the same repo. There is also a post about Wercker and Hugo &lt;a href="https://gohugo.io/tutorials/automated-deployments/">Here&lt;/a> deploying pages to said separate branch.&lt;/p>
&lt;p>However, I took an easier approach on the matter with a completely separate branch for my blog source and my compiled github pages.&lt;/p>
&lt;p>This blog sits here: &lt;a href="https://github.com/Skarlso/skarlso.github.io">https://github.com/Skarlso/skarlso.github.io&lt;/a>. In order to deploy to it, I just have to commit a new blog post to this repository: &lt;a href="https://github.com/Skarlso/blogsource">Blog Source&lt;/a>. After that, &lt;a href="http://wercker.com/">Wercker&lt;/a> takes care of the rest. It builds my blog, and pushes the generated pages to my blog&amp;rsquo;s repository to the master branch without creating the gh-pages branch.&lt;/p></description></item><item><title>Wercker Test</title><link>https://skarlso.github.io/2016/02/10/wercker-test/</link><pubDate>Wed, 10 Feb 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/02/10/wercker-test/</guid><description>&lt;h2 id="basics">Basics&lt;/h2>
&lt;p>This is a wercker Test.&lt;/p></description></item><item><title>Doing CORS in Go with Gin and JSON</title><link>https://skarlso.github.io/2016/02/02/doing-cors-in-go-with-gin-and-json/</link><pubDate>Tue, 02 Feb 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/02/02/doing-cors-in-go-with-gin-and-json/</guid><description>&lt;h2 id="basics">Basics&lt;/h2>
&lt;p>Hello folks.&lt;/p>
&lt;p>This will be a quick post about how to do CORS with jQuery, Gin in Go with a very simple ajax GET and Json.&lt;/p>
&lt;p>I&amp;rsquo;m choosing JSON here because basically I don&amp;rsquo;t really like JSONP. And actually, it&amp;rsquo;s not very complicated to do CORS, it&amp;rsquo;s just hidden enough so that it doesn&amp;rsquo;t become transparent.&lt;/p>
&lt;p>First, what is CORS? It&amp;rsquo;s Cross-Platform Resource Sharing. It has been invented so that without your explicit authorization in the header of a request, Javascript can&amp;rsquo;t reach outside of your domain and be potentially harmful to your visitors.&lt;/p></description></item><item><title>My Journey in advent of code</title><link>https://skarlso.github.io/2016/01/22/my-journey-in-advent-of-code/</link><pubDate>Fri, 22 Jan 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/01/22/my-journey-in-advent-of-code/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>I wanted to share with you my tale of working through the problems with &lt;a href="http://adventofcode.com">Advent Of Code&lt;/a>.&lt;/p>
&lt;p>It is a nice tale and there are a few things I learned from it, especially in Go, since I used that solve all of the problems. So, let&amp;rsquo;s get started.&lt;/p>
&lt;h1 id="solving-the-problems">Solving the problems&lt;/h1>
&lt;p>The most important lesson I learned while doing these exercises was, how to solve these problems. A couple of them were simple enough to not have to over think it, but most of them got very tricky. I could have gone with a brute force attempt, but as we see later, that wasn&amp;rsquo;t always a very good solution. And people who used that, actually just got lucky finding their solutions.&lt;/p></description></item><item><title>Improving performance with byte slice and int map</title><link>https://skarlso.github.io/2016/01/05/improving-performance-with-byte-slice-and-int-map/</link><pubDate>Tue, 05 Jan 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/01/05/improving-performance-with-byte-slice-and-int-map/</guid><description>&lt;p>Hello Folks.&lt;/p>
&lt;p>Today I would like to share with you my little tale of refactoring my solution to &lt;a href="http://adventofcode.com/day/13">Advent Of Code Day 13&lt;/a>.&lt;/p>
&lt;p>It&amp;rsquo;s a lovely tale of action, adventure, drama, and comedy.&lt;/p>
&lt;p>Let&amp;rsquo;s being with my first iteration of the problem.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> (
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;bufio&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;math&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;os&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;strconv&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;strings&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;github.com/skarlso/goutils/arrayutils&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">seatingCombinations&lt;/span> = make([][]&lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#ae81ff">0&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">table&lt;/span> = make(&lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">string&lt;/span>][]&lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">string&lt;/span>]&lt;span style="color:#66d9ef">int&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">keys&lt;/span> = make([]&lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#ae81ff">0&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Person a person
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">Person&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// neighbour *Person
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">name&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">like&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">file&lt;/span>, &lt;span style="color:#a6e22e">_&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">os&lt;/span>.&lt;span style="color:#a6e22e">Open&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;input.txt&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">defer&lt;/span> &lt;span style="color:#a6e22e">file&lt;/span>.&lt;span style="color:#a6e22e">Close&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">scanner&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">bufio&lt;/span>.&lt;span style="color:#a6e22e">NewScanner&lt;/span>(&lt;span style="color:#a6e22e">file&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">scanner&lt;/span>.&lt;span style="color:#a6e22e">Scan&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">line&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">scanner&lt;/span>.&lt;span style="color:#a6e22e">Text&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">split&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">strings&lt;/span>.&lt;span style="color:#a6e22e">Split&lt;/span>(&lt;span style="color:#a6e22e">line&lt;/span>, &lt;span style="color:#e6db74">&amp;#34; &amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">like&lt;/span>, &lt;span style="color:#a6e22e">_&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">strconv&lt;/span>.&lt;span style="color:#a6e22e">Atoi&lt;/span>(&lt;span style="color:#a6e22e">split&lt;/span>[&lt;span style="color:#ae81ff">3&lt;/span>]) &lt;span style="color:#75715e">//If lose -&amp;gt; * -1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">split&lt;/span>[&lt;span style="color:#ae81ff">2&lt;/span>] &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#e6db74">&amp;#34;lose&amp;#34;&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">like&lt;/span> &lt;span style="color:#f92672">*=&lt;/span> &lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">table&lt;/span>[&lt;span style="color:#a6e22e">split&lt;/span>[&lt;span style="color:#ae81ff">0&lt;/span>]] = append(&lt;span style="color:#a6e22e">table&lt;/span>[&lt;span style="color:#a6e22e">split&lt;/span>[&lt;span style="color:#ae81ff">0&lt;/span>]], &lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">string&lt;/span>]&lt;span style="color:#66d9ef">int&lt;/span>{&lt;span style="color:#a6e22e">strings&lt;/span>.&lt;span style="color:#a6e22e">Trim&lt;/span>(&lt;span style="color:#a6e22e">split&lt;/span>[&lt;span style="color:#ae81ff">10&lt;/span>], &lt;span style="color:#e6db74">&amp;#34;.&amp;#34;&lt;/span>): &lt;span style="color:#a6e22e">like&lt;/span>})
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> !&lt;span style="color:#a6e22e">arrayutils&lt;/span>.&lt;span style="color:#a6e22e">ContainsString&lt;/span>(&lt;span style="color:#a6e22e">keys&lt;/span>, &lt;span style="color:#a6e22e">split&lt;/span>[&lt;span style="color:#ae81ff">0&lt;/span>]) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">keys&lt;/span> = append(&lt;span style="color:#a6e22e">keys&lt;/span>, &lt;span style="color:#a6e22e">split&lt;/span>[&lt;span style="color:#ae81ff">0&lt;/span>])
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">generatePermutation&lt;/span>(&lt;span style="color:#a6e22e">keys&lt;/span>, len(&lt;span style="color:#a6e22e">keys&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Best seating efficiency:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">calculateSeatingEfficiancy&lt;/span>())
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">generatePermutation&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span> []&lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">n&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">n&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">news&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> make([]&lt;span style="color:#66d9ef">string&lt;/span>, len(&lt;span style="color:#a6e22e">s&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> copy(&lt;span style="color:#a6e22e">news&lt;/span>, &lt;span style="color:#a6e22e">s&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">seatingCombinations&lt;/span> = append(&lt;span style="color:#a6e22e">seatingCombinations&lt;/span>, &lt;span style="color:#a6e22e">news&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span> &amp;lt; &lt;span style="color:#a6e22e">n&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">++&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>], &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">n&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>] = &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">n&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>], &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">generatePermutation&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span>, &lt;span style="color:#a6e22e">n&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>], &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">n&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>] = &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">n&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>], &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">calculateSeatingEfficiancy&lt;/span>() &lt;span style="color:#66d9ef">int&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">bestSeating&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">math&lt;/span>.&lt;span style="color:#a6e22e">MinInt64&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">v&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">seatingCombinations&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">calculatedOrder&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">left&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> (&lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">-&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>) &lt;span style="color:#f92672">%&lt;/span> len(&lt;span style="color:#a6e22e">v&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">//This is to work around the fact that in Go
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#75715e">//modulo of a negative number will not return a positive number.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#75715e">//So -1 % 4 will not return 3 but -1. In that case we add length.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">left&lt;/span> &amp;lt; &lt;span style="color:#ae81ff">0&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">left&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> len(&lt;span style="color:#a6e22e">v&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">right&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> (&lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>) &lt;span style="color:#f92672">%&lt;/span> len(&lt;span style="color:#a6e22e">v&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// fmt.Printf(&amp;#34;Left: %d; Right: %d\n&amp;#34;, left, right)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">leftLike&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">getLikeForTargetConnect&lt;/span>(&lt;span style="color:#a6e22e">v&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>], &lt;span style="color:#a6e22e">v&lt;/span>[&lt;span style="color:#a6e22e">left&lt;/span>])
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">rightLike&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">getLikeForTargetConnect&lt;/span>(&lt;span style="color:#a6e22e">v&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>], &lt;span style="color:#a6e22e">v&lt;/span>[&lt;span style="color:#a6e22e">right&lt;/span>])
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// fmt.Printf(&amp;#34;Name: %s; Left:%d; Right:%d\n&amp;#34;, v[i], leftLike, rightLike)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">calculatedOrder&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">leftLike&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#a6e22e">rightLike&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// fmt.Printf(&amp;#34;Order for: %v; Calc:%d\n&amp;#34;, v, calculatedOrder)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">calculatedOrder&lt;/span> &amp;gt; &lt;span style="color:#a6e22e">bestSeating&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">bestSeating&lt;/span> = &lt;span style="color:#a6e22e">calculatedOrder&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">bestSeating&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">getLikeForTargetConnect&lt;/span>(&lt;span style="color:#a6e22e">name&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">neighbour&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) &lt;span style="color:#66d9ef">int&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">neighbours&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">table&lt;/span>[&lt;span style="color:#a6e22e">name&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">t&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">neighbours&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span>, &lt;span style="color:#a6e22e">ok&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">t&lt;/span>[&lt;span style="color:#a6e22e">neighbour&lt;/span>]; &lt;span style="color:#a6e22e">ok&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is quiet large. And takes a bit of explaining. So what is happening here? We are putting the names which correspond with numbers and neighbours into a map which has a map as a value. The map contains seating information for a person. For example, next to Alice, a bunch of people can sit, and they have a certain relationship to Alice, represented by a number.&lt;/p></description></item><item><title>Byte arrays and Channels</title><link>https://skarlso.github.io/2016/01/01/byte-arrays-and-channels/</link><pubDate>Fri, 01 Jan 2016 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2016/01/01/byte-arrays-and-channels/</guid><description>&lt;p>Hi folks and a Happy new Year!&lt;/p>
&lt;p>Today, I would like to show you some interesting things you can do with channels. Consider the following simple example.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> &lt;span style="color:#e6db74">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">generatedPassword&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> make(&lt;span style="color:#66d9ef">chan&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>, &lt;span style="color:#ae81ff">100&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">correctPassword&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> make(&lt;span style="color:#66d9ef">chan&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">defer&lt;/span> close(&lt;span style="color:#a6e22e">generatedPassword&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">defer&lt;/span> close(&lt;span style="color:#a6e22e">correctPassword&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">go&lt;/span> &lt;span style="color:#a6e22e">passwordIncrement&lt;/span>(&lt;span style="color:#a6e22e">generatedPassword&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">go&lt;/span> &lt;span style="color:#a6e22e">checkPassword&lt;/span>(&lt;span style="color:#a6e22e">generatedPassword&lt;/span>, &lt;span style="color:#a6e22e">correctPassword&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">pass&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span>&lt;span style="color:#a6e22e">correctPassword&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#a6e22e">pass&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">checkPassword&lt;/span>(&lt;span style="color:#a6e22e">input&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span>&lt;span style="color:#66d9ef">chan&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>, &lt;span style="color:#a6e22e">output&lt;/span> &lt;span style="color:#66d9ef">chan&lt;/span>&lt;span style="color:#f92672">&amp;lt;-&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">p&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span>&lt;span style="color:#a6e22e">input&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">//Introduce lengthy operation here
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#75715e">// time.Sleep(time.Second)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Checking p:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">p&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">p&lt;/span> &amp;gt; &lt;span style="color:#ae81ff">100000&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">output&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span> &lt;span style="color:#a6e22e">p&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">passwordIncrement&lt;/span>(&lt;span style="color:#a6e22e">out&lt;/span> &lt;span style="color:#66d9ef">chan&lt;/span>&lt;span style="color:#f92672">&amp;lt;-&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">p&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">p&lt;/span>&lt;span style="color:#f92672">++&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">out&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span> &lt;span style="color:#a6e22e">p&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The premise is as follows. It launches two go routines. One, which generates passwords, and an other which checks for validity. The two routines talk to each other through the channel &lt;code>generatedPassword&lt;/code>. That&amp;rsquo;s the providing connections between them. The channel &lt;code>correctPassword&lt;/code> provides output for the &lt;code>checkPassword&lt;/code> routine.&lt;/p></description></item><item><title>Use Byte Array Instead of Strings</title><link>https://skarlso.github.io/2015/12/29/use-byte-array-instead-of-strings/</link><pubDate>Tue, 29 Dec 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/12/29/use-byte-array-instead-of-strings/</guid><description>&lt;p>Hello Folks.&lt;/p>
&lt;p>This is just a quick post on the topic and a reminder for myself and everybody to ALWAYS USE []BYTE INSTEAD OF STRINGS.&lt;/p>
&lt;p>[]Byte is marginally faster than a simple Strings. In fact, I would say using []byte should be the standard instead of strings.&lt;/p>
&lt;p>Sample code:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">solutions&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> &lt;span style="color:#e6db74">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> (
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">//INPUT input
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">INPUT&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;1321131112&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">//LIMIT limit
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">LIMIT&lt;/span> = &lt;span style="color:#ae81ff">50&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//LookAndSay translates numbers according to Look and Say algo
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">LookAndSay&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">c&lt;/span> &lt;span style="color:#66d9ef">chan&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">charCount&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">look&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> &amp;lt; len(&lt;span style="color:#a6e22e">s&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>] &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>] {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">charCount&lt;/span>&lt;span style="color:#f92672">++&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#66d9ef">else&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">look&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Sprintf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;%d%s&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">charCount&lt;/span>, string(&lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>]))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">charCount&lt;/span> = &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#66d9ef">else&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">look&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Sprintf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;%d%s&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">charCount&lt;/span>, string(&lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>]))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">c&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span> &lt;span style="color:#a6e22e">look&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//GetLengthOfLookAndSay Retrieve the Length of a lookandsay done Limit times
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">GetLengthOfLookAndSay&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">c&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> make(&lt;span style="color:#66d9ef">chan&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#ae81ff">0&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">go&lt;/span> &lt;span style="color:#a6e22e">LookAndSay&lt;/span>(&lt;span style="color:#a6e22e">INPUT&lt;/span>, &lt;span style="color:#a6e22e">c&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">finalString&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span>&lt;span style="color:#a6e22e">c&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">&amp;lt;=&lt;/span> &lt;span style="color:#a6e22e">LIMIT&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">2&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">++&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">go&lt;/span> &lt;span style="color:#a6e22e">LookAndSay&lt;/span>(&lt;span style="color:#a6e22e">finalString&lt;/span>, &lt;span style="color:#a6e22e">c&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">finalString&lt;/span> = &lt;span style="color:#f92672">&amp;lt;-&lt;/span>&lt;span style="color:#a6e22e">c&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// fmt.Println(finalString)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Lenght of final String:&amp;#34;&lt;/span>, len(&lt;span style="color:#a6e22e">finalString&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This, with the limit raised to 50 run for ~1 hour. Even with the routines although they were just for show since they had to wait for each others input.&lt;/p></description></item><item><title>Use Byte Slice Instead of Strings</title><link>https://skarlso.github.io/2015/12/29/use-byte-slice-instead-of-strings/</link><pubDate>Tue, 29 Dec 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/12/29/use-byte-slice-instead-of-strings/</guid><description>&lt;p>Hello Folks.&lt;/p>
&lt;p>This is just a quick post on the topic and a reminder for myself and everybody to ALWAYS USE []BYTE INSTEAD OF STRINGS.&lt;/p>
&lt;p>[]Byte is marginally faster than a simple Strings. In fact, I would say using []byte should be the standard instead of strings.&lt;/p>
&lt;p>Sample code:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">solutions&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> &lt;span style="color:#e6db74">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> (
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">//INPUT input
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">INPUT&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;1321131112&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">//LIMIT limit
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">LIMIT&lt;/span> = &lt;span style="color:#ae81ff">50&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//LookAndSay translates numbers according to Look and Say algo
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">LookAndSay&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">c&lt;/span> &lt;span style="color:#66d9ef">chan&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">charCount&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">look&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> &amp;lt; len(&lt;span style="color:#a6e22e">s&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>] &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>] {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">charCount&lt;/span>&lt;span style="color:#f92672">++&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#66d9ef">else&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">look&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Sprintf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;%d%s&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">charCount&lt;/span>, string(&lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>]))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">charCount&lt;/span> = &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#66d9ef">else&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">look&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Sprintf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;%d%s&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">charCount&lt;/span>, string(&lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>]))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">c&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span> &lt;span style="color:#a6e22e">look&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//GetLengthOfLookAndSay Retrieve the Length of a lookandsay done Limit times
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">GetLengthOfLookAndSay&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">c&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> make(&lt;span style="color:#66d9ef">chan&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#ae81ff">0&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">go&lt;/span> &lt;span style="color:#a6e22e">LookAndSay&lt;/span>(&lt;span style="color:#a6e22e">INPUT&lt;/span>, &lt;span style="color:#a6e22e">c&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">finalString&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span>&lt;span style="color:#a6e22e">c&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">&amp;lt;=&lt;/span> &lt;span style="color:#a6e22e">LIMIT&lt;/span>&lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">2&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">++&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">go&lt;/span> &lt;span style="color:#a6e22e">LookAndSay&lt;/span>(&lt;span style="color:#a6e22e">finalString&lt;/span>, &lt;span style="color:#a6e22e">c&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">finalString&lt;/span> = &lt;span style="color:#f92672">&amp;lt;-&lt;/span>&lt;span style="color:#a6e22e">c&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// fmt.Println(finalString)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Lenght of final String:&amp;#34;&lt;/span>, len(&lt;span style="color:#a6e22e">finalString&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This, with the limit raised to 50 run for ~1 hour. Even with the routines although they were just for show since they had to wait for each others input.&lt;/p></description></item><item><title>Recursive Letter Frequency Count</title><link>https://skarlso.github.io/2015/12/23/recursive-freq-count/</link><pubDate>Wed, 23 Dec 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/12/23/recursive-freq-count/</guid><description>&lt;p>Hello everybody!&lt;/p>
&lt;p>I wanted to do a sort post about word frequency count. I did it many times now and I was curious as how a recursive solution would perform as opposed to looping.&lt;/p>
&lt;p>So I wrote it up quickly and added a few benchmarks with different sized data.&lt;/p>
&lt;p>First&amp;hellip;. The code:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">freqMap&lt;/span> = make(&lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">string&lt;/span>]&lt;span style="color:#66d9ef">int&lt;/span>, &lt;span style="color:#ae81ff">0&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">countLettersRecursive&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) &lt;span style="color:#66d9ef">string&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> len(&lt;span style="color:#a6e22e">s&lt;/span>) &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">freqMap&lt;/span>[string(&lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#ae81ff">0&lt;/span>])]&lt;span style="color:#f92672">++&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">countLettersRecursive&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span>[&lt;span style="color:#ae81ff">1&lt;/span>:])
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">countLettersLoop&lt;/span>(&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">v&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">freqMap&lt;/span>[string(&lt;span style="color:#a6e22e">v&lt;/span>)]&lt;span style="color:#f92672">++&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Very simple. The first run with a small sample: &amp;ldquo;asdfasdfasdfasdfasdf&amp;rdquo;&lt;/p></description></item><item><title>Go Development Environment</title><link>https://skarlso.github.io/2015/12/08/go-development-environment/</link><pubDate>Tue, 08 Dec 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/12/08/go-development-environment/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Here is a little something I&amp;rsquo;ve put together, since I&amp;rsquo;m doing it a lot.&lt;/p>
&lt;p>&lt;a href="https://github.com/Skarlso/godevelopment">Go Development Environment&lt;/a>&lt;/p>
&lt;p>If I have a project I&amp;rsquo;d like to contribute, like &lt;a href="https://gohugo.io">GoHugo&lt;/a>, I have to setup a development environment, because most of the times, I&amp;rsquo;m on a Mac. And on OSX things work differently. I like to work in a Linux environment since that&amp;rsquo;s what most of the projects are built on.&lt;/p>
&lt;p>So here you go. Just download the files, and say &lt;strong>vagrant up&lt;/strong> which will do the magic.&lt;/p></description></item><item><title>Welcome To My New Blog</title><link>https://skarlso.github.io/2015/12/07/welcome-to-my-new-blog/</link><pubDate>Mon, 07 Dec 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/12/07/welcome-to-my-new-blog/</guid><description>&lt;h1 id="hello-folks">Hello Folks&lt;/h1>
&lt;p>Welcome to my new blog. I decided to move away for a number of reasons, but setting up a static page blog site is very cool if you don&amp;rsquo;t directly use a database. Since posts are just posts and I have a different way of hosting images, this really was just a matter of time.&lt;/p>
&lt;p>And &lt;a href="https://gohugo.io/">Hugo&lt;/a> / Github pages provided the tools which made this move possible.&lt;/p>
&lt;p>Also, I love writing this post in Markdown. I always liked the formatting rules of it, so this is quiet the blast.&lt;/p></description></item><item><title>Go JIRA API client</title><link>https://skarlso.github.io/2015/11/20/go-jira-api-client/</link><pubDate>Fri, 20 Nov 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/11/20/go-jira-api-client/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>So, I was playing around and created a client for JIRA written in Go. It was nice to do some JSON transformation. And sending POSTS was really trivial.&lt;/p>
&lt;p>It&amp;rsquo;s still in it&amp;rsquo;s infancy and I have a couple of more features I want to implement, but, here is the code.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> (
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;bytes&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;encoding/json&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;flag&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;io/ioutil&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;log&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;net/http&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;os&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;github.com/BurntSushi/toml&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">configFile&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;~/.jira_config.toml&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">parameter&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">flags&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Comment&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Description&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">IssueKey&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Priority&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Resolution&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Title&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Project&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Issue is a representation of a Jira Issue
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">Issue&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Fields&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Project&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Key&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> &lt;span style="color:#e6db74">`json:&amp;#34;key&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#e6db74">`json:&amp;#34;project&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Summary&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> &lt;span style="color:#e6db74">`json:&amp;#34;summary&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Description&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> &lt;span style="color:#e6db74">`json:&amp;#34;description&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Issuetype&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Name&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> &lt;span style="color:#e6db74">`json:&amp;#34;name&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#e6db74">`json:&amp;#34;issuetype&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Priority&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">ID&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> &lt;span style="color:#e6db74">`json:&amp;#34;id&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#e6db74">`json:&amp;#34;priority&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#e6db74">`json:&amp;#34;fields&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Transition defines a transition json object. Used for starting, stoppinp
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//generally for state stranfer
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">Transition&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Fields&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Resolution&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Name&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> &lt;span style="color:#e6db74">`json:&amp;#34;name&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#e6db74">`json:&amp;#34;resolution&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#e6db74">`json:&amp;#34;fields&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Transition&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">ID&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> &lt;span style="color:#e6db74">`json:&amp;#34;id&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#e6db74">`json:&amp;#34;transition&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Credentials a representation of a JIRA config which helds API permissions
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">Credentials&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Username&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Password&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">URL&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">init&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">StringVar&lt;/span>(&lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Comment&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;m&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Default Comment&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;A Comment when changing the status of an Issue.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">StringVar&lt;/span>(&lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Description&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;d&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Default Description&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Provide a description for a newly created Issue.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">StringVar&lt;/span>(&lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Priority&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;p&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;2&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;The priority of an Issue which will be set.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">StringVar&lt;/span>(&lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">IssueKey&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;k&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Issue key of an issue.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">StringVar&lt;/span>(&lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Resolution&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;r&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Done&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Resolution when an issue is closed. Ex.: Done, Fixed, Won&amp;#39;t fix.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">StringVar&lt;/span>(&lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Title&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;t&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Default Title&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Title of an Issue.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">StringVar&lt;/span>(&lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Project&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;o&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;IT&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Define a Project to create a ticket in.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">Parse&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">cred&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Credentials&lt;/span>) &lt;span style="color:#a6e22e">initConfig&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">os&lt;/span>.&lt;span style="color:#a6e22e">Stat&lt;/span>(&lt;span style="color:#a6e22e">configFile&lt;/span>); &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatalf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Error using config file: %v&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">toml&lt;/span>.&lt;span style="color:#a6e22e">DecodeFile&lt;/span>(&lt;span style="color:#a6e22e">configFile&lt;/span>, &lt;span style="color:#a6e22e">cred&lt;/span>); &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatal&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Error during decoding toml config: &amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> len(&lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">Args&lt;/span>()) &amp;lt; &lt;span style="color:#ae81ff">1&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatal&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Please provide an action to take. Usage information:&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">parameter&lt;/span> = &lt;span style="color:#a6e22e">flag&lt;/span>.&lt;span style="color:#a6e22e">Arg&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">switch&lt;/span> &lt;span style="color:#a6e22e">parameter&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">case&lt;/span> &lt;span style="color:#e6db74">&amp;#34;close&amp;#34;&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">closeIssue&lt;/span>(&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">IssueKey&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">case&lt;/span> &lt;span style="color:#e6db74">&amp;#34;start&amp;#34;&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">startIssue&lt;/span>(&lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">IssueKey&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">case&lt;/span> &lt;span style="color:#e6db74">&amp;#34;create&amp;#34;&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">createIssue&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">closeIssue&lt;/span>(&lt;span style="color:#a6e22e">issueKey&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">issueKey&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&amp;#34;&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatal&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Please provide an issueID with -k&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Closing issue number: &amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">issueKey&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">trans&lt;/span> &lt;span style="color:#a6e22e">Transition&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">//TODO: Add the ability to define a comment for the close reason
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">trans&lt;/span>.&lt;span style="color:#a6e22e">Fields&lt;/span>.&lt;span style="color:#a6e22e">Resolution&lt;/span>.&lt;span style="color:#a6e22e">Name&lt;/span> = &lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Resolution&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">trans&lt;/span>.&lt;span style="color:#a6e22e">Transition&lt;/span>.&lt;span style="color:#a6e22e">ID&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;2&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">marhsalledTrans&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">json&lt;/span>.&lt;span style="color:#a6e22e">Marshal&lt;/span>(&lt;span style="color:#a6e22e">trans&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatal&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Error occured when marshaling transition: &amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Marshalled:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">trans&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">sendRequest&lt;/span>(&lt;span style="color:#a6e22e">marhsalledTrans&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;POST&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">issueKey&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#e6db74">&amp;#34;/transitions?expand=transitions.fields&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">startIssue&lt;/span>(&lt;span style="color:#a6e22e">issueID&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">issueID&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&amp;#34;&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatal&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Please provide an issueID with -i&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Starting issue number:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">issueID&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">createIssue&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Creating new issue.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">issue&lt;/span> &lt;span style="color:#a6e22e">Issue&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">issue&lt;/span>.&lt;span style="color:#a6e22e">Fields&lt;/span>.&lt;span style="color:#a6e22e">Description&lt;/span> = &lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Description&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">issue&lt;/span>.&lt;span style="color:#a6e22e">Fields&lt;/span>.&lt;span style="color:#a6e22e">Priority&lt;/span>.&lt;span style="color:#a6e22e">ID&lt;/span> = &lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Priority&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">issue&lt;/span>.&lt;span style="color:#a6e22e">Fields&lt;/span>.&lt;span style="color:#a6e22e">Summary&lt;/span> = &lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Title&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">issue&lt;/span>.&lt;span style="color:#a6e22e">Fields&lt;/span>.&lt;span style="color:#a6e22e">Project&lt;/span>.&lt;span style="color:#a6e22e">Key&lt;/span> = &lt;span style="color:#a6e22e">flags&lt;/span>.&lt;span style="color:#a6e22e">Project&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">issue&lt;/span>.&lt;span style="color:#a6e22e">Fields&lt;/span>.&lt;span style="color:#a6e22e">Issuetype&lt;/span>.&lt;span style="color:#a6e22e">Name&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;Task&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">marshalledIssue&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">json&lt;/span>.&lt;span style="color:#a6e22e">Marshal&lt;/span>(&lt;span style="color:#a6e22e">issue&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatal&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Error occured when Marshaling Issue:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">sendRequest&lt;/span>(&lt;span style="color:#a6e22e">marshalledIssue&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;POST&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">sendRequest&lt;/span>(&lt;span style="color:#a6e22e">jsonStr&lt;/span> []&lt;span style="color:#66d9ef">byte&lt;/span>, &lt;span style="color:#a6e22e">method&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">url&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">cred&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">Credentials&lt;/span>{}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">cred&lt;/span>.&lt;span style="color:#a6e22e">initConfig&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Json:&amp;#34;&lt;/span>, string(&lt;span style="color:#a6e22e">jsonStr&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">req&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">http&lt;/span>.&lt;span style="color:#a6e22e">NewRequest&lt;/span>(&lt;span style="color:#a6e22e">method&lt;/span>, &lt;span style="color:#a6e22e">cred&lt;/span>.&lt;span style="color:#a6e22e">URL&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#a6e22e">url&lt;/span>, &lt;span style="color:#a6e22e">bytes&lt;/span>.&lt;span style="color:#a6e22e">NewBuffer&lt;/span>(&lt;span style="color:#a6e22e">jsonStr&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">req&lt;/span>.&lt;span style="color:#a6e22e">Header&lt;/span>.&lt;span style="color:#a6e22e">Set&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Content-Type&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;application/json&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">req&lt;/span>.&lt;span style="color:#a6e22e">SetBasicAuth&lt;/span>(&lt;span style="color:#a6e22e">cred&lt;/span>.&lt;span style="color:#a6e22e">Username&lt;/span>, &lt;span style="color:#a6e22e">cred&lt;/span>.&lt;span style="color:#a6e22e">Password&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">client&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">http&lt;/span>.&lt;span style="color:#a6e22e">Client&lt;/span>{}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">resp&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">client&lt;/span>.&lt;span style="color:#a6e22e">Do&lt;/span>(&lt;span style="color:#a6e22e">req&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> panic(&lt;span style="color:#a6e22e">err&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">defer&lt;/span> &lt;span style="color:#a6e22e">resp&lt;/span>.&lt;span style="color:#a6e22e">Body&lt;/span>.&lt;span style="color:#a6e22e">Close&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;response Status:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">resp&lt;/span>.&lt;span style="color:#a6e22e">Status&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;response Headers:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">resp&lt;/span>.&lt;span style="color:#a6e22e">Header&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">body&lt;/span>, &lt;span style="color:#a6e22e">_&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">ioutil&lt;/span>.&lt;span style="color:#a6e22e">ReadAll&lt;/span>(&lt;span style="color:#a6e22e">resp&lt;/span>.&lt;span style="color:#a6e22e">Body&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;response Body:&amp;#34;&lt;/span>, string(&lt;span style="color:#a6e22e">body&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>It can also be found under my github page: &lt;a href="https://github.com/Skarlso/goprojects/tree/master/gojira" target="_blank">GoJira Github&lt;/a>.&lt;/p></description></item><item><title>The One Hundred Day GitHub Challenge</title><link>https://skarlso.github.io/2015/11/15/the-one-hundred-day-github-challenge/</link><pubDate>Sun, 15 Nov 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/11/15/the-one-hundred-day-github-challenge/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today, I present to you the One Hundred Day Github Challenge.&lt;/p>
&lt;p>The rules are simple:&lt;/p>
&lt;ol>
&lt;li>Minimum of &lt;strong>One&lt;/strong> commit every day for a &lt;strong>Hundred days&lt;/strong>.&lt;/li>
&lt;li>Commit has to be &lt;strong>meaningful&lt;/strong> but can be as little as a fix in a Readme.md.&lt;/li>
&lt;li>Doesn&amp;rsquo;t matter if you are on vacation, there are no exceptions.&lt;/li>
&lt;li>&lt;strong>There. Are. No. Exceptions.&lt;/strong>&lt;/li>
&lt;li>If you &lt;strong>fail&lt;/strong> a day, you have to &lt;strong>start over&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>No cheating.&lt;/strong> You only cheat yourself, so this is really up to you.&lt;/li>
&lt;/ol>
&lt;p>Let me be more clear here, because it seems I wasn&amp;rsquo;t clear enough. What you make out of this challenge, it&amp;rsquo;s up to you. If you just update a readme.md for hundred days, that&amp;rsquo;s fine. Just do it every day. It&amp;rsquo;s a commitment. At least you&amp;rsquo;ll have a nice Readme.&lt;/p></description></item><item><title>Go Progress Quest</title><link>https://skarlso.github.io/2015/11/09/go-progress-quest/</link><pubDate>Mon, 09 Nov 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/11/09/go-progress-quest/</guid><description>&lt;p>Hi Folks.&lt;/p>
&lt;p>I started to build a Progress Quest type of web app in Go.&lt;/p>
&lt;p>If you&amp;rsquo;d like to join, or just tag along, please drop by here =&amp;gt; &lt;a href="https://github.com/Skarlso/goprogressquest" target="_blank">Go Progress Quest&lt;/a> and feel free to submit an issue if you have an idea, or would like to contribute!&lt;/p>
&lt;p>I will try and document the Progress.&lt;/p>
&lt;p>Thank you for reading!&lt;/p>
&lt;p>Gergely.&lt;/p></description></item><item><title>Kill a Program on Connecting to a specific WiFi – OSX</title><link>https://skarlso.github.io/2015/10/26/kill-a-program-on-connecting-to-a-specific-wifi-osx/</link><pubDate>Mon, 26 Oct 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/10/26/kill-a-program-on-connecting-to-a-specific-wifi-osx/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>If you have the tendency, like me, to forget that you are on the corporate VPN, or leave a certain software open when you bring your laptop to work, this might be helpful to you too.&lt;/p>
&lt;p>It&amp;rsquo;s a small script which kills a program when you change your Wifi network.&lt;/p>
&lt;p>Script:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">#!/bin/bash&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">function&lt;/span> log &lt;span style="color:#f92672">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> directory&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;/Users/&amp;lt;username&amp;gt;/wifi_detect&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log_dir_exists&lt;span style="color:#f92672">=&lt;/span>true
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#f92672">[&lt;/span> ! -d $directory &lt;span style="color:#f92672">]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> echo &lt;span style="color:#e6db74">&amp;#34;Attempting to create =&amp;gt; &lt;/span>$directory&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> mkdir -p $directory
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#f92672">[&lt;/span> ! -d $directory &lt;span style="color:#f92672">]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> echo &lt;span style="color:#e6db74">&amp;#34;Could not create directory. Continue to log to echo.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log_dir_exists&lt;span style="color:#f92672">=&lt;/span>false
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> $log_dir_exists ; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> echo &lt;span style="color:#e6db74">&amp;#34;&lt;/span>&lt;span style="color:#66d9ef">$(&lt;/span>date&lt;span style="color:#66d9ef">)&lt;/span>&lt;span style="color:#e6db74">:&lt;/span>$1&lt;span style="color:#e6db74">&amp;#34;&lt;/span> &amp;gt;&amp;gt; &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$directory&lt;span style="color:#e6db74">/log.txt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">else&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> echo &lt;span style="color:#e6db74">&amp;#34;&lt;/span>&lt;span style="color:#66d9ef">$(&lt;/span>date&lt;span style="color:#66d9ef">)&lt;/span>&lt;span style="color:#e6db74">:&lt;/span>$1&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">function&lt;/span> check_program &lt;span style="color:#f92672">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> to_kill&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;[&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>1::1&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">]&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>1:1&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;Checking if &lt;/span>$to_kill&lt;span style="color:#e6db74"> really quit.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ps&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">$(&lt;/span>ps aux |grep &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$to_kill&lt;span style="color:#e6db74">&amp;#34;&lt;/span>&lt;span style="color:#66d9ef">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;ps =&amp;gt; &lt;/span>$ps&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#f92672">[&lt;/span> -z &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$ps&lt;span style="color:#e6db74">&amp;#34;&lt;/span> &lt;span style="color:#f92672">]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># 0 - True&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">else&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># 1 - False&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">function&lt;/span> kill_program &lt;span style="color:#f92672">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;Killing program&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">`&lt;/span>pkill -f &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$1&lt;span style="color:#e6db74">&amp;#34;&lt;/span>&lt;span style="color:#e6db74">`&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> sleep &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> ! check_program $1 ; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$1&lt;span style="color:#e6db74"> Did not quit!&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">else&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$1&lt;span style="color:#e6db74"> quit successfully&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>wifi_name&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">$(&lt;/span>networksetup -getairportnetwork en0 |awk -F&lt;span style="color:#e6db74">&amp;#34;: &amp;#34;&lt;/span> &lt;span style="color:#e6db74">&amp;#39;{print $2}&amp;#39;&lt;/span>&lt;span style="color:#66d9ef">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>log &lt;span style="color:#e6db74">&amp;#34;Wifi name: &lt;/span>$wifi_name&lt;span style="color:#e6db74">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#f92672">[&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$wifi_name&lt;span style="color:#e6db74">&amp;#34;&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&amp;lt;wifi_name&amp;gt;&amp;#34;&lt;/span> &lt;span style="color:#f92672">]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;On corporate network... Killing Program&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> kill_program &lt;span style="color:#e6db74">&amp;#34;&amp;lt;programname&amp;gt;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">elif&lt;/span> &lt;span style="color:#f92672">[&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&lt;/span>$wifi_name&lt;span style="color:#e6db74">&amp;#34;&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&amp;lt;home_wifi_name&amp;gt;&amp;#34;&lt;/span> &lt;span style="color:#f92672">]&lt;/span>; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># Kill &amp;lt;program&amp;gt; if enabled and if on &amp;lt;home_wifi&amp;gt; and if Tunnelblick is running.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;Not on corporate network... Killing &amp;lt;program&amp;gt; if Tunnelblick is active.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> ! check_program &lt;span style="color:#e6db74">&amp;#34;Tunnelblick&amp;#34;&lt;/span> ; &lt;span style="color:#66d9ef">then&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;Tunnelblick is active. Killing &amp;lt;program&amp;gt;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> kill_program &lt;span style="color:#e6db74">&amp;#34;&amp;lt;program&amp;gt;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">else&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;All good... Happy coding.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">else&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> log &lt;span style="color:#e6db74">&amp;#34;No known Network...&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">fi&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now, the trick is, on OSX to only trigger this when your network changes. For this, you can have a &amp;rsquo;launchd&amp;rsquo; daemon, which is configured to watch three files which relate to a network being changed.&lt;/p></description></item><item><title>Circular buffer in Go</title><link>https://skarlso.github.io/2015/10/15/circular-buffer-in-go/</link><pubDate>Thu, 15 Oct 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/10/15/circular-buffer-in-go/</guid><description>&lt;p>I&amp;rsquo;m proud of this one too. No peaking. I like how go let&amp;rsquo;s you do this kind of stuff in a very nice way.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">circular&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> &lt;span style="color:#e6db74">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//TestVersion testVersion
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">TestVersion&lt;/span> = &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Buffer buffer type
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">Buffer&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">buffer&lt;/span> []&lt;span style="color:#66d9ef">byte&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">full&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">size&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>, &lt;span style="color:#a6e22e">e&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//NewBuffer creates a new Buffer
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">NewBuffer&lt;/span>(&lt;span style="color:#a6e22e">size&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Buffer&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">Buffer&lt;/span>{&lt;span style="color:#a6e22e">buffer&lt;/span>: make([]&lt;span style="color:#66d9ef">byte&lt;/span>, &lt;span style="color:#a6e22e">size&lt;/span>), &lt;span style="color:#a6e22e">s&lt;/span>: &lt;span style="color:#ae81ff">0&lt;/span>, &lt;span style="color:#a6e22e">e&lt;/span>: &lt;span style="color:#ae81ff">0&lt;/span>, &lt;span style="color:#a6e22e">size&lt;/span>: &lt;span style="color:#a6e22e">size&lt;/span>, &lt;span style="color:#a6e22e">full&lt;/span>: &lt;span style="color:#ae81ff">0&lt;/span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//ReadByte reads a byte from b Buffer
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">b&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Buffer&lt;/span>) &lt;span style="color:#a6e22e">ReadByte&lt;/span>() (&lt;span style="color:#66d9ef">byte&lt;/span>, &lt;span style="color:#66d9ef">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">full&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>, &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Errorf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Danger Will Robinson: %s&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">b&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">readByte&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">buffer&lt;/span>[&lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">s&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">s&lt;/span> = (&lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>) &lt;span style="color:#f92672">%&lt;/span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">size&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">full&lt;/span>&lt;span style="color:#f92672">--&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">readByte&lt;/span>, &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//WriteByte writes c byte to the buffer
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">b&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Buffer&lt;/span>) &lt;span style="color:#a6e22e">WriteByte&lt;/span>(&lt;span style="color:#a6e22e">c&lt;/span> &lt;span style="color:#66d9ef">byte&lt;/span>) &lt;span style="color:#66d9ef">error&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">full&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> &amp;gt; &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">size&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Errorf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Danger Will Robinson: %s&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">b&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">buffer&lt;/span>[&lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">e&lt;/span>] = &lt;span style="color:#a6e22e">c&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">e&lt;/span> = (&lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">e&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>) &lt;span style="color:#f92672">%&lt;/span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">size&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">full&lt;/span>&lt;span style="color:#f92672">++&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Overwrite overwrites the oldest byte in Buffer
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">b&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Buffer&lt;/span>) &lt;span style="color:#a6e22e">Overwrite&lt;/span>(&lt;span style="color:#a6e22e">c&lt;/span> &lt;span style="color:#66d9ef">byte&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">buffer&lt;/span>[&lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">s&lt;/span>] = &lt;span style="color:#a6e22e">c&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">s&lt;/span> = (&lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>) &lt;span style="color:#f92672">%&lt;/span> &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">size&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Reset resets the buffer
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">b&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Buffer&lt;/span>) &lt;span style="color:#a6e22e">Reset&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">b&lt;/span> = &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">NewBuffer&lt;/span>(&lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">size&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">b&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">Buffer&lt;/span>) &lt;span style="color:#a6e22e">String&lt;/span>() &lt;span style="color:#66d9ef">string&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Sprintf&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Buffer: %d, %d, %d, %d&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">buffer&lt;/span>, &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">s&lt;/span>, &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">e&lt;/span>, &lt;span style="color:#a6e22e">b&lt;/span>.&lt;span style="color:#a6e22e">size&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Jenkins Job DSL and Groovy goodness</title><link>https://skarlso.github.io/2015/10/15/jenkins-job-dsl-and-groovy-goodness/</link><pubDate>Thu, 15 Oct 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/10/15/jenkins-job-dsl-and-groovy-goodness/</guid><description>&lt;p>Hi Folks.&lt;/p>
&lt;p>Ever used &lt;a href="https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin" target="_blank">Job DSL plugin&lt;/a> for Jenkins? What is that you say? Well, it&amp;rsquo;s TEH most awesome plug-in for Jenkins to have, because you can CODE your job configuration and put it under source control.&lt;/p>
&lt;p>Today, however, I&amp;rsquo;m not going to write about that because the tutorials on Jenkins JOB DSL are very extensive and very well done. Anyone can pick them up.&lt;/p>
&lt;p>Today, I would like to write about a part of it which is even more interesting. And that is, extracting re-occurring parts in your job configurations.&lt;/p></description></item><item><title>DataMunger Kata with Go</title><link>https://skarlso.github.io/2015/10/04/datamunger-kata-with-go/</link><pubDate>Sun, 04 Oct 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/10/04/datamunger-kata-with-go/</guid><description>&lt;p>Quickly wrote up the Data Munger code kata in Go.&lt;/p>
&lt;p>Next time, I want better abstractions. And a way to select columns based on their header data. For now, this is not bad.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> (
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;bufio&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;log&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;math&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;os&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;regexp&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;strconv&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;strings&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Data which is Data
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">Data&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">columnName&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">compareOne&lt;/span> &lt;span style="color:#66d9ef">float64&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">compareTwo&lt;/span> &lt;span style="color:#66d9ef">float64&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// datas := []Data{WeatherData{}, FootballData{}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Minimum weather data:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">GetDataMinimumDiff&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;weather.dat&amp;#34;&lt;/span>, , &lt;span style="color:#ae81ff">1&lt;/span>, &lt;span style="color:#ae81ff">2&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Minimum football data:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">GetDataMinimumDiff&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;football.dat&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">1&lt;/span>, &lt;span style="color:#ae81ff">6&lt;/span>, &lt;span style="color:#ae81ff">7&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//GetDataMinimumDiff gathers data from file to fill up Columns.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">GetDataMinimumDiff&lt;/span>(&lt;span style="color:#a6e22e">filename&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">nameColumn&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>, &lt;span style="color:#a6e22e">compareColOne&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>, &lt;span style="color:#a6e22e">compareColTwo&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) &lt;span style="color:#a6e22e">Data&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">data&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">Data&lt;/span>{}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">minimum&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">math&lt;/span>.&lt;span style="color:#a6e22e">MaxFloat64&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">readLines&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">ReadFile&lt;/span>(&lt;span style="color:#a6e22e">filename&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">value&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">readLines&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">valueArrays&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">strings&lt;/span>.&lt;span style="color:#a6e22e">Split&lt;/span>(&lt;span style="color:#a6e22e">value&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;,&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">name&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">valueArrays&lt;/span>[&lt;span style="color:#a6e22e">nameColumn&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">trimmedFirst&lt;/span>, &lt;span style="color:#a6e22e">_&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">strconv&lt;/span>.&lt;span style="color:#a6e22e">ParseFloat&lt;/span>(&lt;span style="color:#a6e22e">valueArrays&lt;/span>[&lt;span style="color:#a6e22e">compareColOne&lt;/span>], &lt;span style="color:#ae81ff">64&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">trimmedSecond&lt;/span>, &lt;span style="color:#a6e22e">_&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">strconv&lt;/span>.&lt;span style="color:#a6e22e">ParseFloat&lt;/span>(&lt;span style="color:#a6e22e">valueArrays&lt;/span>[&lt;span style="color:#a6e22e">compareColTwo&lt;/span>], &lt;span style="color:#ae81ff">64&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">diff&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">trimmedFirst&lt;/span> &lt;span style="color:#f92672">-&lt;/span> &lt;span style="color:#a6e22e">trimmedSecond&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">diff&lt;/span> = &lt;span style="color:#a6e22e">math&lt;/span>.&lt;span style="color:#a6e22e">Abs&lt;/span>(&lt;span style="color:#a6e22e">diff&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">diff&lt;/span> &lt;span style="color:#f92672">&amp;lt;=&lt;/span> &lt;span style="color:#a6e22e">minimum&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">minimum&lt;/span> = &lt;span style="color:#a6e22e">diff&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">data&lt;/span>.&lt;span style="color:#a6e22e">columnName&lt;/span> = &lt;span style="color:#a6e22e">name&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">data&lt;/span>.&lt;span style="color:#a6e22e">compareOne&lt;/span> = &lt;span style="color:#a6e22e">trimmedFirst&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">data&lt;/span>.&lt;span style="color:#a6e22e">compareTwo&lt;/span> = &lt;span style="color:#a6e22e">trimmedSecond&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">data&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//ReadFile reads lines from a file and gives back a string array which contains the lines.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">ReadFile&lt;/span>(&lt;span style="color:#a6e22e">fileName&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) (&lt;span style="color:#a6e22e">fileLines&lt;/span> []&lt;span style="color:#66d9ef">string&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">file&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">os&lt;/span>.&lt;span style="color:#a6e22e">Open&lt;/span>(&lt;span style="color:#a6e22e">fileName&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatal&lt;/span>(&lt;span style="color:#a6e22e">err&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">defer&lt;/span> &lt;span style="color:#a6e22e">file&lt;/span>.&lt;span style="color:#a6e22e">Close&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">scanner&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">bufio&lt;/span>.&lt;span style="color:#a6e22e">NewScanner&lt;/span>(&lt;span style="color:#a6e22e">file&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">//Skipping the first line which is the header.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">scanner&lt;/span>.&lt;span style="color:#a6e22e">Scan&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">scanner&lt;/span>.&lt;span style="color:#a6e22e">Scan&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">line&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">scanner&lt;/span>.&lt;span style="color:#a6e22e">Text&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">re&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">regexp&lt;/span>.&lt;span style="color:#a6e22e">MustCompile&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;\\w+&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">lines&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">re&lt;/span>.&lt;span style="color:#a6e22e">FindAllString&lt;/span>(&lt;span style="color:#a6e22e">line&lt;/span>, &lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> len(&lt;span style="color:#a6e22e">lines&lt;/span>) &amp;gt; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fileLines&lt;/span> = append(&lt;span style="color:#a6e22e">fileLines&lt;/span>, &lt;span style="color:#a6e22e">strings&lt;/span>.&lt;span style="color:#a6e22e">Join&lt;/span>(&lt;span style="color:#a6e22e">lines&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;,&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">scanner&lt;/span>.&lt;span style="color:#a6e22e">Err&lt;/span>(); &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">log&lt;/span>.&lt;span style="color:#a6e22e">Fatal&lt;/span>(&lt;span style="color:#a6e22e">err&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>How to Aggregate Tests with Jenkins with Aggregate Plugin on non-relating jobs</title><link>https://skarlso.github.io/2015/10/02/how-to-aggregate-tests-with-jenkins-with-aggregate-plugin-on-non-relating-jobs/</link><pubDate>Fri, 02 Oct 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/10/02/how-to-aggregate-tests-with-jenkins-with-aggregate-plugin-on-non-relating-jobs/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today, I would like to talk about something I came in contact with, and was hard to find a proper answer / solution for it.&lt;/p>
&lt;p>So I&amp;rsquo;m writing this down to document my findings. Like the title says, this is about aggregating test result with Jenkins, using the plug-in provided. If you, like me, have a pipeline structure which do not work on the same artifact, but do have a upstream-downstream relationship, you will have a hard time configuring and making Aggregation work. So here is how, I fixed the issue.&lt;/p></description></item><item><title>I used to have great ideas on the toilet, but I no longer do.</title><link>https://skarlso.github.io/2015/09/07/i-used-to-have-great-ideas-on-the-toilet-but-i-no-longer-do/</link><pubDate>Mon, 07 Sep 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/09/07/i-used-to-have-great-ideas-on-the-toilet-but-i-no-longer-do/</guid><description>&lt;p>I used to have great ideas on the toilet, but I no longer do. And I would like to reflect on that. So this is not going to be a technical post, rather some ramblings.&lt;/p>
&lt;p>I already had a post similar to this one, but I failed to follow up on it, and now I&amp;rsquo;m re-visiting the question. With technology on the rise, embedded systems, chips, augmented biology and information being available at our fingertips, I have but one concern. I don&amp;rsquo;t want to sound like an old guy reflecting on history, that now everything is changing and that we need to have a sight on the past and bla bla bla. I do have one valid concern though. We are in danger of loosing ourselves.&lt;/p></description></item><item><title>Sieve of Eratosthenes in Go</title><link>https://skarlso.github.io/2015/07/30/sieve-of-eratosthenes-in-go/</link><pubDate>Thu, 30 Jul 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/07/30/sieve-of-eratosthenes-in-go/</guid><description>&lt;p>I&amp;rsquo;m pretty proud of this one as well.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">sieve&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">//Sieve Uses the Sieve of Eratosthenes to calculate primes to a certain limit
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">Sieve&lt;/span>(&lt;span style="color:#a6e22e">limit&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) []&lt;span style="color:#66d9ef">int&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">listOfPrimes&lt;/span> []&lt;span style="color:#66d9ef">int&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">markers&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> make([]&lt;span style="color:#66d9ef">bool&lt;/span>, &lt;span style="color:#a6e22e">limit&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">2&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span> &amp;lt; &lt;span style="color:#a6e22e">limit&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">++&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> !&lt;span style="color:#a6e22e">markers&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>] {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">j&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span>; &lt;span style="color:#a6e22e">j&lt;/span> &amp;lt; &lt;span style="color:#a6e22e">limit&lt;/span>; &lt;span style="color:#a6e22e">j&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">markers&lt;/span>[&lt;span style="color:#a6e22e">j&lt;/span>] = &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">listOfPrimes&lt;/span> = append(&lt;span style="color:#a6e22e">listOfPrimes&lt;/span>, &lt;span style="color:#a6e22e">i&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">listOfPrimes&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Quick Tip for Debugging Headless Locally</title><link>https://skarlso.github.io/2015/07/22/quick-tip-for-debugging-headless-locally/</link><pubDate>Wed, 22 Jul 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/07/22/quick-tip-for-debugging-headless-locally/</guid><description>&lt;p>If you are installing something with Packer and you have Headless enabled(and you are lazy and don&amp;rsquo;t want to switch it off), it gets difficult, to see output.&lt;/p>
&lt;p>Especially on a windows install the Answer File / Unattended install can be like =&amp;gt; Waiting for SSH. for about an hour or two! If you are doing this locally fret not. Just start VirtualBox, and watch the Preview section which will display the current state even if it&amp;rsquo;s a headless install!&lt;/p></description></item><item><title>Converting numbers into string representations</title><link>https://skarlso.github.io/2015/07/19/converting-numbers-into-string-representations/</link><pubDate>Sun, 19 Jul 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/07/19/converting-numbers-into-string-representations/</guid><description>&lt;p>I quiet like this one. My first go program snippet without any peaking or googling. I&amp;rsquo;m proud, though it could be improved with a bit of struct magic and such and such. And it only counts &amp;rsquo;till 1000.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> &lt;span style="color:#e6db74">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">words&lt;/span> = &lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">int&lt;/span>]&lt;span style="color:#66d9ef">string&lt;/span>{&lt;span style="color:#ae81ff">1&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;one&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">2&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;two&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">3&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;three&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">4&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;four&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">5&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;five&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">6&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;six&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">7&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;seven&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ae81ff">8&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;eight&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">9&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;nine&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">10&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;ten&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">11&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;eleven&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">12&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;twelve&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">13&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;thirteen&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">14&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;fourteen&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">15&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;fifteen&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ae81ff">16&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;sixteen&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">17&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;seventeen&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">18&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;eighteen&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">19&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;nineteen&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">20&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;twenty&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">30&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;thirty&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">40&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;forty&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ae81ff">50&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;fifty&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">60&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;sixty&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">70&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;seventy&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">80&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;eighty&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">90&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;ninety&amp;#34;&lt;/span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// CountLetters count the letters in a long string number representation
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">CountLetters&lt;/span>(&lt;span style="color:#a6e22e">limit&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">myLongNumberString&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">&amp;lt;=&lt;/span> &lt;span style="color:#a6e22e">limit&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span>&lt;span style="color:#f92672">++&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">addLettersToMyString&lt;/span>(&lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">myLongNumberString&lt;/span>, &lt;span style="color:#a6e22e">i&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// fmt.Println(&amp;#34;1-9 written with letters is: &amp;#34;, len(myLongNumberString))
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;The string is:&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">myLongNumberString&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fmt&lt;/span>.&lt;span style="color:#a6e22e">Println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;Lenght of string is:&amp;#34;&lt;/span>, len(&lt;span style="color:#a6e22e">myLongNumberString&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">addLettersToMyString&lt;/span>(&lt;span style="color:#a6e22e">myString&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">num&lt;/span> &amp;lt; &lt;span style="color:#ae81ff">20&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">myString&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">words&lt;/span>[&lt;span style="color:#a6e22e">num&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#f92672">&amp;gt;=&lt;/span> &lt;span style="color:#ae81ff">20&lt;/span> &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> &lt;span style="color:#a6e22e">num&lt;/span> &amp;lt; &lt;span style="color:#ae81ff">100&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">myString&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">countMiddle&lt;/span>(&lt;span style="color:#a6e22e">num&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#f92672">&amp;gt;=&lt;/span> &lt;span style="color:#ae81ff">100&lt;/span> &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> &lt;span style="color:#a6e22e">num&lt;/span> &amp;lt; &lt;span style="color:#ae81ff">1000&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">hundred&lt;/span>, &lt;span style="color:#a6e22e">tenth&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">countHundred&lt;/span>(&lt;span style="color:#a6e22e">num&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">tenth&lt;/span> &lt;span style="color:#f92672">==&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">myString&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">hundred&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#66d9ef">else&lt;/span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">tenth&lt;/span> &lt;span style="color:#f92672">&amp;gt;=&lt;/span> &lt;span style="color:#ae81ff">11&lt;/span> &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> &lt;span style="color:#a6e22e">tenth&lt;/span> &amp;lt; &lt;span style="color:#ae81ff">20&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">myString&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">hundred&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#e6db74">&amp;#34;and&amp;#34;&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#a6e22e">words&lt;/span>[&lt;span style="color:#a6e22e">tenth&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#66d9ef">else&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">myString&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#a6e22e">hundred&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#e6db74">&amp;#34;and&amp;#34;&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#a6e22e">countMiddle&lt;/span>(&lt;span style="color:#a6e22e">tenth&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#ae81ff">1000&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">myString&lt;/span> &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;onethousand&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">countMiddle&lt;/span>(&lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) &lt;span style="color:#66d9ef">string&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">minues&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#f92672">%&lt;/span> &lt;span style="color:#ae81ff">10&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#f92672">-=&lt;/span> &lt;span style="color:#a6e22e">minues&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">words&lt;/span>[&lt;span style="color:#a6e22e">num&lt;/span>] &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#a6e22e">words&lt;/span>[&lt;span style="color:#a6e22e">minues&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">countHundred&lt;/span>(&lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) (&lt;span style="color:#66d9ef">string&lt;/span>, &lt;span style="color:#66d9ef">int&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">minues&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#f92672">%&lt;/span> &lt;span style="color:#ae81ff">100&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">num&lt;/span> &lt;span style="color:#f92672">-=&lt;/span> &lt;span style="color:#a6e22e">minues&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> (&lt;span style="color:#a6e22e">words&lt;/span>[(&lt;span style="color:#a6e22e">num&lt;/span>&lt;span style="color:#f92672">/&lt;/span>&lt;span style="color:#ae81ff">100&lt;/span>)] &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#e6db74">&amp;#34;hundred&amp;#34;&lt;/span>), &lt;span style="color:#a6e22e">minues&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Selenium Testing with Packer and Vagrant</title><link>https://skarlso.github.io/2015/07/16/selenium-testing-with-packer-and-vagrant/</link><pubDate>Thu, 16 Jul 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/07/16/selenium-testing-with-packer-and-vagrant/</guid><description>&lt;p>So, recently, the tester team talked to me, that their build takes too long, and why is that? A quick look at their configuration and build scripts showed me, that they are actually using a vagrant box, which never gets destroyed or re-started at least. To remedy this problem, I came up with the following solution.&lt;/p></description></item><item><title>Bitwise &amp; Operator</title><link>https://skarlso.github.io/2015/07/15/bitwise-operator/</link><pubDate>Wed, 15 Jul 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/07/15/bitwise-operator/</guid><description>&lt;p>The first, and only time so far, that I got to use the bitwise &amp;amp; operator. I enjoyed doing so!!&lt;/p>
&lt;p>And of course from now on, I&amp;rsquo;ll be looking for more opportunities to (ab)use it.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">secret&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> &lt;span style="color:#e6db74">&amp;#34;sort&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">REVERSE&lt;/span> = &lt;span style="color:#ae81ff">16&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">Handshake&lt;/span>(&lt;span style="color:#a6e22e">code&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span>) []&lt;span style="color:#66d9ef">string&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// binary_rep := convertDecimalToBinary(code)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">code&lt;/span> &amp;lt; { &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">secret_map&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">int&lt;/span>]&lt;span style="color:#66d9ef">string&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ae81ff">1&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;wink&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ae81ff">2&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;double blink&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ae81ff">4&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;close your eyes&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ae81ff">8&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;jump&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">keys&lt;/span> []&lt;span style="color:#66d9ef">int&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">k&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">secret_map&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">keys&lt;/span> = append(&lt;span style="color:#a6e22e">keys&lt;/span>, &lt;span style="color:#a6e22e">k&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// To make sure iteration is always in the same order.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">sort&lt;/span>.&lt;span style="color:#a6e22e">Ints&lt;/span>(&lt;span style="color:#a6e22e">keys&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">code_array&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> make([]&lt;span style="color:#66d9ef">string&lt;/span>, )
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">_&lt;/span>, &lt;span style="color:#a6e22e">key&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#66d9ef">range&lt;/span> &lt;span style="color:#a6e22e">keys&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">code&lt;/span> &lt;span style="color:#f92672">&amp;amp;&lt;/span> &lt;span style="color:#a6e22e">key&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#a6e22e">key&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">code_array&lt;/span> = append(&lt;span style="color:#a6e22e">code_array&lt;/span>, &lt;span style="color:#a6e22e">secret_map&lt;/span>[&lt;span style="color:#a6e22e">key&lt;/span>])
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">code&lt;/span> &lt;span style="color:#f92672">&amp;amp;&lt;/span> &lt;span style="color:#a6e22e">REVERSE&lt;/span> &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#a6e22e">REVERSE&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">code_array&lt;/span> = &lt;span style="color:#a6e22e">reverse_array&lt;/span>(&lt;span style="color:#a6e22e">code_array&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">code_array&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> &lt;span style="color:#a6e22e">reverse_array&lt;/span> (&lt;span style="color:#a6e22e">array_to_reverse&lt;/span> []&lt;span style="color:#66d9ef">string&lt;/span>) []&lt;span style="color:#66d9ef">string&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">for&lt;/span> &lt;span style="color:#a6e22e">i&lt;/span>, &lt;span style="color:#a6e22e">j&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> , len(&lt;span style="color:#a6e22e">array_to_reverse&lt;/span>) &lt;span style="color:#f92672">-&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> ; &lt;span style="color:#a6e22e">i&lt;/span> &amp;lt; &lt;span style="color:#a6e22e">j&lt;/span>; &lt;span style="color:#a6e22e">i&lt;/span>, &lt;span style="color:#a6e22e">j&lt;/span> = &lt;span style="color:#a6e22e">i&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>, &lt;span style="color:#a6e22e">j&lt;/span> &lt;span style="color:#f92672">-&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">array_to_reverse&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>], &lt;span style="color:#a6e22e">array_to_reverse&lt;/span>[&lt;span style="color:#a6e22e">j&lt;/span>] = &lt;span style="color:#a6e22e">array_to_reverse&lt;/span>[&lt;span style="color:#a6e22e">j&lt;/span>], &lt;span style="color:#a6e22e">array_to_reverse&lt;/span>[&lt;span style="color:#a6e22e">i&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">array_to_reverse&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Packer 0.8.1.</title><link>https://skarlso.github.io/2015/07/01/packer-0-8-1/</link><pubDate>Wed, 01 Jul 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/07/01/packer-0-8-1/</guid><description>&lt;p>Previously I wrote that the scripts I&amp;rsquo;m writing, are failing because Packer hangs.&lt;/p>
&lt;p>Apparently, this was a known issue. And apparently, I was using an older version, 0.7.5. After I updated everything is working wonderfully!!!&lt;/p>
&lt;p>And for my thanks, here is an updated PowerShell script for provisioning my dotnet stuff.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-powershell" data-lang="powershell">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$source = &lt;span style="color:#e6db74">&amp;#34;http://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$destination = &lt;span style="color:#e6db74">&amp;#34;C:\Windows\Temp\dotnet.exe&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Write-Host &lt;span style="color:#e6db74">&amp;#39;Starting to download dotnet file.&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">try&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (New-Object System.Net.WebClient).DownloadFile($source, $destination)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>} &lt;span style="color:#66d9ef">catch&lt;/span> [&lt;span style="color:#66d9ef">Exception&lt;/span>] {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Write-Host &lt;span style="color:#e6db74">&amp;#34;Exception during download. Probable cause could be that the directory or the file didn&amp;#39;t exist.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Write-Host &lt;span style="color:#e6db74">&amp;#39;$_.Exception is&amp;#39;&lt;/span> $_.Exception
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Write-Host &lt;span style="color:#e6db74">&amp;#39;Download done. Checking if file exists.&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">if&lt;/span> (!(Test-Path $destination)) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Write-Host &lt;span style="color:#e6db74">&amp;#39;Downloading dotnet Failed!&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>} &lt;span style="color:#66d9ef">else&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Write-Host &lt;span style="color:#e6db74">&amp;#39;Download successful.&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Write-Host &lt;span style="color:#e6db74">&amp;#39;Starting install process.&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">try&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Start-Process -FilePath $source -ArgumentList &lt;span style="color:#e6db74">&amp;#34;/q /norestart&amp;#34;&lt;/span> -Wait -PassThru
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>} &lt;span style="color:#66d9ef">catch&lt;/span> [&lt;span style="color:#66d9ef">Exception&lt;/span>] {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Write-Host &lt;span style="color:#e6db74">&amp;#39;Exception during install process.&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Write-Host &lt;span style="color:#e6db74">&amp;#39;$_.Exception is&amp;#39;&lt;/span> $_.Exception
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Write-Host &lt;span style="color:#e6db74">&amp;#39;All done. Goodbye.&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Thanks for reading!&lt;/p></description></item><item><title>Powershell can also be nice -Or Installing Java silently and waiting</title><link>https://skarlso.github.io/2015/06/30/powershell-can-also-be-nice-or-installing-java-silently-and-waiting/</link><pubDate>Tue, 30 Jun 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/06/30/powershell-can-also-be-nice-or-installing-java-silently-and-waiting/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today, I would like to show you a small script. It installs Java JDK, both version, x86 and 64 bit, silently, and wait for that process to finish.&lt;/p>
&lt;p>The wait is necessary because /s on a java install has the nasty habit of running in the background. If you are using a .bat file, &lt;strong>you shouldn&amp;rsquo;t&lt;/strong>, than you would use something like: start /w jdk-setup.exe /s. This gets it done, but is ugly. Also, if you are using Packer and PowerShell provisioning, you might want to set up some environment variables as well for the next script. And you want that property to be available and you don&amp;rsquo;t want to mess it up with setting a path into a file and then re-setting your path on the begin of your other script. Or pass it around with Packer. No. Use a proper PowerShell script. Learn it. It&amp;rsquo;s not that hard. Be a professional. Don&amp;rsquo;t hack something together for the next person to suffer at.&lt;/p></description></item><item><title>The Packer, The Windows, and the Vagrant box</title><link>https://skarlso.github.io/2015/06/27/the-packer-the-windows-and-the-vagrant-box/</link><pubDate>Sat, 27 Jun 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/06/27/the-packer-the-windows-and-the-vagrant-box/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today, I would like to write about something close to my heart recently. I&amp;rsquo;ve been fiddling with Packer, Windows and Vagrant these days. Trying to get a Windows box up in running is a pain in the arse though, so I thought I share my pain with you nice folks out there. Let&amp;rsquo;s begin.&lt;/p></description></item><item><title>Docker + Java + Vagrant+ GO.CD</title><link>https://skarlso.github.io/2015/06/06/docker-ruby-lotus-go-cd/</link><pubDate>Sat, 06 Jun 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/06/06/docker-ruby-lotus-go-cd/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today, I would like to write about something interesting and close to me at the moment. I&amp;rsquo;m going to setup Go.cd with Docker, and I&amp;rsquo;m going to get a Ruby Lotus app running. Let&amp;rsquo;s get started.&lt;/p></description></item><item><title>Setting up a new Laptop with Puppet</title><link>https://skarlso.github.io/2015/05/21/setting-up-a-new-laptop-with-puppet/</link><pubDate>Thu, 21 May 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/05/21/setting-up-a-new-laptop-with-puppet/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>So, some of you know &lt;a href="https://puppetlabs.com/" target="_blank">puppet&lt;/a>, some of you don&amp;rsquo;t. Puppet is a configuration management system. It&amp;rsquo;s quite awesome. I like working with it. One of the benefits of puppet is, that I never, ever, EVER have to setup a new laptop from scratch, EVER again.&lt;/p>
&lt;p>I&amp;rsquo;m writing a puppet manifest file which sets up my new laptop to my liking. I will improve it as I go along. Here is version 1.0.&lt;/p></description></item><item><title>Busy building the future</title><link>https://skarlso.github.io/2015/05/19/busy-building-the-future/</link><pubDate>Tue, 19 May 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/05/19/busy-building-the-future/</guid><description>&lt;p>Fact is, I&amp;rsquo;ve been busy.&lt;/p>
&lt;p>I&amp;rsquo;ve got a new job as a build engineer. As sort of a devops kind of guy. It&amp;rsquo;s extremely interesting considering that I made a career as a tester. Granted, I always was technical, and never really knew my path; but it seems my path is finding me after all.&lt;/p>
&lt;p>In the past years, I got better at Docker, Puppet, Chef, AWS, Packer, Vagrant, Gradle, and a hell of a lot more. Also honed my linux skills from the ability of doing an ls -l to do an find . -type f -atime +5 | xargs rm -fr (find all the files which are 5 days older and pipe them to a delete command). I already read many books about devops but this time, it&amp;rsquo;s different. This time, I can actually do these things as well in a live environment.&lt;/p></description></item><item><title>Django – RPG – Part 3</title><link>https://skarlso.github.io/2015/04/21/django-rpg-part-3/</link><pubDate>Tue, 21 Apr 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/04/21/django-rpg-part-3/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>A small update to this. I created the model now, which is the database design for this app. It&amp;rsquo;s very simple, nothing fancy. Also, I&amp;rsquo;m writing the app with Python 3 from now on.&lt;/p>
&lt;p>Here is the model now:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> django.db &lt;span style="color:#f92672">import&lt;/span> models
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> django.contrib.auth.models &lt;span style="color:#f92672">import&lt;/span> User
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Create your models here.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">Item&lt;/span>(models&lt;span style="color:#f92672">.&lt;/span>Model):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> name &lt;span style="color:#f92672">=&lt;/span> models&lt;span style="color:#f92672">.&lt;/span>CharField(max_length&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">100&lt;/span>, default&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;Item&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> damage &lt;span style="color:#f92672">=&lt;/span> models&lt;span style="color:#f92672">.&lt;/span>IntegerField(default&lt;span style="color:#f92672">=&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> defense &lt;span style="color:#f92672">=&lt;/span> models&lt;span style="color:#f92672">.&lt;/span>IntegerField(default&lt;span style="color:#f92672">=&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> consumable &lt;span style="color:#f92672">=&lt;/span> models&lt;span style="color:#f92672">.&lt;/span>BooleanField(default&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">False&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> __str__(self):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> self&lt;span style="color:#f92672">.&lt;/span>name
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">Inventory&lt;/span>(models&lt;span style="color:#f92672">.&lt;/span>Model):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> items &lt;span style="color:#f92672">=&lt;/span> models&lt;span style="color:#f92672">.&lt;/span>ManyToManyField(Item)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> __str__(self):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> self&lt;span style="color:#f92672">.&lt;/span>items
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">Character&lt;/span>(models&lt;span style="color:#f92672">.&lt;/span>Model):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># By default Django uses the primery key of the related object.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># Hence, no need to specify User.id.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> user &lt;span style="color:#f92672">=&lt;/span> models&lt;span style="color:#f92672">.&lt;/span>OneToOneField(User, null&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">True&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> name &lt;span style="color:#f92672">=&lt;/span> models&lt;span style="color:#f92672">.&lt;/span>CharField(max_length&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">100&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> inventory &lt;span style="color:#f92672">=&lt;/span> models&lt;span style="color:#f92672">.&lt;/span>ForeignKey(Inventory)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> __str__(self):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> self&lt;span style="color:#f92672">.&lt;/span>name
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Worth noting a few things here. The __str__ is only with Python 3. In Python 2 it would be unicode. And the OneToOne and the foreign key are automatically using Primary keys defined in the references model. The __str__ is there to return some view when you are debugging in the console instead of [&amp;lt;Item: Item object&amp;gt;].&lt;/p></description></item><item><title>Django – RPG – Part 2</title><link>https://skarlso.github.io/2015/04/12/django-rpg-part-2/</link><pubDate>Sun, 12 Apr 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/04/12/django-rpg-part-2/</guid><description>&lt;p>Hello.&lt;/p>
&lt;p>Continuing where we left off with the Django RPG project. Next up is implementing a rudimentary registration and adding the ability to create a character. Maybe even, design the database through django&amp;rsquo;s modelling.&lt;/p></description></item><item><title>Django – RPG – Part 1</title><link>https://skarlso.github.io/2015/04/10/django-rpg-2/</link><pubDate>Fri, 10 Apr 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/04/10/django-rpg-2/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>So last time, we tried to implement a little RPG of mine using Meteor, which failed miserably. This time we are going to try and use Django. Let&amp;rsquo;s have at it, shall we?&lt;/p></description></item><item><title>Small Python GUI to Calculate Lever Distance</title><link>https://skarlso.github.io/2015/04/10/small-python-gui-to-calculate-lever-distance/</link><pubDate>Fri, 10 Apr 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/04/10/small-python-gui-to-calculate-lever-distance/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>Just a small script which calculates your distance from a lever focal point if you know your weight, the object&amp;rsquo;s weight and the object&amp;rsquo;s and the distance the object has from the focal point of the lever.&lt;/p>
&lt;p>Like this:&lt;/p>
&lt;p>This script will give you D1. And this is how it will look like in doing so:&lt;/p>
&lt;p>So, in order for me (77kg) to lift an object of 80kg which is on a, by default, 1 meter long lever, I have to stand back ~1.03meters. Which is totally cool, right?&lt;/p></description></item><item><title>Python and my Math commitment</title><link>https://skarlso.github.io/2015/03/15/python-and-my-math-commitment/</link><pubDate>Sun, 15 Mar 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/03/15/python-and-my-math-commitment/</guid><description>&lt;p>Let&amp;rsquo;s talk about plans. It&amp;rsquo;s good to have one. For example, I have a plan for this year.&lt;/p>
&lt;p>I kind of like math. So, I have this book:&lt;/p>
&lt;p>It&amp;rsquo;s 1400 pages long and basically, has everything in it. It&amp;rsquo;s a rather exhaustive book. Hence, my plan is to finish the book by the end of 2015 and write a couple of python scripts that calculate something interesting.&lt;/p>
&lt;p>(2021 Hindsight): Yeah, I didn&amp;rsquo;t manage this&amp;hellip; But it&amp;rsquo;s a cool idea, let&amp;rsquo;s see if I can get around coming further. I managed to get until 500 pages or so, before life stepped in.&lt;/p></description></item><item><title>Sphere Judge Online – Python Kivy Android app – Part 2</title><link>https://skarlso.github.io/2015/03/02/sphere-judge-online-python-kivy-android-app-part-2/</link><pubDate>Mon, 02 Mar 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/03/02/sphere-judge-online-python-kivy-android-app-part-2/</guid><description>&lt;p>Here we are again. I will attempt to further this little journey of mine into the land of Android and Python.&lt;/p>
&lt;p>This is the second part of the advanture you can read the first one a little bit back.&lt;/p>
&lt;h1 id="the-script">The Script&lt;/h1>
&lt;p>We left off at a point where I successfully configured my environment and compiled my first hello world APK. At that point it took a little bit fiddling to get it to work on my phone.&lt;/p></description></item><item><title>Sphere Judge Online – Python Kivy Android app</title><link>https://skarlso.github.io/2015/02/26/sphere-judge-online-python-kivy-android-app/</link><pubDate>Thu, 26 Feb 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/02/26/sphere-judge-online-python-kivy-android-app/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today I would like to take you on a journey I fought myself through in order to write a python android app, which gets you a random problem from &lt;a href="http://www.spoj.com/problems/classical/" target="_blank">Sphere Judge Online&lt;/a>. Then you can mark it as solved and it will be stored as such, and you can move on to the next problem. With the words of Neil deGrasse Tyson, Come with Me!&lt;/p>
&lt;h1 id="beginnings">Beginnings&lt;/h1>
&lt;p>When I first embarked on this endeavour I ran into numerous errors, many amongst them being compilation issues when I was trying to install libraries.&lt;/p></description></item><item><title>Why Lock Picking is like Testing</title><link>https://skarlso.github.io/2015/02/08/why-lock-picking-is-like-testing/</link><pubDate>Sun, 08 Feb 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/02/08/why-lock-picking-is-like-testing/</guid><description>&lt;p> &lt;/p>
&lt;p>Not a great many people know that I&amp;rsquo;m actually into Lock Picking as a hobby. This will not be a tutorial on how to do it, or I won&amp;rsquo;t really talk about how I do it; I would like to write about something completely different. So if you came here for that, here are a few very good resources:&lt;/p>
&lt;p>&lt;a href="http://www.lockpicking101.com/%20" target="_blank">&lt;a href="http://www.lockpicking101.com/">http://www.lockpicking101.com/&lt;/a> &lt;/a>- Tutorials&lt;/p>
&lt;p>&lt;a href="http://www.ukbumpkeys.com/collections/lock-picking" target="_blank">&lt;a href="http://www.ukbumpkeys.com/collections/lock-picking">http://www.ukbumpkeys.com/collections/lock-picking&lt;/a>&lt;/a> - Tools ( UK )&lt;/p>
&lt;p>&lt;a href="http://www.reddit.com/r/lockpicking/" target="_blank">&lt;a href="http://www.reddit.com/r/lockpicking/">http://www.reddit.com/r/lockpicking/&lt;/a>&lt;/a> - Reddit&lt;/p>
&lt;p>For my post, click on.&lt;/p></description></item><item><title>Building an RPG App with Meteor – Part One – The struggle</title><link>https://skarlso.github.io/2015/02/01/building-an-rpg-app-with-meteor-part-one-the-struggle/</link><pubDate>Sun, 01 Feb 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/02/01/building-an-rpg-app-with-meteor-part-one-the-struggle/</guid><description>&lt;p>In my previous post, I was getting ready to enjoy some time with the JavaScript web framework Meteor.&lt;/p>
&lt;p>This time I would like to bring it to a bit of overdrive. See, how re-factoring works on a larger scale model with multiple pages. And how it can organize assets, such as, images, multiple CSS, some plugins, you know, ordinary web stuff.&lt;/p>
&lt;p>Let&amp;rsquo;s dive in.&lt;/p></description></item><item><title>JavaScript Web Framework – Meteor</title><link>https://skarlso.github.io/2015/01/29/javascript-web-framework-meteor/</link><pubDate>Thu, 29 Jan 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/01/29/javascript-web-framework-meteor/</guid><description>&lt;p>Hi,&lt;/p>
&lt;p>This time I would like to write about something that interests me. I wanted to try out a pure JavaScript web framework.&lt;/p>
&lt;p>My choice is: &lt;a href="https://www.meteor.com/" target="_blank">Meteor&lt;/a>. Looks interesting enough and it was recommended by a friend of mine. So, let&amp;rsquo;s dive in.&lt;/p>
&lt;h4 id="installation">&lt;strong>Installation&lt;/strong>&lt;/h4>
&lt;p>As always, one starts with installation. The page tells us to follow this simple step:&lt;/p>
&lt;pre tabindex="0">&lt;code>curl https://install.meteor.com/ | sh
&lt;/code>&lt;/pre>&lt;p>Easy enough, when you are on Linux. Turns out, that there is no official release yet for Windows. I&amp;rsquo;m in luck then. After running the command though, I saw this popping up into my face:&lt;/p></description></item><item><title>When cucumber goes wrong</title><link>https://skarlso.github.io/2015/01/28/when-cucumber-goes-wrong/</link><pubDate>Wed, 28 Jan 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/01/28/when-cucumber-goes-wrong/</guid><description>&lt;p>Hi,&lt;/p>
&lt;p>Let&amp;rsquo;s face the horrible truth:&lt;/p>
&lt;p>&lt;strong>It&amp;rsquo;s rare / never happens that a manager / scrum master / product owner actually reads your cucumber test cases.&lt;/strong>&lt;/p>
&lt;p>Back in the old days, this was one of the selling points of human readable tests and DSLs. It sounds nice and I&amp;rsquo;m sure in a utopia it also works.&lt;/p>
&lt;p>BDD is a very nice approach to write tests if used in a correct way. And I can relate that at some point, a manager or the product owner, actually writes up a draft of the tests. But that enthusiasm very rarely stays for the rest of the project.&lt;/p></description></item><item><title>From Zero to Hundred in Four seconds</title><link>https://skarlso.github.io/2015/01/27/from-zero-to-hundred-in-four-seconds/</link><pubDate>Tue, 27 Jan 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/01/27/from-zero-to-hundred-in-four-seconds/</guid><description>&lt;p>I thought I throw my grudge out of the window against Scala and try something with it.&lt;/p>
&lt;p>I also got my hands on a fairly new book, called: &amp;ldquo;&lt;a href="http://www.amazon.co.uk/Learning-Scala-Practical-Functional-Programming/dp/1449367933/ref=sr_1_1?ie=UTF8&amp;qid=1422340157&amp;sr=8-1&amp;keywords=learning+scala+a+practical" target="_blank">Learning Scala: Practical Functional Programming for the JVM&lt;/a>&amp;rdquo;. Turns out to be a rather fun book to read. And Jason Swartz has a nice way of writing. So I wanted to play around with &lt;a href="https://www.playframework.com/" target="_blank">Play 2 Framework&lt;/a>. It now comes packaged in &lt;a href="https://typesafe.com/get-started" target="_blank">Activator&lt;/a>.&lt;/p>
&lt;p>So, I started the long path from almost zero to handle all that. I&amp;rsquo;m running the latest Ubuntu ( 14 ) and latest Java ( 8 ). The list: Scala, SBT, IntelliJ, Play ( through activator ).&lt;/p></description></item><item><title>Why Testers are, like scientists</title><link>https://skarlso.github.io/2015/01/26/why-testers-are-like-scientists/</link><pubDate>Mon, 26 Jan 2015 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2015/01/26/why-testers-are-like-scientists/</guid><description>&lt;p>Hello everybody.&lt;/p>
&lt;p>Today, I would like to write about little observation I made along the way of being a tester.&lt;/p>
&lt;p>The title says it all. I think Testers, are like scientists. I would go even further, and say: Testers, are scientists.&lt;/p>
&lt;p>Let us see how the two compare.&lt;/p></description></item><item><title>Why the expressiveness of your Tests is important – Part One</title><link>https://skarlso.github.io/2014/11/15/why-the-expressiveness-of-your-tests-is-important-part-one/</link><pubDate>Sat, 15 Nov 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/11/15/why-the-expressiveness-of-your-tests-is-important-part-one/</guid><description>&lt;p>Hello Everybody.&lt;/p>
&lt;p>This time I&amp;rsquo;d like to write about the expressiveness of a Test. I think that it&amp;rsquo;s very important to write understandable and expressive tests. In older times I was studying novel writing. There is a rule which a novel needs to follow. It goes something like this: &amp;ldquo;A novel needs to lead its reader and make him understand in the simplest way what&amp;rsquo;s going on, with whom and why?&amp;rdquo;. In other words, it&amp;rsquo;s not a puzzle. It should be obvious what the test is trying to do and it should not require the reader to try and solve it in order to understand it.&lt;/p></description></item><item><title>Updating All Jenkins Jobs Via Jenkins API – Python</title><link>https://skarlso.github.io/2014/11/07/updating-all-jenkins-jobs-via-jenkins-api-python/</link><pubDate>Fri, 07 Nov 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/11/07/updating-all-jenkins-jobs-via-jenkins-api-python/</guid><description>&lt;p>Hello everybody.&lt;/p>
&lt;p>I would like to share with you a small script I wrote to update all, or a single, Jenkins job from a Python script remotely.&lt;/p>
&lt;p>This will enable you to update a Jenkins job from anywhere using an admin credential based on a config.xml template that you have. With this, if you want to apply a config change to all or just a single job in Jenkins, you don&amp;rsquo;t have to go and do it for all the rest. You just call this script and it will cycle through all the jobs you have and update them if the begin with &amp;ldquo;yourpipelinedelimiter&amp;rdquo; or if they aren&amp;rsquo;t in a restricted list of jobs. The delimiter helps to identify pipelines which are dev pipelines. If you have multiple pipelines which are helpers or builders and you don&amp;rsquo;t usually apply the same config to them, than the delimiter can help identify the dev pipelines you actually want to update.&lt;/p></description></item><item><title>The seven Principles of Context Driven Testing – Mind Map</title><link>https://skarlso.github.io/2014/10/23/the-seven-guidelines-of-context-driven-testing/</link><pubDate>Thu, 23 Oct 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/10/23/the-seven-guidelines-of-context-driven-testing/</guid><description>&lt;p>Hi Folks!&lt;/p>
&lt;p>I just wanted to share with you my mind map on the seven principles of Context Driven Testing.&lt;/p>
&lt;p>I used the notion of dragons since it&amp;rsquo;s seven. And a dragon is usually seven headed in my mind.&lt;/p>
&lt;p>So without further ado.&lt;/p>
&lt;p>Click for larger image.&lt;/p>
&lt;p>I have a hand drawn as well but I&amp;rsquo;m guessing that one wouldn&amp;rsquo;t be of much use since it follows my own imagination.&lt;/p></description></item><item><title>Python Course Review</title><link>https://skarlso.github.io/2014/08/25/python-course-review/</link><pubDate>Mon, 25 Aug 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/08/25/python-course-review/</guid><description>&lt;p>Hello Everybody.&lt;/p>
&lt;p>Today I&amp;rsquo;d like to write a little bit about a python course I did.&lt;/p>
&lt;p>It&amp;rsquo;s an 8 week course on algorithmic programming with fun little projects. I&amp;rsquo;d like to write down some of my solutions with pseudo code for my own better understanding and for the sake of sharing knowledge. I won&amp;rsquo;t, however, share full projects since that would be against the honour code.&lt;/p>
&lt;p>Let&amp;rsquo;s begin.&lt;/p></description></item><item><title>Five reasons why a tester should learn SQL</title><link>https://skarlso.github.io/2014/05/31/five-reasons-why-a-tester-should-learn-sql/</link><pubDate>Sat, 31 May 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/05/31/five-reasons-why-a-tester-should-learn-sql/</guid><description>&lt;p>Hello Folks.&lt;/p>
&lt;p>So last I was writing about why a tester should learn Javascript. Today I would like to write about why a tester should learn SQL.&lt;/p>
&lt;p>There, I said it. I know many people, especially testers, don&amp;rsquo;t like SQL. They view it as a monster best be avoided. Something only Database people will know. Something which is so scary and ugly, nobody really wants it.&lt;/p>
&lt;p>But I will give you a couple of good reasons why you shouldn&amp;rsquo;t be afraid of SQL. And why you should welcome it as your best friend and partner in crime.&lt;/p>
&lt;p>Let&amp;rsquo;s go.&lt;/p></description></item><item><title>TDD is Dead – Not really</title><link>https://skarlso.github.io/2014/05/26/tdd-is-dead-not-really/</link><pubDate>Mon, 26 May 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/05/26/tdd-is-dead-not-really/</guid><description>&lt;p>Is TDD dead?&lt;/p>
&lt;p>Not really. So let&amp;rsquo;s talk about this topic for a little bit.&lt;/p>
&lt;p>I&amp;rsquo;m sure you already read a gazillion posts about this debate but frankly I&amp;rsquo;m writing this for myself, to rant a little bit, you know. Because somebody is wrong on the internet and I must intervene.&lt;/p></description></item><item><title>Five reasons why a front-end tester should learn Javascript</title><link>https://skarlso.github.io/2014/05/23/five-reasons-why-a-front-end-tester-should-learn-javascript/</link><pubDate>Fri, 23 May 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/05/23/five-reasons-why-a-front-end-tester-should-learn-javascript/</guid><description>&lt;p>Hello everybody.&lt;/p>
&lt;p>Today I would like to write about a very interesting topic, I hope. So let&amp;rsquo;s get started.&lt;/p>
&lt;p>As the title already suggests, I&amp;rsquo;m writing about why a front-end tester should learn at least a little bit about JavaScripting and the DOM.&lt;/p>
&lt;p>Ohhh and contrary to the belief CSP ( Content Security Policy ) will &lt;strong>not&lt;/strong> be the death of such scripts. There are white-lists and workarounds and exclusions which can be implemented in order to allow local JavaScripting to continue. So don&amp;rsquo;t fret. Read on.&lt;/p></description></item><item><title>Note taking what when how often</title><link>https://skarlso.github.io/2014/05/20/note-taking-what-when-how-often/</link><pubDate>Tue, 20 May 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/05/20/note-taking-what-when-how-often/</guid><description>&lt;p>Hello Everybody.&lt;/p>
&lt;p>Today I would like to tell you about a little conversation I had with my friend Adrian.&lt;/p>
&lt;p>The topic was about how, when and what to log during a testing session regarding a story.&lt;/p>
&lt;p>So let&amp;rsquo;s see what came out of that talk.&lt;/p>
&lt;p>&lt;strong>Logging your work&lt;/strong>&lt;/p>
&lt;p>The question is really not whether you should log your work or not, but rather to what extend. Because we all know that you should log your work. It helps you recall and helps you organize and think out testing strategies. But the extend and methods are a big question. So here is my routine.&lt;/p></description></item><item><title>Using Chrome Search Engine – Multiple Search Params</title><link>https://skarlso.github.io/2014/05/18/using-chrome-search-engine-multiple-search-params/</link><pubDate>Sun, 18 May 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/05/18/using-chrome-search-engine-multiple-search-params/</guid><description>&lt;p>Hello Everybody.&lt;/p>
&lt;p>Today I would like to write a few words about Chrome&amp;rsquo;s Search Engines.&lt;/p>
&lt;p>You&amp;rsquo;re probably already using it for a couple of things, like Google, or Amazon searches or YouTube or anything like that. But are you using it to access environments and testing tools faster, with queries?&lt;/p>
&lt;p>For example, here is a quick Jira Search made easy:&lt;/p>
&lt;p>Keyword: jira&lt;/p>
&lt;p>URL: &lt;code>https://atlas.projectname.com/jira/browse/PROJECT-%s&lt;/code>&lt;/p>
&lt;p>So just type: jira|space|9999&lt;/p>
&lt;p>Will immediately bring you to your ticket.&lt;/p></description></item><item><title>How I started Running</title><link>https://skarlso.github.io/2014/05/16/how-i-started-running/</link><pubDate>Fri, 16 May 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/05/16/how-i-started-running/</guid><description>&lt;p>Hello Everybody.&lt;/p>
&lt;p>Today I would like to write about something non-technical. I would like to write about running and how I started it and what my experiences were with it.&lt;/p>
&lt;p>So tl;dr. here we go.&lt;/p>
&lt;p>&lt;strong>What led me to running&lt;/strong>&lt;/p>
&lt;p>There were actually two things that led me to start running. Three.&lt;/p>
&lt;p>&lt;strong>Reason One: The accident&lt;/strong>&lt;/p>
&lt;p>I&amp;rsquo;m a bike person by default. I *hate running with a passion. One day I was riding my bike in the woods when suddenly I hit a big ol&amp;rsquo; tree trunk right head on at which moment my bikes front fork bent inwards and became completely useless. At this point I had to walk home. Repairing it proved to be a bit time consuming so I had to think of some other way to have my regular exercise.&lt;/p></description></item><item><title>How the past influences the present</title><link>https://skarlso.github.io/2014/04/13/how-the-past-influences-the-present/</link><pubDate>Sun, 13 Apr 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/04/13/how-the-past-influences-the-present/</guid><description>&lt;p>Hello.&lt;/p>
&lt;p>This is only a quick rant about a discussion I overheard the other day.&lt;/p></description></item><item><title>Example when to use the Strategy Pattern</title><link>https://skarlso.github.io/2014/02/19/example-when-to-use-the-strategy-pattern/</link><pubDate>Wed, 19 Feb 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/02/19/example-when-to-use-the-strategy-pattern/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>A quick post about an interesting idea.&lt;/p>
&lt;p>I want to elaborate on a possibility to use the Strategy Design pattern.&lt;/p></description></item><item><title>How to write a blog – Why long posts rarely work</title><link>https://skarlso.github.io/2014/02/13/how-to-write-a-blog-why-long-posts-rarely-work/</link><pubDate>Thu, 13 Feb 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/02/13/how-to-write-a-blog-why-long-posts-rarely-work/</guid><description>&lt;p>Hello.&lt;/p>
&lt;p>So let&amp;rsquo;s clarify this. They rarely or ever work if you are a beginner blogger. If you have a reputation it will probably work or people will use it as a reference. But I&amp;rsquo;m skipping ahead.&lt;/p>
&lt;p>&lt;strong>Beginnings&lt;/strong>&lt;/p>
&lt;p>When you are a beginner blog writer you want to get out as much content as possible. Write mostly relevant things and interesting information because you need to establish a name for yourself. To get that starting you want to be as interesting as possible and make people leave with the intent to come back for more.&lt;/p></description></item><item><title>How to check content header on unknown number of items – Python</title><link>https://skarlso.github.io/2014/02/11/how-to-check-content-header-on-unknown-number-of-items-python/</link><pubDate>Tue, 11 Feb 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/02/11/how-to-check-content-header-on-unknown-number-of-items-python/</guid><description>&lt;p>Hello guys.&lt;/p>
&lt;p>I&amp;rsquo;d like to share a little something with you. It&amp;rsquo;s what I cooked up in Python to check an unknown number of content items in a web application.&lt;/p>
&lt;p>Basically the script runs from a script folder under Grails. It goes through all the configured folders where there is static content like images, javascript, css and so on and so forth.&lt;/p>
&lt;p>And then with curl it calls these items up in using their respective paths&amp;rsquo;. This works best on localhost if you have your local environment configured to access these elements because in some places direct access is restricted.&lt;/p></description></item><item><title>The method of Loci and how it works for me</title><link>https://skarlso.github.io/2014/02/11/the-method-of-loci-and-how-it-works-for-me/</link><pubDate>Tue, 11 Feb 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/02/11/the-method-of-loci-and-how-it-works-for-me/</guid><description>&lt;p>Hello.&lt;/p>
&lt;p>Today I would like to write about something very interesting to you folks.&lt;/p>
&lt;p>It&amp;rsquo;s a common remember / recall technique called the Method of loci. Otherwise known as the Memory Palace. A very popular usage can be seen in the episodes of Sherlock Holmes from BBC. He uses it often.&lt;/p>
&lt;p>&lt;strong>What is the Method of loci?&lt;/strong>&lt;/p>
&lt;p>As the Wikipedia page write so properly.&amp;ldquo;In basic terms, it is a method of memory enhancement which uses visualization to organize and recall information.&amp;rdquo;&lt;/p></description></item><item><title>Why you should learn using Vim</title><link>https://skarlso.github.io/2014/02/10/why-you-should-learn-using-vim/</link><pubDate>Mon, 10 Feb 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/02/10/why-you-should-learn-using-vim/</guid><description>&lt;p>Hello,&lt;/p>
&lt;p>So Vim is a very powerful editing tool and has lots and lots of potential in regarding plug-ins.&lt;/p>
&lt;p>It has years and years of gathered knowledge and extensions and can virtually do anything you want. But that&amp;rsquo;s not even it&amp;rsquo;s final form.&lt;/p>
&lt;p>The real power of Vim lies in navigation and manipulation. The ability to navigate and edit without the use of arrow keys or mouse chops of a large portion of your time which you didn&amp;rsquo;t even realize you are wasting until you try it without it.&lt;/p></description></item><item><title>Why does it matter if I sit in an office or in a park</title><link>https://skarlso.github.io/2014/02/09/why-does-it-matter-if-i-sit-in-an-office-or-in-a-park/</link><pubDate>Sun, 09 Feb 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/02/09/why-does-it-matter-if-i-sit-in-an-office-or-in-a-park/</guid><description>&lt;p>Hello everybody.&lt;/p>
&lt;p>I&amp;rsquo;d like to explain a lot about a topic that is very near my heart. If your job is in an office you will understand this.&lt;/p>
&lt;p>&lt;strong>Why offices?&lt;/strong>&lt;/p>
&lt;p>So why are we sitting together in one big place cramped up with 20-300 other people? Why bother the catering and the ventilation and what not to accommodate these people at one place? Why not just leave them be and let them work at home?&lt;/p></description></item><item><title>How I recruit – Why tool requirements are stupid</title><link>https://skarlso.github.io/2014/02/04/how-i-recruit-why-tool-requirements-are-stupid/</link><pubDate>Tue, 04 Feb 2014 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2014/02/04/how-i-recruit-why-tool-requirements-are-stupid/</guid><description>&lt;p>Hello folks!&lt;/p>
&lt;p>Today I would like to write about something very interesting I&amp;rsquo;m seeing all over the place from recruiters. And that is tool requirements from developers.&lt;/p>
&lt;p>&lt;strong>For words&lt;/strong>&lt;/p>
&lt;p>So why is it a problem that in a requirement from a developer there a lots of these:&lt;/p>
&lt;ul>
&lt;li>DB2&lt;/li>
&lt;li>QTP&lt;/li>
&lt;li>Ranorex&lt;/li>
&lt;li>Eclipse ( yes I saw a few of these. )&lt;/li>
&lt;li>Hibernate&lt;/li>
&lt;li>Grails&lt;/li>
&lt;li>Ruby on Rails&lt;/li>
&lt;li>.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Long answer&lt;/strong>&lt;/p>
&lt;p>The answer is simple yet it has it&amp;rsquo;s roots very deep in the recruitment and the way companies work.&lt;/p></description></item><item><title>Why you should care about the quality of your test code</title><link>https://skarlso.github.io/2013/11/02/why-you-should-care-about-the-quality-of-your-test-code/</link><pubDate>Sat, 02 Nov 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/11/02/why-you-should-care-about-the-quality-of-your-test-code/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today I would like to talk to you about something interesting I was talking about with a developer friend.&lt;/p>
&lt;p>We talked about the quality of test code.&lt;/p>
&lt;p>He said. And I will quote this.&amp;ldquo;Why should we care? It&amp;rsquo;s not production code. We aren&amp;rsquo;t giving it to the customer.&amp;rdquo;&lt;/p>
&lt;p>There are a few reasons why you are going to get a slap in the face for a sentence like this. And let&amp;rsquo;s clarify here that we are talking about unit and functional tests as well. It shouldn&amp;rsquo;t matter what tests you are thinking about.&lt;/p></description></item><item><title>Diary of a Bit</title><link>https://skarlso.github.io/2013/10/11/diary-of-a-bit/</link><pubDate>Fri, 11 Oct 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/10/11/diary-of-a-bit/</guid><description>&lt;hr>
&lt;p>Dear everbody.&lt;/p>
&lt;p>I&amp;rsquo;d like to present you a small idea I was working on recently. The reminiscence of an old program. From the view point of the program.&lt;/p>
&lt;p>I&amp;rsquo;m planning to put these out in few days successions.&lt;/p>
&lt;p>I hope you enjoy it.&lt;/p>
&lt;p>Cheers,&lt;/p>
&lt;p>Gergely.&lt;/p>
&lt;hr>
&lt;p>If I remember correctly it was the year 2012 when I was born. I&amp;rsquo;m unsure of this date as my subroutines and algorithms have been re-written so many times that if it weren&amp;rsquo;t for my backups I wouldn&amp;rsquo;t remember a thing. I was a bold adventure of some young minds who thought that with me they will change the face of the world.&lt;/p></description></item><item><title>Low Tech – Why having less will fell more</title><link>https://skarlso.github.io/2013/08/26/low-tech-why-having-less-will-fell-more/</link><pubDate>Mon, 26 Aug 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/08/26/low-tech-why-having-less-will-fell-more/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>I&amp;rsquo;d like to share today something with all of you. I&amp;rsquo;ve been thinking about how technology affected my life in the long run. And how I perceive the world today around me. So let&amp;rsquo;s go around this topic for a little bit shall we?&lt;/p>
&lt;p>&lt;strong>The Past&lt;/strong>&lt;/p>
&lt;p>So as somebody who lived for a while without technology coming near family for a decade or so I have a little bit of past in me without smart phones, gadgets, tv or computers for that matter. Much times needed to pass as my family slowly got the money to gather to buy us our new part of the family the ZX Spectrum.&lt;/p></description></item><item><title>Why not to automate everything…</title><link>https://skarlso.github.io/2013/07/31/why-not-to-automate-everything/</link><pubDate>Wed, 31 Jul 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/07/31/why-not-to-automate-everything/</guid><description>&lt;p>Hello. I created a tale of why not to automate everything. With legos. Enjoy.&lt;/p>
&lt;p>Gergely.&lt;/p>
&lt;p>&lt;img alt="Picture 1" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture1.jpg">&lt;/br>
&lt;img alt="Picture 2" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture2.jpg">&lt;/br>
&lt;img alt="Picture 3" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture3.jpg">&lt;/br>
&lt;img alt="Picture 4" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture4.jpg">&lt;/br>
&lt;img alt="Picture 5" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture5.jpg">&lt;/br>
&lt;img alt="Picture 6" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture6.jpg">&lt;/br>
&lt;img alt="Picture 7" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture7.jpg">&lt;/br>
&lt;img alt="Picture 8" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture8.jpg">&lt;/br>
&lt;img alt="Picture 9" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture9.jpg">&lt;/br>
&lt;img alt="Picture 10" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture10.jpg">&lt;/br>
&lt;img alt="Picture 11" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture11.jpg">&lt;/br>
&lt;img alt="Picture 12" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture12.jpg">&lt;/br>
&lt;img alt="Picture 13" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture13.jpg">&lt;/br>
&lt;img alt="Picture 14" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture14.jpg">&lt;/br>
&lt;img alt="Picture 15" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture15.jpg">&lt;/br>
&lt;img alt="Picture 16" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture16.jpg">&lt;/br>
&lt;img alt="Picture 17" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture17.jpg">&lt;/br>
&lt;img alt="Picture 18" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture18.jpg">&lt;/br>
&lt;img alt="Picture 19" loading="lazy" src="https://skarlso.github.io/img/2013/07/31/picture19.jpg">&lt;/br>&lt;/p></description></item><item><title>Sublime text</title><link>https://skarlso.github.io/2013/06/24/sublime-text-5/</link><pubDate>Mon, 24 Jun 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/06/24/sublime-text-5/</guid><description>&lt;p>Hello everybody. I&amp;rsquo;ve been messing around with sublime for some time now. And been using it to write entires and stuff. So here I was thinking why the hell I should not us it as my main blog entry writer. And being the curious guy I was I thought that creating a plugin that let&amp;rsquo;s you submit your post from your favorite editor is just the thing I need.&lt;/p>
&lt;p>So without any further ado here it is. The wordpress blog entry submitter plugin for sublime text: &lt;a href='https://github.com/Skarlso/SublimeWordpressPlugin' target='blank'>Sublime WordPress Plugin&lt;/a>&lt;/p></description></item><item><title>Cucumber-Jvm And @AfterAll</title><link>https://skarlso.github.io/2013/04/18/cucumber-jvm-and-afterall/</link><pubDate>Thu, 18 Apr 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/04/18/cucumber-jvm-and-afterall/</guid><description>&lt;p>Hey folks.&lt;/p>
&lt;p>I find out something new about cucumber-jvm every day.&lt;/p>
&lt;p>If you want something that is executed after all of the tests have finished you must use the Java shutdownHook. It&amp;rsquo;s simple really you add in a block of code that can run right before the JVM quits. I know I know. It sounds awful but I found out that this is the actual way of doing this with java / cucumber.&lt;/p></description></item><item><title>Cucumber Test Name and Tags on Feature</title><link>https://skarlso.github.io/2013/04/15/cucumber-test-name-and-tags-on-feature/</link><pubDate>Mon, 15 Apr 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/04/15/cucumber-test-name-and-tags-on-feature/</guid><description>&lt;p>Hello everybody.&lt;/p>
&lt;p>I would like to show you a gem today that I found out.&lt;/p>
&lt;p>Apparently there is no easy way to get to the name of an executing cucumber scenario in cucumber-jvm&lt;/p>
&lt;p>You can try something like that:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-java" data-lang="java">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">@After&lt;/span> &lt;span style="color:#75715e">//this is cucumbers @Afters&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">void&lt;/span> &lt;span style="color:#a6e22e">afterExecution&lt;/span>(Scenario scenario) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> logger.&lt;span style="color:#a6e22e">log&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;The status of the test is: &amp;#34;&lt;/span> &lt;span style="color:#f92672">+&lt;/span> scenario.&lt;span style="color:#a6e22e">getStatus&lt;/span>());
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>But that isn&amp;rsquo;t giving you too much now is it? And the API of scenario is as small as it can get. It offers you four options:&lt;/p></description></item><item><title>Groovy and Grails course summary</title><link>https://skarlso.github.io/2013/04/11/groovy-and-grails-course-summary/</link><pubDate>Thu, 11 Apr 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/04/11/groovy-and-grails-course-summary/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>I attended a 4 day course of Groovy and Grails and this is my attempt at writing up a summary to see how much I retained. I&amp;rsquo;ll try to do this from the top of my head without peaking at my notes.&lt;/p>
&lt;p>So let&amp;rsquo;s begin.&lt;/p>
&lt;p>&lt;strong>Introductions&lt;/strong>&lt;/p>
&lt;p>First of all, introductions. The course was held by Peter Ledbrook. He is the guy who wrote &lt;a href="http://www.amazon.co.uk/Grails-Action-Peter-Ledbrook/dp/1617290963/ref=sr_1_2?ie=UTF8&amp;qid=1365713080&amp;sr=8-2&amp;keywords=peter+ledbrook" title="Grails in Action">Grails in Action&lt;/a>. He is awesome, go check him out. :: &lt;a href="https://twitter.com/pledbrook" title="Twitter for Peter">Twitter&lt;/a> ::&lt;/p></description></item><item><title>My history in testing</title><link>https://skarlso.github.io/2013/04/11/my-history-in-testing/</link><pubDate>Thu, 11 Apr 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/04/11/my-history-in-testing/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today I&amp;rsquo;d like to share with you some of the experiences I had as a beginner tester. I hope it sets you off on a path to enlightenment and leaves you off with a good appetite for testing. Shall we begin then?&lt;/p>
&lt;p>&lt;strong>The early days&lt;/strong>&lt;/p>
&lt;p>It was 2004 when I finished school and started working at my first company. I finished as a software developer which is kind of an exaggeration since I only finished a 2 years course of it. I wasn&amp;rsquo;t really one for school. I was more of a home learner. That&amp;rsquo;s how you learn programming these days anyways.&lt;/p></description></item><item><title>It’s all about human interaction.</title><link>https://skarlso.github.io/2013/01/31/its-all-about-human-interaction/</link><pubDate>Thu, 31 Jan 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/01/31/its-all-about-human-interaction/</guid><description>&lt;p>Hello everybody.&lt;/p>
&lt;p>Today I would like to write about something I experienced over the years of being in the software industry.&lt;/p>
&lt;p>&lt;strong>Some History&lt;/strong>&lt;/p>
&lt;p>I&amp;rsquo;ve been a tester for a long time now. I&amp;rsquo;ve been up and down and down and up. I struggled for a very long time until I became somebody who I am today. And I still have many things to learn ahead of me.&lt;/p>
&lt;p>I learned from many people. I personally thing my greatest influence on testing was James Marcus Bach and his Brother Jon Bach you should definitely check out these guys. It took me a long time to get to where I am today. And after ~10 years now I can state with a reasonable confidence that this industry is no longer about technology or solutions to technological problems.&lt;/p></description></item><item><title>What you really need to know to become a Testing Expert</title><link>https://skarlso.github.io/2013/01/21/what-you-really-need-to-become-a-testing-expert/</link><pubDate>Mon, 21 Jan 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/01/21/what-you-really-need-to-become-a-testing-expert/</guid><description>&lt;p>Hello Everybody.&lt;/p>
&lt;p>Today I would like to show you what you need to become a Testing expert.&lt;/p>
&lt;p>If you had noticed I deliberately left out the word Software. Why? Because becoming and expert in Testing Anything has the same root as becoming an expert to test software. And for that let me take you back to a Galaxy Far Far Away in Time AND Space.&lt;/p>
&lt;p>&lt;strong>The beginnings.&lt;/strong>&lt;/p>
&lt;p>I went to school in Oroszlany, my home town in Hungary. My official Technical title would be Mechanical Testing Engineer. I had the luck that most things which were thought at that school and I liked were thought by people I liked too and were clever in their respective fields. Like Pneumatics, Metallurgy, Mechanics, Chemistry these were all really awesome fields. To this day I don&amp;rsquo;t know why I haven&amp;rsquo;t ended up in some lab testing the breaking point of metals and the capacity of various chemicals.&lt;/p></description></item><item><title>From Chaos There Shall Be Order</title><link>https://skarlso.github.io/2013/01/04/from-chaos-there-shall-be-order/</link><pubDate>Fri, 04 Jan 2013 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2013/01/04/from-chaos-there-shall-be-order/</guid><description>&lt;p>Dear Readers.&lt;/p>
&lt;p>Today I want to talk to you about something I discovered over years of working and experience.&lt;/p>
&lt;p>Also something that I can see in the world repeating over and over again. Not just in Software business but also in History in Human nature in Physics and Systems.&lt;/p>
&lt;p>So let&amp;rsquo;s see what I&amp;rsquo;m talking about.&lt;/p>
&lt;p>&lt;strong>What is Chaos?&lt;/strong>&lt;/p>
&lt;p>Chaos is a state of utter confusion. Chaos is the opposite of order. Chaos is when everybody does what they want without thinking about the consequences.&lt;/p></description></item><item><title>Methodologies, Thought Patterns, Lies</title><link>https://skarlso.github.io/2012/12/12/methodologies-thought-patterns-lies/</link><pubDate>Wed, 12 Dec 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/12/12/methodologies-thought-patterns-lies/</guid><description>&lt;p>Hello everybody.&lt;/p>
&lt;p>Today I&amp;rsquo;d like to write about something I discovered over the years of researching and following certain people and movements in Testing and Programming world.&lt;/p>
&lt;p>Let me tell you that there are quite an amazing amount of stuff to be read out there. It&amp;rsquo;s overwhelming.&lt;/p>
&lt;p>Let&amp;rsquo;s talk about &lt;strong>Methodologies&lt;/strong> first.&lt;/p>
&lt;p>There are many out there currently. In programming and in testing too. Many speak of ways how you should or should not do you work. Many of them tend to say that others aren&amp;rsquo;t the right way. However just as many tend to say that you can share your knowledge or you can only partially use that particular methodology because they realised that if they say others are crap they close themselves from evolving and they create a way of thinking that will say: Ohhh yeah? You can&amp;rsquo;t tell me what I should do! Who are you to say that that technique is wrong?&lt;/p></description></item><item><title>TEAS: Testing Exploration Adventure Session</title><link>https://skarlso.github.io/2012/12/01/teas-testing-exploration-adventure-session/</link><pubDate>Sat, 01 Dec 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/12/01/teas-testing-exploration-adventure-session/</guid><description>&lt;p>Hello Everybody.&lt;/p>
&lt;p>I&amp;rsquo;d like to introduce T.E.A.S. to you. This is something I came up with yesterday which requires a lot of fantasy some good thinking planning and enthusiastic people. So, let&amp;rsquo;s get started.&lt;/p>
&lt;p>&lt;strong>What is it about?&lt;/strong>&lt;/p>
&lt;p>Testing Exploration Adventure Session is about. Testing! There. No real surprise, eh? TEAS has it&amp;rsquo;s roots in &lt;strong>RPGs&lt;/strong>. Role Playing Games. If you ever heard or read about M.A.G.U.S. or the more known Dungeons &amp;amp; Dragons you will have a better understanding of the concept behind this phenomena.&lt;/p></description></item><item><title>How to eliminate a parameter boom</title><link>https://skarlso.github.io/2012/10/09/how-to-eliminate-a-parameter-boom/</link><pubDate>Tue, 09 Oct 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/10/09/how-to-eliminate-a-parameter-boom/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Today I want to write about a little trick I learned.&lt;/p>
&lt;p>If you are working with legacy code and you don&amp;rsquo;t have the chance to eliminate core design problems, you can use this little pattern to help you out.&lt;/p>
&lt;p>&lt;strong>Problem&lt;/strong>&lt;/p>
&lt;p>Problem is that you have a class that has a gazillion collaborators and at some point in time one of the clever devs thought it would be a cool idea to do dependancy injection via the constructor. We all know that doing this makes the class immutable which is very good for a number of reasons. However it doesn&amp;rsquo;t provide a flexible solution if you want to leave out one or two collabs. For that your would have to create Adapter constructors and chain them upwards which would get very ugly very fast. While using JavaBeans getters and setters can leave your class in a harmful state like not at all or partially initialised.&lt;/p></description></item><item><title>Coderetreat London</title><link>https://skarlso.github.io/2012/09/30/89/</link><pubDate>Sun, 30 Sep 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/09/30/89/</guid><description>&lt;p>Hello everybody.&lt;/p>
&lt;p>So yesterday I was on a little gathering called &lt;a href="http://coderetreat.org/" title="Coderetreat" target="_blank">Coderetreat&lt;/a>.&lt;/p>
&lt;p>If you look at the link you can read everything about it. If not, I&amp;rsquo;ve provided a short description.&lt;/p>
&lt;p>&lt;strong>What it is about?&lt;/strong>&lt;/p>
&lt;p>So what is codereatreat about? In short it&amp;rsquo;s about programmers getting together and honing and practicing there skills in order to become more at what they are doing. It&amp;rsquo;s a practice run with great people. TDDing one problem the whole day long with constantly applied constraints.&lt;/p></description></item><item><title>What my brain is up to the whole day…</title><link>https://skarlso.github.io/2012/09/20/what-my-brain-is-up-to-the-whole-day/</link><pubDate>Thu, 20 Sep 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/09/20/what-my-brain-is-up-to-the-whole-day/</guid><description>&lt;p>Hello folks.&lt;/p>
&lt;p>Here is a little graphic I made to show what my brain is up to the whole day long. Excuse me for the lack of my colouring skills. Enjoy&lt;/p>
&lt;p>![Brain]&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/p>
&lt;p>Thanks for reading!&lt;/p>
&lt;p>Gergely.&lt;/p>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>&lt;a href="http://dl.dropbox.com/u/7604030/barinColored.jpg">http://dl.dropbox.com/u/7604030/barinColored.jpg&lt;/a>&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Learning programming with a visual mind</title><link>https://skarlso.github.io/2012/09/09/learning-programming-with-a-visual-mind/</link><pubDate>Sun, 09 Sep 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/09/09/learning-programming-with-a-visual-mind/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>Today I want to write to you about &lt;strong>learning&lt;/strong> something with a &lt;strong>visual mind&lt;/strong>. There are a gazillion posts out there that tell you how to learn something with a visual mind. However, there are only a few &lt;strong>actually describing&lt;/strong> how to learn something as complicated and logical as programming. How do you draw up a function? How do you draw up a cycle or a structure?&lt;/p>
&lt;p>Actually these are really &lt;strong>easy&lt;/strong>. A &lt;strong>cycle&lt;/strong>? No problem. What&amp;rsquo;s a &lt;strong>circle&lt;/strong> if not a cycle? &lt;strong>Structure&lt;/strong>? This should be an easy one. You can draw a whole &lt;strong>building&lt;/strong> and then place &lt;strong>building blocks&lt;/strong> into it.&lt;/p></description></item><item><title>TDD and Game of Life</title><link>https://skarlso.github.io/2012/07/12/tdd-and-game-of-life/</link><pubDate>Thu, 12 Jul 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/07/12/tdd-and-game-of-life/</guid><description>&lt;p>So today at 8-12PM I had a great session with two friends of mine. It was awesome. Like a mini code retreat.&lt;/p>
&lt;p>We set down in a musky bar, drank wine and beer and cider, and decided to practice some TDD with the well known problem of &lt;a href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life" target="_blank">Conway&amp;rsquo;s Game of Life&lt;/a>. This challenge is really interesting. I never done it before, ever. So it was a really good practice for me.&lt;/p></description></item><item><title>Journey into an unknown system</title><link>https://skarlso.github.io/2012/06/28/journey-into-an-unknown-system/</link><pubDate>Thu, 28 Jun 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/06/28/journey-into-an-unknown-system/</guid><description>&lt;p>Aka, what you can do if you are facing and unknown framework / system you have to work with for quite some time.&lt;/p>
&lt;p>&lt;strong>Get intimate&lt;/strong>&lt;/p>
&lt;p>You are going to live with this system for a while. The best thing you can do is getting to know it better. You have to get it to know like you would approche a fine lady. You have to ask it questions look after it, how it feels how its day was. Have to listen to what it tells you, you have to read its diary if necessary.&lt;/p></description></item><item><title>Solution to Wrap Kata</title><link>https://skarlso.github.io/2012/06/26/solution-to-wrap-kata/</link><pubDate>Tue, 26 Jun 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/06/26/solution-to-wrap-kata/</guid><description>&lt;p>My solution to the String Wrap Kata. The goal is to have it wrap a text on a given column width.&lt;/p>
&lt;p>It is not the best solution but this is my first try. I did it with TDD so there were tests first, which I&amp;rsquo;m not going to copy in..&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-java" data-lang="java">&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">WrapKata&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> String &lt;span style="color:#a6e22e">wrap&lt;/span>(String input, &lt;span style="color:#66d9ef">int&lt;/span> columnSize) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> (input.&lt;span style="color:#a6e22e">length&lt;/span>() &lt;span style="color:#f92672">&amp;lt;=&lt;/span> columnSize)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> input;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">else&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> wrapLines(input, columnSize);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> String &lt;span style="color:#a6e22e">wrapLines&lt;/span>(String input, &lt;span style="color:#66d9ef">int&lt;/span> columnSize) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">int&lt;/span> breakPoint &lt;span style="color:#f92672">=&lt;/span> getBreakPoint(input, columnSize);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> String head &lt;span style="color:#f92672">=&lt;/span> createHead(input, breakPoint);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> String tail &lt;span style="color:#f92672">=&lt;/span> createTail(input, breakPoint);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> head &lt;span style="color:#f92672">+=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;\n&amp;#34;&lt;/span> &lt;span style="color:#f92672">+&lt;/span> wrap(tail, columnSize);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> String &lt;span style="color:#a6e22e">createTail&lt;/span>(String input, &lt;span style="color:#66d9ef">int&lt;/span> breakPoint) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> input.&lt;span style="color:#a6e22e">substring&lt;/span>(breakPoint).&lt;span style="color:#a6e22e">trim&lt;/span>();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> String &lt;span style="color:#a6e22e">createHead&lt;/span>(String input, &lt;span style="color:#66d9ef">int&lt;/span> breakPoint) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> input.&lt;span style="color:#a6e22e">substring&lt;/span>(, breakPoint).&lt;span style="color:#a6e22e">trim&lt;/span>();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span> &lt;span style="color:#a6e22e">getBreakPoint&lt;/span>(String input, &lt;span style="color:#66d9ef">int&lt;/span> columnSize) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> (input.&lt;span style="color:#a6e22e">contains&lt;/span>(&lt;span style="color:#e6db74">&amp;#34; &amp;#34;&lt;/span>)) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> input.&lt;span style="color:#a6e22e">lastIndexOf&lt;/span>(&lt;span style="color:#e6db74">&amp;#39; &amp;#39;&lt;/span>, columnSize);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#66d9ef">else&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> columnSize;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>How to read a professional book for slow learners</title><link>https://skarlso.github.io/2012/06/18/how-to-read-a-professional-book-for-slow-learners/</link><pubDate>Mon, 18 Jun 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/06/18/how-to-read-a-professional-book-for-slow-learners/</guid><description>&lt;p>Hi everybody.&lt;/p>
&lt;p>Today I want to talk to you about.. Well.. How to read a professional book for slow learners without too much waste of time.&lt;/p>
&lt;p>Let us start at the. well. the beginning. How do you normally read a book if you want to memorize it properly. You read it once and then re read the whole thing again until it gets in your head? Or do you have another strategy?&lt;/p></description></item><item><title>Don’t throw Exception</title><link>https://skarlso.github.io/2012/06/13/dont-throw-exception/</link><pubDate>Wed, 13 Jun 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/06/13/dont-throw-exception/</guid><description>&lt;p>Hi.&lt;/p>
&lt;p>Today I want to talk about a common problem in many frameworks I encountered over the course of my carrier as a Java dev / automation engineer, whatnot.&lt;/p>
&lt;p>Throwing Exceptions. That is in your method you have something like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-java" data-lang="java">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">void&lt;/span> &lt;span style="color:#a6e22e">insertMethodNameHere&lt;/span>(String param) &lt;span style="color:#66d9ef">throws&lt;/span> Exception {}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is bad. And I will tell you in short forms why.&lt;/p>
&lt;p>&lt;strong>Hides exceptions&lt;/strong>&lt;/p>
&lt;p>This one should be obvious. When a method throws exception you can never be sure what kind of exceptions it handles. It will hide what problems it can encounter. It will hide possible threats and will generally mean nothing to you when it fails.&lt;/p></description></item><item><title>How to write a professional blog</title><link>https://skarlso.github.io/2012/06/13/how-to-write-a-professional-blog/</link><pubDate>Wed, 13 Jun 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/06/13/how-to-write-a-professional-blog/</guid><description>&lt;p>Hi folks.&lt;/p>
&lt;p>I want to write a little bit about writing a professional blog.&lt;/p>
&lt;p>&lt;strong>Early steps&lt;/strong>&lt;/p>
&lt;p>Let&amp;rsquo;s first talk about what you understand about professional blog. It&amp;rsquo;s either a semi professional one, that mixes life with professionalism, like chess, programming, testing, painting, drawing, engineering whatever your profession is. Or it can be a purely professional one without your life getting involved in it.&lt;/p>
&lt;p>Either way you have to decide at the beginning. Why? Because that&amp;rsquo;s the kind of people you will attract. If you want to attract people from your profession then you have to decide that you will write plenty of your profession into your blog. If you want to attract hobbists more then you write about your profession AND daily life or other situations that are essentially irrelevant. Of course you can get both in both versions but the numbers will be different.&lt;/p></description></item><item><title>Making your code understandable</title><link>https://skarlso.github.io/2012/06/13/making-your-code-understandable/</link><pubDate>Wed, 13 Jun 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/06/13/making-your-code-understandable/</guid><description>&lt;p>Hi!&lt;/p>
&lt;p>I&amp;rsquo;ve seen this many times over and over again. Many people have wrote books about it already. Like Uncle Bob&amp;rsquo;s Clean Code. Like Pragmatic Programmer by Andrew Hunt and David Thomas. What makes your code understandable to others.&lt;/p>
&lt;p>Is it &lt;strong>Comments&lt;/strong>?&lt;/p>
&lt;p>No. It&amp;rsquo;s not comments. If your code could be read properly you wouldn&amp;rsquo;t need comments to explain what it does. Like Uncle Bob said. A good code doesn&amp;rsquo;t contain surprises. It does exactly what you would think it should do on the next line. It doesn&amp;rsquo;t have curves and misinformation. It doesn&amp;rsquo;t have plots and turns of events like a good crime book. No. Good code is a like a boring soap opera with predictable plot and boring plain characters who don&amp;rsquo;t change there behavior based on circumstances.&lt;/p></description></item><item><title>Getting Dual Card to work on Ubuntu 12.04.</title><link>https://skarlso.github.io/2012/04/11/getting-dual-card-to-work-on-ubuntu-12-04/</link><pubDate>Wed, 11 Apr 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/04/11/getting-dual-card-to-work-on-ubuntu-12-04/</guid><description>&lt;p>Hi guys.&lt;/p>
&lt;p>Today I want to talk about a little adventure I had yesterday night. It was quite the fun and frustration too. But neither comes without the other when it&amp;rsquo;s about linux.&lt;/p>
&lt;p>So let us see what the problem is at hand. The problem machine is a Dell Inspiron N5110 with Nvidia card number one: GeForce GT 525M. And number two: Integrated. Optimus for the win.&lt;/p>
&lt;p>So how windows is handling this is actually with a software called Optimus. Now linux wasn&amp;rsquo;t design to handle this properly but there are solutions. But I&amp;rsquo;m getting ahead of myself. Let&amp;rsquo;s start with the install.&lt;/p></description></item><item><title>JMS Connection setup and Framework</title><link>https://skarlso.github.io/2012/03/04/jms-connection-setup-and-framework/</link><pubDate>Sun, 04 Mar 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/03/04/jms-connection-setup-and-framework/</guid><description>&lt;p>Hello chumps.&lt;/p>
&lt;p>Today I want to write about jms connection testing with a small framework. I wrote a small thing using a factory object model. It&amp;rsquo;s a lead, a proof of concept. You can use this to go onward.&lt;/p>
&lt;p>First, let&amp;rsquo;s begin with the JMS connection it self.&lt;/p>
&lt;p>&lt;strong>JMS Connection&lt;/strong>&lt;/p>
&lt;p>First rule of thumb is: &amp;ldquo;Don&amp;rsquo;t wait for a response when dealing with JMS queues.&amp;rdquo; How so? Because, a JMS queue is asynchronous so you wont get back anything. There are however two ways of checking if it was a success or not.&lt;/p></description></item><item><title>Configuration</title><link>https://skarlso.github.io/2012/02/27/configuration/</link><pubDate>Mon, 27 Feb 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/02/27/configuration/</guid><description>&lt;p>When I see something like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-java" data-lang="java">&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">Config&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">final&lt;/span> string DATABASELINK &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;linkhere&amp;#34;&lt;/span>;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>It sends a small, but chilling shiver down my spine. Just. don&amp;rsquo;t. There are a lot of possibilities to use configuration in Java. Java property files. Xml. Xml serialization. CSV file. Whatever suits you best, but this? DON&amp;rsquo;T!&lt;/p></description></item><item><title>Hello and welcome</title><link>https://skarlso.github.io/2012/02/26/hello-and-welcome/</link><pubDate>Sun, 26 Feb 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/02/26/hello-and-welcome/</guid><description>&lt;p>Hello Dear Visitor.&lt;/p>
&lt;p>Welcome to the ramblings of a software test engineer who thinks that he is a tester but feels like a developer but works as a tester but wants to learn programming like a developer. And so on and so fort.&lt;/p>
&lt;p>I will make a journey that has been done by many automation testers. The journey when you decide to step one forward. A friend of mine told me that it is good that a tester learns proper programming and that more should do so. She is right. And I will try to document this journey as best as possible. I will try to write down my experiences with java, android, automation, swing, maven, hudson, selenium, cucumber, TDD, BDD, Agile environment and whatever tool I meet.&lt;/p></description></item><item><title>Testing ‘code’ tag.</title><link>https://skarlso.github.io/2012/02/26/testing-code-tag/</link><pubDate>Sun, 26 Feb 2012 00:00:00 +0000</pubDate><guid>https://skarlso.github.io/2012/02/26/testing-code-tag/</guid><description>&lt;p>Hello.&lt;/p>
&lt;p>This is just a quick post to test the working of the code tag.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-ruby" data-lang="ruby">&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">Given&lt;/span>(&lt;span style="color:#e6db74">/The Action is ([A-z]*)/&lt;/span>) &lt;span style="color:#66d9ef">do&lt;/span> &lt;span style="color:#f92672">|&lt;/span>action&lt;span style="color:#f92672">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> @action &lt;span style="color:#f92672">=&lt;/span> action
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">end&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Perfect!!&lt;/p>
&lt;p>The name of the plugin is WP-Syntax. The trick is to edit the page in plain HTML. Because the WordPress word editor screws up the &amp;lt;&amp;gt; tags. But surely you already knew that.&lt;/p></description></item></channel></rss>