the corner office : tech blog

a tech blog, by Colin Pretorius

Swap

Not read all of this yet, but came across it while reading about Linux disk encryption (and a counter to a lot of "just disable swap or set swappiness to 0" advice)

Chris Downe - In defence of swap: common misconceptions

{2019.07.07 12:16}

zerofree

Links - zeroing out unused blocks (useful for backing up and compressing virtual drives)

{2019.06.28 21:29}

HTTPS

The blog's moved over to colinpretorius.org. I wrote about it on the main blog, but one thing I didn't mention was that the blog's also served via https.

I was initially unhappy about the idea of switching to https. It went against the idea of people flinging up web pages 20 years ago and them still being served up without much cost or intervention ever since.

I changed my mind when reading the EFF's Encrypting the Web. It'd be nice if we could just serve up http and be done with it, but content injection from ISPs and the like, are enough reason to say farewell to the old world.

So, I've switched to https using Let's Encrypt and hoping nothing breaks. And also hoping the renewal cron job kicks in later this year...

{2019.06.16 16:47}

Redirects

Wow. I'm doing the final bits of prep before switching over to the new blog location. One of the things on my list was "redirects". As in, check the apache docs for how to do them and be ready to switch over the server config. I knew I'd set it up previously before but was quite surprised when I went to check my apache config on the web server.

It had this:

# virtual host config for thecorneroffice.org
# 2006.03.22 CP

<VirtualHost *>

... and then a ton of redirects for all the various flavours of urls from the older Domino versions of the blog. And server aliasing and a lot more.

That config's been copied over from server to server, hosting provider to hosting provider, and there it is, 13 years later. I have no memory of putting together all that config, no recollection that I'd once known how to do it.

I wonder how many of those old redirects still get triggered. Just looking at access logs today, I saw some web crawler requests for site urls which disappeared 4 years ago. Nothing would surprise me.

{2019.06.14 21:50}

Linux

I was going to post about something else and then realised that while approximately 0% of the world's population won't care, the tiny fraction who do (me) would be quite surprised to see me posting on my tech blog about something else, where implicit in said topic would be the fact that I'm using Linux on my desktop at home. Noone likes a continuity error ruining the story.

When I bought my PC I installed Linux (XFCE), then soon after I switched to Windows. And then at some point late last year, I decided that I really didn't want to be running Windows, that I had a hankering for something a little more interesting (eg), a little less phone-homey, a little less annoying in various subtle ways.

And so I switched to Ubuntu MATE. Having switched away from Linux once before, I was rather cautious and methodical about it. I set up a VM, and over a few weeks, migrated all aspects of my computing life to the VM. I promised myself that if I was still happily using the VM in a month, I'd switch properly. A month passed, and I was still using the VM, so I took the plunge, wiped the hard drives and switched.

That was 6 months ago, and I have no urge to return to Windows.

Good things:

  • switching was a breeze. I copied across all dotfiles from my VM, found the right incantation to get MATE to pick 'em up on the new machine, and everything was set up exactly how I wanted it.
  • I couldn't say why (18.04 versus earlier 17.x versions?), but the issues I'd had with app performance and bluetooth and the like have been largely nonexistent. Also, I've enjoyed using MATE. I wouldn't say the experience is hugely different to using XFCE, but it looks good and I'm happy with it.
  • even with the arrival of WSL, and a pretty well-tweaked Cygwin set-up, it's just so much nicer doing unix-like things on a real unix-like system. Suddenly my headaches with borg backup and random git oddities and personal scripts for doing things just went away.
  • I can actually do what I'd spoken about doing when I got this machine and installed Linux on it - allow my son to be doing his thing on the PC, with me logged in remotely from a laptop upstairs and doing my thing at the same.

Niggles and things I miss:

  • pulseaudio (the sound daemon) is a bit rubbish. I regularly need to restart/killall the processes, especially if anyone's switched users on the machine. Also, weirdly enough, just opening windows in Chromium vs Firefox (I tend to have both open all the time, for different things), can cause sound to go fuzzy.
  • there are some Windows apps I miss. Notepad++ followed me via wine (there's a snap version, but that stopped working for me at some point, and I've stuck with a vanilla wine version). Also, sad to say, apps like TortoiseGit (as much as people love to hate it, there are some use cases like rebasing and cherry-picking where it's still the best tool for the job) and WinMerge don't really have decent Linux equivalents.

... and now I've forgotten whatever I was originally planning to write about.

{2019.05.19 14:43}

.Net 5

Microsoft has announced .Net 5.

I've been using C# and F# at work for years now, but it's taken some time for me to start favouring .Net at home. These days though it's solid on Linux, the tooling is decent, and as much as I prefer Kotlin over Java for my Java-based projects, I prefer F# (or falling back to C#) over Kotlin for new projects and tinkerings.

I was reading old posts on Miguel de Icaza's blog the other day and remembered how much the open source world hated .Net in the early 00's, and how distrustful everyone was of Microsoft. At the time that wasn't an irrational position. In the end Mono didn't end up being some evil destroy-Linux trojan, and these days .Net Core is open-sourced, everything happens on github, and nobody worries about evil Microsoft planning to shake everyone down eventually (cf. Java). It's ironic how much Microsoft aren't the bad guys anymore.

{2019.05.06 17:51}

Caja File Sorting

I've been playing with MATE. Long story.

Caja does clever sorting of directories and files, so if you have a directory with an underscore, a la _todo, then Caja just sorts it inline. The reason I put the underscore there in the first place is to list it at the top. This annoyed me 10 years ago with Nautilus, has annoyed me regularly with Thunar, and annoyed me enough tonight with Caja to see if I could fix it.

Upshot: you can indeed fix it, by putting export LC_COLLATE=C into .profile.

Details: Caja sort order relies on the LC_COLLATE environment variable to determine sort order. The fancy sorting comes from the standard UTF_8 setting. Setting LC_COLLATE=C gives the more obvious strcmp() style sorting. This is covered in eg. this SO post and a few others.

The messy part was finding out where to set the environment variable. Some places which don't work:

  • .bashrc works for console sorting, where the same issue was happening, but not for Caja.
  • .gnomerc was mentioned in a few older online posts, but MATE no longer reads this.
  • I also saw mention of setting this in /etc/profile.d but that seems like overkill.

Update: after all that I discovered that setting the locale this way causes files and directories which start with capital letters to come before all files and directories starting with punctuation and lower-case. Grrr.

{2018.09.26 22:39}

Linux Desktops circa 2018

I spend most of my time in Windows but I do have a couple of Linux VMs which I fire up as and when I want/need them. I switched to Xfce when Ubuntu came out with Unity, and it's served me well ever since.

But I do like to look and play around occasionally. I was feeling a bit bored tonight and wasted a few hours playing around with the latest and greatest in Linux desktops.

  • (worth throwing in that I fired up a live DVD of the latest Ubuntu recently. Don't like Gnome 3 at all. Just no.)

  • I read about elementary OS and Pantheon. I installed it. I didn't like it either. Same thing. I don't like the dock on the bottom of the screen and the top of the screen seems a waste with a few widgetey things and the 'Activities' menu (iirc). No right-click on the desktop. Just no.

  • I installed Ubuntu MATE and Mint MATE. I tried Mint in 2012, fell out of love with it very quickly for some reason, and haven't made friends with it since. What about MATE itself? I liked it, it feels old-Gnomish (which is rather the point). At rest Mint used about 600MB and Ubuntu used about 660MB. I liked the feel of Mint slightly more (menu set-up etc), but there wasn't much between them. I could probably use and get to like MATE.

  • I tried Solus Budgie but didn't get far. The installer didn't give English UK as an option, and the interface felt a bit sluggish (moreso than others). I saw it was Gnome/Unity-ish from the outset, so didn't bother going further.

  • finally, I tried Bhodi Linux, which provides a fork of Enlightenment called Moksha. I installed it. The interface is interesting, with mouse pointers lighting up and the like. You get a sense that you could get into a parallel world of interesting user experience if you gave it the time. But... no.

{2018.09.15 23:40}

My PowerBook Time Capsule

I started up my old PowerBook 520C recently, for the first time in many, many years. It warrants a write-up which I'll probably never get around to, but the tl;dr is that I got it all started up again and connected to my PC via an Ethernet adapter I got on eBay a few years ago.

I stopped using this Mac late 1997, when it got replaced by a 200MMX at home. I loved my old Mac (as just about everyone did who used one at the time), but it's the last Mac I ever used.

Starting it up and using it again (even if just to Stuff all my old files and FTP them up my PC), was a blast from the past. I'd forgotten quite what the experience was like. I have no idea whether using a modern Mac is anything like this, but these were some of the things I'd forgotten about:

  • The Wastebasket bloats when you delete files, and then shrinks back when you empty it. (UK English I presume, the US version per my newly set up Mac emulator calls it 'Trash'). Incidentally, it's on the bottom right corner of the screen and to this day, one of the first things I do when using a new PC is move the Recycle Bin (just realised it's called 'Rubbish Bin' on Win10) to the bottom right corner.

  • Icons. Yes, you can set custom icons for files and folders in Windows, but I remember it being easy and commonplace on the Mac, and the icons were always so beautiful. I even designed a few of my own (not as beautiful). It's been ages since I bothered with icons and icon themes in Windows or Linux, though I remember doing it with old Win95 and Win98 machines (invariably trying to make them look more Mac-like).

  • Put Away - the desktop metaphor was that you dragged a file or folder onto your desktop (which didn't exactly move or copy it), and then there was a Put Away command to move it back to its original location when you were done.

  • The menu bar at the top is per-app, not per window. I'd forgotten what that was like. I remember being frustrated when I first switched to Windows (and Linux desktops). You had to move your mouse to the menu bar of the particular window, which required more precision, rather than just shunting the mouse to the top of the screen. Now I don't think twice about it, and working with the Mac, found myself annoyed about having to move the mouse so far away from the window I was working in.

  • No task bar to minimise to. You could 'hide' the app, but double-clicking on the title bar just turned it into a ribbon.

  • Extensions (features/widgets) were easy to add or remove - you just put them in an Extensions folder.

  • Old screen savers! Flying Toasters, Fish! and a heap of others.

  • StuffIt and Drop Stuff and friends. I started one of these apps and it moaned at me in a big red font that I had been using the Shareware for OVER A YEAR and it was time for me to pay for it. Make that 20 years, sorry! A quick Google shows that Aladdin Systems, which made StuffIt, got renamed and bought out ages ago and is now run by a small software company. Wikipedia and the Internet don't remember StuffIt with its proprietary format kindly, and given the hassle I've had trying to get these opened outside of the Mac I feel the same way.

  • Fetch for FTP (I'm uploading all my files to back them up). I see they're still going. Good for them!

  • Archie and Gopher. Long dead. Usenet? Mostly-dead? And Ircle. As of now, dead with a poll about whether it should return. When last did I use IRC? 2000, maybe 2001 at a stretch?

  • Netscape Navigator 2.01. When I got my PowerBook, it had Netscape 1.0, but I almost immediately downloaded NN 2. NN 3 came out, but it was a bit too resource-hungry for the PowerBook so I stuck with version 2.

  • Folders and file labelling. You could make a folder green, or add a blue tinge to an existing icon, say.

  • I forgot that unlike Windows machines, Macs (or at the least, my PowerBook) didn't have an eject button for floppy disks (in SA we called them stiffy disks to differentiate from the original really-floppy disks, I learned later we were about the only people who did). Instead, you could Put it Away, or you could drag it to the trash to eject it. I'm not sure that was the greatest desktop metaphor, but anyway.

{2018.08.11 08:07}

Windows Command Line Backgrounder

In-depth blog series about the Windows Command Line

{2018.07.25 21:09}

« Older