Sunday stuff, and Legend of Korra

After taking a sick day on Friday, I felt a lot better yesterday, but was still taking it pretty easy. I read some more Buffy comics, and also started watching The Legend of Korra on DVD. I thought I was even better this morning, but then had to cut my usual Sunday walk short because I started getting tired at around the 15-minute mark. So I guess today will also be mostly Buffy and Korra and hot tea and maybe a nap or two.

Avatar and Korra both started streaming on Netflix recently, so there’s been a surge of interest and popularity for both series. I’d watched Avatar some time ago, when it was streaming… somewhere. I don’t really remember. I know I didn’t watch it when it first aired, and I know I don’t have the DVD set. But I never got around to watching Korra. I got interested in it early this year, and bought the DVD set from Amazon. At the time, it wasn’t streaming anywhere that I had access to, and the DVD set was less than $20.

When Netflix got both shows, I started seeing a lot of references to them on the web, so that reminded me that I hadn’t gotten around to Korra yet, and now seemed like a good time to start watching it. Generally, there’s a dearth of new shows coming out right now, for obvious reasons, so there’s been a lot of articles and podcasts that are mining old ones. I listened to a Pop Culture Happy Hour episode on Avatar recently that was pretty good. I was going to link to a few more articles here, but one of them turned out to have a big spoiler in it for something I haven’t gotten to yet, so I think I’m going to avoid reading any more Korra articles until I’ve finished the series.

Anyway, I finished “book one” yesterday, and I’m really enjoying the series so far. It’s got a bit of a steampunk feel to it. Steampunk definitely had a peak at some point, maybe around the same time this was originally airing, so I might have rolled my eyes at it then, but now it seems kind of cool again. It’s kind of amazing what they did with this show, on what I assume must have been a fairly limited budget. I’m not sure how well it holds up over the next three seasons, but it’s well-respected enough that I assume it continues to be pretty good, at least.

sick day, more Buffy comics

I went on a Buffy comics kick back at the end of 2019, reading through Buffy seasons eight and nine, Angel & Faith season nine, and some miscellaneous one-shots and mini-series. I finished up in December, but now I’m getting back into it. At the time, the Dark Horse stuff was out of print, so it was a little hard to come by. I’d purchased a full run of Buffy season ten off eBay in December, but had just left it in my “to be read” pile, until now. Well, I’ve been feeling sick all week and finally gave in and took a sick day today. So I’m reading Buffy comics. And I’m really liking season ten.

The current holder of the Buffy license, Boom Studios, has finally started reprinting some of the Dark Horse stuff. So I can now buy Buffy seasons 11 and 12 right from Comixology. (Season 11 is on sale for 40% off right now, so I already bought that.) They’ve also reprinted Angel season 11, but, annoyingly, haven’t done Angel & Faith season 10 yet. Mind you, I have a ton of stuff from the Angel & Buffy Humble Bundle that I bought in 2016 that I still haven’t read yet, but I really want to ready Angel & Faith season 10. Both the trade paperbacks and individual issues from that run are scarce and pricey. So I guess I’m going to have to wait for it to get reprinted. (It’s funny how sometimes I can have hundreds of comics and books to read, but the one thing I want to read is the one thing I can’t get…)

Anyway, finishing Buffy season 10 will probably take me a while, and getting through that may be enough to get me off my Buffy kick again. Meanwhile, I’ll keep an eye out for Angel & Faith back issues on eBay.

Oh, and back on the subject of sick days: one nice thing about the pandemic is that I haven’t gotten a cold in six months. I guess that long run has been broken, since I seem to have something very much like a cold right now. I often get one at the change in seasons, and this week is the week when I finally switched from shorts to long pants, so I guess this is the official transition from summer to fall, so it makes sense.

Calling a SOAP WCF web service from .NET Core

I had a problem at work today that I’d previously solved, almost exactly a year ago. The project I was working on then got almost completely rewritten, so the current version of that code doesn’t have any reference to calling WCF web services at all. I kind of remembered that I’d written up a blog post about it, but couldn’t find it, since I was searching for SOAP instead of WCF. So I’m writing a new blog entry, with “SOAP” in the title, so if I have the same problem again, and I search for “SOAP” again, I’ll at least find this post, with a reference to the previous post. (Having a blog comes in handy, when your present-day self has to solve a problem that your past self has solved, but forgotten about…)

I don’t really have anything to add to that previous post. One thing I will do, though, is post the actual code here, rather than just embed a gist, since I now have a syntax highlighting solution that won’t garble it the way the previous setup did.

// https://gist.github.com/andyhuey/d67f78f6568548f66aabd20eadff8acf
// old way:
        public async Task RunAsync()
        {
            CallContext context = new CallContext();
            context.Company = "axcompany";
            string pingResp = string.Empty;
            var client = new XYZPurchInfoServiceClient();
            var rv = await client.wsPingAsync(context);
            pingResp = rv.response;
            Console.WriteLine("Ping response: {0}", pingResp);
        }
/* app.config:
    <system.serviceModel>
        <bindings>
            <netTcpBinding>
                <binding name="NetTcpBinding_XYZPurchInfoService" />
            </netTcpBinding>
        </bindings>
        <client>
            <endpoint address="net.tcp://myserver:8201/DynamicsAx/Services/XYZPurchInfoServices"
                binding="netTcpBinding" bindingConfiguration="NetTcpBinding_XYZPurchInfoService"
                contract="XYZPurchInfoSvcRef.XYZPurchInfoService" name="NetTcpBinding_XYZPurchInfoService">
                <identity>
                    <userPrincipalName value="myservice@corp.local" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
*/

// new way:
	CallContext context = new CallContext();
	context.Company = "axcompany";
	string pingResp = string.Empty;
	var client = new XYZPurchInfoServiceClient(GetBinding(), GetEndpointAddr());
	var rv = await client.wsPingAsync(context);
	pingResp = rv.response;
	Console.WriteLine("Ping response: {0}", pingResp);
	
	private NetTcpBinding GetBinding()
	{
		var netTcpBinding = new NetTcpBinding();
		netTcpBinding.Name = "NetTcpBinding_XYZPurchInfoService";
		netTcpBinding.MaxBufferSize = int.MaxValue;
		netTcpBinding.MaxReceivedMessageSize = int.MaxValue;
		return netTcpBinding;
	}

	private EndpointAddress GetEndpointAddr()
	{
		string url = "net.tcp://myserver:8201/DynamicsAx/Services/XYZPurchInfoServices";
		string user = "myservice@corp.local";

		var uri = new Uri(url);
		var epid = new UpnEndpointIdentity(user);
		var addrHdrs = new AddressHeader[0];
		var endpointAddr = new EndpointAddress(uri, epid, addrHdrs);
		return endpointAddr;
	}

six months

I’ve been thinking a lot about how we’re just hitting the six month mark on this whole COVID-19 thing here in the US. March 12 was my last day in the office. I took March 13 as a vacation day. Then, we started working from home on Monday, March 16. And my company is still working from home, with plans now to return to the office in November, with managers coming in two days a week and the rest of us coming in only one day a week. This is probably the fifth “return to office” plan we’ve had. The last one had us all returning in October, two days a week. I’m not complaining or criticizing; no one is having an easy time figuring this thing out, and I’m glad my employer hasn’t forced us to come back too early. But it seems like, through the whole pandemic, we’re always just about a month away from returning to “normal,” but we never quite get there. I’m only now really starting to see that, and thinking about things I could be doing differently, treating work from home as “normal” rather than “temporary”. So that’s all a lot of wind-up to say that I finally broke down and ordered a new USB headset for home use. (There’s still one sitting on my desk at work, but they haven’t allowed us to go back in and clean out our desks. I put in a request to do that, but I guess it’s stalled somewhere, since I haven’t gotten a response to it.)

I ordered the headset from Best Buy, since they had it in stock to ship right away, while Amazon still has a one-month wait on USB headsets, at least for the model I wanted. That turned out to be a bit dangerous, since it also led to me poking around in their Blu-ray selection, which led to me buying four Miyazaki SteelBook Blu-rays, plus the 25th Anniversary Ghost in the Shell Blu-ray SteelBook, and pre-ordering the Weathering With You Blu-ray SteelBook. I’m not particularly attached to SteelBooks, but they do look nice, and the Miyazaki ones were only $18 each. (Apparently, they’re also $18 at Amazon right now.) The Ghost in the Shell one was also only $18. Weathering With You was more expensive, but still reasonable. So now I have a bunch of new anime discs to watch. (Even though most of them are movies I’ve already seen multiple times.)

Yesterday, I watched a bit of DC FanDome and some of NCSFest. This second day of FanDome was done differently from the first day, last month, where they actually had a schedule, kind of like a real con. This time, they just dumped all the video content out there at 1 PM Eastern time, and left it up until 1 PM today. So you could watch whatever you want, whenever you want. The content was really a hodgepodge of random stuff. I’m pretty sure most of it was recorded at least a month ago. And there wasn’t really much content around the actual comic books. But I did watch a nice panel discussion with Brian Bendis, Gene Yang, and Dan Jurgens, talking about Superman. The feeling I’m getting out of DC Comics right now is that they’re really hitting the brakes on a lot of stuff and pulling back on things. I think that a lot of the FanDome content was prepared before the layoffs last month, so it’s not really reflecting the actual state of things at DC right now. I’m not really sure what DC is going to look like at the end of this year, but it’ll probably be a lot different from the way they looked at the beginning of this year, before Dan DiDio left, and COVID-19 hit, and all the layoffs happened.

NCSFest was done as one long live stream, via YouTube. They had a number of panels, interspersed with announcements of the Reuben awards. The whole nine-hour stream is available to watch on YouTube now. If you wanted to find a particular panel, I guess you could check the schedule, then do a little math and fast-forward to it. I watched a bit of the “From Panels to Publishing” panel, some of the Jim Davis panel, and some of the Mutts panel. All of them were fun to watch. Cartoonists are generally pretty cool, chill, funny people. NCS is really a professional organization, so the content isn’t necessarily geared towards fans, or towards self-promotion, more towards actual cartoonists. For me, that makes it even more fun. But if you don’t want to hear Lynn Johnston and Patrick McDonnell talking about what brand of ink they use, then it’s probably not for you.

I guess that’s my ramblings for today. There’s maybe not much value in any of this for anyone else, but writing these posts helps me get through things. Tomorrow starts another week of sitting alone in my apartment, staring at a computer screen, trying to do my job without going nuts. If random blogging about comics and anime helps, I’m going to keep doing it.

tinkering with WordPress

Just for the sake of doing something useful today, I decided to tinker with my WordPress setup a bit. I’d upgraded to WordPress 5.5 in mid-August, then updated my version of PHP from 7.3.21 to 7.4.9. And, a little later, I switched to a new syntax highlighting plugin. I had one more major thing on my to-do list: upgrading to a newer version of MySQL.

My host, IONOS, makes it easy to switch PHP versions; you can do that right in their control panel. But you can’t just switch to a new MySQL version. You have to create a new database, export you data, import it to the new database, then edit your WordPress config file to point to the new database. So I did that first on my test database, and it worked fine, so I went ahead and did it with my production database too.

It had been a long time since I’d done anything even vaguely low-level with MySQL. The IONOS control panel lists your MySQL databases and gives you a link to get to a phpMyAdmin site for each of them. From there, you can backup, restore, run queries, and so on. On my first try, I forgot that you need to edit the backup SQL to remove the “create database” command, and edit the “use” command to point to the new database. But once I figured that out, I didn’t have any problems.

My old test WordPress install takes up 19 MB in the old database and 35 MB in the new one. I’m not sure why the new version is bigger than the old version. I could probably figure that out, but it’s not really important. The max size on a MySQL database in IONOS is 1000 MB, so I’m fine there. The production blog is 60 MB in the old database and 87 MB in the new one. So if you ever wondered how much space 20 years of blog entries takes up, it’s apparently 87 MB.

I did all this on my PC, rather than my Mac, and it turns out that I didn’t have an SFTP client installed. On my Mac, I generally use Commander One for SFTP file management. On the PC, I’ve recently started using Directory Opus as an Explorer replacement. Opus includes SFTP support, but it’s an add-on purchase, and I hadn’t bothered with it when I paid for my license a few months ago. I went ahead and enabled a trial of the FTP functionality today, and it worked fine. So I’ll probably pay for it when the trial expires. It’s only $10.

The first thing I did after switching to the new database was to run a WordPress site backup with UpdraftPlus. I’ve been using UpdraftPlus for a long time. I’ve stuck with the free version, which is good enough for me. The paid version is $70, plus $42/year after the first year. That’s not bad, I guess, but I don’t really need it.

The next thing on my WordPress “rainy day” list is to maybe look into switching to a new theme. The Stargazer theme that I’ve been using since 2014 hasn’t been updated in a couple of years and is being “phased out” by its developer. He’s replacing it with something called Exhale, for which he’s charging $50/year. I don’t have a problem with that, but I’d like to stick to a free theme, if I can. (If I was actually making money off this blog, I’d be more willing to spend money on subscription themes and backup services, but this is really just a little personal blog with no revenue stream, so I like to keep things simple.)

Labor Day

So, here it is, Labor Day. If you’d told me back in March that I’d still be working from home in September, and too afraid to take NJ Transit into NYC to visit a few museums on Labor Day, I’d… well, I’d be a little depressed but I probably wouldn’t be that surprised. I didn’t initially expect this thing to last so long, but there were good reasons to suspect that it would be around at least until the end of 2020, even back in March. I was ruminating in my last post about whether or not I could talk myself into going into NYC today; I’ve definitely given up on that idea.

Walking


I’ve been going out for a morning walk nearly every day since the beginning of this thing in March. That habit has been one of the bright spots of the last several months. I’ve gotten into the habit of taking a few photos on my walks and picking one of them to save to Day One, along with a short journal entry, usually just a sentence of two. Day One tracks streaks, if you post to it every day, and my current streak is nearing 200 days. (Looking back, it appears that my current streak started on March 10, just before the pandemic lockdown.) I post about other stuff in Day One too, but I almost always start the day with a photo from my walk.

Often I just walk a circuit down Main St, up one of the side streets, then down High Street, back to Main St, and back to my front door. I can get a good 20-minute, 1-mile walk out of that. On weekends, though, I’ll often walk along the Peters Brook Greenway. I can get some nice photos along there. I took the hibiscus photo in this post yesterday morning, just about one minute before getting bitten by a mosquito. That mosquito bite bothered me a lot more than it should have. I’d gotten so used to getting into a nice relaxed state on these walks, and it’s been so long since I’ve been bitten by a mosquito, that I took it as something of a personal affront. And of course my mind started playing out all sorts of nightmare scenarios. (Can you get COVID-19 from a mosquito bite? Almost definitely not. Whew.) But I got back out there this morning and did a nice 40-minute walk along the Greenway again. This time, though, I tried to keep a little further away from the water.

Reading

I really didn’t do anything much useful yesterday, and I don’t plan on doing much today either. Yesterday, I read the “City of Bane” issues of Batman, which were the end of Tom King’s run on the title. My Goodreads review for the second half of that story nearly turned into a long essay on the Trump presidency, but I held myself back. Finishing that story got me thinking about King’s run on Batman, which started with the DC Rebirth event from the summer of 2016, which was of course just a few months before the 2016 election. That got me thinking about how much the world has changed over the last four years, and especially over the last six months. And how much it might change over the next, say, six months, or four years. I’d started reading monthly comics again in 2016 with the DC Rebirth event, and have keep reading them, though I’ve dropped Batman and Detective recently and I don’t have any titles on my current subscription list that were on it back in 2016. And I’m thinking of dropping monthly books entirely again. (But this is a subject I’ve blogged about too many times.)

Listening

Bandcamp has continued to do their Bandcamp Friday thing, where they waive their revenue share and give all the money from sales to the musicians. I last bought anything from them in June, so I was overdue to spend some money on music. I wound up spending around $75 this past Friday, buying seven albums (all digital), including something called Good Music to Avert the Collapse of American Democracy, a compilation benefiting the voting rights group Fair Fight. So I hope my $20 helps, though I’m not optimistic about the future of American democracy, to be honest.

almost the end of summer

Well, here it is, almost Labor Day, and almost six months since the COVID-19 stuff started. Things are continuing to open up a bit more. I went for a haircut on Saturday, my first since February. I’ve been trimming my own hair since then, and honestly not doing the best job. Since my regular barber decided to retire during the pandemic shutdown, I had to go to Sport Clips, which was… ok, but not really the same quality as the 80-year-old Italian barber I’ve been going to for the last 20 years. NJ has also recently allowed gyms to reopen, and will be allowing limited indoor dining starting this weekend.

I haven’t been keeping really close track of what’s going on with school reopenings, but I actually saw a crossing guard out this morning, so I guess at least some schools around here are open now, for (presumably) some in-person instruction.

The Met and MoMA are both open now. As I mentioned last month, I’ve really been missing my visits to both of those museums. Here’s a post from a year ago today, talking about a couple of my NYC museum visits from last summer. Sigh. I’m pretty sure I’m not going to try going into NYC this weekend, but I’m still toying with the idea. It’s tempting. I haven’t really done much of anything this summer, aside from work, exercise, reading, and watching TV. (Well, and sleeping and eating too, I guess.) I haven’t traveled more than 15 miles from my home since March. And I only went that far for doctor’s visits.

Here’s an article from the Washington Post, by someone who went to the Met and MoMA right after they reopened. And here’s a visitor’s guide from the NY Times, with some information on the current exhibits at the Met and MoMA, and the new rules for getting in. It looks like they’re both open Sunday and Monday (Labor Day), so… maybe I can talk myself into it. Or maybe I should just order myself copies of Making The Met, 1870–2020 and MoMA Now, and stay home and enjoy the museums from afar.

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.