<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Dorian Clay</title>
        <link>https://dorianclay.com/</link>
        <description>Your blog description</description>
        <lastBuildDate>Sat, 28 Nov 2026 01:22:10 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>Dorian Clay</title>
            <url>https://dorianclay.com/favicon.ico</url>
            <link>https://dorianclay.com/</link>
        </image>
        <copyright>All rights reserved 2026</copyright>
        <item>
            <title><![CDATA[The aesthetics of AI use]]></title>
            <link>https://dorianclay.com/writing/aesthetics-of-ai</link>
            <guid isPermaLink="false">https://dorianclay.com/writing/aesthetics-of-ai</guid>
            <pubDate>Fri, 29 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How work is perceived is important, even when other criteria for AI delegation are met.]]></description>
            <content:encoded><![CDATA[<img alt="A glass sculpture of in the Phipps Conservatory in Pittsburgh" loading="lazy" decoding="async" data-nimg="1" style="color:transparent" sizes="100vw" srcSet="https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_640,q_auto/photos/phipps-conservatory-what-glass 640w, https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_750,q_auto/photos/phipps-conservatory-what-glass 750w, https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_828,q_auto/photos/phipps-conservatory-what-glass 828w, https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_1080,q_auto/photos/phipps-conservatory-what-glass 1080w, https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_1200,q_auto/photos/phipps-conservatory-what-glass 1200w, https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_1920,q_auto/photos/phipps-conservatory-what-glass 1920w, https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_2048,q_auto/photos/phipps-conservatory-what-glass 2048w, https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_3840,q_auto/photos/phipps-conservatory-what-glass 3840w" src="https://res.cloudinary.com/dnutlirbk/image/upload/f_auto,c_limit,w_3840,q_auto/photos/phipps-conservatory-what-glass"/>
<h2 id="some-thoughts">Some thoughts</h2>
<p>For a second time in several weeks, I&#x27;ve seen some writing on the idea of what it&#x27;s like to write in the era of AI. The most recent was <a href="https://www.theatlantic.com/culture/2026/05/typo-ai-trend-human/687237/?gift=_25kKCPV9NAQxD25nnpEGGb8dA1w3LWlmqH8AdLXU0k&amp;utm_source=copy-link&amp;utm_medium=social&amp;utm_campaign=share">The Typo Vibe Shift</a> by The Atlantic, and the first was a Substack Note that I cannot find because the platform’s search is terrible, and most recently <a href="https://80000hours.substack.com/p/how-to-succeed-on-substack-by-ozy?open=false#%C2%A7find-your-voice">this post</a> on how to Substack. The thing I&#x27;ve been thinking about through these is that there is a changing <em>aesthetic</em> of writing, and more people are becoming acutely aware of how aesthetics pervade what we create and consume—how we communicate. Aesthetics can mean different things in different contexts, but here what I mean by it is that there is a type of style. To those that are familiar with trends like the “cool girl aesthetic” or the “performative male aesthetic,” this use is more akin to those.</p>
<p>Regarding aesthetics in the age of AI, there is the distinctly rebellious aesthetic of “I created this without using AI, even if it resulted in a worse product.” In its most blatant form, this is the aesthetic of typos and distinctly human writing, and in its more subtle form it is a particular writer’s voice. It is even the aesthetic that I adopt here. Yet, note that this aesthetic is not <em>right</em> in the strong sense—it is not inherently better than another <em>choice</em> of aesthetic. If I were to use AI to elaborate on some of my key points and polish my writing, it&#x27;s not clear how that is <em>wrong</em> in abstract, as long as I confirm that the additions reflect my vision. Rather, it might not be the choice I, as the creator, want to make to communicate to my recipient how <em>I</em> see my work. If my purpose were to create a piece of writing that is clear and concise, then it may well be a strong choice to use AI to write in the aesthetic of, say, a public academic. But if my purpose is to share my reflections, then that choice may seem confusing. Regardless, the aesthetic is a choice, and one that is used for communication, just as is any other creative decision.</p>
<p>For the aesthetic of a creative product to matter, its content value must already be sufficient. In an forthcoming work, my coauthors and I discuss how key criteria for a proper delegation of a task to AI are <em>trust</em> and <em>competence</em>. For the sake of relevance, let&#x27;s examine blogging as an example. Trust here comes into play at a couple different levels. First, the reader must trust that the author was sufficiently involved in the production of the work—if delegation is allowed, it must be transparent through either explicit citation like giving the model a byline or implicit social norms. Second, if the author delegates part of the writing to an AI system, the author must trust the system and its creators to generate high-quality and correct writing. Competence in delegation to AI means that the author is able to and does use their basic rational abilities and domain-relevant knowledge. It would be an inappropriate delegation for me to use AI to write about <a href="https://youtu.be/aaR6yEE-Myo?si=ih7MHSCZ4mhQWA-l">aerospace incidents</a>, because I don’t have enough domain knowledge to verify the correctness of claims the AI would generate.</p>
<p>Let’s assume all goes well in a delegation: the delegation is transparent, trust relations are preserved, the author has sufficient competence, and the author is not deskilling herself.<sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref="true" aria-describedby="footnote-label">1</a></sup> In these cases, it might still be <em>inadvisable</em> to use AI, as an aesthetic decision. This is because even if the author cannot identify the &quot;AI-ness&quot; of their writing, readers likely can, or at the very least, the author is missing an opportunity to share through their voice (and perhaps even missing the opportunity to develop it). But as an aesthetic decision, this is akin to choosing to paint a painting in the style of impressionism, with noticeable brush-strokes, instead of a photo-realist style, with depiction as accurate as possible. Neither decision is more &quot;right&quot; than the other in abstract, for the purpose of producing a painting. They capture different subtexts and produce a different response in the viewer, but both produce the same product: a painting of a subject.</p>
<p>Assuming the competence and trust conditions are met, the products only vary with respect to their aesthetics, not to their truthiness or factual value. Aesthetics <em>might</em> be implicated in other pragmatic considerations, such as whether readers are receptive to the content or take it seriously—and that is the point. The aesthetics matter only insofar as they are relevant in these other considerations, not for an intrinsic value.<sup><a href="#user-content-fn-2" id="user-content-fnref-2" data-footnote-ref="true" aria-describedby="footnote-label">2</a></sup></p>
<p>For an object’s aesthetics to matter for an intrinsic reason would mean that the product <em>itself</em> is somehow valued. While we may use language in this way, such as saying that the Mona Lisa is a valuable piece of art, it is not clear that this is <em>really</em> what we mean. If there were no humans and no historical context, the Mona Lisa is only a collection of fiber, oils, and pigments. Instead, the language of intrinsic value is a shorthand for other extrinsic values. An object is valued <em>by</em> an agent. The Mona Lisa is valuable because of its historical relevance in the Renaissance period, and a great novel is valued for the impact it has on its readers, the way it is able to transmit ideas through time and space. But these are still agent-centered impacts, not some abstract value that exists in <em>aesthetic</em> space.</p>
<h2 id="tldr">tldr;</h2>
<p>Even where AI use is acceptable—it is not deskilling the user, deceiving the audience, and is reasonably correct—there are still other reasons we should be careful about using AI. We create things for a purpose, and we should be hesitant to use AI where the product of AI use is not aligned with those purposes. When writing marketing copy devoid of human experience and personality, delegation to AI may be a strong choice. But when writing applications to academic programs or jobs, delegation may be a bad choice even when the model is prompted with personal experiences because the aesthetic of AI writing raises alarms in the reader’s mind.</p>
<section data-footnotes="true" class="footnotes"><h2 class="sr-only" id="footnote-label">Footnotes</h2>
<ol>
<li id="user-content-fn-1">
<p>Vallor, S. Moral Deskilling and Upskilling in a New Machine Age: Reflections on the Ambiguous Future of Character. Philos. Technol. 28, 107–124 (2015). <a href="https://doi.org/10.1007/s13347-014-0156-9">https://doi.org/10.1007/s13347-014-0156-9</a> <a href="#user-content-fnref-1" data-footnote-backref="" aria-label="Back to reference 1" class="data-footnote-backref">↩</a></p>
</li>
<li id="user-content-fn-2">
<p>It is at this point that I should note that I have no training in the philosophy of aesthetics, and this is an entirely from-priors discussion of aesthetics. <a href="#user-content-fnref-2" data-footnote-backref="" aria-label="Back to reference 2" class="data-footnote-backref">↩</a></p>
</li>
</ol>
</section>]]></content:encoded>
            <author>spencer@planetaria.tech (Dorian Clay)</author>
        </item>
        <item>
            <title><![CDATA[Communicating in the Outdoors]]></title>
            <link>https://dorianclay.com/writing/communicating-in-the-outdoors</link>
            <guid isPermaLink="false">https://dorianclay.com/writing/communicating-in-the-outdoors</guid>
            <pubDate>Sat, 02 Dec 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Some thoughts on how to keep in touch without cell coverage.]]></description>
            <content:encoded><![CDATA[<p>My following thoughts on how to keep in touch when doing outdoor sports are taken from a post I made in a mountain biking forum. Because it discusses safety and emergency communication, it&#x27;s worth sharing more widely.</p>
<blockquote>
<p>I am not an expert and the opinions expressed in this article are based solely on my personal experiences. Please do additional research to understand what will address your outdoor safety needs best.</p>
</blockquote>
<h2 id="general-outdoor-safety">General outdoor safety</h2>
<p>The tenets of outdoor safety apply equally to mountain biking as they do to any other sport: a good resource for these is the WTA’s <a href="https://www.wta.org/go-outside/new-to-hiking/safety-essentials-hiking-toolkit#5--know-what-to-do-in-case-of-emergency">Safety Essentials: A Toolkit for Hikers</a>.</p>
<p>First, a little about me: I was previously volunteer Search and Rescue in the I-90 corridor (<a href="https://kcesar.org/">KCESAR</a>, <a href="https://kingcountysar.org/">KCSARA</a>; I since moved out of WA), I am HAM radio certified, and I myself venture out of cell coverage time to time. That said, I am not an expert in telecom, radio, or satellite, and <em>you should always do your own research from reliable sources and be comfortable using the tools you rely on before you need them</em>.</p>
<p><strong>From a safety perspective, the most important thing is to communicate your plans to someone before leaving.</strong>
It only takes a minute to a text to a family, friend, or colleague saying where you are going and when you plan to be back. You are also recommended to leave info on your car, gear, and medical conditions. And don’t forget to let them know once you’re back safely before taking a long stop for coffee, food, or shopping.</p>
<p>It’s not fun to think about, but <strong>no form of communication should be your final backstop in an emergency</strong>, as you may be injured, incapacitated, or otherwise unable to use such communication.</p>
<p>That said, hopefully you will never be in such a situation. The rest are my personal opinions on how to stay connected with people when outdoors, in increasing levels of communication frequency and decreasing levels of coverage.</p>
<h2 id="satellite">Satellite</h2>
<p>If you often spend time in areas out of cell coverage, it can be a good idea to consider getting a satellite communicator. This will allow you to send messages and get help pretty much anywhere. The price of these devices have come down in recent years due to competition, but be aware there is usually also a fairly steep monthly service fee.</p>
<p>Personally, I don’t think satellite communicators are as beneficial for mountain biking as backpacking or mountain climbing. I’ve considered it but I don’t have one, though I know several people that do (they haven’t used theirs).</p>
<p>For emergency communication, the satellite on iPhone 14+ may fall into this category, but I’ve yet to hear of anyone that actually used it. As always, know how this iPhone feature works before relying on it—Connect to a satellite with your iPhone. You’re even able to test it without calling emergency services.</p>
<h2 id="radio">Radio</h2>
<p>To me, 2-way radio remains the best sweet-spot between reliable communication anywhere and cost. There’s a lot of different kinds of radios and bands, though, so some research is needed to know what will fit your needs best. If you’re just looking to tell your trail buddies you’re taking a turn, a decent run-of-the-mill <a href="https://www.rei.com/learn/expert-advice/twoway-radios.html">FRS or GMRS radio</a> can work perfectly fine. These will get far less range than they’re quoted for, but they tend to still be good for about a mile, which in my experience is far longer than my group is spread.</p>
<p>If you need something more reliable for long-range communication and spend a good amount of time outdoors, I highly recommend getting HAM radio certified and picking up a handheld or portable (vehicular) radio. A handheld will get a fraction of the range of a portable radio, but if you’re able to hit a repeater, you can reach pretty much anywhere in the greater Seattle area, as Miguel’s image shows. If you’re not, the range on portable HAM radios is still much longer than FRS/GMRS, so you should have no trouble reaching your group as long as you’re not an unreasonable distance apart. Using a radio will require more consideration of the radios’ relative positions, orientation, power, and range to ensure communication, but these are things you’d learn when getting the <a href="https://www.rei.com/learn/expert-advice/twoway-radios.html">amateur FCC license</a>. The price on such radios is also fairly approachable for entry-level devices, though money will generally buy you reliability here.</p>
<p>Note that if you go with HAM radios, anyone broadcasting on a radio will need to have an FCC license, so you’ll have to convince people you ride with to spend the time to get their license too. In an emergency situation, you are able to use any band to get help, whether you have a license or not (I am not a lawyer and definitely not your lawyer).</p>
<h2 id="cell">Cell</h2>
<p>Cell coverage in the outdoors can be unreliable. However, it’s the easiest and fastest when you have it. If you do need coverage, my general rule of thumb is to get on a hill, out of trees, and near a highway.</p>
<blockquote>
<p><em>The following is specific to the I-90 area west of Seattle, as that was the topic of the forum thread:</em></p>
<p>As for specific carriers, pretty much everyone I knew from SAR that cared about coverage got Verizon. These are people that frequented Tiger Mtn, Fall City, and North Bend. My information here is now about 6 years old, but looking at the <a href="https://fcc.maps.arcgis.com/apps/webappviewer/index.html?id=6c1b2e73d9d749cdb7bc88a0d1bdd25b">FCC’s 4G LTE Coverage map from 2021</a>, it looks like the data aligns with Verizon being the best option. This is accentuated as you go further East into I-90.</p>
<p>As the maps show, AT&amp;T may give you voice coverage over all of Tiger, but not data. Verizon appears to have LTE data across. This may not be representative of what you will get on a 5G phone, though. I was unable to find any unified information on 5G coverage, but I would assume it’s spottier than this, given the range and foliage penetration of the UHF bands.</p>
</blockquote>]]></content:encoded>
            <author>spencer@planetaria.tech (Dorian Clay)</author>
        </item>
        <item>
            <title><![CDATA[Dorian's Developer Cheat Sheet]]></title>
            <link>https://dorianclay.com/writing/dorians-developer-cheat-sheet</link>
            <guid isPermaLink="false">https://dorianclay.com/writing/dorians-developer-cheat-sheet</guid>
            <pubDate>Fri, 25 Aug 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[A collection of handy commands, tools, and tutorials.]]></description>
            <content:encoded><![CDATA[<h2 id="configure-terminal-features">Configure terminal features</h2>
<h3 id="add-directories-to-cd-search-path">Add directories to <code>cd</code> search path</h3>
<p>Using <a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH">Zsh</a>, it&#x27;s easy to make it so the <code>cd</code> command searches a group of directories. Add to the <code>~/.zshrc</code> config file:</p>
<pre class="language-bash"><code class="language-bash">setopt auto_cd
<span class="token assign-left variable">cdpath</span><span class="token operator">=</span><span class="token punctuation">(</span><span class="token environment constant">$HOME</span> <span class="token environment constant">$HOME</span>/code <span class="token environment constant">$HOME</span>/projects<span class="token punctuation">)</span>
</code></pre>
<h3 id="set-terminal-colors">Set terminal colors</h3>
<h4 id="best-option-use-zsh-and-oh-my-zsh">Best option: Use Zsh and Oh My Zsh</h4>
<p><a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH">Zsh</a> is a great Unix terminal, and <a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH">Oh My Zsh</a> makes it look pretty!</p>
<h4 id="customize-your-terminal-manually">Customize your terminal manually</h4>
<p><a href="https://linuxhint.com/linux_terminal_customization_guide_beginners/">Linux Terminal Customization Guide for Beginners</a></p>
<pre class="language-bash"><code class="language-bash"><span class="token comment"># In the ~/.bashrc file, add a line:</span>
<span class="token assign-left variable"><span class="token environment constant">PS1</span></span><span class="token operator">=</span><span class="token string">&quot;\[<span class="token entity" title="\033">\033</span>[35m\]\u\[<span class="token entity" title="\033">\033</span>[39m\]@\[<span class="token entity" title="\033">\033</span>[95m\]\H \[<span class="token entity" title="\033">\033</span>[36m\]\W\[<span class="token entity" title="\033">\033</span>[39m\]$ &quot;</span>
</code></pre>
<h3 id="set-ls-colors">Set <code>ls</code> colors</h3>
<p><a href="https://www.howtogeek.com/307899/how-to-change-the-colors-of-directories-and-files-in-the-ls-command/">How to Change the Colors of Directories and Files in the ls Command</a></p>
<pre class="language-bash"><code class="language-bash"><span class="token builtin class-name">echo</span> <span class="token environment constant">$LS_COLORS</span>
<span class="token assign-left variable"><span class="token environment constant">LS_COLORS</span></span><span class="token operator">=</span><span class="token string">&quot;rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:&quot;</span>
</code></pre>
<h2 id="setting-up-ssh">Setting up SSH</h2>
<h3 id="create-ssh-key">Create SSH key</h3>
<pre class="language-bash"><code class="language-bash"><span class="token comment"># Best encryption to use</span>
ssh-keygen -t ed25519 -C <span class="token string">&quot;username@host.com&quot;</span>
<span class="token comment"># or RSA</span>
ssh-keygen -t rsa -b <span class="token number">4096</span> -C <span class="token string">&quot;your_email@example.com&quot;</span>
</code></pre>
<p><a href="https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server">How to Configure SSH Key-Based Authentication on a Linux Server</a></p>
<h3 id="copy-key-from-host-to-server">Copy key from host to server</h3>
<pre class="language-bash"><code class="language-bash"><span class="token comment"># Linux/Unix</span>
ssh-copy-id -i ~/.ssh/KEYNAME.pub <span class="token environment constant">USER</span>@HOST

<span class="token comment"># Windows</span>
<span class="token builtin class-name">type</span> <span class="token variable">$env</span>:USERPROFILE<span class="token punctuation">\</span>.ssh<span class="token punctuation">\</span>SSH-KEY-FILE.pub <span class="token operator">|</span> <span class="token function">ssh</span> IP-ADDRESS-OR-FQDN <span class="token string">&quot;cat &gt;&gt; .ssh/authorized_keys&quot;</span>
</code></pre>
<p>Additional references:</p>
<p><a href="https://chrisjhart.com/Windows-10-ssh-copy-id/#copy-ssh-key-to-remote-linux-device">Windows 10 OpenSSH Equivalend of ssh-copy-id | Christopher Hart</a></p>
<p><a href="https://stackoverflow.com/a/56536275">How to set up an SSH config-file for beginners | GitHub</a></p>
<h3 id="set-ssh-config">Set SSH config</h3>
<p>First, create a file <code>~/.ssh/config</code>:</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">touch</span> ~/.ssh/config

<span class="token comment"># Open with your preferred editor.</span>
<span class="token function">nano</span> ~/.ssh/config
</code></pre>
<p>Add your remote hosts to your config file.</p>
<pre class="language-bash"><code class="language-bash"><span class="token comment"># ~/.ssh/config</span>
Host remote1
    User username
    Hostname sub.domain.com

Host remote2
    User username
    Hostname sub2.domain.com
    IdentityFile ~/.ssh/id_rsa  <span class="token comment"># optional: path to SSH private key</span>
    LocalForward <span class="token number">9000</span> localhost:9000  <span class="token comment"># optional: port forwarding</span>
    ForwardX11 <span class="token function">yes</span>  <span class="token comment"># optional: UI forwarding, if configured</span>
</code></pre>
<p>If I would normally type</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">ssh</span> user@sub.domain.com
</code></pre>
<p>I can just type</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">ssh</span> remote1
</code></pre>
<h2 id="git">Git</h2>
<h3 id="configuring-git-tab-completion">Configuring git tab completion</h3>
<p>Tab completion for git should work by default in Linux/Unix. For Windows, see my post on <a href="https://stackoverflow.com/questions/12399002/how-to-configure-git-bash-command-line-completion/75552137#75552137">Stack Overflow</a>.</p>
<h3 id="setting-git-command-aliases">Setting git command aliases</h3>
<pre class="language-bash"><code class="language-bash"><span class="token function">git</span> config --global alias.lg <span class="token string">&quot;log --color --graph --pretty=format:&#x27;%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)&lt;%an&gt;%Creset&#x27; --abbrev-commit&quot;</span>
<span class="token function">git</span> config --global alias.co checkout
<span class="token function">git</span> config --global alias.sw switch
<span class="token function">git</span> config --global alias.ci commit
<span class="token function">git</span> config --global alias.st status
<span class="token function">git</span> config --global alias.br branch
<span class="token function">git</span> config --global alias.fix <span class="token string">&#x27;!git add . &amp;&amp; git ci --amend -n --no-edit &amp;&amp; git push -f&#x27;</span>
</code></pre>
<p><a href="https://github.com/andreevWork/configs/blob/master/git_aliases">git_aliases | andreevWork on GitHub</a></p>
<h3 id="git-remotes">Git remotes</h3>
<pre class="language-bash"><code class="language-bash"><span class="token comment"># See all remotes:</span>
<span class="token function">git</span> remote -v

<span class="token comment"># Add another remote:</span>
<span class="token function">git</span> remote <span class="token function">add</span> <span class="token operator">&lt;</span>remote-name<span class="token operator">&gt;</span> <span class="token operator">&lt;</span>url<span class="token operator">&gt;</span>
<span class="token comment"># e.g.</span>
<span class="token function">git</span> remote <span class="token function">add</span> diff-repo https://github.com/username/reponame

<span class="token comment"># Push to other remote</span>
<span class="token function">git</span> push diff-repo master

<span class="token comment"># Change URI for remote repository</span>
<span class="token function">git</span> remote set-url origin new.git.url/here
</code></pre>
<p><a href="https://stackoverflow.com/questions/42084116/pushing-to-a-different-git-repo">github - Pushing to a different git repo | Stack Overflow</a></p>
<h3 id="rebase-a-branch-on-top-of-changes-merged-to-originmain">Rebase a branch on top of changes merged to origin/main</h3>
<p>This sequence of commands is useful when you want to update your working branch to have changes merged in main. Depending on the changes in the working branch and main, it is likely there will be conflicts when running the <code>rebase</code> command.</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">git</span> fetch origin main
<span class="token function">git</span> rebase origin/main
<span class="token function">git</span> push -f origin HEAD
</code></pre>
<h3 id="set-default-pull-behavior-to-rebase">Set default pull behavior to rebase</h3>
<pre class="language-bash"><code class="language-bash"><span class="token function">git</span> config --global pull.rebase <span class="token boolean">true</span>
</code></pre>
<h3 id="git-cherry-pick">Git cherry-pick</h3>
<pre class="language-bash"><code class="language-bash"><span class="token function">git</span> cherry-pick <span class="token punctuation">{</span>COMMIT-SHA<span class="token punctuation">}</span>

<span class="token comment"># e.g. cherry picking commit &#x27;f&#x27; from branch Feature into Main</span>

<span class="token comment"># Initially:</span>
<span class="token comment">#     a - b - c - d   Main</span>
<span class="token comment">#          \</span>
<span class="token comment">#            e - f - g Feature</span>

<span class="token function">git</span> checkout main
<span class="token function">git</span> cherry-pick f

<span class="token comment"># Now:</span>
<span class="token comment">#     a - b - c - d - f   Main</span>
<span class="token comment">#          \</span>
<span class="token comment">#            e - f - g Feature</span>
</code></pre>
<h3 id="git-reset-changes-on-one-file">Git reset changes on one file</h3>
<p>Sometimes changes need to be reset on just one file to a previous commit in the git history. To do this, use the <code>--</code> argument for the git command that switches to file names, as shown <a href="https://stackoverflow.com/a/7147320/9231919">here</a>.</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">git</span> checkout COMMITSHA -- fileToReset.md
</code></pre>
<p><a href="https://www.atlassian.com/git/tutorials/cherry-pick#how-to-use-git-cherry-pick">Git Cherry Pick | Atlassian Git Tutorial</a></p>
<h2 id="windows-powershell-grep-equivalent">Windows PowerShell grep equivalent</h2>
<p>The Powershell equivalent of the linux <code>grep</code> command is <a href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.3"><code>Select-String</code></a>. It doesn&#x27;t work identical to grep, so it&#x27;s best to learn the command directly from the <a href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.3">docs</a> and not to alias grep.</p>
<p>Using <code>Out-String -Stream</code> ensures that the pipe output is interpreted correctly by the <code>Select-String</code> program.</p>
<pre class="language-powershell"><code class="language-powershell"><span class="token function">ls</span> <span class="token punctuation">|</span> <span class="token function">Out-String</span> <span class="token operator">-</span>Stream <span class="token punctuation">|</span> <span class="token function">Select-String</span> <span class="token string">&quot;some phrase&quot;</span>
<span class="token comment"># Use Regex</span>
<span class="token function">ls</span> <span class="token punctuation">|</span> <span class="token function">Out-String</span> <span class="token operator">-</span>Stream <span class="token punctuation">|</span> <span class="token function">Select-String</span> <span class="token operator">-</span>Pattern <span class="token string">&quot;<span class="token variable">$r</span>*g[a-z]x&quot;</span>
<span class="token comment"># Search a file</span>
<span class="token function">Select-String</span> <span class="token operator">-</span>Path myfile<span class="token punctuation">.</span>txt <span class="token operator">-</span>Pattern <span class="token string">&quot;words to find&quot;</span>
</code></pre>
<h2 id="vim-cheat-sheet">Vim Cheat Sheet</h2>
<p>It&#x27;s important to be familiar with at least one common command-line text editor, whether it be Vim, Nano, or Emacs.</p>
<blockquote>
<p>Need help choosing which editor is best for you? Consider <a href="https://www.redhat.com/sysadmin/3-text-editors-compared">this</a>.</p>
</blockquote>
<p>My personal favorite is Vim because it&#x27;s almost always installed by default and very powerful. It&#x27;s complicated, though, so it&#x27;s always good to have the <a href="https://vim.rtorr.com/">Vim Cheat Sheet</a> bookmarked for reference.</p>
<h2 id="softlinks">Softlinks</h2>
<h3 id="unix">Unix</h3>
<pre class="language-bash"><code class="language-bash"><span class="token function">ln</span> -s <span class="token punctuation">{</span>source-filename<span class="token punctuation">}</span> <span class="token punctuation">{</span>symbolic-filename<span class="token punctuation">}</span>

<span class="token comment"># Remove a link just like you&#x27;d remove a file:</span>
<span class="token function">rm</span> <span class="token punctuation">{</span>symbolic-filename<span class="token punctuation">}</span>
</code></pre>
<p><a href="https://www.cyberciti.biz/faq/creating-soft-link-or-symbolic-link/">How to: Linux / UNIX create soft link with ln command</a></p>
<h3 id="windows">Windows</h3>
<pre class="language-powershell"><code class="language-powershell"><span class="token function">New-Item</span> <span class="token operator">-</span>Path C:\LinkDir <span class="token operator">-</span>ItemType SymbolicLink <span class="token operator">-</span>Value F:\RealDir

<span class="token comment"># Command Prompt</span>
mklink <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token operator">/</span>d<span class="token punctuation">]</span> <span class="token punctuation">|</span> <span class="token punctuation">[</span><span class="token operator">/</span>h<span class="token punctuation">]</span> <span class="token punctuation">|</span> <span class="token punctuation">[</span><span class="token operator">/</span>j<span class="token punctuation">]</span><span class="token punctuation">]</span> &lt;link&gt; &lt;target&gt;
</code></pre>
<p><a href="https://stackoverflow.com/a/34905638/9231919">Creating hard and soft links using PowerShell | Stack Overflow</a></p>
<h2 id="running-a-program-disconnected-from-a-session">Running a program disconnected from a session</h2>
<h3 id="screen">Screen</h3>
<p>Screen is a Linux terminal program that continues to run even after disconnecting. You can have multiple windows and go between them.</p>
<p>For example, if running a long Jupyter notebook, run it within screen and it will continue to run, even if your terminal session ends.</p>
<pre class="language-bash"><code class="language-bash"><span class="token comment"># One way: Screen  -&gt; tty emulator</span>
^A C <span class="token comment"># create window</span>
^A N <span class="token comment"># next window</span>
^A D <span class="token comment"># disconnect from screen</span>

<span class="token function">screen</span> -R <span class="token comment"># reconnect to screen</span>
</code></pre>
<h2 id="tmux">Tmux</h2>
<p><a href="https://devhints.io/tmux">Cheat Sheet</a>
<a href="https://www.redhat.com/sysadmin/introduction-tmux-linux">A beginner&#x27;s guide to tmux | Red Had</a></p>
<pre class="language-bash"><code class="language-bash">tmux detach-client -P -s session-name-or-id
</code></pre>
<h2 id="adding-gcc-versions-for-c-compilation">Adding GCC Versions for C++ compilation</h2>
<pre class="language-bash"><code class="language-bash"><span class="token function">sudo</span> add-apt-repository ppa:ubuntu-toolchain-r/test
<span class="token function">sudo</span> <span class="token function">apt</span> update
<span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> gcc-11 g++-11
</code></pre>
<h3 id="set-alternatives">Set alternatives</h3>
<pre class="language-bash"><code class="language-bash"><span class="token function">sudo</span> update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 <span class="token number">100</span> --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10

<span class="token function">sudo</span> update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 <span class="token number">90</span> --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9

<span class="token function">sudo</span> update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 <span class="token number">80</span> --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
</code></pre>
<p>Then, we run:</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">sudo</span> update-alternatives --config gcc
</code></pre>
<p>We can select the version we want with:</p>
<pre class="language-bash"><code class="language-bash">Output

There are <span class="token number">3</span> choices <span class="token keyword">for</span> the alternative gcc <span class="token punctuation">(</span>providing /usr/bin/gcc<span class="token punctuation">)</span>.

  Selection    Path            Priority   Status
------------------------------------------------------------
* <span class="token number">0</span>            /usr/bin/gcc-10   <span class="token number">100</span>       auto mode
  <span class="token number">1</span>            /usr/bin/gcc-10   <span class="token number">100</span>       manual mode
  <span class="token number">2</span>            /usr/bin/gcc-8    <span class="token number">80</span>        manual mode
  <span class="token number">3</span>            /usr/bin/gcc-9    <span class="token number">90</span>        manual mode

Press <span class="token operator">&lt;</span>enter<span class="token operator">&gt;</span> to keep the current choice<span class="token punctuation">[</span>*<span class="token punctuation">]</span>, or <span class="token builtin class-name">type</span> selection number:
</code></pre>
<h2 id="see-directory-storage-size">See directory storage size</h2>
<pre class="language-bash"><code class="language-bash"><span class="token function">du</span> -sh PATH_TO_DIR
</code></pre>
<h2 id="fast-high-compression">Fast high compression</h2>
<pre class="language-bash"><code class="language-bash"><span class="token comment">### This requires 7z and tar</span>
<span class="token comment"># Create a tar archive:</span>
7z a ARCHIVE.tar PATH_TO_DIRECTORY

<span class="token comment"># Compress the archive using xz: (-mmt4 specifies using 4 processors)</span>
7z a -mmt4 ARCHIVE.tar.xz ARCHIVE.tar

<span class="token comment"># Extract</span>
<span class="token function">tar</span> -xvf ARCHIVE.tar.xz
<span class="token comment"># or</span>
7z e ARCHIVE.tar.xz
7z e ARCHIVE.tar
</code></pre>
<h2 id="python">Python</h2>
<h3 id="anaconda">Anaconda</h3>
<blockquote>
<p>Consider using <a href="https://mamba.readthedocs.io/en/latest/index.html">Mamba</a>, a fast, robust, and cross-platform Anaconda alternative.
For Mamba, replace <code>conda</code> with <code>mamba</code> in almost any conda command.</p>
</blockquote>
<pre class="language-bash"><code class="language-bash"><span class="token comment"># Create conda environment</span>
conda create -n myenv <span class="token assign-left variable">python</span><span class="token operator">=</span><span class="token number">3.9</span>

<span class="token comment"># Create conda environment from file</span>
conda <span class="token function">env</span> create -f environment.yml

<span class="token comment"># List environments:</span>
conda <span class="token function">env</span> list

<span class="token comment"># Switch environments:</span>
conda activate <span class="token punctuation">{</span>ENVIRONMENT_NAME<span class="token punctuation">}</span>

<span class="token comment"># See installed packages</span>
conda list
conda list -n myenv

<span class="token comment"># install packages with pip</span>
conda <span class="token function">install</span> -n myenv pip
conda activate myenv
pip <span class="token operator">&lt;</span>pip_subcommand<span class="token operator">&gt;</span> 

<span class="token comment"># Add local packages</span>
<span class="token comment"># (local packages must have `setup.py` file)</span>
conda activate myenv
conda <span class="token function">install</span> pip
pip <span class="token function">install</span> ./path/to/packagedirectory

<span class="token comment"># Save environment.yml file</span>
conda <span class="token function">env</span> <span class="token builtin class-name">export</span> <span class="token operator">&gt;</span> environment.yml
</code></pre>
<p>For instructions on how to create an <code>environment.yml</code> file, see the <a href="https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#create-env-file-manually">Anaconda docs</a>.</p>
<h3 id="running-jupyter">Running Jupyter</h3>
<pre class="language-bash"><code class="language-bash"><span class="token comment"># This runs whatever jupyter notebook in the directory its run on</span>
jupyter notebook --no-browser --port<span class="token operator">=</span><span class="token comment">#####</span>

<span class="token comment"># Jupyter Lab version:</span>
jupyter-lab 

<span class="token comment"># Connect to the remote on that port to see the notebook:</span>
<span class="token function">ssh</span> -L localhost:PORT:localhost:PORT REMOTE_MACHINE_NAME
</code></pre>
<h3 id="convert-between-char-and-int">Convert between char and int</h3>
<pre class="language-bash"><code class="language-bash"><span class="token operator">&gt;&gt;</span><span class="token operator">&gt;</span> chr<span class="token punctuation">(</span><span class="token number">97</span><span class="token punctuation">)</span>
<span class="token string">&#x27;a&#x27;</span>
<span class="token operator">&gt;&gt;</span><span class="token operator">&gt;</span> ord<span class="token punctuation">(</span><span class="token string">&#x27;a&#x27;</span><span class="token punctuation">)</span>
<span class="token number">97</span>
</code></pre>
<p><a href="https://stackoverflow.com/questions/704152/how-can-i-convert-a-character-to-a-integer-in-python-and-viceversa/704160#704160">How can I convert a character to a integer in Python, and viceversa? | Stack Overflow</a></p>]]></content:encoded>
            <author>spencer@planetaria.tech (Dorian Clay)</author>
        </item>
    </channel>
</rss>