Making PowerShell “Posh”
Back in the days when DOS and Windows were separate programs, the default Command Prompt didn’t look exactly the way that it does now. I can’t recall if it w...
A while ago, I wrote about using a bare git repository to manage my dotfiles. That worked somewhat well, but it had some shortcomings. Honestly, it’s been a while since I switched from that particular setup, and I forget what my main motivating reasons were. I do vaguely recall running config clean one day… that removes any files in the profile that aren’t in the repository, which would essentially delete my entire user profile… that might have had something to do with it.
Regardless of my motivations, I quickly adapted to using an open source application called dotbot to help with the task becuase it just ended up being a better way to do things. First, instead of making a bare repository out of my entire user profile and ignoring files that are not under version control, all of the files are in a normal repository and symlinked to their original locations. Fortunately dotbot handles all of this more gracefully.*
(* with a quick local security policy modification in Windows)
Since I already had my dotfiles set up to be shared, I only needed to set up dotbot. However, if you’re new this sort of thing, you have to keep in mind the target machines that you use. For me, that includes machines from Raspberry Pi Zeros through my Windows 11 desktop and both work and personal. Keep in mind that these configurations include all of my user preferences. I want my shell key bindings to be the same at work and home, for example, so things have to play nice on both sides of that aisle. Fortunately, that’s not too difficult.
The user environment variables can give a lot of hints that can set things for work or home. I want certain things to be the same between work and home, but not everything. However, I want things to be the same between workstations at work and between computers at home. Fortunately, I can look at an environment variable for a hint. In this case, $ENV:USERDOMAIN is very helpful:
if($IsWindows -and
($ENV:COMPUTERNAME -ne $ENV:USERDOMAIN) -and
(Test-Path -Path (Join-Path $ENV:USERPROFILE ".dotfiles" "powershell" "profile.$ENV:USERDOMAIN.ps1"))) {
. $(Join-Path $ENV:USERPROFILE ".dotfiles" "powershell" "profile.$ENV:USERDOMAIN.ps1")
}
This excerpt will source in a separate profile.WORKDOMAIN.ps1 file with some work-specific functions.
Everything works out-of-the-box as documented except for one thing – in Windows, one needs Administrator rights to create symbolic links. Fortunately, this is pretty easy to overcome.
Back in the days when DOS and Windows were separate programs, the default Command Prompt didn’t look exactly the way that it does now. I can’t recall if it w...
Sometimes it’s the little things…
As a Data Engineer using Mirth Connect, it’s often tricky to review my team’s merge requests because the merge request document contains the XML representati...
When dealing with Python dependencies, it’s sometimes necessary to determine if a given project is using a given version of a library. Since our team is usin...
A while ago, I wrote about using a bare git repository to manage my dotfiles. That worked somewhat well, but it had some shortcomings. Since, I’ve started us...
One of my current projects involves some improvements to code that I wrote last year – specifically enhancing the “Patient Identity Fixer”, which is my pet p...
To borrow from a favorite web comic: whenever I learn a new skill, I concoct elaborate fantasy scenarios where it lets me save the day. Actually, it feels li...
This one bugged me for a few days. I don’t think this script is the best solution to the problem at hand, but it was still fun to figure out.
My team at work has a custom FHIR resource that we work with often called an Operation Outcome. We generate one of these for nearly every record we process, ...
a.k.a. Why I Don’t Use Nano
COVID-19 has us many of us working from home. My husband and I are both fortunate enough to be in this group. However, as a teacher, his schedule is very pre...
When I set up a Raspberry Pi, there are a few things that I have to do right out of the gate to make things easier on myself. They involve putting a few file...
While I don’t use Linux as my primary operating system, I do use it a lot both at home and at work. It can be frustrating to try to sync up configurations be...
Anyone who knows my husband or me knows that we really like our cold brew, and they also know that we make our own at home. Nitro cold brew has become a bit ...
So you want to run an OpenVPN Server on a Raspberry Pi? I did too, but it wasn’t easy to figure out the first time. If you want to skip all of this and do it...