<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/atom.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Posts tagged: terminal</title>
  <id>https://pype.dev/tags/terminal/atom.xml</id>
  <updated>2025-12-08T05:16:55Z</updated>
  <subtitle>All posts with the tag &#34;terminal&#34;</subtitle>
  <link href="https://pype.dev/tags/terminal/" rel="alternate" type="text/html"></link>
  <link href="https://pype.dev/tags/terminal/atom.xml" rel="self" type="application/atom+xml"></link>
  <author>
    <name>Nic Payne</name>
  </author>
  <generator uri="https://github.com/WaylonWalker/markata-go">markata-go</generator>
  <entry>
    <title>COLUMNS Env Var For Nicer Screenshots</title>
    <id>https://pype.dev/columns-env-var-for-nicer-screenshots/</id>
    <updated>2025-12-08T05:16:55Z</updated>
    <published>2025-12-08T05:16:55Z</published>
    <link href="https://pype.dev/columns-env-var-for-nicer-screenshots/" rel="alternate" type="text/html"></link>
    <summary type="text">I was working on uv-run-pep-723-is-a-match-made-in-heaven and I wanted to grab a screenshot of a TUI, but my terminal is full screen and the TUI was then...</summary>
    <content type="html">&lt;p&gt;I was working on &lt;a href=&#34;/uv-run-pep-723-is-a-match-made-in-heaven/&#34; class=&#34;wikilink&#34; data-title=&#34;UV Run + PEP 723 Is A Match Made In Heaven&#34; data-description=&#34;This post will be short but hopefully be a dense few paragraphs about how using along with PEP 723 is life-changing.&#34; data-date=&#34;2025-12-08&#34; data-preview=&#34;This post will be short but hopefully be a dense few paragraphs about how using along with PEP 723 is life-changing.&#34;&gt;UV Run + PEP 723 Is A Match Made In Heaven&lt;/a&gt; and I wanted to grab a screenshot of a TUI, but my terminal is full screen and the TUI was then super stretched&amp;hellip; Nice for working and using it, but not nice for a screenshot going into a blog post&amp;hellip; see the difference &lt;code&gt;export COLUMNS=120&lt;/code&gt; does here!&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;COLUMNS=120 mytui.py&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://cdn.statically.io/gh/pypeaday/images.pype.dev/main/blog-media/20251208111709_aa06bd03.png&#34; alt=&#34;20251208111709_aa06bd03.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&lt;pre&gt;&lt;code&gt;mytui.py&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://cdn.statically.io/gh/pypeaday/images.pype.dev/main/blog-media/20251208111820_a209638f.png&#34; alt=&#34;20251208111820_a209638f.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;</content>
    <author>
      <name>Nic Payne</name>
      <uri>https://pype.dev</uri>
    </author>
  </entry>
  <entry>
    <title>💭 COLUMNS env var</title>
    <id>https://pype.dev/thoughts-878/</id>
    <updated>2025-12-03T11:40:58Z</updated>
    <published>2025-12-03T11:40:58Z</published>
    <link href="https://pype.dev/thoughts-878/" rel="alternate" type="text/html"></link>
    <summary type="text">Awesome awesome TIL with COLUMNS for some nicer terminal printouts for READMEs and such</summary>
    <content type="html">&lt;a href=&#34;https://waylonwalker.com/columns-env-var/&#34;&gt;&#xA;    &lt;img&#xA;        src=&#34;https://shots.wayl.one/shot/?url=https://waylonwalker.com/columns-env-var/&amp;height=450&amp;width=800&amp;scaled_width=800&amp;scaled_height=450&amp;selectors=&#34;&#xA;        alt=&#34;shot of post - COLUMNS env var&#34;&#xA;        height=450&#xA;        width=800&#xA;    &gt;&#xA;&lt;/a&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s my thought on &lt;a href=&#34;https://waylonwalker.com/columns-env-var/&#34;&gt;COLUMNS env var&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;Awesome awesome TIL with &lt;code&gt;COLUMNS&lt;/code&gt; for some nicer terminal printouts for READMEs and such&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;div class=&#34;admonition note&#34;&gt;&#xA;&lt;p class=&#34;admonition-title&#34;&gt;Note&lt;/p&gt;&#xA;&lt;p&gt;This is one of [[ my-thoughts ]]. I picked this up from &lt;a href=&#34;https://waylonwalker.com&#34;&gt;Waylon Walker&lt;/a&gt;(&lt;a href=&#34;https://thoughts.waylonwalker.com&#34;&gt;https://thoughts.waylonwalker.com&lt;/a&gt;). It&amp;rsquo;s a short note that I make about someone else&amp;rsquo;s content online.  Learn more about the process &lt;a href=&#34;/thoughts/&#34; class=&#34;wikilink&#34; data-title=&#34;Thoughts&#34; data-description=&#34;My thoughts are found at my thoughts feed&#34; data-date=&#34;2025-06-09&#34; data-preview=&#34;My thoughts are found at my thoughts feed&#34;&gt;Thoughts&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;</content>
    <author>
      <name>Nic Payne</name>
      <uri>https://pype.dev</uri>
    </author>
  </entry>
  <entry>
    <title>Monolith - download and save site as html</title>
    <id>https://pype.dev/monolith-download-and-save-site-as-html/</id>
    <updated>2025-03-16T16:03:31Z</updated>
    <published>2025-03-16T16:03:31Z</published>
    <link href="https://pype.dev/monolith-download-and-save-site-as-html/" rel="alternate" type="text/html"></link>
    <summary type="text">I needed to save a website earlier and this was just what I needed...</summary>
    <content type="html">&lt;h2 id=&#34;til-monolith&#34;&gt;&lt;span class=&#34;heading-wear-glyph&#34;&gt;TIL: Monolith&lt;/span&gt; &lt;a href=&#34;#til-monolith&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;I needed to save a website earlier and this was just what I needed&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/Y2Z/monolith&#34;&gt;https://github.com/Y2Z/monolith&lt;/a&gt;&lt;/p&gt;&#xA;</content>
    <author>
      <name>Nic Payne</name>
      <uri>https://pype.dev</uri>
    </author>
  </entry>
  <entry>
    <title>docker context (and an issue to question your sanity)</title>
    <id>https://pype.dev/docker-context-and-an-issue-to-question-your-sanity/</id>
    <updated>2024-12-19T05:59:30Z</updated>
    <published>2024-12-19T05:59:30Z</published>
    <link href="https://pype.dev/docker-context-and-an-issue-to-question-your-sanity/" rel="alternate" type="text/html"></link>
    <summary type="text">docker contexts are great, would recommend putting them in your prompt though (via starship or something else)... here&#39;s why</summary>
    <content type="html">&lt;p&gt;&lt;a href=&#34;/docker/&#34; class=&#34;glossary-term&#34; title=&#34;docker - container runtime&#34; data-hover-title=&#34;docker&#34;&gt;docker&lt;/a&gt; contexts are great, would recommend putting them in your prompt though (via starship or something else)&amp;hellip; here&amp;rsquo;s why&lt;/p&gt;&#xA;&lt;p&gt;I like to manage my containers remotely - I have a nice development setup on my desktop and I try to keep my server as bare-bones as possible. For a while I&amp;rsquo;ve been using ansible which makes it easy to manage configuration etc on other machines. But I recently learned about docker contexts and I&amp;rsquo;m planning to scale down my homelab management to just docker-compose stacks rather than a bunch of super complicated ansible playbooks&lt;/p&gt;&#xA;&lt;p&gt;So, setting up a context is easy - it&amp;rsquo;s basically an ssh connection to another machine!&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;docker context create koober --docker &amp;quot;host=ssh://nic@koober&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;koober&lt;/code&gt; is one of my dev machines and my &lt;code&gt;~/.ssh/config&lt;/code&gt; is setup such that I can &lt;code&gt;ssh nic@koober&lt;/code&gt;, this makes the context work really seamlessly.&lt;/p&gt;&#xA;&lt;p&gt;So there&amp;rsquo;s the &lt;code&gt;default&lt;/code&gt; context (the machine you&amp;rsquo;re on) and now I have &lt;code&gt;koober&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;To use it you run &lt;code&gt;docker context use koober&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;And then to check we can &lt;code&gt;ls&lt;/code&gt; the contexts&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;docker context ls&#xA;NAME       DESCRIPTION                               DOCKER ENDPOINT               ERROR&#xA;default    Current DOCKER_HOST based configuration   unix:///var/run/docker.sock   &#xA;koober *                                             ssh://nic@koober&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Notice the * - that indicates that&amp;rsquo;s our current context.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;trouble&#34;&gt;&lt;span class=&#34;heading-wear-glyph&#34;&gt;Trouble&lt;/span&gt; &lt;a href=&#34;#trouble&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Now here&amp;rsquo;s where things get hairy&amp;hellip; you&amp;rsquo;ve gotta be super-aware of what context you&amp;rsquo;re using. I have an indicator in my starship prompt that shows the current context, but since I&amp;rsquo;m new to using them I &lt;a href=&#34;/kind/&#34; class=&#34;glossary-term&#34; title=&#34;kind - kubernetes in docker&#34; data-hover-title=&#34;kind&#34;&gt;kind&lt;/a&gt; of didn&amp;rsquo;t notice it until I ran into this issue&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m working on a python application in docker but was not able to execute the entrypoint even though I KNEW the file was there&amp;hellip; let&amp;rsquo;s take a look&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;&lt;span class=&#34;heading-wear-glyph&#34;&gt;Example&lt;/span&gt; &lt;a href=&#34;#example&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s a minimal hello world applycation in docker to illustrate the issue&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# main.py&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;print&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;hello world&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Use an official Python runtime as a parent image&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;python:3.11-slim&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Set the working directory in the container&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;WORKDIR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;/app&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Copy the current directory contents into the container at /app&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;COPY&lt;/span&gt; . /app&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Run the main.py script as the container&amp;#39;s main process&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;CMD&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;python&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;main.py&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;services&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;hello-world&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;build&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;volumes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;.:/app&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Notice volume mounting in my project directory &lt;code&gt;.&lt;/code&gt; to &lt;code&gt;/app&lt;/code&gt; as a common practice to develop inside the container&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s where I started to question my sanity&amp;hellip;&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;✗ docker compose up                                            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;+&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; Running 1/0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; ✔ Container docker-context-example-hello-world-1  Created                                                                                                                                                                                                                                                              0.0s &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Attaching to hello-world-1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;hello-world-1  &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; python: can&lt;span class=&#34;s1&#34;&gt;&amp;#39;t open file &amp;#39;&lt;/span&gt;/app/main.py&lt;span class=&#34;err&#34;&gt;&amp;#39;&lt;/span&gt;: &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;Errno 2&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; No such file or directory&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;hello-world-1 exited with code &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;python can&#39;t open file&lt;/code&gt;? hmm&amp;hellip; Let&amp;rsquo;s take a look at the image&lt;/p&gt;&#xA;&lt;p&gt;First let&amp;rsquo;s make sure we get the image name right&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;✗ docker container ls -a              &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;CONTAINER ID   IMAGE                                           COMMAND                  CREATED          STATUS                       PORTS                                                                                  NAMES&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;3d7285fc39e2   docker-context-example-hello-world              &lt;span class=&#34;s2&#34;&gt;&amp;#34;python main.py&amp;#34;&lt;/span&gt;         &lt;span class=&#34;m&#34;&gt;10&lt;/span&gt; minutes ago   Exited &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;2&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;44&lt;/span&gt; seconds ago                                                                                           docker-context-example-hello-world-1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we can &lt;code&gt;docker run --rm -it --entrypoint /bin/bash --name debug docker-context-example-hello-world&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;❯ docker run --rm -it --entrypoint /bin/bash --name debug docker-context-example-hello-world  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;root@ee46d0e22de8:/app# python main.py&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Hello, World!&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;root@ee46d0e22de8:/app# &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;WHAT THE HECK??&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-happened&#34;&gt;&lt;span class=&#34;heading-wear-glyph&#34;&gt;What happened…&lt;/span&gt; &lt;a href=&#34;#what-happened&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;What happened turns out to be pretty simple once we realize I&amp;rsquo;m using contexts&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;koboer&lt;/code&gt; is a remote context, the &lt;code&gt;docker run&lt;/code&gt; and &lt;code&gt;docker compose up&lt;/code&gt; commands are interacting with the docker socket on that machine.&lt;/p&gt;&#xA;&lt;p&gt;So if I compose up the stack notice that there&amp;rsquo;s a volume bind mount in there - well those do &lt;em&gt;not&lt;/em&gt; work with contexts (or at least I&amp;rsquo;m not aware of hose to make it work) and so the &lt;code&gt;/app&lt;/code&gt; directory was getting blown away essentially with an empty overlay&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;But when running with just &lt;code&gt;docker run&lt;/code&gt; with no volume mount, the code was copied in during the build and is right where we expect it&amp;hellip;&lt;/p&gt;&#xA;&lt;h3 id=&#34;let-s-prove-it&#34;&gt;&lt;span class=&#34;heading-wear-glyph&#34;&gt;Let’s prove it&lt;/span&gt; &lt;a href=&#34;#let-s-prove-it&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;❯ docker run --rm -it --entrypoint /bin/bash --name debug -v .:/app docker-context-example-hello-world&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;root@903f591c0384:/app# python main.py&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;python: can&lt;span class=&#34;s1&#34;&gt;&amp;#39;t open file &amp;#39;&lt;/span&gt;/app/main.py&lt;span class=&#34;err&#34;&gt;&amp;#39;&lt;/span&gt;: &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;Errno 2&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; No such file or directory&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;root@903f591c0384:/app# &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;Adding a `-v .:/app` to match the compose file, we get the same error...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If we switch to the default context we are back up and running as expected&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;✗ docker context use default&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;default&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Current context is now &lt;span class=&#34;s2&#34;&gt;&amp;#34;default&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;nic in /tmp/docker-context-example  via   v3.13.0  &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;dev&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; 󰒄 󱔎 NO PYTHON ENVIORNMENT SET &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;❯ docker compose up         &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;+&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; Running 1/0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; ✔ Container docker-context-example-hello-world-1  Created                                                                                                                                                                                                                                                              0.0s &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Attaching to hello-world-1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;hello-world-1  &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; Hello, World!&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;hello-world-1 exited with code &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;nic in /tmp/docker-context-example  via   v3.13.0  &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;dev&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; 󰒄 󱔎 NO PYTHON ENVIORNMENT SET &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;❯ docker run --rm -it --entrypoint /bin/bash --name debug -v .:/app docker-context-example-hello-world&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;root@4045b6aa8883:/app# python main.py&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Hello, World!&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;root@4045b6aa8883:/app# &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Successful runs on both accounts with the volume mount&lt;/p&gt;&#xA;&lt;h2 id=&#34;tldr&#34;&gt;&lt;span class=&#34;heading-wear-glyph&#34;&gt;TLDR&lt;/span&gt; &lt;a href=&#34;#tldr&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Context is king&lt;/p&gt;&#xA;</content>
    <author>
      <name>Nic Payne</name>
      <uri>https://pype.dev</uri>
    </author>
  </entry>
  <entry>
    <title>rsync like a pro</title>
    <id>https://pype.dev/rsync-like-a-pro/</id>
    <updated>2024-12-11T10:52:23Z</updated>
    <published>2024-12-11T10:52:23Z</published>
    <link href="https://pype.dev/rsync-like-a-pro/" rel="alternate" type="text/html"></link>
    <summary type="text">I am moving a hefty amount of data to a new ZFS pool due to some corruption and I want to avoid using for this just to make sure I don&#39;t propagate any...</summary>
    <content type="html">&lt;p&gt;I am moving a hefty amount of data to a new ZFS pool due to some corruption and I want to avoid using &lt;code&gt;zfs send/recv&lt;/code&gt; for this just to make sure I don&amp;rsquo;t propagate any corrupted data to my new pool.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve used &lt;code&gt;rsync&lt;/code&gt; for simple things before but I needed this to be a little smarter and I wanted to see simple progress without flooding my terminal with a billion filenames.&lt;/p&gt;&#xA;&lt;h2 id=&#34;tldr&#34;&gt;&lt;span class=&#34;heading-wear-glyph&#34;&gt;TLDR&lt;/span&gt; &lt;a href=&#34;#tldr&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;TLDR:&#xA;&lt;code&gt;rsync -aHAX --chmod=Da+s --info=progress2 --inplace --exclude=&#39;encrypted/docker/frigate-media&#39; /tank/ /harbor/&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;explanation&#34;&gt;&lt;span class=&#34;heading-wear-glyph&#34;&gt;Explanation&lt;/span&gt; &lt;a href=&#34;#explanation&#34; class=&#34;heading-anchor&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;-aHAX: Preserves attributes (archive mode, hard links, ACLs, extended attributes).&#xA;&amp;ndash;chmod=Da+s: Ensures the setgid bit is applied to directories.&#xA;&amp;ndash;info=progress2: Provides detailed progress information, including overall data transfer stats.&#xA;&amp;ndash;inplace: Writes directly to the destination file, avoiding temporary files (useful for large files).&#xA;&amp;ndash;exclude=&amp;lsquo;encrypted/&lt;a href=&#34;/docker/&#34; class=&#34;glossary-term&#34; title=&#34;docker - container runtime&#34; data-hover-title=&#34;docker&#34;&gt;docker&lt;/a&gt;/frigate-media&amp;rsquo;: Excludes the specified path (relative to the /tank root).&#xA;/tank/ /harbor/: Ensures the contents of /tank are copied directly into /harbor.&lt;/p&gt;&#xA;</content>
    <author>
      <name>Nic Payne</name>
      <uri>https://pype.dev</uri>
    </author>
  </entry>
  <entry>
    <title>hostnamectl to easily change hostname</title>
    <id>https://pype.dev/hostnamectl-to-easily-change-hostname/</id>
    <updated>2024-12-06T07:25:59Z</updated>
    <published>2024-12-06T07:25:59Z</published>
    <link href="https://pype.dev/hostnamectl-to-easily-change-hostname/" rel="alternate" type="text/html"></link>
    <summary type="text">hostnamectl is apparently a linux utility for easily changing your hostname in a variety of ways</summary>
    <content type="html">&lt;p&gt;hostnamectl is apparently a linux utility for easily changing your hostname in a variety of ways&lt;/p&gt;&#xA;&lt;pre class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;❯ hostnamectl --help&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;hostnamectl &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;OPTIONS...&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; COMMAND ...&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Query or change system hostname.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Commands:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  status                 Show current hostname settings&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  hostname &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;NAME&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;        Get/set system hostname&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  icon-name &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;NAME&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;       Get/set icon name &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; host&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  chassis &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;NAME&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;         Get/set chassis &lt;span class=&#34;nb&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; host&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  deployment &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;NAME&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;      Get/set deployment environment &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; host&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  location &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;NAME&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;        Get/set location &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; host&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Options:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  -h --help              Show this &lt;span class=&#34;nb&#34;&gt;help&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;     --version           Show package version&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;     --no-ask-password   Do not prompt &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; password&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  -H --host&lt;span class=&#34;o&#34;&gt;=[&lt;/span&gt;USER@&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;HOST  Operate on remote host&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  -M --machine&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;CONTAINER Operate on &lt;span class=&#34;nb&#34;&gt;local&lt;/span&gt; container&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;     --transient         Only &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; transient hostname&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;     --static            Only &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; static hostname&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;     --pretty            Only &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; pretty hostname&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;     --json&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;pretty&lt;span class=&#34;p&#34;&gt;|&lt;/span&gt;short&lt;span class=&#34;p&#34;&gt;|&lt;/span&gt;off&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                         Generate JSON output&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;See the hostnamectl&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;1&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; man page &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; details.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I learned there&amp;rsquo;s transient and static hostnames, so that&amp;rsquo;s cool&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;The thing I needed was &lt;code&gt;hostnamectl --static hostname babyblue-aurora&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;pretty sweet tool&lt;/p&gt;&#xA;</content>
    <author>
      <name>Nic Payne</name>
      <uri>https://pype.dev</uri>
    </author>
  </entry>
  <entry>
    <title>Restart KDE Plasma</title>
    <id>https://pype.dev/restart-kde-plasma/</id>
    <updated>2024-11-08T15:53:52Z</updated>
    <published>2024-11-08T15:53:52Z</published>
    <link href="https://pype.dev/restart-kde-plasma/" rel="alternate" type="text/html"></link>
    <summary type="text">Plasma shits the bed a little too often on Fedora for me right now but I finally have a quick fix...</summary>
    <content type="html">&lt;p&gt;Plasma shits the bed a little too often on Fedora for me right now but I finally have a quick fix&amp;hellip;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&#xA;sudo killall plasmashell&#xA;&#xA;kstart plasmashell&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</content>
    <author>
      <name>Nic Payne</name>
      <uri>https://pype.dev</uri>
    </author>
  </entry>
</feed>