<?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>O'Malley.dev</title><link>https://omalley.dev/</link><description>Recent content on O'Malley.dev</description><generator>Hugo -- 0.128.0</generator><language>en-ie</language><lastBuildDate>Thu, 27 Mar 2025 13:14:00 +0100</lastBuildDate><atom:link href="https://omalley.dev/rss.xml" rel="self" type="application/rss+xml"/><item><title>New Mac First Steps</title><link>https://omalley.dev/posts/new-mac-first-steps/</link><pubDate>Thu, 27 Mar 2025 13:14:00 +0100</pubDate><guid>https://omalley.dev/posts/new-mac-first-steps/</guid><description>I just upgraded my personal laptop from a 2015 Intel MacBook Pro to an M4 Pro MacBook Pro. I wanted to try keep this new laptop as clean as possible, as you can imagine using the same machine for 10 years means you accrue a lot of files, setups, half started projects and the rest.
The goal of this post is to act as a sort of documentation for myself of the things I have setup on it and where possible the reasoning for it.</description><content:encoded><![CDATA[<p>I just upgraded my personal laptop from a 2015 Intel MacBook Pro to an M4 Pro MacBook Pro. I wanted to try keep this new laptop as clean as possible, as you can imagine using the same machine for 10 years means you accrue a lot of files, setups, half started projects and the rest.</p>
<p>The goal of this post is to act as a sort of documentation for myself of the things I have setup on it and where possible the reasoning for it.</p>
<h2 id="mac-system-settings">Mac System Settings</h2>
<ul>
<li>Apple ID: Sign in</li>
<li>Keyboard: key repeat = fast, delay until repeat = short</li>
<li>Trackpad: 3/4 tracking speed, tap to click, click = light, natural scroll = off</li>
<li>Finder: Show Library, show hidden files, show path to dir</li>
</ul>
<pre tabindex="0"><code>defaults write com.apple.finder AppleShowAllFiles YES
</code></pre><ul>
<li>
<p>Dock: Hide and show dock, increase size, remove most default apps, align on left of screen.</p>
</li>
<li>
<p>Set background to Steins Gate Background I&rsquo;ve been using this background since at least 2013 and probably before. If anyone has a higher quality copy of this image please send it on.</p>
</li>
</ul>
<p><img alt="Image is a screenshot of my desktop with the mentioned wallpaper and the dock showing " loading="lazy" src="/images/Desktop.png"></p>
<h1 id="programming">Programming</h1>
<ul>
<li>homebrew</li>
</ul>
<pre tabindex="0"><code>/bin/bash -c &#34;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&#34;

# add brew to default shell path
echo &gt;&gt; /Users/scottomalley/.zprofile
echo &#39;eval &#34;$(/opt/homebrew/bin/brew shellenv)&#34;&#39; &gt;&gt; /Users/scottomalley/.zprofile
eval &#34;$(/opt/homebrew/bin/brew shellenv)&#34;
</code></pre><ul>
<li>Install iTerm2</li>
</ul>
<pre tabindex="0"><code>brew install --cask iterm2
</code></pre><p>Set global hotkey <code>CMD + §</code>, Set theme: Solarized Dark.</p>
<p>Set LS Colors <code>export LSCOLORS=gxfxbEaEBxxEhEhBaDaCaD</code>,</p>
<p>Install <a href="https://ohmyz.sh/#install">oh-my-zsh</a>,</p>
<p>Install and configure <a href="https://github.com/romkatv/powerlevel10k">Powerleve10k</a></p>
<ul>
<li>Install fnm</li>
</ul>
<pre tabindex="0"><code>brew install --cask fnm
# Add the config to `.zshrc`
eval &#34;$(fnm env --use-on-cd --shell zsh)&#34;
</code></pre><ul>
<li>Install git</li>
</ul>
<pre tabindex="0"><code>brew install --cask git
git config --global init.defaultBranch main
git config --global user.name &#34;scottomalley&#34;
git config --global user.email &lt;email redacted&gt;
</code></pre><ul>
<li>IDEs
I&rsquo;ve been trying zex recently, with the reliable VSCode as a backup.</li>
</ul>
<pre tabindex="0"><code>brew install --cask zed
brew install --cask visual-studio-code
</code></pre><h2 id="utilities">Utilities</h2>
<pre tabindex="0"><code>brew install --cask alfred
brew install --cask bettertouchtool
</code></pre><h2 id="chat-and-gaming">Chat and Gaming</h2>
<pre tabindex="0"><code>brew install --cask signal
brew install --cask steam
brew install --cask telegram
brew install --cask discord
</code></pre><p>This is where I&rsquo;m leaving it for now. I&rsquo;ll come back to this and add additional details as I make more changes.</p>
]]></content:encoded></item><item><title>Migrating to Hugo from Gatsby</title><link>https://omalley.dev/posts/migrating-to-hugo-from-gatsby/</link><pubDate>Sun, 09 Mar 2025 13:14:00 +0100</pubDate><guid>https://omalley.dev/posts/migrating-to-hugo-from-gatsby/</guid><description>Hey folks! For the past number of years I&amp;rsquo;ve had a gatsby powered site sitting on omalley.dev. I bought the domain when .dev first got released and have always wished to do something more with it. I started writing over COVID but never published much outside of an article on npm-overrides. While I would take the time to start articles I would inevitably get side tracked fixing gatsby realted issues. My hope with this move to Hugo I will get to spend more time writing and less time triging.</description><content:encoded><![CDATA[<p>Hey folks! For the past number of years I&rsquo;ve had a gatsby powered site sitting on omalley.dev. I bought the domain when <code>.dev</code> first got released and have always wished to do something more with it. I started writing over COVID but never published much outside of an article on npm-overrides. While I would take the time to start articles I would inevitably get side tracked fixing gatsby realted issues. My hope with this move to Hugo I will get to spend more time writing and less time triging.</p>
<p>Here is a summary of the steps I followed to migrate a blog from Gatsby to Hugo:</p>
<h2 id="initial-setup">Initial setup</h2>
<p>My sites code lives in github and I host on netlify. My domains DNS is handed off to netlify&rsquo;s DNS servers and I&rsquo;m pretty happy with how it&rsquo;s worked the past few years so I don&rsquo;t feel like changing this.</p>
<p>My first step is to install Hugo. I split my dev between Mac OS and Windows. On Mac I used <code>brew</code> to install Hugo, On windows I used <code>winget</code></p>
<p>Mac: <code>brew install hugo</code></p>
<p>Windows: <code>winget install Hugo.Hugo.Extended</code></p>
<p>Once installed I used the following to scafold out my site.</p>
<p><code>hugo new site new.omalley.dev --format toml</code></p>
<p>I initially used JSON as my config lanugage of choice but swapped to TOML as it allowed for easier multi-line strings and less typing to make changes.</p>
<h2 id="theme-setup">Theme setup</h2>
<p>I have to admit after spending hours trying to theme gatsby the hugo submodule approach to themes was a breath of fresh air. I&rsquo;ve chosed the very popular Papermod theme as it has most of the features I want and looks close enough to my original theme that it shouldn&rsquo;t be so jaring for anyone coming to the site.</p>
<p>In the site directory run:</p>
<p><code>git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod git submodule update --init --recursive</code></p>
<p>and then update your hugo.toml</p>
<p><code>theme = &quot;PaperMod&quot;</code></p>
<h2 id="netlify-integration">Netlify Integration</h2>
<p>I really love Netlify for it&rsquo;s ease of use. It&rsquo;s been my go to providor for spinning up new sites or small projects. I only had to add a few things to a <code>netlify.toml</code> file to get the branch deploys working as expected. Other than that it worked OOTB</p>
<pre tabindex="0"><code>[context.deploy-preview]
command = &#34;hugo --gc --minify --baseURL ${DEPLOY_PRIME_URL}&#34;
</code></pre><h2 id="content-migration">Content Migration</h2>
<p>Thankfully this was reletively simple. Both Hugo and Gatsby use markdown for their posts and the headers are similar enough that I could just copy paste the content. I did have to play with the URL generator to map the original URLs so that they&rsquo;ll still work. Additioanlly I had to make a breaking change to where the old images are stored and linked. Rather than being in the static/images folder they now live alongside their posts.</p>
<h2 id="observability">Observability</h2>
<p>In order to get some additional info as to who may or may not be viewing my site I looked for some &ldquo;free&rdquo; analytics. I could have continued to use Google Analytics, but I wanted to see what was available that could be more privacy focused. I settled on <a href="https://posthog.com/">PostHog</a> as I&rsquo;ve heard good things and they were relatively easy to integrate by dropping in a script tag.</p>
<p>I created a new folder in my hugo site called <code>layouts/partials</code> and added a new file called <code>extend_head.html</code>. This allows me to drop in the PostHog script to the site without having to manually edit the theme.</p>
<h2 id="wrapping-up">Wrapping Up</h2>
<p>With that the migration is complete. I&rsquo;m happy with the results and I hope you are too. If you have any questions or comments please feel free to reach out.</p>
]]></content:encoded></item><item><title>Npm Overrides</title><link>https://omalley.dev/2022-05-06/npm-overrides/</link><pubDate>Fri, 06 May 2022 00:00:00 +0000</pubDate><guid>https://omalley.dev/2022-05-06/npm-overrides/</guid><description>Hey! Recently I&amp;rsquo;ve been putting together a small program to track the temperature inside of a hand-me-down fridge. I&amp;rsquo;d planned to use my Nordic Thingy52 as it has all the sensors I need plus its own power source, but unfortunately I found that its NodeJS reference implementation was built with an abandoned Bluetooth Low Energy library which has stopped working with OSX after High Sierra.
Error: Cannot find module &amp;#39;xpc-connection&amp;#39; Require stack: - /Users/scottomalley/Projects/Nordic-Thingy52-Nodejs/node_modules/noble-device/node_modules/noble/lib/mac/highsierra.</description><content:encoded><![CDATA[<p>Hey! Recently I&rsquo;ve been putting together a small program to track the temperature inside of a hand-me-down fridge. I&rsquo;d planned to use my <a href="https://www.nordicsemi.com/Products/Development-hardware/Nordic-Thingy-52">Nordic Thingy52</a> as it has all the sensors I need plus its own power source, but unfortunately I found that its NodeJS reference implementation was built with an <a href="https://github.com/noble/noble">abandoned Bluetooth Low Energy library</a> which has stopped working with OSX after High Sierra.</p>
<pre tabindex="0"><code>Error: Cannot find module &#39;xpc-connection&#39;
Require stack:
- /Users/scottomalley/Projects/Nordic-Thingy52-Nodejs/node_modules/noble-device/node_modules/noble/lib/mac/highsierra.js
- /Users/scottomalley/Projects/Nordic-Thingy52-Nodejs/node_modules/noble-device/node_modules/noble/lib/mac/bindings.js
- /Users/scottomalley/Projects/Nordic-Thingy52-Nodejs/node_modules/noble-device/node_modules/noble/lib/resolve-bindings.js
</code></pre><p>Thankfully a few fine folks came together to create <a href="https://abandonware.github.io/">@abandonware</a> and have forked and updated noble, and a quick hack of replacing the existing noble reference with the @abandonware one on the surface seems to resolve my problem, but I don&rsquo;t think this is a particularly elegant solution.</p>
<h2 id="replacing-a-dependency-of-a-dependency">Replacing a dependency of a dependency</h2>
<p>Digging into the Thingys Node library we can see that it&rsquo;s not actually relying directly on Noble. Instead it uses a small wrapper made by the same author called <code>noble-device</code>. Meaning I can&rsquo;t just replace the noble dependency the way I&rsquo;d done in my quick fix previously.</p>
<pre tabindex="0"><code>$ npm list --depth 1
thingy52@1.0.4
└─┬ noble-device@1.4.1
 └── noble@1.9.1
</code></pre><h2 id="npm-overrides">npm overrides</h2>
<p>npm version 8.3 was released in December 2021 and while it&rsquo;s a minor release it did include a very useful feature &ldquo;overrides&rdquo;.
<a href="https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides">npm overrides</a> as the name describes lets you replace a dependency in your tree. Previously the only way to do nested dependency control was to fork and fix it yourself, so this is a welcome change that brings <code>npm</code> inline with similar features in <a href="https://classic.yarnpkg.com/en/docs/selective-version-resolutions/">yarn</a> and <a href="https://pnpm.io/package_json#pnpmoverrides">pnpm</a>
Looking at our dependency tree above, if we were to go the forking route we&rsquo;d have to fork <code>noble-device</code> to update its version of noble and either fork <code>thingy52</code> or get a PR opened to the base repo to use our forked version. But with overrides we can add the following to our <code>package.json</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#e6db74">&#34;overrides&#34;</span><span style="color:#960050;background-color:#1e0010">:</span> {
</span></span><span style="display:flex;"><span>   <span style="color:#f92672">&#34;noble-device&#34;</span>: {
</span></span><span style="display:flex;"><span>       <span style="color:#f92672">&#34;noble&#34;</span>: <span style="color:#e6db74">&#34;npm:@abandonware/noble@1.9.2-15&#34;</span>
</span></span><span style="display:flex;"><span>   }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>which will instruct npm to install our override in place of the original dependency.</p>
<pre tabindex="0"><code>$ npm list --depth 1
thingy52@1.0.4
└─┬ noble-device@1.4.1
 └── noble@npm:@abandonware/noble@1.9.2-15
</code></pre><p>There are a number of ways you can customise which dependency is replaced and in what situation. You can also be more targeted by specifying only to replace in certain situations. Below we only replace <code>foo</code> if <code>bar</code> is version <code>2.0.0</code></p>
<pre tabindex="0"><code>&#34;overrides&#34;: {
   &#34;bar@2.0.0&#34;: {
     &#34;foo&#34;: &#34;1.0.0&#34;
   }
 }
</code></pre><p>You can also use it to standardise across your project. The below override will make foo always be v1.0.0 regardless of what any dependency requests.</p>
<pre tabindex="0"><code>{
 &#34;overrides&#34;: {
   &#34;foo&#34;: &#34;1.0.0&#34;
 }
}
</code></pre><p>Additionally it&rsquo;s important to note that the overrides only take effect in the top level project. This means if I was to PR the change to the Thingy library, it would only work if I was running the Thingy library itself. To have it take effect in my own project I need to specify it there.</p>
<p>With the override in place if we run our original example from the Thingy reference library it will successfully execute and start looking for the Thingy</p>
<pre tabindex="0"><code>node ./examples/environment.js
Reading Thingy environment sensors!
</code></pre><p>With that solved I&rsquo;m able to continue with my temp tracking project for the fridge!</p>
<p>Hopefully this helps anyone who is looking to fix broken dependencies!</p>
]]></content:encoded></item><item><title>Okay I'm making an app.</title><link>https://omalley.dev/2021-03-25/20210325-okay-were-making-an-app/</link><pubDate>Thu, 25 Mar 2021 23:15:04 +0000</pubDate><guid>https://omalley.dev/2021-03-25/20210325-okay-were-making-an-app/</guid><description>A wanabie DMs plan to make a helpful webapp</description><content:encoded><![CDATA[<p>And I have a terrible time getting this onto paper and setting goals for my personal projects. I&rsquo;m hoping by writing it down here I can frame what I want the app to do.</p>
<h3 id="what-kind-of-app-do-i-want-to-make">What kind of app do I want to make?</h3>
<p>At a high level the app will allow a DM to prepare the inventory of the different mercantile establishments based on the published source material.</p>
<p>Most campaigns in DnD will have the players eventually visit a market or some other type of store within their setting. The DMs guide usually will state that the store will sell anything from the Equipment Section of the Players Handbook under X value in GP.</p>
<p><img alt="Image is a screenshot of a PHB reference in a free dndbeyond one-shot" loading="lazy" src="/images/dndbeyond-phb-reference.png"></p>
<p>This isn&rsquo;t particularly useful as the list in the PHB is very long and isn&rsquo;t sortable (being paper for the physical books and just a table in digital form).</p>
<h3 id="what-do-i-want-the-app-to-do">What do I want the app to do</h3>
<p>Let&rsquo;s write a user story&hellip; kindaW</p>
<p>As a DM:</p>
<ul>
<li>I should have a way to filter the PHB equipment list to specify the min/max GP value of items that are available in a store.</li>
<li>I should be able to provide a link to players to view a non editable and printable final list</li>
<li>I should have the ability to modify the pricing of items based on a multiplier, e.g. equipment list &lt; 50GP * 10</li>
<li>I should be able to filter by equipment type (Weapons could be at a blacksmith, magic components at an apothecary)</li>
<li>I should be able to filter by source book, there are many items in the new adventures that may need to be included.</li>
</ul>
<p><strong>Optional non user story extras</strong></p>
<ul>
<li>
<p>Lightning fast however possible, should load really really really fast. Additionally dev experience should be fast too! This is optional for now but I really like the idea of trying to optimize a webapp as much as possible.</p>
</li>
<li>
<p>The printed list should look like a player handout similar to <a href="https://homebrewery.naturalcrit.com/">https://homebrewery.naturalcrit.com/</a></p>
</li>
<li>
<p>Expand the tool to include rolls on the trinkets table.</p>
</li>
</ul>
<h3 id="how-do-i-make-it">How do I make it</h3>
<p>This is an easy enough choice for me, I want the resulting lists to be sharable via a link and I&rsquo;m a full-stack engineer. I&rsquo;ll make it a react app bootstrap’d by <code>create-react-app</code>. I&rsquo;ll probably eject it at some stage and may look at using something other than webpack as the bundler.</p>
<h3 id="where-will-it-live">Where will it live?</h3>
<p>I&rsquo;ve been using Netlify for the better part of a year and see no reason to stop. Their free tier has everything I need.</p>
<p>I think I have enough to start putting together a skeleton app. Once I start writing some code I&rsquo;ll have a better idea of what takes priority.</p>
]]></content:encoded></item><item><title>My first time as a dungeon master</title><link>https://omalley.dev/2021-03-25/20210325-a-first-time-dm/</link><pubDate>Thu, 25 Mar 2021 21:30:04 +0000</pubDate><guid>https://omalley.dev/2021-03-25/20210325-a-first-time-dm/</guid><description>The good, the bad and the ugly</description><content:encoded><![CDATA[<p>I recently ran my first Dungeons and Dragons game from <em>behind the board</em>. I spent the better part of a month setting up scenes in Roll20, reading the one-shot end to end and watching several people on youtube running the game to know what to expect. As far as I can tell a good time was had by all and I actually can&rsquo;t wait to do it again even with the huge amount of time it required.</p>
<h3 id="the-prep">The prep</h3>
<p>The one-shot I ran is called the <a href="https://winghornpress.com/adventures/wolves-of-welton/">Wolves of Welton</a>. It&rsquo;s a free module from Winghorn press for DnD 5e. In addition I read nearly all the <a href="https://www.dndbeyond.com/tag/encounter-of-the-week">Encounter of the Week</a> posts on dndbeyond.com to get ideas of how things could be fit in should my players go off the rails.</p>
<p>As we were playing online over discord I elected to use Roll20 to give my players a virtual tabletop to better see encounters and interact with NPCs. For the maps I mainly got assets off Reddit and Pinterest linked to the Wolves of Welton</p>
<p>For character sheets I used dndbeyond.com in conjunction with the <a href="https://beyond20.here-for-more.info/">Beyond20</a> browser extension to allow my players to roll from their character sheets into Roll20 directly which saved a lot of setup hassle.</p>
<h3 id="the-game">The game</h3>
<p>The game was pretty standard, I&rsquo;d originally budgeted 3-4 hours to complete the one-shot, But in total it took closer to 5. Additionally I had planned for 4-5 players in the game, but ended up with only 2 on the day. This was mostly due to me not setting a date and time for the game when I asked people to play and having to deal with a 9 hour difference in time zones for some players.</p>
<h3 id="some-other-thoughts">Some other thoughts</h3>
<p>While reading the different encounters I noticed there&rsquo;s a recurring theme to reference the equipment list in order to generate the inventory for stores in game. It was the only thing I didn&rsquo;t find a tool for specifically which I found weird. There really should be an app for that.</p>
]]></content:encoded></item><item><title>Repurposing a Nexus 9 to Watch Streams on Discord</title><link>https://omalley.dev/2020-05-20/repurposing-a-nexus9/</link><pubDate>Wed, 20 May 2020 00:00:00 +0000</pubDate><guid>https://omalley.dev/2020-05-20/repurposing-a-nexus9/</guid><description>Can we reuse old technology for a single purpose</description><content:encoded><![CDATA[<p>COVID19 has upheaved everyones day to day lives mine being no exception. I&rsquo;m working from home full time, I&rsquo;m social distancing and I&rsquo;ve had to get creative with most of by hobbies to keep enjoying them.</p>
<p>My D&amp;D game has moved online with our DM opting to stream a copy of Fantasy Grounds via Discord and have each of us speak our actions though a group voice chat. This has worked pretty well for the most part, save for a few of our members only having access to phones currently which can make viewing the stream difficult. With my Nexus 9 gathering dust for a few years now I figured it was an opertune time to try repurpose it for one thing, watching streams on Discord.</p>
<p>The Nexus 9 was a premium tablet in 2014, a 9 inch display powered by a 64bit NVIDIA tegra K1 dual-core processor at 2.3GHz and 2GB of DDR3 memory. Subsiquent android updates and the addtion of full disk encryption caused the tablet to lag and become pretty unusable.</p>
<p>The objective for this project is install a stripped down version of Android (SlimROM), remove full disk encryption and install the Discord app on the tablet.</p>
<h2 id="installing-a-custom-recovery">Installing a custom recovery</h2>
<p>By default you can&rsquo;t install a custom version android easily, we need to remove a few barriers first. The first being a custom recovery tool which will allow us to flash the new image.</p>
<p>A breif search of reddit and XDA Developers indicated that the custom recovery I&rsquo;d used in the past (clockwork recovery) was no longer being actively developed and I should use a project called <a href="https://twrp.me/about/">TWRP</a> instead. Their website was quite informative and most importantly had <a href="https://twrp.me/htc/htcnexus9.html#fastboot-install">support for the Nexus 9</a>. The link above details the steps required to install, but I will sumerise below.</p>
<ul>
<li>Downloaded the <a href="https://eu.dl.twrp.me/flounder/">latest version of TWRP for the Nexus 9</a></li>
<li>Downloaded a <a href="https://developer.android.com/studio/releases/platform-tools">standalone version of Androids platform tools.</a></li>
<li>Place the TWRP image in the same folder as your platform tools.</li>
<li>Enabled USB debugging
<blockquote>
<p>On your device, go into Settings -&gt; About and find the Build Number and tap on it 7 times to enable developer settings. Press back and go into Developer Options and enable USB debugging.</p>
</blockquote>
</li>
<li>Open a terminal and use adb to reboot to the bootloader <code>adb reboot bootloader</code></li>
<li>Use fastboot to flash the image <code>fastboot flash recovery twrp.img</code></li>
<li>Then use the on screen commands to reboot to recovery, this should allow you to boot TWRP.</li>
</ul>
<h2 id="installing-the-custom-rom">Installing the custom rom</h2>
<p>Next we&rsquo;re going to install the custom rom. For this we need to downloaded <a href="https://slimroms.org/#/device/flounder">Slimrom for the Nexus 9</a> and a copy of the <a href="https://opengapps.org/">open source google apps</a>. I&rsquo;ve elected to go with pico as it&rsquo;s the smallest available to get the play store working.</p>
<ul>
<li>In TWRP, go to <code>Wipe -&gt; Format Data</code>, this will remove the encryption on the data partition.</li>
<li>Go to <code>Advanced Wipe</code> and wipe all partitions</li>
<li>In a terminal on your computer use adb to transfer over the slimrom and gapps images.
<ul>
<li><code>./adb push slimrom.zip /sdcard</code></li>
<li><code>./adb push gapps.zip /sdcard</code></li>
</ul>
</li>
<li>In TWRP flash slimrom and then gapps</li>
<li>Restart the tablet and it should now boot into slimrom.</li>
</ul>
]]></content:encoded></item></channel></rss>