Development ๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป The RSS feed for Development ๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป.

  • I’ve been setting up my new Raspberry Pi to be an always-on, lightweight server but I was running into the oddest issue when trying to get memory data out of Docker. As it turns out, adding “cgroup_memory=1 cgroup_enable=memory” to my “/boot/cmdline.txt” file fixed the issue. ๐ŸŽ‰ Link

  • Given my background with MS Sql / T-SQL, you’d think it would be trivial for me to upgrade from PostgreSQL 15 to 16…but you’d be wrong! ๐Ÿ˜‚ Maybe it was b/c Docker was involved but goodness, that turned out complicated than I thought.

  • Trying to update the SSL certificates our Kafka consumer / producer uses and it’s driving me to drink more coffee. โ˜•๏ธ๐Ÿคช

  • Someone created a Github issue for my Justified Swipebox Micro.blog pluginโ€ฆand Iโ€™m so excited to know someone out there is at least looking at my work, much less using it; itโ€™s not really โ€my workโ€, I just enhanced / joined two other libraries so theyโ€™d work with Micro.blogโ€ฆbut still, Iโ€™m excited!

  • Years ago, I set up a self-hosted Gitea, as a backup solution for my Github account. I didn’t think much of it at the time but I used MS SQL as the backend for it, without realizing the Docker version doesn’t work with encrypted Synology volumes. ๐Ÿฅด I finally took care of that, now on MySQL. ๐ŸŽ‰

  • New Plugin: Simple Image Generation

    So I did a thing: I wrote my first Micro.Blog plugin. ๐Ÿฅณ It’s nothing fancy, just another image generator but, as I was in the process of migrating the content from my old blog to here, I realized I had already created one in my Hugo instance…all I needed to do was port it over to GitHub and get it in the right format (also, documentation, mustn’t forget the documentation ๐Ÿคข). Yes, I could have just changed out the Shortcode for proper HTML as part of the migration but I wanted to keep the same format I was already using…and when does a developer ever take the easy road…? ๐Ÿคฃ

    Once the repo was in place, it was a pretty easy process to move my photos to Micro.Blog (thank you MarsEdit) and the markdown code…and there you have it, easy-peasy.

    Screen grab of my work on the Plugin page of Micro.blog's Plug-in page.

    I have to say, it's pretty darn cool to see my work (limited as it is) on the Plug-in page. ๐Ÿ˜„

    If you’re interested in the Plugin (and really, you shouldn’t be), it can be found on GitHub. If you want to use the plugin, documentation exists on GitHub or you can continue reading. ๐Ÿ˜‚


    Note: In the code examples below, curry brackets have been replaced with straight ones so that Micro.Blog’s Hugo instance doesn’t crash / fail / give-up.

    Image Only

    The only required parameter for the shortcode / plugin is src.

    [[< simple-image src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg" >]]
    

    Result:

    <figure>
        <img src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg">
    </figure>
    

    Clickable Image

    Including the link parameter will allow the image to be clickable.

    [[< simple-image src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg" link="https://lostinhaste.com/2023/09/29/september-microblog-photo.html" >]]
    

    Results:

    <figure>
        <a href="https://lostinhaste.com/2023/09/29/september-microblog-photo.html">
            <img src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg">
        </a>
    </figure>
    

    Image with Caption / Alt

    Adding text in the alt parameter will result in the generation of an image with alternative text. If the caption parameter is used, additional text will be rendered near the image, within the figure html tag.

    [[< simple-image src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg" alt="View of the St. Lawrence River, with ice chunks occupying most of the surface, at night, with houses covered in snow and streets with lights at the bottom of the picture. On the upper part of the picture, across the river, lights can be seen up and down a bluff, with a few well-light buildings prominent in the cloudy night sky." caption="An icy view of lower Old Town Quebec during winter." >]]
    

    Result:

    <figure>
        <img src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg" alt="View of the St. Lawrence River, with ice chunks occupying most of the surface, at night, with houses covered in snow and streets with lights at the bottom of the picture. On the upper part of the picture, across the river, lights can be seen up and down a bluff, with a few well-light buildings prominent in the cloudy night sky.">
        <figcaption>
            <p>
                An icy view of lower Old Town Quebec during winter.
            </p> 
        </figcaption>
    </figure>
    
    View of the St. Lawrence River, with ice chunks occupying most of the surface, at night, with houses covered in snow and streets with lights at the bottom of the picture. On the upper part of the picture, across the river, lights can be seen up and down a bluff, with a few well-light buildings prominent in the cloudy night sky.

    An icy view of lower Old Town Quebec during winter.


    Image with Title / Caption

    Adding the title parameter will generate an h4 html tag within the greater figure html tag.

    [[< simple-image src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg" title="Winter in Quebec" caption="An icy view of lower Old Town Quebec during winter." >]]
    

    Result:

    <figure>
        <img src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg" alt="An icy view of lower Old Town Quebec during winter.">
        <figcaption>
            <h4>Winter in Quebec</h4>
            <p>
                An icy view of lower Old Town Quebec during winter.
            </p> 
        </figcaption>
    </figure>
    
    An icy view of lower Old Town Quebec during winter.

    Winter in Quebec

    An icy view of lower Old Town Quebec during winter.


    Including the attr and attrlink parameters will allow for the creation of a hyperlink within the figure html tag element.

    [[< simple-image src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg" attr="Original Post" attrlink="https://lostinhaste.com/2023/09/29/september-microblog-photo.html" >]]
    

    Results:

    <figure>
        <img src="https://cdn.uploads.micro.blog/8317/2023/winter-ice-and-light.jpg">
        <figcaption>
            <p>
                <a href="https://lostinhaste.com/2023/09/29/september-microblog-photo.html"> 
                    Original Post
                </a> 
            </p> 
        </figcaption>
    </figure>
    

    Original Post of the photo...

  • Markdown Linebreak in Hugo

    My primary website uses Hugo for a variety of reasons and for the most part, I love it…except when you run into odd edge-cases and the latest one: line-breaks using Markdown aka the <br /> tag.

    After a little bit of research, I ended up creating a custom shortcode to handle the need / issue, naming it “line-break.html”:

    List of html files under the layouts / shortcodes directory structure.

    To use the shortcode, I add [[< line-break >]] (I used regular brackets here, instead of curly ones, so this shortcode wouldn’t trip up Hugo) into my various markdown files and voila: line-breaks in the generated HTML!

    Screen grab of text, showing the newly created line-break tag at the end of each line.
  • I have a love/hate relationship with unit testing but as they just caught a logic bug in some if/else statements, I won’t curse them out this morning. ๐Ÿคฃ #code

  • Entry Level Mistake

    We (my employer) recently parted ways with a development vendor and yesterday I was combing through various repositories, cleaning up the nightmare that was their branching strategy (or lack thereof) when I stumbled across this little gem:

    Screenshot a GIT commit with easily-guessed, hard-coded passwords...with a comment about needing to change the passwords...

    Bad Code: Hard-coded passwords and a comment acknowledging the problem

    Two thought immediately popped into my head:

    • Why would you hard-code credentials into your application?
    • Why wouldn’t you have stronger credentials right off the bat?

    I have to take some of the accountability here; as the Lead at my company, code quality falls within my realm of responsibility. Thankfully, this commit never made it out of the Development branch…but it’s all to easy to imagine this sort of problem making it’s way up the chain, into Production. Honestly, I never thought I’d have to add “do NOT hard-code credentials” into our guidelines for new developers but then, I’ve been wrong about a lot of things in my career… ๐Ÿ˜„


    On a lark, I took my Mac down the hall to our cyber security expert and asked her to spot the problem. It took her all of ten seconds to start laughing. Once she was able to stop giggling, she offered two bits of advice:

    1. Stash this sort of issue in your “this is bad code” file to show to junior developers as a teachable moment.
    2. Look into something called SonarQube to help automate the detection of potential security issues in source code.

    It’s an old, tired stereotype that developers hate interacting with security folks but every time I talk with our cyber security expert, I get homework…and that’s an absolutely wonderful thing; when we stop learning, we start to degrade.


    Note: This post is from my old site and was ported over into Micro.Blog when I consolidated from two sites into one. All of the migrated posts can be found here.