-
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 fromPostgreSQL
15 to 16…but you’d be wrong! ๐ Maybe it was b/cDocker
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.
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>
Image with Title / Caption
Adding the title parameter will generate an
h4
html tag within the greaterfigure
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>
Image with Link
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>
-
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”:
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! -
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:
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:
- Stash this sort of issue in your “this is bad code” file to show to junior developers as a teachable moment.
- 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.