Dev Oops - All things Arch, Debian and Pythonhttps://mcgillij.dev/2023-09-06T23:49:00-03:00Recovering from failed terraform apply2023-09-06T23:49:00-03:002023-09-06T23:49:00-03:00mcgillijtag:mcgillij.dev,2023-09-06:/recovering-from-failed-terraform-apply.html<p class="first last">Quick post on how to recover from a failed terraform apply</p>
<div class="section" id="failed-apply">
<h2><a class="toc-backref" href="#id1">Failed apply?</a></h2>
<p>So we use a remote state for our terraform backend at work hosted in an S3 bucket for some background. And a backend configuration may look something like this:</p>
<div class="highlight"><pre><span></span><span class="nb">terraform</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kr">backend</span><span class="w"> </span><span class="nv">"s3"</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="na">bucket</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"my-terraform-state"</span>
<span class="w"> </span><span class="na">region</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"us-east-2"</span>
<span class="w"> </span><span class="na">key</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"statebucket/terraform.tfstate"</span>
<span class="w"> </span><span class="na">dynamodb_table</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"my-lock"</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
<p>What happens, when you’re authentication lapses while you’re running a terraform apply?</p>
<p>Terraform won’t be able to update the state in the s3 bucket, and if you try to re-apply, you will get several errors reporting that the resources already exist.</p>
<p>However, terraform will dump an <cite>errored.tfstate</cite> file in your working directory, which you can use to recover from the failed apply.</p>
<p>You can inspect it to make sure it looks correct, and then run:</p>
<div class="highlight"><pre><span></span>terraform<span class="w"> </span>state<span class="w"> </span>push<span class="w"> </span>errored.tfstate
</pre></div>
<p>This will re-push the state to your configured backend.</p>
<p>However if you tried an apply, it will throw another error saying that the states do not match, and you will need to add the <strong>-force</strong> parameter.</p>
<div class="highlight"><pre><span></span><span class="err">terraform</span><span class="w"> </span><span class="err">state</span><span class="w"> </span><span class="err">push</span><span class="w"> </span><span class="err">-force</span><span class="w"> </span><span class="nv">errored.tfstate</span>
</pre></div>
<p>This saved me several hours today that would have had to be spent manually re-importing 460~ resources that were half-created when the authentication to <span class="caps">AWS</span> was severed.</p>
<p>Hope this helps someone else out there!</p>
</div>
Taking the drone out in Bayers Lake, early spring 20232023-04-15T12:30:00-03:002023-04-15T12:30:00-03:00mcgillijtag:mcgillij.dev,2023-04-15:/april-2023-drone-bayers-lake.html<p class="first last">Just taking a quick spin around with the Drone in Bayers Lake, Nova Scotia.</p>
<p>Here’s a 360 panorama of taken in Bayers Lake this morning.</p>
<iframe allowfullscreen="" height="600" src="theme/html/pannellum.htm#panorama=/images/bayers_spring_pano.jpg&autoLoad=true" style="border-style:none;" width="800"></iframe><p>Just out this morning with Atiya, to get her a new collar and I stopped by Bayers Lake to take a few drone shots since it was so nice out. Really starting to feel like spring out there finally.</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/-jhqChMawOo"></iframe></div>Out with the drone in Shediac New Brunswick Easter weekend 20232023-04-08T12:49:00-03:002023-04-08T12:49:00-03:00mcgillijtag:mcgillij.dev,2023-04-08:/easter-weekend-2023.html<p class="first last">Out with the drone in Shediac New Brunswick Easter weekend 2023</p>
<p>Here’s a 360 panorama of taken at sunset in Shediac.</p>
<iframe allowfullscreen="" height="600" src="theme/html/pannellum.htm#panorama=/images/shediac_pano.jpg&autoLoad=true" style="border-style:none;" width="800"></iframe><p>I was out visiting some family and friends in New Brunswick this weekend, and I briefly
took the drone up to get some shots of the sunset.</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/-Psj3yRmv90"></iframe></div>Setting up Syncthing and Obsidian2022-11-26T15:49:00-04:002022-11-26T15:49:00-04:00mcgillijtag:mcgillij.dev,2022-11-26:/syncthing-obsidian.html<p class="first last">Setting up Syncthing and Obsidian on a Boox Onyx, Android phone, Linux desktop and Server</p>
<p>I was getting frustrated with the constant spam from google about running out of space in my drive / gmail and the spam for google one (which I had a year free from when I got my Chromebook, now I get spammed for life it seems)?</p>
<p>Trying to put an end to also emailing myself files to share between my phone and desktop and vice versa.</p>
<p>I wanted to find a sync’ing solution in place that wouldn’t rely on <a class="reference external" href="https://google.com">Google</a> or <a class="reference external" href="https://dropbox.com">Dropbox</a> and that I could self-host on my own server.</p>
<div class="section" id="plan">
<h2><a class="toc-backref" href="#id1">Plan</a></h2>
<img alt="Syncthing Plan" src="https://mcgillij.dev/images/syncthing_plan.png" style="width: 100%;"/>
<p>Ultimately I wanted to be able to write notes on my tablet or phone and have them sync to my desktop and server from where I could do some better formatting in the <a class="reference external" href="https://obsidian.md">Obsidian</a> desktop client for organization.</p>
<p>This would allow me to take notes either while working or out and about, and then fine tune them later when I get back to my workstation.</p>
</div>
<div class="section" id="the-requirements">
<h2><a class="toc-backref" href="#id2">The Requirements</a></h2>
<p>The requirements were a short list:</p>
<ul class="simple">
<li>Self-hosted on my Linux server</li>
<li>Work on my Pixel phone</li>
<li>Work on my Boox Onyx</li>
<li>Work on my Linux desktop</li>
</ul>
<p>After doing a bit of research, all signs pointed to <a class="reference external" href="https://syncthing.net/">Syncthing</a>. I could have used <a class="reference external" href="https://nextcloud.com">NextCloud</a>, but it seemed a bit overkill for what I was trying to do.</p>
</div>
<div class="section" id="the-setup">
<h2><a class="toc-backref" href="#id3">The Setup</a></h2>
<p>I opted for using <strong>docker</strong> images with <strong>docker-compose</strong> even though Syncthing was available in the Arch Linux repositories, since I didn’t want to end up with version mismatches on my Debian server. This allows me to run the same versions on the desktop and on the server.</p>
<div class="section" id="setting-up-the-server-and-desktop">
<h3><a class="toc-backref" href="#id4">Setting up the server and desktop</a></h3>
<p>I used the following <em>docker-compose.yml</em> on both the server and desktop machines:</p>
<div class="highlight"><pre><span></span><span class="nn">---</span>
<span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s">"2.1"</span>
<span class="nt">services</span><span class="p">:</span>
<span class="w"> </span><span class="nt">syncthing</span><span class="p">:</span>
<span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lscr.io/linuxserver/syncthing:latest</span>
<span class="w"> </span><span class="nt">container_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">syncthing</span>
<span class="w"> </span><span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">syncthing</span><span class="w"> </span><span class="c1">#optional</span>
<span class="w"> </span><span class="nt">environment</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">PUID=1000</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">PGID=1000</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">TZ=America/Halifax</span>
<span class="w"> </span><span class="nt">volumes</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/home/j/syncthing/appdata/config:/config</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/home/j/syncthing/data1:/data1</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/home/j/syncthing/data2:/data2</span>
<span class="w"> </span><span class="nt">ports</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">8384:8384</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">22000:22000/tcp</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">22000:22000/udp</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">21027:21027/udp</span>
<span class="w"> </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">unless-stopped</span>
</pre></div>
<p>This basically the default configuration, with my home directory specified in the volumes.</p>
<p>From there you can access the web interface at <a class="reference external" href="http://localhost:8384">http://localhost:8384</a> and add the devices you want to sync with.</p>
<p>Note: Make sure you setup password authentication, since by default the web interface isn’t protected by anything.</p>
</div>
<div class="section" id="setting-up-the-android-phone-and-tablet">
<h3><a class="toc-backref" href="#id5">Setting up the Android phone and tablet</a></h3>
<p>I installed the Android app on both the phone and tablet and set it up to sync with the server by pasting the <strong>device-ids</strong> which are found once you start up the application. And from there you can setup the folders that you want to sync.</p>
<p>The Android app is available on the <a class="reference external" href="https://play.google.com/store/apps/details?id=com.nutomic.syncthingandroid">Google Play Store</a>.</p>
</div>
<div class="section" id="obsidian-for-notes">
<h3><a class="toc-backref" href="#id6">Obsidian for notes</a></h3>
<p>Now all that was left was to get my Obsidian vault created in one of the shared folders and the replication was now happening between all the devices.</p>
</div>
<div class="section" id="conclusion">
<h3><a class="toc-backref" href="#id7">Conclusion</a></h3>
<p>Now I have a sync solution in place that avoids the usage of any cloud resources, and sync’s to my own server and desktop (even when I’m not on my personal network, since Syncthing can use a <a class="reference external" href="https://www.3cx.com/pbx/what-is-a-stun-server">stun server</a> to get access from the internet). While requiring little more configuration than a Dropbox or Google Drive (in Linux this still sucks). And I can load it up with way more than 2 gigabytes of files if required.</p>
<p>However I am still <em>on-the-hook</em> for backups, which I already have in place to a certain extent.</p>
</div>
</div>
Hurricane Fiona2022-09-25T23:49:00-03:002022-09-25T23:49:00-03:00mcgillijtag:mcgillij.dev,2022-09-25:/hurricane-fiona.html<p class="first last">Just an update on hurricane Fiona in my neck of the woods.</p>
<p>Made it through the storm, there are fewer tree’s in the backyard now, and several branches came dangerously close to smashing through the roof.</p>
<p>I ate so many chips this weekend, I don’t even know what to-do with myself anymore.</p>
<p>No power for 42 hours is typical with how poorly managed NSPower is these days.</p>
<p>I was able to keep most of my devices, powered and charged thanks in part to my <span class="caps">UPS</span> and Dewalt Car battery booster, able to charge up my phone and Steamdeck.</p>
<p>Now I just gotta throw out a bunch of food from the freezer, but glad to have power back.</p>
<p>Below are some pictures I took on the trail where I walk my dog, it’s quite impassable without having to trudge through the woods to get around the tree’s and power lines in there.</p>
Out off-roading in Tantallon Nova-Scotia, taking a look at a couple wild campsites2022-09-18T23:49:00-03:002022-09-18T23:49:00-03:00mcgillijtag:mcgillij.dev,2022-09-18:/off-roading-in-tantallon-ns-taking-a-look-at-a-couple-wild-campsites.html<p class="first last">Off-roading in Tantallon <span class="caps">NS</span>, taking a look at a couple wild campsites</p>
<p>Taking a look at the weather forecast this weekend, it was only going to be nice for a short amount of time on Saturday.
I figured I should get out there, and there was a couple spots that I had noted on my last trip that I wanted to check out a bit more closely.</p>
<p>First location. Roughly 20 mins drive into the woods and is located directly beside the road, however there’s a nice little pond and cliff for jumping into the water with some ropes to climb back up the cliff face.</p>
<p>The second location is probably closer to an 45 mins in, but you are greeted with a much larger lake, and some nice tree coverage and it’s only a small hike away from the road, and there’s some tucked away parking available relatively close.</p>
<p>Here’s a 360 panorama of the lake.</p>
<iframe allowfullscreen="" height="600" src="theme/html/pannellum.htm#panorama=/images/tantallon_pano.jpg&autoLoad=true" style="border-style:none;" width="800"></iframe><p>It was quite windy out, so I wasn’t super confident in the drones ability to keep up, but it managed pretty well.</p>
<p>It was also the first time that my drone lost connection with the remote, so I was left with a mild state of panic, as it then toggled itself into “<span class="caps">RETURN</span> <span class="caps">HOME</span>” mode, and once it started climbing, the remote was able to re-establish the connection, and I was able to bring it in again. I think it was having a hard time getting a connection through the rocks that were between us. Either way I was able to recover the drone, so it was a success.</p>
<p>Below is a video of both locations, they were nice spots the both of them. Each with pre-made campfire rings and stumps / seating and room for tents at both locations.</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/xzkS2v136kg"></iframe></div><p>Included below is some pictures I took along the way, I saw a deer, which was nice, and Atiya was needs a pair of sunglasses if she’s to stare at the sun anymore.</p>
Bayers Lake Droning2022-09-10T23:49:00-03:002022-09-10T23:49:00-03:00mcgillijtag:mcgillij.dev,2022-09-10:/bayers-lake-droning.html<p class="first last">A panoramic view of the construction site at Bayers Lake in Halifax, taken while flying my drone around the lakes.</p>
<div class="section" id="bayers-lake">
<h2><a class="toc-backref" href="#id1">Bayers Lake</a></h2>
<p>It was a nice sunny day today, after taking the Atiya to the dog park we went out to Bayers lake and took the drone out for a quick fly around a couple lake/ponds.</p>
<p>It was quite windy out, and I got several warnings on the controller implying that the auto-return functionality of the drone wouldn’t function, however I was able to pilot it back fine manually. Haven’t had to use the auto-return yet though, so there’s that.</p>
<iframe allowfullscreen="" height="600" src="theme/html/pannellum.htm#panorama=/images/bayerslake_pano.jpg&autoLoad=true" style="border-style:none;" width="800"></iframe><p>Quick spin around the ponds:</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/fN4nSeEuji8"></iframe></div><p>That was it for today, was a nice time out with the doggo.</p>
</div>
Stable-Diffusion on Amd cards with rocm on Arch Linux2022-09-09T13:49:00-03:002022-09-09T13:49:00-03:00mcgillijtag:mcgillij.dev,2022-09-09:/stable-diffusion-on-amd-cards-with-rocm-on-arch-linux.html<p class="first last">Experimenting with Stable-Diffusion with my <span class="caps">AMD</span> card on Arch Linux with rocm.</p>
<p>Like any self-respecting nerd, I’ve been playing around with stable-diffusion since it came out.</p>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/1.png" style="width: 100%;"/>
<br/><div class="section" id="stable-diffusion">
<h2><a class="toc-backref" href="#id1">Stable-Diffusion</a></h2>
<p>Stable-Diffusion is a new <span class="caps">AI</span>/<span class="caps">ML</span> framework that is being developed by the <a class="reference external" href="https://stability.ai">stability.ai</a> folks. I’ve been toying with it for the last couple weeks.</p>
<p>The idea of using text-prompts to generate images isn’t new, however the level of detail and accuracy achieved with stable-diffusion, is enough to remove any doubts questioning it’s legitimacy.</p>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/2.png" style="width: 100%;"/>
<br/></div>
<div class="section" id="amd-cards">
<h2><a class="toc-backref" href="#id2"><span class="caps">AMD</span> cards</a></h2>
<p>The issue with most documentation, and docker containers and environments for running stable-diffusion is the baked in Nvidia <span class="caps">CUDA</span> packages. However I’ve only got <span class="caps">AMD</span> cards, so I needed to find a solution to running with a different back-end.</p>
<p>The documentation for stable diffusion great already to follow along, however so I hope to just supplement the missing pieces here with regards to <span class="caps">AMD</span> cards, and what I had todo to get it up and running on my system.</p>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/3.png" style="width: 100%;"/>
<br/></div>
<div class="section" id="pre-requisites">
<h2><a class="toc-backref" href="#id3">Pre-requisites</a></h2>
<p>For this I’m using Arch Linux, but you can replace the commands with whatever the equivalent from your distro’s package manager.</p>
<p>Firstly we need the <strong>hsa-amd-aqlprofile-bin rocm-opencl-runtime rocminfo docker</strong> packages.</p>
<p>Running the following commands will install and enable docker.</p>
<div class="highlight"><pre><span></span>yay<span class="w"> </span>-S<span class="w"> </span>hsa-amd-aqlprofile-bin<span class="w"> </span>rocm-opencl-runtime<span class="w"> </span>rocminfo<span class="w"> </span>docker
sudo<span class="w"> </span>systemctl<span class="w"> </span><span class="nb">enable</span><span class="w"> </span>docker<span class="w"> </span><span class="c1"># this is optional to make docker start on system startup</span>
sudo<span class="w"> </span>systemctl<span class="w"> </span>start<span class="w"> </span>docker
</pre></div>
<p>You will also need to add yourself to the docker group, if you haven’t already.</p>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/4.png" style="width: 100%;"/>
<br/></div>
<div class="section" id="docker-shenanigans">
<h2><a class="toc-backref" href="#id4">Docker shenanigans</a></h2>
<p>Next we will need to create an alias or shortcut for the docker command to provide <span class="caps">GPU</span> and privileged access to the system, since we will not be running ordinary docker containers, we will be allowing it to access our <span class="caps">GPU</span> directly.</p>
<p>And also creating a volume mount point in <strong>$<span class="caps">HOME</span>/dockerx</strong> that will allow us to update our stable-diffusion as needed, without having to rebuild the dependencies in the container.</p>
<p>Either save this snippet in your path, or create an alias.</p>
<p>Example <strong>~/bin/docker_gpu</strong>:</p>
<div class="highlight"><pre><span></span><span class="ch">#!/bin/bash</span>
sudo<span class="w"> </span>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>--network<span class="o">=</span>host<span class="w"> </span>--device<span class="o">=</span>/dev/kfd<span class="w"> </span>--device<span class="o">=</span>/dev/dri<span class="w"> </span>--group-add<span class="o">=</span>video<span class="w"> </span>--ipc<span class="o">=</span>host<span class="w"> </span>--cap-add<span class="o">=</span>SYS_PTRACE<span class="w"> </span>--security-opt<span class="w"> </span><span class="nv">seccomp</span><span class="o">=</span>unconfined<span class="w"> </span>-v<span class="w"> </span><span class="nv">$HOME</span>/dockerx:/dockerx
</pre></div>
<p>Or add an alias similar to this:</p>
<div class="highlight"><pre><span></span><span class="nb">alias</span><span class="w"> </span><span class="nv">docker_gpu</span><span class="o">=</span><span class="s1">'sudo docker run -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $HOME/dockerx:/dockerx'</span>
</pre></div>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/5.png" style="width: 100%;"/>
<br/></div>
<div class="section" id="running-the-container">
<h2><a class="toc-backref" href="#id5">Running the container</a></h2>
<p>Now we can update the dependencies list from the stable diffusion repo to remove <span class="caps">CUDA</span> and use <strong>rocm</strong> as the back-end.</p>
<p>Note: I have a 6800xt, so the pytorch image I’m using is only for Navi21 cards, you may have to check <a class="reference external" href="https://hub.docker.com/r/rocm/pytorch/tags">dockerhub</a> for your <span class="caps">GPU</span> if it’s different.</p>
<div class="highlight"><pre><span></span>docker_gpu<span class="w"> </span>rocm/pytorch:rocm5.2_ubuntu20.04_py3.7_pytorch_1.11.0_navi21
</pre></div>
<p>You should now have a prompt inside the container. Now we can open up another terminal and clone the stable-diffusion repo (<a class="reference external" href="https://github.com/sd-webui/stable-diffusion-webui">https://github.com/sd-webui/stable-diffusion-webui</a> I chose this one, since I wanted the webui as well). Clone this repo in your <strong>~/dockerx/</strong> since it’s volume mounted into your docker container.</p>
<p>Now we will hop into the container as our regular user, use the following command to find the container name and hop into the container.</p>
<div class="highlight"><pre><span></span>docker<span class="w"> </span>container<span class="w"> </span>ls
><span class="w"> </span>CONTAINER<span class="w"> </span>ID<span class="w"> </span>IMAGE<span class="w"> </span>COMMAND<span class="w"> </span>CREATED<span class="w"> </span>STATUS<span class="w"> </span>PORTS<span class="w"> </span>NAMES
cba1b9b628e7<span class="w"> </span>rocm/pytorch:rocm5.2_ubuntu20.04_py3.7_pytorch_1.11.0_navi21<span class="w"> </span><span class="s2">"bash"</span><span class="w"> </span>About<span class="w"> </span>a<span class="w"> </span>minute<span class="w"> </span>ago<span class="w"> </span>Up<span class="w"> </span>About<span class="w"> </span>a<span class="w"> </span>minute<span class="w"> </span>eager_bose
</pre></div>
<p>In this case our container name is <strong>eager_bose</strong>. And we can hop into it with the following command.</p>
<div class="highlight"><pre><span></span>docker<span class="w"> </span><span class="nb">exec</span><span class="w"> </span>-it<span class="w"> </span>eager_bose<span class="w"> </span>bash
</pre></div>
<p>Now in the container, we can start fixing up the Conda environment. Navigate to your stable-diffusion directory and lets setup and activate the Conda environment.</p>
<div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>/dockerx/stable-diffusion-webui
conda<span class="w"> </span>env<span class="w"> </span>create<span class="w"> </span>-f<span class="w"> </span>environment.yaml
conda<span class="w"> </span>activate<span class="w"> </span>ldm
</pre></div>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/6.png" style="width: 100%;"/>
<br/></div>
<div class="section" id="pytorch-conda">
<h2><a class="toc-backref" href="#id6">PyTorch / Conda</a></h2>
<p>Now we will want to browse to the <a class="reference external" href="rocm/pytorch:rocm5.2_ubuntu20.04_py3.7_pytorch_1.11.0_navi21">pytorch</a> website and grab the <tt class="docutils literal">pip</tt> command that we will be using in our container to update the pytorch dependencies.</p>
<img alt="pytorch" src="https://mcgillij.dev/images/pytorch.png" style="width: 1043px; height: auto; max-width: 100%;"/>
<p>We can modify the command to add the <tt class="docutils literal"><span class="pre">--upgrade</span></tt> flag, and run it in our container.</p>
<div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>--upgrade<span class="w"> </span>torch<span class="w"> </span>torchvision<span class="w"> </span>torchaudio<span class="w"> </span>--extra-index-url<span class="w"> </span>https://download.pytorch.org/whl/rocm5.1.1
</pre></div>
<p>This will replace the pytorch inside the Conda environment with one that can run on <span class="caps">AMD</span> GPUs.</p>
<p>From here you now have stable diffusion pretty well up and running you can run the tests / start up the <cite>webui</cite>.</p>
<p>Using the following command:</p>
<div class="highlight"><pre><span></span>python<span class="w"> </span>scripts/relauncher.py
</pre></div>
<p>And click on the <strong>localhost</strong> url that is generated, and you will have access to the WebUI for your experiments.</p>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/7.png" style="width: 100%;"/>
<br/></div>
<div class="section" id="optional">
<h2><a class="toc-backref" href="#id7">Optional</a></h2>
<p>Now, you have everything running, however you will have to restart some of the steps each time, since the work you did in the container isn’t going to persist.</p>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/8.png" style="width: 100%;"/>
<br/><div class="section" id="saving-your-container">
<h3><a class="toc-backref" href="#id8">Saving your container</a></h3>
<p>Run the following docker command in another terminal to save your work. First we need to find the container id.</p>
<div class="highlight"><pre><span></span>docker<span class="w"> </span>container<span class="w"> </span>ls
><span class="w"> </span>CONTAINER<span class="w"> </span>ID<span class="w"> </span>IMAGE<span class="w"> </span>COMMAND<span class="w"> </span>CREATED<span class="w"> </span>STATUS<span class="w"> </span>PORTS<span class="w"> </span>NAMES
cba1b9b628e7<span class="w"> </span>rocm/pytorch:rocm5.2_ubuntu20.04_py3.7_pytorch_1.11.0_navi21<span class="w"> </span><span class="s2">"bash"</span><span class="w"> </span>About<span class="w"> </span>a<span class="w"> </span>minute<span class="w"> </span>ago<span class="w"> </span>Up<span class="w"> </span>About<span class="w"> </span>a<span class="w"> </span>minute<span class="w"> </span>eager_bose
</pre></div>
<p>In this case our container id is <strong>cba1b9b628e7</strong>. And we can save it with the following command.</p>
<div class="highlight"><pre><span></span>docker<span class="w"> </span>commit<span class="w"> </span>cba1b9b628e7<span class="w"> </span>stable-diffusion
</pre></div>
<p><strong>Caution</strong> This will be a large container.</p>
<p>Now you can exit the container as your user, and as the root user. And to use your new saved container, you can run the following command.</p>
<div class="highlight"><pre><span></span>docker_gpu<span class="w"> </span>stable-diffusion
</pre></div>
<p>And you’ll just need to activate your Conda environment from inside the container as your user / kick off the WebUI etc.</p>
<p>Trimming down the image, modifying the Conda dependencies is left as an exercise to the reader.</p>
<p>More fun some fun images, that I generated while playing with this.</p>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/9.png" style="width: 631px; height: auto; max-width: 100%;"/>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/10.png" style="width: 627px; height: auto; max-width: 100%;"/>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/11.png" style="width: 632px; height: auto; max-width: 100%;"/>
<img alt="Stable-Diffusion" src="https://mcgillij.dev/images/sd/12.png" style="width: 628px; height: auto; max-width: 100%;"/>
<br/><p>Let please let me know what interesting prompts you come up with, and send me some of the images you generated, I’d love to see them.</p>
</div>
</div>
Memramcook / Taylor Village off-roading trip2022-09-07T21:49:00-03:002022-09-07T21:49:00-03:00mcgillijtag:mcgillij.dev,2022-09-07:/memramcook-taylor-village-off-roading-trip.html<p class="first last">A trip to Memramcook, <span class="caps">NB</span> to visit the Taylor Village and do some off-roading.</p>
<div class="section" id="road-trip-to-memramcook-nb">
<h2><a class="toc-backref" href="#id1">Road trip to Memramcook, <span class="caps">NB</span></a></h2>
<p>During the weekend, I took a trip out to Memramcook to visit the Taylor Village with my family, to our small Blueberry field, and I had brought the drone out to play.</p>
<p>Here’s a neat panoramic photo, you should be able to scroll around and spin the image.</p>
<iframe allowfullscreen="" height="600" src="theme/html/pannellum.htm#panorama=/images/blueberry_pano.jpg&autoLoad=true" style="border-style:none;" width="800"></iframe><p>Some footage from the drone flight at the blueberry field.</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/XrtpfmRyMt4"></iframe></div><p>Further down the road I met up with some relatives and took some aerial footage of some of our family’s camps, and the nice sandy beach in Taylor village.</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/eUW1a4E5oLI"></iframe></div><p>And finally a bonus, giant pit just off the side of the road, that was used to barge out quarry stones back in the day.</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/cuDYwwCSSTc"></iframe></div><p>Some pictures taken while walking along the beach looking for fossils.</p>
</div>
Terrence Bay River outing with the Drone2022-08-28T21:49:00-03:002022-08-28T21:49:00-03:00mcgillijtag:mcgillij.dev,2022-08-28:/terrence-bay-river-outing-with-the-drone.html<p class="first last">Terrence Bay River outing with the Drone</p>
<p>It was a nice day for a Sunday drive out to Terrence Bay.</p>
<p>Took my dog Atiya out to the park and had a nice walk around the river. I had my new drone with me, so I took it for a spin, still learning the ropes.</p>
<p>This was my third outing with the drone, and so far I really like it. I’m getting more confident in the mini-drones abilities and no longer constantly wondering if it’s going to plunge directly into the water, also how it deals with some slight winds.</p>
<p>Here’s a nice panorama of the river:</p>
<iframe allowfullscreen="" height="600" src="theme/html/pannellum.htm#panorama=/images/terrencebay_pano.jpg&autoLoad=true" style="border-style:none;" width="800"></iframe><p>Here’s a short video of the drone flying around a bit over the river.</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/btW7kKF3W2s"></iframe></div><p>I’ll be back out there soon, I’m enjoying flying this thing around.</p>
Second Drone Flight!2022-08-27T16:49:00-03:002022-08-27T16:49:00-03:00mcgillijtag:mcgillij.dev,2022-08-27:/second-drone-flight.html<p class="first last">Just a quick clip of my second drone flight with the mini drone.</p>
<p>Building some confidence flying the drone, I guess is what I was out there doing.</p>
<p>Just wanted to get a bit of flight time, and try to figure out some more of the functionality of the drone.</p>
<p>It was a nice night out, and I managed to almost drain the battery.</p>
<div class="section" id="some-photo-s-and-a-video">
<h2><a class="toc-backref" href="#id1">Some photo’s and a video</a></h2>
<p>Just about to take off.</p>
<img alt="Takeoff" class="image-process-large-photo align-center" sizes="(min-width: 1200px) 800px, (min-width: 992px) 650px, (min-width: 768px) 718px, 100vw" src="https://mcgillij.dev/images/derivatives/large-photo/800w/bayerlake_takeoff.jpg" srcset="https://mcgillij.dev/images/derivatives/large-photo/600w/bayerlake_takeoff.jpg 600w, https://mcgillij.dev/images/derivatives/large-photo/800w/bayerlake_takeoff.jpg 800w, https://mcgillij.dev/images/derivatives/large-photo/1600w/bayerlake_takeoff.jpg 1600w" style="width: 4032px; height: auto; max-width: 100%;"/>
<p>Here I was messing around with the panorama mode, and managed to get a half decent shot.</p>
<img alt="Panorama" class="image-process-large-photo align-center" sizes="(min-width: 1200px) 800px, (min-width: 992px) 650px, (min-width: 768px) 718px, 100vw" src="https://mcgillij.dev/images/derivatives/large-photo/800w/bayerlake_panorama.jpg" srcset="https://mcgillij.dev/images/derivatives/large-photo/600w/bayerlake_panorama.jpg 600w, https://mcgillij.dev/images/derivatives/large-photo/800w/bayerlake_panorama.jpg 800w, https://mcgillij.dev/images/derivatives/large-photo/1600w/bayerlake_panorama.jpg 1600w" style="width: 8192px; height: auto; max-width: 100%;"/>
<p>It does look to warp near the bottom, but otherwise looks really nice.</p>
<p>The Video:</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/xZOzQ2q4LDw"></iframe></div></div>
Installing Lineage on my Pixel 2xl2022-08-24T22:30:00-03:002022-08-24T22:30:00-03:00mcgillijtag:mcgillij.dev,2022-08-24:/lineage-on-pixel-2xl.html<p class="first last">Overview of how to install Lineage on my Pixel 2xl</p>
<p>My Pixel 2xl was really starting show it’s age, with the battery life trending downwards.</p>
<p>And being several years out of support from Google, stuck on Android 11.</p>
<p>I decided to install LineageOS on the phone, and I’ll go into details the process of doing so from Arch Linux.</p>
<p>Here’s a link to the <a class="reference external" href="https://wiki.lineageos.org/devices/taimen/install">official documentation</a> it’s quite great and comprehensive.</p>
<div class="section" id="pre-requisites-on-your-desktop">
<h2><a class="toc-backref" href="#id1">Pre-requisites on your desktop</a></h2>
<p>In Arch Linux, you will need the <strong>android-tools</strong> package that contains the <tt class="docutils literal">adb</tt> and <tt class="docutils literal">fastboot</tt> binaries.</p>
<p>You can install it with the following command:</p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>pacman<span class="w"> </span>-S<span class="w"> </span>android-tools
</pre></div>
<p>You will need to download the recovery image for LineageOS and the <span class="caps">OS</span> image for your phone <a class="reference external" href="https://download.lineageos.org/taimen">from here</a>.</p>
<p>They will be named something like <strong>lineage-19.1-20220811-recovery-taimen.img</strong> and <strong>lineage-19.1-20220811-nightly-taimen-signed.zip</strong></p>
<p>If you want to install Google Play services, you will need to install the <strong>MindTheGapps-12.1.0-arm64-20220605_112439.zip</strong> package which can be found <a class="reference external" href="https://androidfilehost.com/?w=files&flid=322935">here</a>.</p>
</div>
<div class="section" id="pre-requisites-on-your-phone">
<h2><a class="toc-backref" href="#id2">Pre-requisites on your phone</a></h2>
<p>Your phone will need to have <strong>developer mode</strong> enabled, <span class="caps">OEM</span> unlocked and <span class="caps">USB</span> Debugging. These options are available in the <strong>Settings -> System -> Developer</strong> menu.</p>
<p>Enabling the developer options is quick, go to <em>Settings -> About</em>, find the <em>build number</em> and mash on it 7 times.</p>
<p>Once those settings are all enabled. We will use <strong>fastboot</strong> to fully unlock the bootloader.</p>
</div>
<div class="section" id="open-your-terminal-of-choice">
<h2><a class="toc-backref" href="#id3">Open your terminal of choice</a></h2>
<p>From a terminal you can verify that you can connect to your phone with <strong>adb</strong> using the following command after plugging in the <span class="caps">USB</span> cable.</p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>adb<span class="w"> </span>devices
><span class="w"> </span>List<span class="w"> </span>of<span class="w"> </span>devices<span class="w"> </span>attached
><span class="w"> </span>905KTBA1965395<span class="w"> </span>device
</pre></div>
<p>If you see the device there, you should be good to go.</p>
<div class="section" id="rebooting-into-the-bootloader">
<h3><a class="toc-backref" href="#id4">Rebooting into the bootloader</a></h3>
<p>You can reboot into the bootloader now with:</p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>adb<span class="w"> </span>reboot<span class="w"> </span>bootloader
</pre></div>
<p>Watch your phone reboot itself into the bootloader, and from there you can unlock the bootloader fully.</p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>fastboot<span class="w"> </span>flashing<span class="w"> </span>unlock
</pre></div>
<p>Then you’ll have to press “yes” on the phone to continue the process.</p>
</div>
<div class="section" id="flashing-the-recovery-image">
<h3><a class="toc-backref" href="#id5">Flashing the recovery image</a></h3>
<p>Next we will flash and boot into the recovery image for LineageOS.</p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>fastboot<span class="w"> </span>flash<span class="w"> </span>recovery<span class="w"> </span>lineage-19.1-20220811-recovery-taimen.img
</pre></div>
<p>This should only take a couple seconds, and use your phones volumes buttons to select booting into recovery mode and hit the power button.</p>
<p>You should be greeted with the LineageOS recovery menu, which we will now use to install LineageOS proper.</p>
<p>You may have to re-plug your <span class="caps">USB</span> cable, to make it appear with <strong>adb devices</strong>.</p>
<p>Once you’ve validated that it’s connected, you will click on the <strong>Apply Update</strong> button, and <strong>Apply from <span class="caps">ADB</span></strong>.</p>
<p>Which will setup the phone for sideloading, which we will use to install the full LineageOS image using the following command:</p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>adb<span class="w"> </span>sideload<span class="w"> </span>lineage-19.1-20220811-nightly-taimen-signed.zip
</pre></div>
<p>At this point you are potentially done (if you don’t want any of the Google apps, you can reboot now and enjoy LineageOS).</p>
</div>
<div class="section" id="installing-mindthegapps">
<h3><a class="toc-backref" href="#id6">Installing MindTheGapps</a></h3>
<p>If you want to run some of the Google Play services, you will need to install the <strong>MindTheGapps-12.1.0-arm64-20220605_112439.zip</strong> package as well.</p>
<p>From the recovery menu you will need to choose <strong>Advanced</strong> and <strong>Reboot to Recovery</strong>, then select <strong>Apply Update</strong> and <strong>Apply from <span class="caps">ADB</span></strong> again, and repeat the sideloading process once again for the MindTheGapps package as seen below.</p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>adb<span class="w"> </span>sideload<span class="w"> </span>MindTheGapps-12.1.0-arm64-20220605_112439.zip
</pre></div>
<p>You will need to accept installing the unsigned package from the phone, and with that installed you can reboot your device and you’re good to go.</p>
<img alt="LineageOS on phone" src="https://mcgillij.dev/images/lineage_on_phone.png" style="width: 352px; height: auto; max-width: 100%;"/>
<img alt="LineageOS about" src="https://mcgillij.dev/images/lineage_about.png" style="width: 352px; height: auto; max-width: 100%;"/>
<p>It’s really incredible what the LineageOS team has done to give us better support for end of life devices. Great work guys, it really runs great.</p>
</div>
</div>
Sign your git commits with ssh keys instead of gpg2022-08-23T20:00:00-03:002022-08-23T20:00:00-03:00mcgillijtag:mcgillij.dev,2022-08-23:/git-sign-commits-with-ssh.html<p class="first last">How to sign your git commits with <span class="caps">SSH</span> instead of <span class="caps">GPG</span></p>
<p><a class="reference external" href="https://github.blog/changelog/2022-08-23-ssh-commit-verification-now-supported/">Github announced today</a> the ability to show signed commits from <span class="caps">SSH</span>, which is nice since it was a bit of a pain to sign with <span class="caps">GPG</span> (to be fair <strong>git</strong> has supported this for quite a while, Github just didn’t show the signed commits properly).</p>
<p>Getting this setup involved a bit of trial and error on my part, below are the steps I ended up taking to get it working.</p>
<p><strong>Note:</strong> I’m using the <strong>—global</strong> flag on my git commands since I want to sign commits for all my repos, you can omit this if you want to set it on a per repo basis.</p>
<div class="section" id="setup-git-to-use-ssh-instead-of-gpg">
<h2><a class="toc-backref" href="#id1">Setup Git to use <span class="caps">SSH</span> instead of <span class="caps">GPG</span></a></h2>
<p>First we need to configure git to use <span class="caps">SSH</span> keys instead of <span class="caps">GPG</span> to sign commits.</p>
<div class="highlight"><pre><span></span>git<span class="w"> </span>config<span class="w"> </span>--global<span class="w"> </span>gpg.format<span class="w"> </span>ssh
</pre></div>
<p>Below we indicate which public keys are allowed to sign commits. Replace with your public keys, unless you want me to be verified on your commits.</p>
<div class="highlight"><pre><span></span>git<span class="w"> </span>config<span class="w"> </span>--global<span class="w"> </span>user.signingKey<span class="w"> </span><span class="s1">'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMSsJjYL0PNE8/ahTdQXbiOS4Fdg/rY8pafH2YWjmpJM mcgillivray.jason@gmail.com'</span>
git<span class="w"> </span>config<span class="w"> </span>--global<span class="w"> </span>gpg.ssh.allowedSignersFile<span class="w"> </span>~/.config/git/allowed_signers
<span class="nb">echo</span><span class="w"> </span><span class="s2">"mcgillivray.jason@gmail.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMSsJjYL0PNE8/ahTdQXbiOS4Fdg/rY8pafH2YWjmpJM"</span><span class="w"> </span>>><span class="w"> </span>~/.config/git/allowed_signers
</pre></div>
<p>Checking to make sure which private keys are loaded in your <strong>ssh-agent</strong>.</p>
<div class="highlight"><pre><span></span>ssh-add<span class="w"> </span>-L
</pre></div>
<p>This was empty for me since I had previously <strong>killed</strong> my <tt class="docutils literal"><span class="pre">ssh-agent</span></tt>. So I needed to re-add my keys. Which can be done with the following command.</p>
<div class="highlight"><pre><span></span>ssh-add<span class="w"> </span>~/.ssh/id_ed25519
<span class="c1"># now we can check again to make sure our key is present</span>
ssh-add<span class="w"> </span>-L
><span class="w"> </span>ssh-ed25519<span class="w"> </span>AAAAC3NzaC1lZDI1NTE5AAAAIMSsJjYL0PNE8/ahTdQXbiOS4Fdg/rY8pafH2YWjmpJM<span class="w"> </span>mcgillivray.jason@gmail.com
</pre></div>
</div>
<div class="section" id="signing-commits-with-your-ssh-key">
<h2><a class="toc-backref" href="#id2">Signing commits with your <span class="caps">SSH</span> key</a></h2>
<p>When you are ready to commit your changes you can use the following git flag <strong>-S</strong> for commits or <strong>-s</strong> for tags to sign them with your newly configured <span class="caps">SSH</span> signing key.</p>
<p>Example:</p>
<div class="highlight"><pre><span></span>git<span class="w"> </span>commit<span class="w"> </span>-S<span class="w"> </span>-m<span class="w"> </span><span class="s2">"Commit message"</span>
git<span class="w"> </span>tag<span class="w"> </span>-s<span class="w"> </span>-m<span class="w"> </span><span class="s2">"Tag message"</span><span class="w"> </span>v1.0.0
</pre></div>
<p>Alternatively you can set the following <strong>git.config</strong> option to auto-sign your commits.</p>
<div class="highlight"><pre><span></span>git<span class="w"> </span>config<span class="w"> </span>--global<span class="w"> </span>commit.gpgsign<span class="w"> </span><span class="nb">true</span>
</pre></div>
</div>
<div class="section" id="debugging">
<h2><a class="toc-backref" href="#id3">Debugging</a></h2>
<p>If you are having some troubles and you need to debug what <cite>git</cite> is doing behind the scenes for signing (or really any other issues your having with git, you can enable GIT_TRACE logging).</p>
<div class="highlight"><pre><span></span><span class="nv">GIT_TRACE</span><span class="o">=</span><span class="m">1</span><span class="w"> </span>git<span class="w"> </span>commit<span class="w"> </span>-S<span class="w"> </span>-m<span class="w"> </span><span class="s1">'test'</span>
><span class="w"> </span><span class="m">20</span>:18:49.302765<span class="w"> </span>git.c:460<span class="w"> </span>trace:<span class="w"> </span>built-in:<span class="w"> </span>git<span class="w"> </span>commit<span class="w"> </span>-S<span class="w"> </span>-m<span class="w"> </span><span class="nb">test</span>
><span class="w"> </span><span class="m">20</span>:18:49.304053<span class="w"> </span>run-command.c:654<span class="w"> </span>trace:<span class="w"> </span>run_command:<span class="w"> </span>ssh-keygen<span class="w"> </span>-Y<span class="w"> </span>sign<span class="w"> </span>-n<span class="w"> </span>git<span class="w"> </span>-f<span class="w"> </span>/tmp/.git_signing_key_tmpHx7vuE<span class="w"> </span>/tmp/.git_signing_buffer_tmpEwDNMQ
><span class="w"> </span>error:<span class="w"> </span>Load<span class="w"> </span>key<span class="w"> </span><span class="s2">"/tmp/.git_signing_key_tmpHx7vuE"</span>:<span class="w"> </span>invalid<span class="w"> </span>format?
><span class="w"> </span>fatal:<span class="w"> </span>failed<span class="w"> </span>to<span class="w"> </span>write<span class="w"> </span>commit<span class="w"> </span>object
</pre></div>
<p>If you get an error message like the above, you will need to add your private key to your <strong>ssh-agent</strong> with the <strong>ssh-add</strong> command as indicated in the above steps.</p>
</div>
<div class="section" id="validating-signatures">
<h2><a class="toc-backref" href="#id4">Validating signatures</a></h2>
<p>Once you have a commit staged you can verify that the signature is working by running the following command:</p>
<div class="highlight"><pre><span></span>git<span class="w"> </span>show<span class="w"> </span>--show-signature
</pre></div>
<p>You should see something like this:</p>
<img alt="git show --show-signature" src="https://mcgillij.dev/images/git-show-signature.png" style="width: 1585px; height: auto; max-width: 100%;"/>
</div>
<div class="section" id="finally">
<h2><a class="toc-backref" href="#id5">Finally</a></h2>
<p>You will need to add your public signing key to your github accounts settings.</p>
<img alt="github settings" src="https://mcgillij.dev/images/github_settings.png" style="width: 1017px; height: auto; max-width: 100%;"/>
<p>When you commit your changes to a github repo, you will be able to see the verified badge to go along with your commits similarly to when you had to jump through a bunch of hoops to use <span class="caps">GPG</span>.</p>
<img alt="github signed" src="https://mcgillij.dev/images/github-signed.png" style="width: 819px; height: auto; max-width: 100%;"/>
</div>
<div class="section" id="arguments-for-against-signing">
<h2><a class="toc-backref" href="#id6">Arguments for / against signing</a></h2>
<p>Some people believe that there’s plausible deniability that goes along with not signing commits, but at the end of the day it’s up-to you. I choose to sign my commits when I can either with <span class="caps">GPG</span> or <span class="caps">SSH</span> keys.</p>
<p>Anyways let me know what you think, is signing good / bad, do you have an opinion on this?</p>
</div>
First Drone Flight / Off-Roading2022-08-23T16:49:00-03:002022-08-23T16:49:00-03:00mcgillijtag:mcgillij.dev,2022-08-23:/my-first-drone-flight-off-roading.html<p class="first last">My first drone flight off-roading.</p>
<p>Last week I got myself a drone, more on the specifics later. And I brought it out with me off-roading on the weekend.</p>
<p>My goals were to not crash the drone on my first flight screwing around with it. And I’m glad to say that it was a success!</p>
<div class="section" id="drone-in-question">
<h2><a class="toc-backref" href="#id1">Drone in question</a></h2>
<p>I picked up a <a class="reference external" href="https://www.dji.com/ca/mini-3-pro">dji mini 3 pro</a>. I’m not yet super into all the drone specs.</p>
<p>The main selling point for me was that it was a mini drone (under 250g, so that there’s no headache requiring me to register it etc).</p>
</div>
<div class="section" id="geofencing">
<h2><a class="toc-backref" href="#id2">Geofencing</a></h2>
<p>It has built-in geofencing, so in theory I won’t be getting myself into trouble for flying it.</p>
<p>However there are some extra necessities in regards to flying a drone in Canada that aren’t taken into account by the built-in geofencing.</p>
<p>Checking the <a class="reference external" href="https://nrc.canada.ca/en/drone-tool/flightMap.php"><span class="caps">NRC</span> Drone flight map</a> site or app prior to flying.</p>
<p>So far I’ve only done one flight, so it hasn’t been a huge hassle. There’s also ways to ask for exemptions from the geofencing, but I’m not that concerned about wanting to try to fly it in restricted areas honestly. This is mostly just for me to mess around in the woods.</p>
</div>
<div class="section" id="my-first-flight">
<h2><a class="toc-backref" href="#id3">My first flight</a></h2>
<p>I’ve uploaded the video to <a class="reference external" href="https://www.youtube.com/watch?v=qxl-shHZ8HM">youtube</a> of the maiden flight, and you can check it out here if you like.</p>
<div class="youtube youtube-16x9"><iframe allowfullscreen="" frameborder="0" seamless="" src="https://www.youtube.com/embed/qxl-shHZ8HM"></iframe></div><p>I can’t wait to take it out again and start messing with more features, but I’ll probably hold off on the <strong>sports</strong> mode.
Since it disables all the flight assist stuff and object-avoidance, since I don’t really want to crash it into a tree just yet.</p>
</div>
get_latest_proton_ge2022-08-05T00:00:00-03:002022-08-05T00:00:00-03:00mcgillijtag:mcgillij.dev,2022-08-05:/get-latest-proton-ge.html<p class="first last">Quick script to nab the latest Proton <span class="caps">GE</span> version, can be run from your SteamDeck.</p>
<div class="section" id="id1">
<h2><a class="toc-backref" href="#id3">get_latest_proton_ge</a></h2>
<p>Just a quick script that I wrote to fetch the latest versions of Proton <span class="caps">GE</span>.</p>
<p>Can be found here on my github: <a class="reference external" href="https://github.com/mcgillij/get_latest_proton_ge">get_latest_proton_ge</a>.</p>
<p>I also have this bash script to call this script loaded in my <strong><span class="caps">PATH</span></strong>.</p>
<div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>/home/j/gits/get_latest_proton_ge/
poetry<span class="w"> </span>run<span class="w"> </span>python<span class="w"> </span>src/get_latest_proton_ge/get_latest_proton_ge.py
</pre></div>
<p>To use this just clone the repo, and then run a <tt class="docutils literal">poetry install</tt> from inside the repository directory to populate the Python virtualenv.</p>
<p>Running <strong>get_proton</strong> anytime will fetch the latest version and install it.
This is handier than typing all that out on the SteamDeck.</p>
<p>I also use it on my desktop.</p>
</div>