Posts

Showing posts from 2021

More useful AutoHotKey commands!

Image
I figure I'd just share stuff as found myself needing to automate more of my life. This might also give you some behind-the-scenes insight in what I'm doing. Or it might not. Previous article in this series:  AutoHotKey is neat ... Dates! I write a lot of notes with dates attached to them. With a simple .date , AHK writes the current date in my local date format in whatever I'm editing, e.g. 30/09/2021 : ::.date:: Today := A_Now FormatTime, Today, %Today%, ShortDate SendInput %Today% return To prepare for future meetings, I use .t for tomorrow, or .2 for the day after tomorrow. ::.t:: Tomorrow := A_Now Tomorrow += 1, days FormatTime, Tomorrow, %Tomorrow%, ShortDate SendInput %Tomorrow% return ::.2:: DayAfterTomorrow := A_Now DayAfterTomorrow += 2, days FormatTime, DayAfterTomorrow, %DayAfterTomorrow%, ShortDate SendInput %DayAfterTomorrow% return Window management! Windows already comes with great windows management; I use the following built-in actions on a daily basis (

Just had this idea of calculate a constant color value for a given piece of text

Image
My first thought was to take the text and remove all non-hexadecimal values from it, meaning "In f orm a tion C l a ssifi ca tion" would be #FACAFA . Neat! " Ba n a n a s" would end up being #BAAA . Not exactly a banana-looking color, but it's a color. I played around with it a little bit when I got another idea. What if I just take extract the numerical unicode value from each character and build up an RGB color from that?  let r = 1, g = 1, b = 1; Array .from(text) .map(c => c.charCodeAt()) .forEach((v, i) => { if (i % 3 === 0) b += v; else if (i % 2 === 0) g += v; else r += v; }); The only issue I was having then, was that the resulting number would exceed 255 which is a non-OK color value. To solve the issue, I decided to normalize the value to somewhere between 150 and 255 to get bright-looking colors that would look nice behind

The Five Dysfunctions of a Team - a leadership fable

Image
Constructed as a fable, this book - like the Phoenix Project - is able to pack a lot of learning in a small package. I found the book quite easy to read, getting through half of it in one single sitting (which is unheard of for me)! I understand now why this is recommended reading for leadership positions at Redgate (where I'm currently employed), and I - in turn - strongly believe that more people in leadership, nay team settings  should read this book. There is so much to unpack about intrapersonal behaviour, that I'd argue the book will be valuable quite early in one's career, if one is expected to partake in meetings and discuss topics. Pretty broad, eh? Indeed.

Care Personally and Challenge Directly

Image
It took me a while, but I've finally finished Radical Candor ! I found the book tough to get through, but do believe it was time well spent. I would recommend the book to aspiring managers as it tells stories about a variety of situations that can arise on the job and helps you think through them. The book starts with encouraging the reader to build meaningful relationships with people you work with, arguing that maintaining these relationships will be key when you later try to get, give and encourage guidance. Kim Scott emphasizes the importance in understanding what motivates each person on your team - which part of their job to they particularly enjoy; which parts do they suffer through; is there something else they're eyeing? - so that you then can drive results collaboratively. In part 2 of the book, Kim gives you a series of tools and techniques to build these relationships, establish trust and gives you ideas for getting, giving and encouraging praise and criticism (we n

AutoHotKey is neat: Duplicate document with CTRL+D

I keep coming back to AutoHotKey to help me automate/streamline things I do on a daily basis. If you get inspired by this post, I urge you to suffer through the pain and write your scripts yourself, however (rather than downloading them), as they will act on your behalf (and therefore cause damage). Anyway, I found myself creating new documents based on old one. It felt natural to Duplicate  the old document with CTRL+D as you'd do in Mac with CMD+D (or as you'd do in, say PowerPoint to duplicate a slide). CTRL+D however, deletes a document in Windows Explorer. Great sadness. To fix the sadness, I adopted my AHK script to include #IfWinActive, ahk_exe Explorer.EXE ^d::Send ^c^v That is, in Windows Explorer windows, when I press CTRL+D , I actually want to send CTRL+C followed by CTRL+V to duplicate an entry. Other fun sections in the scripts are #IfWinActive, Microsoft Visual Studio ::gt::=>  ::fn::() =>  That is, in Visual Studio, when I type gt , I actually want

High Output Management - a book review

Image
Transitioning to a new role in my organization, I'm reading a whole lot of books from categories I hadn't been previously. Here are my thoughts on High Output Management (linked below). I was introduced to the book from a YouTube video (recommended to me by a colleague), basically saying that this book contains the source ideas of many other works. My colleague also ensured me that it was an easy read. Filled with applicable, hands-on advice, the book starts off by teaching you about The Basics of Production: Delivering a Breakfast (or a Colleague Graduate, or a Compiler, or a Convicted Criminal...) , introducing concepts such as limiting steps, optimizations (and their constraint on flexibility), using indicators, trends/forecasts, and so much more. Have you heard of OKRs before ? The book discusses paired indicators early, stating that "a measurement - any measurement - is better than none" and goes on to say "a genuinely effective indicator will cover the out

Succeeding with OKRs in Agile

Image
Here are my highlights from Succeeding with OKRs in Agile (linked below). Once set, OKRs should be the focus of all work. Whether OKRs are met or not is almost secondary. OKRs are a hypothesis for the coming quarter, a best effort guess at what will advance purpose. At the end of the quarter, review and adapt - what could be more agile? ARPANET became the internet in 1981, the same year IBM launched the PC. Managers must look at outcomes. Enhance independence even at the cost of redundancy and duplication. Goals bring focus, and focus is powerful. But focus also means blinkered vision, which carries dangers - but if we aren't blinkered we may be overwhelmed. Software engineers might recognize this as abstraction. Outcome is described in terms that speak to the customers. Achieving a key result should deliver some benefit - some value - to someone. A team may have a long-term plan or a roadmap, a mission oar vision statement, a business plan or statement of the market opportunity, m

Book review: Blazor WebAssembly by Example: A project-based guide to building web apps with .NET, Blazor WebAssembly, and C#

Image
I recently got my hands on a pre-release copy of Blazor WebAssembly by Example (linked below) by Toi B. Wright. As I've previously been quite biased towards Blazor Server, I appreciated reading about the merits of BWA, such as using it as a conduit to Progressive Web Applications and using PWAs as a means to publish your web application to app stores, like Starbucks, Uber and Spotify have done . The book does not go into how to publish your application, but teaches you about the PWA manifest and service workers as it discusses JavaScript interoperability. Another thing I appreciated about the book, was the way it set expectations in its preface. Toi outlines what her book covers, chapter by chapter, giving you a sense of what you're about to learn.  Speaking of the preface, however; in the section Who this book is for , it said something I didn't recognize throughout the book: This book is for experienced web developers who are tired of constantly learning the latest new J

There's never been a better time to get into web development with .NET!

I recently read Jimmy Engström's "Web Development with Blazor: A hands-on guide for .NET developers to build interactive UIs with C#" (linked below), finishing it in record time (2 days!) which is quite the compliment to the author as I normally consider myself a slow reader! His book gives you step-by-step instructions on how to create a fully functional blogging app (with Markdown Support!) with Blazor, including its database configuration and setting up authentication with social logins, such as Google and Facebook. While I, as an experienced .NET and web developer, got value out of the book (and will revisit parts as I get my hands dirty; I got some ideas ...), I believe it would offer even more value to the uninitiated: I’m convinced this would be a great first book on .NET web development, giving an aspiring engineer-in-training a kick start into their new career! I claim this as Jimmy not only teaches the reader about Blazor, but also touches on techniques such as

Using Active Directory Service Principal authentication to connect to Azure SQL

Image
This article describes how to authorize a .NET application to connect to an Azure SQL Server through Azure Active Directory. Why You don't want to connect to a database with your personal account details. You want to be able to control the login over time, expiring access as needed. Register your application Presuming you have an Azure SQL Server and a Database you'd like to connect to, you'll need to register your application in Azure AD. This is done through the App Registrations blade : You won't need to register a Redirect URL for this example. At this point, it will be prudent to write down the following properties for later use: Application (client) ID (called AppId  in the accompanying code) Directory (tenant) ID (called TenantId  in the accompanying code) Grant access to Azure SQL Database Next up, we need to give your application access to the Azure SQL Database service . This is done through the API Permissions  blade: Add client authentication In order for yo

Infrastructure as Code - a Summary

Adhere to DORA's Accelerate research, track Delivery lead time , Deployment frequency , Change fail percentage and Mean Time to Restore . Prioritize speed and quality by continuously deliver infrastructure changes through code and automated pipelines. These is the final part of the Infrastructure as Code series . Define everything as code. Continuously test and deliver all work in progress. Build small, simple pieces that you can change independently. You need a Cloud Age mindset, exploiting speed to improve quality and building quality in to gain speed. Automating your infrastructure takes work, but doing it helps you make changes (and build better systems from scratch). Assume that systems are unreliable. Make everything reproducible. Avoid snowflake systems that you dare not touch. Create disposable things. Minimize variation to simplify maintenance, even if you dockerize everything. Ensure that you can repeat any action. Minimize configuration. If you need radically different

If every change is an exception, then you can't automate it.

An application has traditionally run on a machine of some sort, utilizing the machine's hardware and software capabilities. A number of years back, I was responsible for a Windows based system, utilizing MSMQ as part of its operation, for example. These application servers, were the application runtimes for my system. These are my reflections, lessons learned and brief summary of chapters 11 and 12 of Infrastructure as Code and is  part of the Infrastructure as Code series . Servers are more complex than other types of infrastructure, like network and storage primitives. They have more moving parts and variation, so most teams still spend quite a bit of their time configuring and updating operating systems, packages and configuration files.  It is useful to assign a role  to a server, indicating its purpose. Is this an application server, a dedicated database service, a central monitoring repository? When provisioning servers, it's also useful to use role inheritance . You migh

Application Driven Infrastructure

The whole point of provisioning infrastructure, is to run applications on it. Depending on the technology behind your programming environment of choice, you might need an application runtime (JRE, .NET Runtime) to support its execution. Your application might also need other supporting systems to be available, e.g. a queuing system, a file system etc., all of which might require some configuration to work the way you intend them to. Finally, your application might need data structures and reference data available to it, not to mention connectivity configuration and, possibly, parameters passed into your application. These are my reflections, lessons learned and brief summary of chapter 10 of Infrastructure as Code and is  part of the Infrastructure as Code series . Although Docker, K8s and Helm charts are all the rage, other deployment package formats include Server Operating System packages such as RPM, DEB, MSI and Language Runtime Engine packages such as JARs. To manage data schemas

Applying sound coding practices when testing infrastructure

Just as a big benefit of TDD, is that your component design improves ; writing tests while designing and building systems - rather than afterwards - forces you to improve your designs. A component that is difficult to test in isolation, is a symptom of design issues.  These are my reflections, lessons learned and brief summary of chapter 9 of Infrastructure as Code and is  part of the Infrastructure as Code series . Design your components to be small and focused, e.g. installing an application runtime (.NET, JRE, ...) onto a server and then ensuring that it (dotnet, java) is available on the path. When it comes to testing, consider taking steps to syntax check and lint your infrastructure code, before you ask your cloud provider to provision resources for you. This will save you time and, money and headaches: Syntax checking: Execute a dry run ( terraform validate , aws cloudformation validate-template , using arm-tt ) on your infrastructure code to quickly get feedback when you've

Stack configuration, configuration management and infrastructure testing

A stack is a set of infrastructure resources, e.g. an Virtual Machine, Network and Database ; or a Network Interface, A Virtual Harddrive and a Network Share . These are my reflections, lessons learned and brief summary of chapters 7 and 8 of Infrastructure as Code and is  part of the Infrastructure as Code series . When you configure a stack, keep parameters simple. If you find that you need an advanced set of parameters - or you find yourself introducing branching logic - make a new, more specialized, stack. When naming resources in your stack, consider using a combination of a static and dynamic name, like app-service- ENVIRONMENT . If you are working with resource managers where you can generate a unique ID, consider generating a unique ID for a root object and then use that ID as a suffix. See this article for more information . When transitioning into the world of stack configuration, keep non-secret configuration in source control (as opposed manually typing it in, or passing it

Stacks in all sizes and shapes

Image
One of the initial hurdles in learning any new thing, is to get a grasp of the terminology - the specific language used in the specific context. Infrastructure as Code addresses a shortcoming of language as it is trying to define a "Stack". Having talked about how a Stack is a set of related infrastructure resources (say a Database, a Disk, a Network), it acknowledges that "Most stack management tools don't call themselves stack management tools. Each tools has its own terminology to describe the unit of infrastructure it manages." Future blog posts are likely to use the word Stack to describe a set of related infrastructure resources. This post covers chapters 5-6 of the book (linked below) and is part of the Infrastructure as Code series . When you make a change in a Stack, you want to Continuously Deploy it, as you want to make sure that the files you have on disk represents the state of your applications and you want to make sure that you can act on any fail