Somerville news

I don’t have a lot to say about either of these news items, but I just wanted to note them on my blog for some reason.

First: There was a huge fire on Friday at a new apartment building here in town. (The building wasn’t yet complete, and no one was living there yet.) There’s been a lot of new construction in town over the last few years, including three or four big new apartment buildings/complexes. They’re all “luxury” apartments that go for around $2000 per month for a one-bedroom. Here’s the site for this development. Fancy. I couldn’t find any prices on the site, but I found a mention on another site that indicated that it was $1950. I really don’t know where they find people who can afford that. Maybe some of them are people who think it’s OK to spend a much higher percentage of their salary on rent than I do. I wonder if these high rents are going to hold up post-COVID, or if a lot of people are going to wind up in positions where they can work from home and don’t need to be so close to the train into NYC.

Second: There was another BLM protest in Somerville on Sunday. It wasn’t a big one, but it was still big enough to drown out the cartoon I was watching on Netflix at the time. I should probably feel bad about binge-watching cartoons while there’s so much bad stuff going on in the world, but honestly I’m exhausted. I need cartoons to keep me sane. And I’m still not sure it’s safe for me to be out in a crowd of strangers, even if they’re all wearing masks. Young healthy folks can go out and march. I’ll make a few charitable donations and do what I can in the voting booth. (Well, not actually in the voting booth this year, hopefully, but you know what I mean.)

PowerShell profiles and prompts and other command-line stuff

I’ve been spending some time at work this week rearranging some stuff between my two development VMs, and I hit on a few items that I thought might be worth mentioning on this blog. I have two development VMs, one with a full install of Dynamics AX 2012 R2 on it, and another with a full install of SharePoint 2013 on it. Both are running Windows Server 2012 R2. And both have Visual Studio 2013 and 2017 installed. My AX work needs to get done on the AX VM, and any old-style SharePoint development needs to get done on the SharePoint VM.

General .NET development can be done on either VM. For reasons that made sense at the time, and aren’t worth getting into, my general .NET work has all ended up on the SharePoint VM. This is fine, but not optimal really, since the SP VM has only 8 GB of RAM, and 6 GB of that is in constant use by the SP 2013 install. That’s leaves enough for VS 2017, but just barely. The AX VM has a whopping 32 GB of RAM, and the AX install generally uses less than 10 GB. And my company is gradually moving from SP 2013 to SharePoint Online, so my need for a dedicated SharePoint VM will be going away within the next year or so (hopefully).

So it makes sense to me to move my general .NET projects from the SP VM to the AX VM. That’s mostly just a case of copying the solution folder from one VM to the other. Back when we were using TFS (with TFVC) for .NET projects, it would have been more of a pain, but with git, you can just move things around with abandon and git is fine.

All of this got me looking at my tool setups on both VMs, and trying to get some stuff that worked on the SP VM to also work on the AX VM, which led me down a number of rabbit holes. One of those rabbit holes had me looking at my PowerShell profiles, which led me to refresh my memory about how those worked and how to customize the PowerShell prompt.

The official documentation on PowerShell profiles is here, and the official doc on PowerShell prompts is here. User profile scripts are generally found in %userprofile%\Documents\WindowsPowerShell. Your main profile script would be “Microsoft.PowerShell_profile.ps1”. And you might have one for the PS prompt in VS Code as “Microsoft.VSCode_profile.ps1”. (Note that I haven’t tried using PowerShell Core yet. That’s another rabbit hole, and I’m not ready to go down that one yet…)

Anyway, on to prompts: I’ve always kind of disliked the built-in PowerShell prompt, because I’m often working in a folder that’s several levels deep, so my prompt takes up most of the width of the window. The about_prompts page linked above includes the source for the default PowerShell prompt, which is:

function prompt {
    $(if (Test-Path variable:/PSDebugContext) { '[DBG]: ' }
      else { '' }) + 'PS ' + $(Get-Location) +
        $(if ($NestedPromptLevel -ge 1) { '>>' }) + '> '

In the past, I’ve replaced that with a really simple prompt that just shows the current folder, with a newline after it:

function prompt {"PS $pwd `n> "}

Yesterday, I decided to write a new prompt script that kept the extra stuff from the default one, but added a couple of twists:

function prompt {
    $loc = $(Get-Location).Path.Replace($HOME,"~")
    $(if (Test-Path variable:/PSDebugContext) { '[DBG]: ' } else { '' }) + 
    $loc + 
    $(if ($NestedPromptLevel -ge 1) { '>>' }) +
    $(if ($loc.Length -gt 25) { "`nPS> " } else { " PS> " })

The first twist is replacing the home folder with a tilde, which is common on Linux shells. The second twist is adding a newline at the end of the prompt, but only if the length of the prompt is greater than 25 characters. So, nothing earth-shattering or amazing. Just a couple of things that make the PowerShell prompt a little more usable. (I’m pretty sure that I picked up both of these tricks from other people’s blog posts, but I can’t remember exactly where.)

Anyway, this is all stuff that I’m doing in the “normal” PowerShell prompt. I also have cmder set up, which applies a bunch of customization to both the cmd.exe and PowerShell environments. Honestly, the default prompt in cmder is fine, so none of the above would be necessary if I was only using cmder. But I’ve found that certain things were only working for me in the “normal” PowerShell prompt, so I’ve been moving away from cmder a bit. Now that I’m digging in some more, though, I think some of my issues might have just been because I had certain things set up in my normal PowerShell profile that weren’t in my cmder PowerShell profile.

Cmder is basically just a repackaging of ConEmu with some extra stuff. I don’t think I’ve ever tried ConEmu on its own, but I’m starting to think about giving that a try. That’s another rabbit hole I probably shouldn’t go down right now though.

I’d love to be able to run Windows Terminal on my dev VMs, but that’s only for Windows 10. (It might be possible to get it running on Windows Server 2012 R2, but I haven’t come across an easy way to do that.) Scott Hanselman has blogged about how to get a really fancy prompt set up in Windows Terminal.

And at this point, I’ve probably spent more time messing with my PowerShell environment than I should have and I should just settle in and do some work.

WordPress syntax highlighting

I started writing a blog post about PowerShell today, then got caught up in an issue with the code syntax highlighting plugin that I’ve been using on this blog since 2017. I’ve been using WP-Syntax since then, and I’ve generally been happy with it, but there are a few things that bug me, so that set me off looking into other options. One issue I noticed is that WP-Syntax hasn’t been updated in four years, and hasn’t been tested with recent versions of WordPress. So that definitely got me looking for a good alternative.

My search led me to SyntaxHighlighter Evolved, which seems to be under active development and worked well in my testing. It uses a special shortcode for highlighting, which means that I’m going to have to go through all of my old code posts and replace <pre> tags with “code” tags. I did a search to find those, and apparently I only have about 40 posts on this blog with code in them. That’s a little embarrassing, considering that I have more than 2000 posts on this blog. I always want to write more programming-related posts with real code in them, but I never get around to it. Well, maybe this will motivate me.

Five months and counting

We’ve just passed the five month mark since this whole COVID-19 thing kicked into high gear. My last day in the office was Thursday March 12. I took Friday March 13 off and, at that time, wasn’t even sure if we were going to be allowed to work from home the following week. Well, we were, and I’ve been working from home since. At the end of May, it looked like we might have to come back in August. That got pushed to September, and has now been pushed to October 5. Meanwhile, I never even got a chance to clean out my desk, so it’s probably still cluttered with a desk calendar stuck at March 12, a few boxes of granola bars that likely expired a month or two ago, and random scribbled notes from whatever I was working on in March. (The wasted granola bars bother me more than they probably should.) It seems like we’ve been living in a state of denial through this whole thing, where we’re always a month away from reopening everything, but that date keeps getting pushed back.

I’ve really been missing my trips into New York to visit The Met and MoMA. The Met is supposed to be reopening on August 27 for members and August 29 for the public, and MoMA plans to open on August 27. I don’t think I’m ready to go in to New York yet though. I’m not ready to deal with NJ Transit, Newark Penn Station, the NYC subway, or all of the extra stuff that would be involved in getting into and moving through the museums. But I’m tempted to give it a try. I spent a little time last night thinking through it, but couldn’t really come up with a plan that sounded like it would be both safe and fun.

One thing that’s probably a bright spot is how well the S&P 500 is doing right now. It’s at a new record high, which should probably make me happy, given how much of my retirement money is in S&P 500 index funds. But it’s a little unnerving for some reason. Maybe I just don’t know how to process good news? Or I just don’t trust anything that looks like it might be good news?

I have a bunch of other stuff I wanted to blog about, including some tech stuff and some comic book stuff, but I should really stop now and plop myself down in front of the TV and relax for a bit.

Comic Book news, good and bad

I saw today that NYCC has finally canceled their con for this year. It had been obvious for quite some time that they’d have to do that, but I guess they had some insurance or other bureaucratic issues to deal with before they could officially announce it. I’m sad I won’t be able to go this year, since last year’s con was so much fun. (And, thinking about it, last year’s con was my last real vacation. Oh well.) They’re going to be doing some stuff similar to SDCC’s Comic-Con@Home event. They’re running something called Metaverse this weekend (Aug 13-16), but I don’t think that’s specifically meant to be an NYCC replacement. I think they’re going to do another event in October when NYCC would actually have happened.

The Metaverse event has some curious stuff going on, including “digital meet and greets” where you can pay, for instance, $137 to chat with Karen Gillan for two minutes. Or just $22 to chat with Greg Capullo for three minutes. As much as I like Karen Gillan, I don’t think I’d pay $137 for two minutes of her time. I might, though, pay $22 just to have Greg Capullo yell at me for three minutes. I’ve seen him on con panels, and he’s always high-energy and quite amusing. I could ask him to do his Todd McFarlane impression for three minutes. Or ask him to name his ten favorite metal bands. Anyway, that’s fun to think about, but I’m not going to do it. I took a look at the panel schedule, and there are a few panels I might want to watch. Not as many as there were for SDCC, but a few.

In less positive news, it looks like there was a bloodbath at DC yesterday. The comic book industry is in a strange place right now, and I wonder what the fallout from these layoffs will be. Are they going to be cancelling a bunch of titles too? My August Westfield order was for six DC books and two books from other publishers. Only two of the DC books are ongoing titles. The rest are minis or one-shots. I could easily be down to zero books pretty quickly if DC starts cutting back.

I still don’t really like the idea of giving up on monthly printed comics altogether, but it looks like I might not be able to justify buying them for much longer. I’ve been waffling on this for a long time. Coincidentally, it was two years ago today that I got my first Westfield shipment, after starting to order from them again. Between all the problems with monthly books right now, plus the ongoing problems with the postal service, it might be time to give up and go mostly-digital. It bothers me a bit to do that though, since the only (legal) place to get digital mainstream comics is Comixology, which is owned by Amazon, so I’d just be making Jeff Bezos even richer than he already is.

I should probably give up on mainstream comics altogether and just buy indie books straight from the creators. (Speaking of which: there’s a new Girl Genius graphic novel Kickstarter.)

Comfort Food

Looking at the “on this day” widget here on my blog, I see that I haven’t acknowledged my Dad and Gloria’s shared birthday in a few years, so I should go ahead and do that today. Happy birthday, Dad and Gloria! I did want to do something today to honor my Dad’s memory, but I couldn’t come up with much. I could probably have taken a drive up to the cemetery, but with the pandemic restrictions, I’m pretty sure the restrooms would be closed, and I really can’t take a drive that far without a pit stop. I guess the restrooms are open at the Turnpike service areas, so I could have managed it, but, well… I didn’t. (And maybe I’m a little afraid of the Turnpike service area restrooms…) I also noticed an entry from this day in 2004, about honoring my brother Pat’s memory.

Thinking about honoring Dad, Gloria, and Patrick gets me thinking about food: lasagna, pizza with extra cheese, rice and beans, burgers, potato salad… I’m probably going to have a small salad and a veggie burger for dinner though. Maybe I can have a beer tonight too. That’ll be something. I haven’t had much to drink at all during this pandemic. I bought a bottle of red wine in March, and had a few glasses during the first few weeks of the lockdown, but that’s been it. I still have half the bottle left. And I haven’t touched any of the beer in my fridge. I should probably toss the wine. A half-empty bottle of wine that’s been sitting out on a counter for five months is probably not worth drinking at this point. (I do have one of those vacuum caps on it, but those aren’t perfect.)

It’s probably good that I’ve been sticking to my diet and staying away from alcohol these last few months. I’ve been thinking about Tina Fey’s sheetcaking skit from SNL a bit lately. Costco stopped selling sheet cakes at the start of the pandemic, apparently, but they might be back now, at least in some stores. But I’m not going to drive to Costco and buy a sheet cake for myself. Definitely not.

I’ve been spending a lot of my weekend time reading and watching stuff that I’d put in the “comfort food” category. I’m currently watching Trollhunters on Netflix, which is a pretty predictable cartoon, and easy to binge-watch. I’ve also recently finished watching Kipo and the Age of Wonderbeasts on Netflix, which is also a fun and easily bingeable cartoon. I’ve been watching some old Bugs Bunny cartoons on DVD too. On the comic book front, I’ve been reading some fairly random stuff, most of which is pretty light reading. I started the second Complete Peanuts collection last week, for instance. Nothing says “escape from reality” like Peanuts strips from 1953!

I don’t honestly know if there’s a point to this post, but I felt I had to write one this weekend, and it’s almost 5 PM on Sunday, so I might as well get it done. I think that writing it helped me work through some stuff and amused me, if nothing else. If you’re reading this, I hope it amused you too.