Blind Not Dumb (Posts by Chris Patti)https://www.feoh.org/authors/chris-patti.atom2024-01-21T01:02:42ZChris PattiNikolaGit Submodules are awful but occasionally necessary.https://www.feoh.org/posts/git-submodules-are-awful-but-occasionally-necessary.html2024-01-09T23:09:31-05:002024-01-09T23:09:31-05:00Chris Patti<p><img alt="Yo Dawg I Hear You Like Dotfiles In Your Dotfiles" src="https://www.feoh.org/images/YoDawgDotFiles.jpg"></p>
<h2>Intro</h2>
<p>One of the beautiful things about powerful tools is that they enable you to do
easy things easily but also more complicated things as well.</p>
<p>Git is the perfect example of this. It represents an incredible amount of
innovation in mainstream widely adopted version control systems, but it has some
of the worst UX of any software I've ever used, and that includes Nortel switch
administration consoles where all input was in the form of numeric codes :)</p>
<h2>Git Submodules</h2>
<p>Git submodules are a fractal of bad UX, which is almost assuredly why they
generate such incredibly strong feelings among the Git using community. Mention
that you use submodules in various technical communities chat rooms and you
might as well have lobbed a hand grenade into their midst without having had the
decency to shout "FIRE IN THE HOLE!" first.</p>
<p>However, I encountered a very particular use case that to mind virtually
necessitated their use. I would welcome any alternatives people may come up with
other than "Don't do that".</p>
<p>Let me explain.</p>
<h2>The Plot Thickens</h2>
<p>I manage my dot files using Github, and in particular I utilize a variation on
the method laid out
<a href="https://www.ackama.com/what-we-think/the-best-way-to-store-your-dotfiles-a-bare-git-repository-explained/">here</a>.</p>
<p>You can read the article for details, but the upshot is that my home directory
actually contains a <a href="https://github.com/feoh/git_dotfiles">Git repository</a> that houses my dot files, so I can revise
them to my heart's content and enjoy all the benefits that managing source code
in Github brings to the table.</p>
<p>Now, here's where the need for submodules comes in.</p>
<p>I co-maintain a moderately popular Neovim project called
<a href="https://github.com/nvim-lua/kickstart.nvim">kickstart.nvim</a>. As such I need to
be able to check out the latest revisions and test them on my own system to see
how they integrate with my own customizations.</p>
<p>Given that, being able to simply <code>git pull</code> the latest is critical.</p>
<p>So we have a "Yo dawg, I hear you like dotfiles in your dotfiles!" situation
here. Git submodules to the rescue!</p>
<p>I won't go into the details around adding a submodule to your existing project,
that's covered elsewhere in way more detail than I have time for here, but you
can see the net result in the repo I linked above.</p>
<p>I have kickstart.nvim checked out as a submodule of my main git dotfiles
project, so I can always pull down the latest changes from the master repository
into my own personalized fork for testing.</p>
<h2>Traps for the Unwary</h2>
<p>As I mention above, Git submodules represent a loaded footgun and they are
<em>extremely</em> easy to mis-use to the point where you wind up with a tangle of
wires shooting sparks in your git workspace trapped in an unendingly frustrating
purgatory of bad error messages, unclear working states and an utterly obtuse
route back to the "happy path".</p>
<p>How do I avoid this? I Keep It Simple, Stupid :)</p>
<h2>Simple Rules For My Simple Mind - Using Submodules Sanely</h2>
<p>I follow a few simple rules that keep things understandable. The key is not
trying to do too much.</p>
<h3>Avoid them wherever possible</h3>
<p>Seriously, unless you have a use case like mine, they <em>are</em> a faff. You're
better off avoiding them if you can, but if you can't or can't see a way to
avoid them, then read on!</p>
<h3>Treat your checked out submodules as read-only.</h3>
<p>Make any changes in a separate workspace for that project where you can branch,
fork and modify to your heart's content.</p>
<p>It's really tempting to just ignore this rule and make changes in your
submodule. I can just HEAR you saying "But Chris, it's git. It SHOULD work!" and
the truth is - <em>in a perfect world, it does!</em>. But you and I both know the world
we live in is far from perfect, and if humans can be counted on for anything
it's an utter lack of consistency and discipline when the chips are down and
time is of the essence.</p>
<p>So save yourself the heartache, make your changes elsewhere, and then simply
run:</p>
<p><code>git submodule update --remote</code> potentially adding --force if things don't seem
to be updating properly.</p>
<h3>Don't be afraid to nuke and pave!</h3>
<p>Assuming you're following my rule above, you can always simply nuke your
submodule and start over. Remember if you go this route that you'll likely need
to delete the .gitmodules directory in your project as they contain important
state for your submodules.</p>
<p>Seriously, this can be a <em>huge</em> win when you find yourself thinking "OK what the
blue blazes is <em>going on</em>?" and chances are good that if you choose to use
submodules, this day <em>will</em> come!</p>
<h2>Unless you know better...</h2>
<p>As I've mentioned several times, submodules are indeed a pain, but for my needs
as outlined here I can't think of a better way to implement this. Do you know of
one? Have you found a minimal faff way to implement this without manually
copying new revisions from one Github project into another?</p>
<p>If you do, I'm all ears! You can reach me on the Fediverse -
@feoh@oldbytes.space or via email - feoh at feoh dot org. Or leave a comment
here if that works for you. In any case I look forward to hearing from you, even
if you think I'm full of malarkey :)</p>
<h2>Update: Someone knew better! Git subtree!</h2>
<p>If you're a technical person in 2024 and you're not on the Fediverse, you're
missing out. It doesn't have the dank memes and crap posting Twitter does, but
some of us consider that a feature :)</p>
<p>When I wrote this post, I sent a copy there and asked "Does anyone know
better?". Thankfully I received an incredibly helpful
<a href="https://cybersecurity.theater/@varx/111731694640751156">response</a>.</p>
<p>It turns out there's a much better alternative to git submodules, and they're
called Git subtrees. They're awesome :)</p>
<p>You can find all about them
<a href="https://www.atlassian.com/git/tutorials/git-subtree">here</a>. Once you set a
subtree up, it checks out automatically with the rest of your repository.</p>
<p>I'm delighted thus far!</p>Why do YOU Homelab?https://www.feoh.org/posts/why-do-you-homelab.html2023-12-01T17:20:29-05:002023-12-01T17:20:29-05:00Chris Patti<p><img alt="XKCD Comic About Self Hosting" src="https://imgs.xkcd.com/comics/hard_reboot.png"></p>
<h2>The Internet is a Dangerous Place These Days (Introduction)</h2>
<p>In this day and age, you really are taking a risk if you're not running some
form of ad blocking. Heck, even <a href="https://www.wired.com/story/security-roundup-even-cia-nsa-use-ad-blockers/">CISA is telling government agencies this</a>.</p>
<p>So I mentioned on the Fediverse that I was thinking about going back to using
<a href="https://pi-hole.net/">Pi-hole</a> for this. It's quick to set up, super
convenient, and all around does the job well.</p>
<p>At this, -dsr-, a long time online acquaintance whose opinions I respect, piped in with this:</p>
<iframe src="https://tilde.zone/@dashdsrdash/111449235781879573/embed" width="400" allowfullscreen="allowfullscreen" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-forms"></iframe>
<p>Generally, when he speaks, I listen. His skill as a system administrator is formidable
and to say that he has helped me out from time to time would be an understatement.</p>
<p>So I started down the rabbit hole of doing what he suggested and installing BIND in a VM
and getting it set to use DNSRBL to perform the same kind of ad blocking Pi-hole does.</p>
<p>And then I realized something: This is absolutely positively the <em>wrong</em> tool for my use case.</p>
<p>Why? I'll answer that, but before I do, let's get down to the business of this post.</p>
<h2>Why <em>I</em> Homelab</h2>
<p>Over the last few years, people interested in technology have enjoyed an incredibly bounty of
free and open source software. It's not just possible but <em>easy</em> to do things that would in
past eras have taken incredible amounts of effort and physical hardware with a few hours
of spare time, a relatively small amount of money, and maybe a smidgen of space on a desk somewhere.</p>
<p>There are all kinds of reasons one might wish to run various bits and bobs of infrastructure at home,
and sometimes trying to figure out which rabbit hole to go down can be dizzying and maybe even a bit
intimidating, and answering the Why question may be able to help you as it did me.</p>
<p>I run a bunch of my infrastructure at home myself rather than relying on cloud vendors because ultimately
I want to enhance my privacy and, more importantly to me, take control of my technology life in a day and
age when books can vanish from your Kindle in the dead of night, never to return, music you love can
sink beneath the waves when your streaming service and a record company get into a tiff, and software you
purchased with actual money can evaporate into a puff of bits because some company somewhere decided it
wasn't profitable enough.</p>
<p>I'm not primarily doing it as a way to build skills for my career. I do feel like any time I flex my
technical muscle I'm improving myself career wise though.</p>
<h2>Why Others Might Homelab</h2>
<p>There are all kinds of great reasons to run your own server hardware and software at home that don't
match those I cited above. I want to cover a couple of them here.</p>
<h3>Building Your Systems / Network Administration Skills</h3>
<p>Depending on what you do for work, it can be incredibly hard to constantly evolve all the skills the
job market is looking for in new hires. Whether you're currently working or looking for work, being
able to honestly claim "Oh yeah, I've done that. I set it up in my Homelab" is a fabulous answer to
have during an interview, and you can certainly add these new found skills to your resume so long as
you're VERY honest with yourself about your <em>actual</em> level of mastery. Don't fall prey to the
<a href="https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect">Dunning Kreuger Effect</a>!</p>
<p>For example during my last job search I was finding employers REALLY wanted
Kubernetes experience, so I set up Rancher in some VMs running on one of the ProxMox servers I have here. It was great and I
learned a tun.</p>
<p>This is where -dsr-'s toot above really comes in. He's absolutely right, setting up BIND instead of
a Pi-hole is most decidedly <em>not</em> hard for anyone with a reasonable degree of comfort with UNIX
systems and infrastructure, and you win familiarity with one of the most important pieces of
infrastructure software in the world - bind.</p>
<h3>The Chance To Experiment With Zero Consequences</h3>
<p>I don't know about you, but after 30 years working in the technology sector, I've lost count of the
number of times I was asked to build some really <em>truly</em> complex piece of software or infrastructure,
live, without a net. No test environments, no dry runs.</p>
<p>You'd better be good at running downhill while juggling chainsaws, because that's what you'll be asked
to do. Over and over and <em>OVER</em>.</p>
<p>With a homelab, you can play, blow stuff up, shrug your shoulders and enjoy the satisfaction of knowing
that you learned something from your failure and will know what to do next time.</p>
<p>This is what life as a technology professional <em>should</em> be like everywhere, but
all too frequently isn't.</p>
<h2>Why I Ultimately Chose Pi-hole</h2>
<p>The answer is very simple: My lovely wife :)</p>
<p>In order to be an effective solution for us, she needs to be able to control the ad blocker we use.</p>
<p>The most critical thing is that she herself be able to add exceptions to the block list. With Pi-hole,
that's as easy as surfing to the web address of Pi-hole's admin and entering a value.</p>
<p>There is absolutely positively <em>zero</em> chance of her learning a UNIX editor, much less BIND's configuration file format.</p>
<p>It's not that she couldn't do it if she wanted to, but she REALLY doesn't want to! Computers are appliances to her.</p>
<p>So, for my purposes, any desire to hone my sysadmin skills is irrelevant, at least for the purposes of this particular
decision.</p>
<p>So, why do <em>you</em> homelab?</p>A Mac User's Survival Guide For Buying A PC Laptophttps://www.feoh.org/posts/a-mac-users-survival-guide-for-buying-a-pc-laptop.html2023-07-18T09:58:05-04:002023-07-18T09:58:05-04:00Chris Patti<p><img alt='"Scream" by xuhulk is licensed under CC BY-SA 2.0.' src="https://www.feoh.org/images/Scream.jpg"></p>
<h2>Why Are We Here?</h2>
<p>Mac users tend to be a rather opinionated lot. We generally love our Macs for
all kinds of reasons - the interface, the hardware, the polish - the list goes
on.</p>
<p>But life is complicated, and there are all kinds of situations that might make a
dyed in the wool Mac user choose to buy a PC laptop.</p>
<p>For myself, the motivation was simple. Apple had about a 5 year stretch where
they manufactured nothing but <em>epic turds</em> for laptops. I don't choose such a
vulgar turn of phrase lightly. As someone who has literally been a Mac fan for
decades (My first Mac was a Motorola 68XXX CPU based Quadra tower. Yes I'm old)
I was appalled at how far the quality had fallen. I won't go into it here as
that's not the point of the article, but let me just offer this one hint:
Butterfly keyboards.</p>
<p>So anyway, the pandemic was just starting to kick up and I realized that I
REALLY needed a personal laptop. So here we are.</p>
<p>This isn't going to be exhaustive, I'm just going to cover some of the more
salient points you may not have been aware of, having lived the sheltered Mac
life as I did :)</p>
<p>Also note these are my opinions. I'm not by any means an expert, I just wanted
to share what I learned in hopes it might help someone.</p>
<h2>Choosing a Vendor</h2>
<p>Which laptop maker you choose will depend largely on what's most important to
you. If ultra expandability is your think, you should probably check out
<a href="https://frame.work/">Framework</a>. If you care less about portability and want a
luggable gaming rig, I'd give
<a href="https://www.dell.com/en-us/gaming/alienware">Alienware</a> a look.</p>
<p>As for myself, I need something that would be sincerely portable, and I
absolutely require a <em>really</em> good keyboard, as well as good warranty support
because fixing it myself wasn't a thing, so I chose
<a href="https://www.lenovo.com/us/en/pc/">Lenovo</a>.</p>
<p>There are plenty of other choices, but hopefully this will at least get you
going.</p>
<h2>Screen</h2>
<p>One of the biggest nasty surprises I was in store for in my PC laptop buying
experience was the screen. Mac laptops have, near as I can tell, always shipped
with gorgeous, bright, high resolution screens.</p>
<p>This isn't always the case in the PC world, so if you're like me and picky about
screens (in my case, I'm low vision, I NEED a large bright display), you need to
be careful here.</p>
<h3>To Matte or Not To Matte</h3>
<p>Every time I mention nit count and screens, people who likely know more than I
do about this stuff remind me that having a Matte screen can make a significant
impact on the amount of perceived glare. That makes sense to me, but I have yet
to have the opportunity to test matte and non matte screens side by side so I
have no personal opinion on this. If I ever buy a PC laptop again though, I'll
be sure to look for a matte screen. With glare being such a serious problem for
me, it certainly can't hurt!</p>
<h3>It's All About The Nits</h3>
<p>The Lenovo T15 gen2 I bought is a lovely laptop in many ways, but the screen is
totally unsuitable for me. At 15" and 300 nits, the display always leaves my
eyes straining and can't handle use in outdoor daylight situations at all.</p>
<p>This is a deal breaker for me, so if it is for you, be <em>sure</em> to pay attention
to how many nits your display has and whether or not it's big enough for your
needs.</p>
<p>There are PC laptop models out there that match the 1000 nit gorgeousness of a
Mac laptop's screen, you just need to be sure the one you pick is one of those
models :)</p>
<h2>Keyboard</h2>
<p>As consumer demand has driven vendors to make laptops thinner, their keyboards
have, in my opinion, suffered. Thankfully Lenovo realized that not everyone is
willing to live with a mushy keyboard with no key travel, so their Thinkpad line
all have keyboards ranging from good to excellent. The keyboard on my T15 was
quite good with nice key travel and just enough tactile feedback to let my wrist
know it can stop pressing. I tend to unfortunately CAVEMAN SMASH mushy
keyboards, and then it hurts :)</p>
<p>Alienware laptops also generally have superlative keyboards, but as I said those
are often more luggables than truly portable, so, it's all about the trade-offs
:)</p>
<p>Unfortunately, it's very hard to shop for a keyboard that fits you through the
mail. You may need to phone a friend or find a local computer store where you
can actually lay hands on that model laptop to try it out yourself.</p>
<h2>Ports</h2>
<p>Be sure you get any adapters you'll need. PCs are more likely to have
DisplayPort ports for monitor / video connections than HDMI, so you may need to
go buy an adapter for your monitor.</p>
<p>You'll also likely see an actual wired network (Ethernet) port, because unlike
Apple, PC vendors recognize that in many places wifi is dodgy as heck and having
a wired network connection can be a godsend.</p>
<h2>Warranty</h2>
<p>If you're like me, when you buy Apple hardware, you ALWAYS buy Applecare to go
with it.</p>
<p>Be careful about your laptop of choice's warranty options. One thing I really
like about Lenovo in this regard is that they have good warranty service <em>and</em>
the warranty attaches to the machine, not the person, so if you want to sell
your laptop, the warranty travels right along with it.</p>
<p>I've seen several laptop vendors offer a 1 year parts and labor warranty by
default, and that's it. I generally like to be sure I can get more out of my
investment than that, but opinions vary on whether or not warranty service is a
good idea. Just bear in mind that if you don't have one and you break it, you'll
need to either fix it yourself or hope for the best at a local computer repair
shop.</p>
<h2>Closing</h2>
<p>Now that Apple has gone back to making excellent laptops, I don't see myself
buying a PC for myself in the near future, but having done it once, if I ever do
again at least I'll know what to look for. I hope this helps you make a purchase
you're happy with.</p>
<p>Whatever you choose, have fun and happy computing!</p>Windows Papercuts for *NIX Developershttps://www.feoh.org/posts/windows-papercuts-for-nix-developers.html2023-07-04T13:42:31-04:002023-07-04T13:42:31-04:00Chris Patti<h3>Introduction</h3>
<p>If you're used to developing on *NIX systems, coming to Windows can be a bit of
a shock.</p>
<p>My goal in writing this article is to point out some of the pain points and,
where I know they exist, some work-arounds.</p>
<p>Note that I'm talking about <em>native</em> Windows here. If WSL meets your needs and
your environment allows it (not everyone's does. Many IT orgs turn it off) then
bully for you but this article isn't about that :) I think WSL is both an
incredible tool for developers and an awesome feat of engineering. I wish more
Linux folks appreciated this. Anyway :)</p>
<p>So let's get started!</p>
<h3>The Paper Cuts</h3>
<h4>The C Compiler</h4>
<p>For most of us, having a standard raft of development tools on hand is par for
the course. We just expect gcc and make to be there at our beck and call, and
the fact that they're not can cause some tools to fail spectacularly.</p>
<p>For instance, whenever I start my editor of choice (Neovim) I'm greeted with:</p>
<p><img alt="Neovim C Compiler Error on Windows" src="https://www.feoh.org/images/windows_nvim_c_boom.png"></p>
<p>Having spoken to some experts, apparently it's considered <em>really</em> bad form to
leave your C compiler on the PATH on Windows. I suspect this is because malware
on Windows is such an incredibly pervasive problem.</p>
<p>I get that, but then we should probably either modify our tool-chains to not
expect that as a default or maybe create documentation to help people understand
the happy path.</p>
<p>As near as I can tell, the 'standard' set of c/c++ tools on Windows is Microsoft
Visual Studio. The free "Community" version works just fine though the installer
is a bit of a jank-fest.</p>
<p>That thing provides a prompt shortcut called "Powershell for VS XXXX" and you
can use that to get a shell that has the usual build tools available.</p>
<p>Not a great solution though, since the experts say not to run that way as a
default, but having your editor blow up on start just-up isn't a great feel.</p>
<h4>The Shell</h4>
<p>While you certainly <em>can</em> run tools like bash or zsh on Windows, unless you
<em>really</em> know what you're doing, this is not the happy path. You're in Rome. Do
what the Romans do and you won't regret it :)</p>
<p>The good news here is that the native tools are now really quite good. Gone are
the days when CMD.EXE was your only choice. You now have Powershell and it's
really quite awesome.</p>
<p>Here are a couple of tips to make your Powershell experience awesome and help
you appreciate what this environment has to offer.</p>
<h5>Oh My Posh</h5>
<p>This one's gotten a lot of press and let me tell you it's incredibly well
deserved. It's like the oh my zsh of Windows shell prompts :)</p>
<p>Mine shows me git status and whether my last command's exit code indicates
success or failure, as well as what Git branch I'm on. Here's what it looks
like:</p>
<p><img alt="What My Oh My Posh Prompt Looks Like" src="https://www.feoh.org/images/OhMyPoshScreenshot.png"></p>
<p>I wrote some about Oh My Posh in my <a href="https://www.feoh.org/posts/getting_started_with_python_on_windows_2021_edition_push_the_easy_button.html">previous article on Windows for Python
Developers</a>.</p>
<h5>PSFzf</h5>
<p>One of the biggest productivity boost for me in recent memory was when I
integrated <a href="https://github.com/junegunn/fzf">fzf</a> the fuzzy finder into my
workflow.</p>
<p>With a single keystroke I can find any file or directory on my system.
Navigation becomes effortless and the endless sequence of <code>cd</code> and <code>pwd</code> commands
melt away in a burst of productivity goodness :)</p>
<p>Thankfully, Powershell offers all these benefits as well via
<a href="https://github.com/kelleyma49/PSFzf">PSFzf</a>.</p>
<p>Here's what it looks like. In this case I wanted to edit my Neovim main
configuration file <code>init.lua</code>:</p>
<p><img alt="Edit my init.lua file" src="https://www.feoh.org/images/psfzf.png"></p>
<h4>The Console / Terminal</h4>
<p>For long time *NIX users, one of the biggest bones of contention for a
long time was the Windows console. To put it kindly, it was god awful, mostly
because it maintained compatibility with the Antideluvian DOS console.</p>
<p>Happily, we now have a fairly decent solution <a href="https://github.com/microsoft/terminal">Windows
Terminal</a>. I say fairly decent because
it's still not quite up to par with your favorite <em>NIX terminal, but the fine
folks behind this open source project are working </em>really* hard to change that,
and the progress they've made here has been nothing short of miraculous. Mad
props to these folks for fixing by far the biggest deal breaker for many around
working in Windows!</p>
<p>They've even recently added an easier UI for editing settings, but you can also
still go edit the JSON yourself if that's your jam :)</p>
<p>It's not perfect, but this is an incredibly flexible tool with a ton of depth
and it's been exciting to watch it evolve.</p>
<h4>The Windows Desktop/GUI</h4>
<p>I'm sure there will be folks who aren't happy with this one but my take? Just
ignore it.</p>
<p>Windows is pretty good about making EVERYTHING accessible from the keyboard, and
many things are also accessible from the command line. If you just avoid
graphical interfaces wherever possible, and if you're anything like me, you'll
see your productivity levels soar and your frustration levels plummet.</p>
<h4>Packaging</h4>
<p>One of the big pain points coming from *NIX is the lack of a 'real' package
manager.</p>
<p>I use the <code>winget</code> tool that comes bundled with Windows 11. It's officially
supported by Microsoft and lets me install most if not all of the commercial
apps I use.</p>
<p>It has the further advantage that it will write a JSON blob with all the
packages you have installed, so you can get your software up to snuff with a
single Powershell invocation.</p>
<p>But there are other popular options as well, namely
<a href="https://github.com/ScoopInstaller/Scoop">Scoop</a> and
<a href="https://chocolatey.org/">Chocolatey</a>.</p>
<p>To be honest I wish MSFT had worked a bit harder to maintain compatibility with
these other projects so we don't have multiple separate package namespaces.
Can't have everything I guess.</p>
<h4>Where Do I Put?</h4>
<p>One of the things I continue to struggle with is the simple expedient of "Where
do I PUT things?". On UNIX based systems, pretty much everything user or
configuration related lives in $HOME. Not so on Windows.</p>
<p>As just an example, my Neovim configuration lives in something like
<code>$HOME\AppData\Local\nvim.</code></p>
<p>In some respects, I get it. Keeping application configuration separate is a good
thing, but navigating where to put what can feel like a bit of a morass for the
uninitiated.</p>
<p>Maybe once I get a better understanding of the lay of the land, I can create a
cheat sheet for UNIX users.</p>
<h3>Fin</h3>
<p>That's all I have for now, but I may update this post as time permits or if
various situations I detail here improve. Thanks for reading!</p>Hacking the Wetware 2 - Antipatterns (Burn Out & The Ego Trap)https://www.feoh.org/posts/hacking-wetware-antipatterns.html2023-01-23T13:20:57-05:002023-01-19T21:16:21-05:00Chris Patti<p><img alt='"Boiling Frog" by DonkeyHotey is licensed under CC BY-SA 2.0.' src="https://www.feoh.org/images/Boiling_The_Frog.jpg"></p>
<h3>Of Burn Out And Boiled Frogs</h3>
<p>I can't speak for everyone, but as for my own experience, burn out can be tough to self diagnose because it happens slowly,
by degrees.</p>
<p>It's a state of mind where pushing yourself even a little bit, even to do the things you'd normally
do as a matter of course, feels incredibly difficult. It's that feeling of knowing you need to do something but being
unable to actually complete the thoughts or actions necessary to actually get it done.</p>
<p>Often, at least for me, it's a result of having to perform the same set of tasks over and over again in a stressful situation.</p>
<p>Human brains simply weren't designed to be subjected to a constant diet of stress combined with cognitively challenging tasks
and an overall lack of novelty or variation.</p>
<p>Understanding this can go a long way for preventing it, but even so, especially in the technology industry, it can happen to
anyone.</p>
<p>Changing things up with your work load can sometimes help, but other times the source of the stress or conditions around your
work mean that even varying your worrk may not be enough.</p>
<p>There's a really superlative book on this topic I can strongly recommend - <a href="https://www.goodreads.com/book/show/327.Why_Zebras_Don_t_Get_Ulcers">Why Zebras Don't Get Ulcers</a>.</p>
<h3>How Does One Un-Boil a Frog?</h3>
<p>There are a few things I have found to be helpful through the years in recovering from burn out.</p>
<h4>Do Something Fun & DIFFERENT. Pick Up a New Hobby!</h4>
<p>As a part of recovering from my most recent bout of burn out I've started learning how to play the piano/keyboard. A key
aspect in this being effective is that it's something VERY different from the activity that got you here. For me,
learning an entirely new skill that has nothing to do with computers has been satisfying and fulfilling.</p>
<p>Tech projects can be good too provided they're well and truly disconnected from the work that's burning you out and don't
end up being a source of stress themselves!</p>
<p>Why not go for some long walks/hikes in the woods? Go for a nice bicycle ride? Finding fun activities that are also exercise
can be good on many levels!</p>
<h4>Give Yourself a Break</h4>
<p>As professionals we put a ton of pressure on ourselves. Everybody wants to be a superstar and nobody likes to think about losing,
even when losing a tiny and actually almost meaningless skirmish can feel like you've lost the war.</p>
<p>It can be difficult to zoom out and gain that perspective in the moment, but it's important to try and figure it out. Having
solid support systems can be very helpful here, whether it's your spouse, a good friend, or even a therapist. Speaking of...</p>
<h4>Get Help If You Need It</h4>
<p>Many of us were raised to think of therapy as a thing for "crazy people" - that nebulous other that SURELY isn't us! We're
stronger than that and more self sufficient.</p>
<p>Except, when push comes to shove, we're all human. We all need mechanisms in our lives to help provide balance and an outside
perspective to keep us grounded and help avoid boiled frog syndrome.</p>
<p>I myself use <a href="https://www.betterhelp.com/">BetterHelp</a> and have found it incredibly useful.</p>
<h4>Gratitude</h4>
<p>This may sound a bit wu or perhaps irrelevant to some, but I have recently found it to be a powerful tool for shaping the way I
think about things in a positive direction.</p>
<p>Taking a moment to zoom out from whatever I'm thinking or feeling and <em>appreciate</em> the fact that I live a life of such incredible
privilege helps me gain some much needed perspective. </p>
<p>Clearly I'm not the only one, I found <a href="https://www.youtube.com/watch?v=ZBduBppB8r0">this Youtube video</a> on the topic really helpful.</p>
<h3>The Ego Trap</h3>
<p>There's something else I want to talk about. This may not apply to you, but if it does, maybe I can help.</p>
<p>Many of us who work in technology take a lot of pride in our work. We may even, if we're lucky enough to
go to work for what some might consider an 'elite' company, attain positions with a fair bit of cachet in
the industry.</p>
<p>This can create yet another variety of boiled frog - the ego trap. Where your very identity becomes bound up
in your job. It's not just "I work for BigCo" - it's "I AM BigCo".</p>
<p>I can't imagine that anyone who's fallen for this would even admit to it in the moment. It's the kind of clarity
many of us only get when our situation changes out from under us and we're forced to confront an unpleasant
reality.</p>
<p>Remember, no matter how excited you are to be working for any particular company at a particular job, at the end
of the day it's JUST a job. </p>
<p>Cliches about health being the only thing that matters aside, this situation can create some incredibly intense
tunnel vision:</p>
<p>"I WILL find a way to maintain the status quo!".</p>
<p>Thing is, maybe you <em>Can't</em> and moreover maybe you <em>shouldn't</em>! For your own sake and perhaps for that of your
employer.</p>
<p>Sometimes, the only winning move is embracing your limitations and accepting that you can only do so much so fast.</p>
<p>I don't mean to say that one should just meekly accept defeat, but sometimes winning is having the wisdom to
tactically retreat and formulate a better plan for success :)</p>
<p>Skills can be built upon and improved, and taking ownership of that process and the will to make it happen can itself be
incredibly empowering!</p>Mis-Adventures In GatsbyJShttps://www.feoh.org/posts/mis-adventures-in-gatsbyjs.html2022-05-20T16:14:19-04:002022-05-20T16:14:19-04:00Chris Patti<figure><img src="https://www.feoh.org/images/Octopus.jpg"></figure> <div><p><img alt="Key West Octopus by oe Parks is licensed under CC BY-NC 2.0" src="https://www.feoh.org/images/Octopus-smol.jpeg"></p>
<p>Over the last few years I've been feeling like living exclusively in my Python programming happy place is something I can't afford to do.</p>
<p><a href="https://www.feoh.org/posts/mis-adventures-in-gatsbyjs.html">Read moreā¦</a> (6 min remaining to read)</p></div>A Teency Bit More Housekeepinghttps://www.feoh.org/posts/a-teency-bit-more-housekeeping.html2022-05-17T16:34:40-04:002022-05-17T16:34:40-04:00Chris Patti<p>I'm switching the static site generator I ues for this blog from <a href="https://blog.getpelican.com/">Pelican</a> to <a href="https://getnikola.com/">Nikola</a>.</p>
<p>There are a number of reasons for this - better/more theme options, a more active development community, and some really swank features I just love.</p>
<p>The up-shot however is that the RSS feeds will need to change. The new links are clearly signposted on the header at the top of the blog.</p>
<p>Also, I've switched the comment system from Disqus (Which I really Dis-like :) to <a href="https://www.intensedebate.com/">Intense Debate</a> which I've been using on my personal blog and love to bits.</p>
<p>You can find the old Disqus comments <a href="https://disqus.com/home/forum/blindnotdumb/">here</a></p>
<p>Thanks for understanding and updating your feed readers!</p>Some Brief But Important House Keepinghttps://www.feoh.org/posts/some-housekeeping.html2022-03-11T01:11:00-05:002022-03-11T01:11:00-05:00Chris Patti<p>Hi all!</p>
<p>Just a brief house-keeping note.</p>
<p>This is going to hence-forth be strictly my professional blog.</p>
<p>I'll be cleaning out old posts that aren't tech related and <em>maybe</em>
moving any I feel particularly inclined to keep over to my new personal
blog, <a href="https://playingwithquicksilver.net">Playing With Quicksilver</a>.</p>
<p>I'm not trying to hide anything, so feel free to browse my old posts via the
Wayback Machine over <a href="https://web.archive.org/web/20211225090030/https://www.feoh.org/">here</a>.</p>
<p>I look forward to blogging here more often! I'll likely also be switching to
the <a href="https://getnikola.com">Nikola</a> static site generator because it offers
a number of features and creature comforts that will make my life easier
(Like having a command that will pre-seed a new post with all the right metadata fields. Yay :)</p>
<p>As always feel free to hit me up here or on social media if you have any thoughts.</p>
<p>Onward!</p>Getting Started With Python On Windows 2021 Edition: Push The Easy Button!https://www.feoh.org/posts/getting_started_with_python_on_windows_2021_edition_push_the_easy_button.html2021-11-06T01:45:00-04:002021-11-06T01:45:00-04:00Chris Patti<h2>Don't Despair! This Is Gonna Be Easy! :)</h2>
<p>Over the last few months I've seen a <strong><em>ton</em></strong> of confusion swirling around social media about how to help people who are new to Python development and software development in general get up and running on Windows quickly.</p>
<p>GOOD NEWS! You can ignore all that. Many of these suggestions are well meaning but come from people who don't actually do Python development on Windows regularly.</p>
<p>Note that I'm not going to tell you the 5 different ways to do a thing, I'm going to tell you the ONE easy way :)</p>
<p>So let's get started!</p>
<h3>Side Note: Everyone Will Tell You To Use WSL - You Probably Don't Want That!</h3>
<p>I hear a lot of incredibly talented and experienced well meaning UNIX/Mac enthusiasts tell newcomers looking to get going on
Windows "Oh well you just use WSL! It's easy! Then you install python with apt get yada yada, and then you install pyenv,
and then you configure your shell's environment to use the right shims... and..."</p>
<p>The truth is that if you want to learn Linux - you SHOULD! It's an incredible platform and a virtually bottomless font of
power waiting for you to tap.</p>
<p>But if there's one thing I've learned in 30 years in the tech trenches, it's that trying to learn a million things all at
once is the surest way to learn nothing. Why not focus on teaching yourself Python programming first and then exploring Linux
as a separate effort?</p>
<h2>Install Python</h2>
<p>If you're on Windows 11 (And I recommend it if your hardware is new enough!) this is as simple as bringing up a Powershell in your swank Windows Terminal. If you want a look at my setup please go read <a href="https://www.feoh.org/2021-the-year-windows-became-a-first-class-python-development-environment.html">my article on that</a>.</p>
<p>Anyway, all you have to do is type:</p>
<div class="code"><pre class="code literal-block">winget install python
</pre></div>
<p>That's it! This will install the latest stable version of Python from <a href="https://www.python.org">The official Python website</a>. If you're not lucky enough to be running Windows 11, just download the latest stable version from <a href="https://www.python.org/downloads/">the website's Downloads page</a> and double click on the executable file in your Downloads folder. If you're not sure just keep clicking Next on the dialogs and in a few minutes you'll have Python installed!</p>
<h2>Embracing The Power of Py! (Psst. This Is The Easy Button!)</h2>
<p>The 'py' Python launcher used to be a super power that only Windows versions of Python shipped with, but now thanks to <a href="https://github.com/brettcannon/python-launcher">Brett Cannon, an amazingly prolific Python core developer's hard work</a> our UNIX friends can enjoy the easy button as well!</p>
<p>So let's get this party started and see how easy it is these days to get into the Python prompt:</p>
<p><img alt="Windows Python Prompt With Py" src="https://www.feoh.org/images/WindowsPyPrompt.png"></p>
<p>Pretty easy, right?</p>
<p>Note that py has other superpowers as well. It can list all the python versions you have installed, and also let you choose which version to run with the arguments you choose. Run:</p>
<div class="code"><pre class="code literal-block">py --help
</pre></div>
<p>to see an exhaustive description of all the magic tricks py can do :)</p>
<h4>Set The Stage</h4>
<p>Again, from your Powershell, create a project directory for yourself. Programmers often create a 'src' directory wherever it's convenient (Maybe in your home directory?) and then put their projects underneath.</p>
<p>So let's go ahead and do that:</p>
<div class="code"><pre class="code literal-block">CD $HOME
mkdir src\starwars_characters
<span class="gh">#</span> Yes i'm a big nerd. Our project will pull down a list of characters in the movies from the Star Wars API :)
cd src\starwars_characters
</pre></div>
<h4>Building A Sandbox</h4>
<p>Now let's create a safe space for our project so we don't unintentionally install libraries or other experiments in public. This can lead to situations where you go to create another project but a library you installed previously either causes undesirable behavior or perhaps is even in a broken state, getting in the way of you getting your work done.</p>
<p>We're going to create a thing called 'virtual environment'. Don't worry too much about the details, just think about this as a nice tidy sandbox for us to play in where we don't have to worry about breaking anything outside.</p>
<p>Again from our Powershell prompt:</p>
<div class="code"><pre class="code literal-block"># Actually create our virtual environment. Put the bits in a folder called 'venv'.
# Most Pythonistas use this folder name, but you can use any name you want :)
py -m venv venv
# Actually activate our new virtual environment in our Powershell
.\venv\Scripts\Activate.ps1
</pre></div>
<p>Let's see what happens when we do that (Assuming you're running Oh My Posh, and you should be if you followed my setup article):</p>
<p><img alt="Create/Activate Virtual Environment" src="https://www.feoh.org/images/virtualenvps.png"></p>
<p>See what happens there? We create the virtual environment, and our shell notices which Python version it uses, and tells us that in our Powershell prompt!</p>
<p>Then, we activate our virtual environment, and now our prompt adds a (venv) at the beginning. With this visual indicator in plce, we know we're safely ensconced in our sandbox and can start playing with no worries!</p>
<h4>Install Necessary Libraries</h4>
<p>You'll need an editor or an IDE. I use <a href="https://code.visualstudio.com/">Visual Studio Code</a>. It's free, it runs on any modern computer, and it offers an incredibly rich set of tools to help you with your development. Bonus points? It's also free, and even largely open source.</p>
<p>Let's get started, and tell Python which libraries we'll need for our project:</p>
<div class="code"><pre class="code literal-block">code requirements.txt
</pre></div>
<p>In this file, add a single line:</p>
<div class="code"><pre class="code literal-block">requests
</pre></div>
<p>If you want to add a truly superlative interactive Python environment with which to prototype and
explore, you could also add IPython:</p>
<div class="code"><pre class="code literal-block">IPython
</pre></div>
<p>(Note IPython here is case sensitive so be careful!)</p>
<p>Now, still in our Powershell prompt, type this command to actually install these required libraries into our virtual environment:</p>
<div class="code"><pre class="code literal-block">py -m pip install -r requirements.txt
</pre></div>
<p>You should see some messages about libraries being installed. Note that you invoke IPython this exact same way:</p>
<div class="code"><pre class="code literal-block">py -m IPython
</pre></div>
<h3>Write The Code</h3>
<p>Create a file in your project directory called starwars_characters.py with your editor that includes the following code:</p>
<div class="code"><pre class="code literal-block"><span class="kn">import</span> <span class="nn">requests</span>
<span class="n">STARWARS_API_URL_BASE</span> <span class="o">=</span> <span class="s2">"https://swapi.dev/api"</span>
<span class="n">GET_CHARACTERS_URL</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">STARWARS_API_URL_BASE</span><span class="si">}</span><span class="s2">/people"</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">GET_CHARACTERS_URL</span><span class="p">)</span>
<span class="n">response_json</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
<span class="n">characters</span> <span class="o">=</span> <span class="n">response_json</span><span class="p">[</span><span class="s1">'results'</span><span class="p">]</span>
<span class="k">for</span> <span class="n">character</span> <span class="ow">in</span> <span class="n">characters</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Character Name: </span><span class="si">{</span><span class="n">character</span><span class="p">[</span><span class="s1">'name'</span><span class="p">]</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</pre></div>
<p>Here's what my Visual Studio Code session looks like with this code loaded and the output shown in the run window:</p>
<p><img alt="Starwars Project VSCode Screenshot" src="https://www.feoh.org/images/vscode.png"></p>
<p>Notice that bit at the bottom that says 3.10? That shows us that Visual Studio Code automatically detected the Python we have installed in our virtualenv. You can click on that to see a list of installed Python interpreters to choose from.</p>
<p>We can run our new project either by using the Run menu inside Visual Studio Code or on the command line with that very same <code>py</code> syntax we used before:</p>
<div class="code"><pre class="code literal-block">py starwars_characters.py
</pre></div>
<h2>The End Is Just The Beginning</h2>
<p>Well there we have it! You have Python installed and running, and you've built a small but interesting Python project right here on your Windows machine!</p>
<p>The truth is, a large number of people have put in innumerable hours making Python drive smooth like a Cadillac on Windows,
so if you find yourself using and enjoying it, the next time someone tells you to abandon all hope and install Linux/WSL,
be sure to point them at this article! Maybe if we change some minds we can help bring more Pythonistas into the incredibly
awesome Python community!</p>
<p>Please feel free to leave comments with any questions, or hit me up on
<a href="https://cybre.space/@feoh">Mastodon</a> or <a href="https://twitter.com/feoh">Twitter</a>.</p>
<p>I'd love to hear from you!</p>2021 - The Year Windows Became a First Class Python Development Environmenthttps://www.feoh.org/posts/2021-the-year-python-became-a-first-class-python-development-environment.html2021-06-08T22:12:00-04:002021-06-02T17:54:00-04:00Chris Patti<p><em>[06/08/2021 Update: Added a bit about Windows Terminal. Dunno how I forgot that the first time around!]</em></p>
<p>As I've written about previously and elsewhere, I felt so badly burned by Apple's laptop
hardware design decisions of a few years ago that I've rather fallen out of love with that platform for my personal work. The latest hardware is much better, but I feel like the message has been sent and received, so I'm not rushing back any time soon.</p>
<p>My first choice was the Linux desktop, and after months of struggling, instability and accessibility issues I'll admit I've been looking for stable, solid alternatives that are also powerful enough to get the job done and maybe even have something new to offer. As an old dog, sometimes it's really nice to be taught some new tricks!</p>
<p>If you've tangoed with Windows in the past, and found yourself struggling against its rather byzantine UI, I'd urge you to read on and see if maybe it's not time for another careful look.</p>
<p>Since choosing the right tools is all about your unique set of needs, I'll use those as categories to drive the discussion and showcase how Windows is doing a great job of satisfying them.</p>
<h3>In The Beginning, There Was The Command Line!</h3>
<p>One of the things that first drew me to UNIX decades ago was the shell. The ability to get pretty much ANYTHING I needed done by typing a few commands, and to create <strong>incredibly</strong> powerful mechanisms by stringing them together is downright intoxicating.</p>
<p>I still love me some Bourne shell, it's just as powerful today as it was decades ago. However <a href="https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.1">Windows Powershell</a> has some incredibly powerful paradigms of its own that are worth looking into.</p>
<p>In addition to things like object pipelines and desired state configuration that
the UNIX shell simply can't do, modern Powershell has creature comforts like <a href="https://ohmyposh.dev/">Oh My Posh</a> that make for a very comfortable work environment. Here's a screenshot of mine:</p>
<p><img alt="My Oh My Posh Prompt" src="https://www.feoh.org/images/OhMyPoshScreenshotSmol.png"></p>
<p>You can see that I get all kinds of nice status like exit code of last command, current git branch, current Python version and virtual environment, etc.</p>
<p>While Powershell is indeed a totally different beast from the UNIX shell I'm used to, its built in help for <strong>every</strong> command and understandable syntax make the learning curve feel rather shallow indeed.</p>
<p>Another gripe most UNIX users have when coming to Windows is that everything requires mousing around and futzing with a GUI, and it can feel like you're trapped in an endless series of installer screens to get even your basic working tools installed. Modern Windows obviates all that with <a href="https://www.slashgear.com/microsofts-winget-1-0-released-for-real-heres-why-you-want-it-01675425/">winget</a> a full fat package manager with tons of common applications already in there. Just <code>winget install git</code> and you're off to the races :)</p>
<h3>Before The Command Line, There Was The Terminal</h3>
<p>As anyone who's worked with Windows for a long time could tell you, in the old days, the Windows Console was pretty primitive. You were basically dealing with MS-DOS CMD.EXE with the barest modicum of window dressing. Needless to say, this is 2021 and that's just not cutting it.</p>
<p>Thankfully, there is a superlative alternative that's really come into its own in 2021 - <a href="https://github.com/microsoft/terminal">Windows Terminal</a>. Finally all the features anyone who's been working in the UNIX world have come to expect over the last 30 years are available on Windows as well. Multiple tabs, excellent terminal emulation, great theming and color support, and the ability to seamlessly handle different shells per tab. I regularly keep a Powershell and a WSL tab open for my work.</p>
<p>If you've ever struggled along with the old CMD.EXE, fighting for every cut, paste or insert, this really is a game changer.</p>
<h3>I Hate Meeces To Pieces! (Really, Don't Make Me Use the Mouse!)</h3>
<p>As someone who's partially blind and has fine and gross motor impairment, using the standard Windows Icons Mice and Pointers user interface is downright agonizing. I need to be able to launch apps with just a few keystrokes. On the Mac, <a href="https://www.alfredapp.com/">Alfred</a> fulfills this role admirably and adds a whole host of next level productivity power ups in addition to keyboard app launching.</p>
<p>A <strong>very</strong> recent addition on the Windows side that seems equally powerful and easy is Microsoft Powertoys <a href="https://docs.microsoft.com/en-us/windows/powertoys/run">Powertoys Run</a> feature. I can launch apps, bind keys to actions, and access system functions like sleep, restart and the like all 100% from the keyboard. Nice!</p>
<p>Another Powertoys addition that's frosting my Pop-tarts is <a href="https://docs.microsoft.com/en-us/windows/powertoys/keyboard-manager">Powertoys Keyboard Manager</a> which allows me to remaps the dread CAPS LOCK key to Ctrl so it's right next to my pinky as God Intended :)</p>
<p>This simple enhanment has been impossible with Windows forever without resorting to more drastic measures, so having it work pretty much out of box now is super sweet.</p>
<h3>Python - It Takes a Cast of Thousands to Raise a Platform</h3>
<p>If you'd uttered the words "Python" and "Windows" in the same sentence a few years back, the average Pythonista would have rolled their eyes or groaned and then proceeded to tell you a war story about how they had to spend weeks trying to get some critical module or other working.</p>
<p>Those days are just straight up gone. Microsoft and the Python community at large have poured countless engineer hours into making the Python ecosystem a truly first class experience under Windows. Virtual environments, poetry, and even tools for installing and managing command line scripts that integrate with the shell like <a href="https://pypi.org/project/pipx/">pipx</a> work just great under Powershell on Windows.</p>
<p>And if by chance you're coding something up that's native UNIX to its very core, Windows *<em>still</em> has you covered. Cue the Windows Subsystem for Linux!</p>
<h3>WSL - I See Penguins!</h3>
<p>With the avent of WSL2 and most recently <a href="https://github.com/microsoft/wslg">WSL-g</a> you really do have everything you need to seamlessly build, debug and run Linux programs on Windows, including those that require X/Wayland GUI support or sound.</p>
<p>It's not just some kind of compatibility shim, it's an <strong>actual</strong> Linux kernel running in Windows. The integration is so complete these days that you can run things like Docker within WSL successfully. That's a really big deal!</p>
<p>Also, most of the popular mainstream development tools like <a href="https://www.jetbrains.com/pycharm/">Pycharm</a> and <a href="https://code.visualstudio.com/">Visual Studio Code</a> have superlative support for deploying to and debugging in WSL built in.</p>
<p>The amount and quality of work Microsoft has put into this is truly impressive. And unlike the Mac, you're not actually using some oddball FreeBSD user space running atop the Mach microkernel, you're running 100% Linux. It's turtles all the way down.</p>
<h3>I Go Where The Innovation Is & Use What Works</h3>
<p>As a technologist, I'm proud of the success I've had in sniffing out pockets of high velocity, high value innovation in the technology landscape.</p>
<p>Years ago, I was running Linux when many people were either using DOS, pre OSX MacOS or super expensive prorietary vendor workstations like Sun's Sparc. Being able to have an honest to god UNIX environment on commodity hardware was like Prometheus's gift of fire to the mortals. It really was that big a deal.</p>
<p>I still think the Linux desktop has incredible potential, but for me the obstacles imposed by my disabilities and the lack of accessibility features can be a real buzz and productivity killer.</p>
<p>So here I am embracing a desktop that works, with an ecosystem that works and a rather large well heeled company pouring resources into bar raising and innovation.</p>
<p>I look forward to exploring and leveraging the incredible potential this platform represents. Stay tuned for more posts as I go!</p>