Posts

Base64 Encoding Images in PowerShell

I needed to embed a couple of additional images into a HTML file. The output file already had a couple of base64 encoded SVGs within it, so I decided to try doing the same with the additional images. Instead of using an online encoding service I tried to find if I could do it in PowerShell. I found the following solution. [ Convert ]::ToBase64String((Get-Content -Path .\myImage.png -Encoding Byte)) >> myImage.txt Explainer [Convert]::ToBase64String  calls the ToBase64String method of the .NET Conversion class. Essentially using a .NET library to do the lifting. I then pass PowerShells Get-Content cmdlet as an argument with the path to the image. >>  simply redirects the output of the Convert method to a text file. I can then paste the output of the text file into the HTML  <img>  tag.

Book Review - Get Everything Done and Still Have Time to Play

  Below is my book review/summary of   Get Everything Done and Still Have Time to Play   by Mark Forester The book in 3 sentences The ‘word’ no is the fundamental time management tool, you can’t do more if you’re doing too much. Time management is about overcoming resistance and focusing our attention We need to build into our lives time to think, time to reflect Impressions I’ve read a lot of productivity books but this one really got me thinking and focusing on how much I fit into my life. Especially now I’m a parent, I have even less time than before. I was surprised when I did the commitments inventory how little time I do have. I couldn’t fit any more activities into my life than I already do and still give them the attention they deserve. Even then I’m not giving some activities the attention they do deserve in the first place! I also tried his technique of rotating between activities in brief time bursts to get past the resistance and get things moving. This allowe...