Still getting mail from a leaked database

Internet

A famous pizza chain in Australia had their customer account database stolen a few years ago. I was living in Mascot with Clara at the time, a suburb just south of Sydney. I was lucky that I never use my real name on these services, and I use one-off passwords with KeePassXC which you should also use because its great.

Years later I still get regular emails like this:

Subject: Jeff, Mascot?

Jeff
are you in Mascot?

These kinds of social engineering attacks are far more dangerous than general spam. Your location is a piece of information an attacker would need to know in advance, which unsuspecting or trusting email users could interpret as adding legitimacy. Like my hat.

A related, widely-discussed scam involves sending a leaked password you once used to scare you into sending them money:

Some time ago your computer was infected with my private software, RAT (Remote Administration Tool). I know your password is ce#Dz!7oy]m(Fc$. My malware gave me access to all your accounts, contacts and it was possible to spy on you over your webcam.

This is unrelated, but I thought it was funny that my long passphrase of gibberish was truncated with the first dollar sign. Some suspect scammer’s software must have alliterated parsed it as regex.

Next time you have another video call or catchup with family, it might be a great opportunity to bring up what they know about email and web scams. Education is our best defence against these kinds of attacks. Attackers making mistakes may be #2.


Bringing my own git in-house

Software

GitHub generated a lot of positive press for their renaming of Master branches to Main. I think they missed an opportunity to call it Trunk, but either way it’s an entirely hollow gesture for those of us who care about human dignity and rights.

Regardless of where you stand there though, this has reminded me that I need to bring more stuff in-house. Hosting your own git on a cloud instance or VPS is fairly simple with tools like Gitea, though I’m thinking of just using straight-up git with GitWeb for publishing a web frontend for others to view. I don’t need pull requests and other workflow tools for my personal projects, and GitWeb would give people visibility.

It’s also got me thinking about where Subversion fits. I still prefer it for some reasons among others, but with FreeBSD potentially moving to git (IIRC), and almost all of my work being git now, dare I say it makes sense to standardise on it and make my life easier. The site you’re reading now has been on git since I moved off WordPress five seven years ago, as too are my dotfile configs and lunchbox.

Now that I think about it, all my public-facing repos and work are on git, either from the start or having been migrated from hg. It’s my private stuff that’s on Subversion. Maybe that could be a useful separation to maintain.


Making better tea

Thoughts

Screenshot showing the scientist and journalist in a lab with a mass spectrometer

The BBC ran a video last year about how we all drink tea wrong. Normally I give clickbaity titles like this a hard pass, but I watched it in a moment of weakness and found it surprisingly interesting. Unlike so many of these you’re living life wrong videos, it had science to back its claims.

These were their steps to improving your tea:

  • Use a ceramic or glass mug, not plastic. Styrofoam especially absorbs flavour. Drink it out of a red mug if you find tea too bitter, because psychologically we perceive red as being ripe and sweet.

  • Filter your water. Hard water leads to scum, especially with milk, which removes flavour.

  • Steep for five minutes. That extra time allows more antioxidants, flavour molecules, and caffeine to be released from a given bag.

I also appreciated that they started with a reference to loose leaf, but went to discussing teabags given most people in the real world use them. Now all they need to do is avoid the milk!


Feedback on Markdown’s square brackets

Software

I thought I’d cop flack for my ARM Mac post, but I’ve had more comments about my reservations on Markdown brackets. These were in my inbox on the weekend, starting with Gabriel S:

I thought that was just me!

And Hales:

Yes. Definitely yes. Round brackets for the roundy human bit, square brackets for the squarey computer bit.

Hales also mentioned how MediaWiki does external links with a single square bracket around the human link and the URL, which I agree is much easier. He also mentioned Textile, which I remember back when my blog was briefly on TextPattern.

And finally, HLA quoted a portion of the post with a 👍. Thanks!

I haven’t committed to it yet, but I’m thinking as part of learning emacs—or even if I decide to stick with Vim for everything—I might try and set up some macros to do inline HTML for me as I did in the old days.


Markdown links have brackets backwards

Software

Markdown has so many frustrating limitations, undefined behaviours, and incompatible implementations, but its utility just outweighs it all to still be useful in certain circumstances.

The order of link elements have always seemed backwards to me. This is a Markown link:

[link text](target "description")

And here’s the equivilent HTML anchor:

<a title="description" href="target">link text</a>

Markdown is supposed to be human readable, so I agree that it makes it more sense to read the text for a link before its URL. We could debate all day about how XML/SGML got the order wrong where it should have put the URL and other attributes in the closing element, not the opening.

But to me, Markdown square brackets look mechanical and robotic, and rounded brackets look natural and human. So the machine code—aka, the URL—should be in the square brackets, and the human part should be in the rounded ones:

(link text)[target "description"]

I still instinctively reach for round brackets to start links like this, despite having written Markdown for more than a decade. It just makes more visual sense. Maybe I could start my own flavour called Common(Sense)MarkII.

While I’m here, I’ve since learned that American English refers to rounded brackets as parentheses. For a language seemingly hell-bent on dropping letters from colourful, flavourful words, it seems strange that an entirely new and superflous one would be invented and used. I guess that’s the great thing about English, nowhere does it make sense.


ARM Macs (but RISC-V would be cooler)

Hardware

The rumours of an ARM-based Mac have only been getting louder with WWDC approaching. Old rumours have been reheated and served as fresh news, and pundits have worked themselves into a lather unlike anything I’ve seen in a while. It’s not the first architecture transition for many of us in the ecosystem, but while there are superficial similarities between Motorola to PowerPC, and PowerPC to Intel, there’s enough unique about this situation to be interesting.

I forgot that my earliest blog posts here were written on my beloved old iBook G3. It was the first machine I ran Mac OS X, FreeBSD, and NetBSD on, the latter two in part because their PowerPC support was so great. Two years later in 2006, I was writing about downloading universal binaries from Mozilla for my shiny new first-generation Intel MacBook Pro. That screenshot of Camino takes me back.

The PowerPC to Intel transition, and Apple’s handling of it, offered four compelling changes:

  1. Better performance. Intel’s CPUs were faster by that stage, but more importantly they offered better performance-per-watt. I also had a PowerPC G5 tower, but by that stage it had become obvious an equivalent PowerBook wasn’t feasible. Intel’s CPU roadmap also looked more assured.

  2. Instant access to PC software and games. We weren’t stuck with slow Virtual PC anymore, we could hack our machines to dual-boot into Windows when we needed to. I was so excited to beta test the first versions of Parallels Desktop and VMware Fusion. And eventually, Apple officially offered Boot Camp in 2006.

  3. Easier software porting. Games especially benefited from this.

  4. Decent (enough) compatibility. Universal binaries meant you didn’t have to worry about new software being compatible. Rosetta could also dynamically translate PowerPC to Intel fairly well, given how much faster the Intel silicon was. Four years later, and PowerPC started to disappear.

There’s every reason to believe an ARM-based Mac would offer all of the same benefits that Intel offered in point 1) above. Apple’s phones have the fastest CPUs in the industry, and the performance-per-watt could offer iPad-like battery life and performance in a Mac, for those of us who don’t like tablets.

The other points, perhaps selfishly, worry me.

Is there sufficient performance headroom on ARM to offer an amd64 translation layer that wouldn’t be so slow as to be practically useless? Would Apple even offer one? Will it only accelerate macOS’s devolution into a platform to run horrible Electron apps, or poorly-ported software from iOS?

A big part of the Mac value proposition for me was the fact I could use the desktop with which I was most familiar and enjoyed using, but could drop to PC land for a specific Windows tool or game. Yes I could use another dedicated PC that would sit there taking up space 90% of the time, but that’s another machine I have to maintain and keep in a tiny apartment. You also lose portability and convenience, something that nay gets a mention when someone brings it up.

Despite the architecture being more splintered than amd64, it’s easy to see the future is ARM. The Pinebook Pro is the most compelling hardware I’ve seen in a while. I like playing world-building and simulation games sometimes. And yes, I still prefer macOS to Windows or other *nix desktops. Reconciling these increasingly-conflicting needs in one machine to do it all perhaps says more about me than a CPU transition.

My daily carry is already a Panasonic Let’s Note running FreeBSD, and I already offload as much as I can to my FreeBSD and NetBSD Microservers, and FreeBSD and Linux in cloud instances. I suspect the game machine I was going to get rid of might end up sticking around; I’ll just have to clean the dust off and wait for Windows Update each month I turn it on.

Part of me wishes that if they were going to ditch amd64, they’d go full hog and announce iOS and macOS on RISC-V. They’ve done more unpredictable stuff before!


Rubenerd Show 411: The FreeBSD cat(1) episode

Show

Rubenerd Show 411

Podcast: Play in new window | Download

28:45 – A discussion about feline creatures liking me despite having never owned one… turned into a rant about desktop software quality, remembering Wintel and desktop Java, running OpenZFS on FreeBSD and NetBSD with cgd, BSD on an iBook back in the day, being burned by btrfs, BSDCan comments about home labs now being production, and wandering outside in beautifully-mild winter weather.

Recorded in Sydney, Australia. Licence for this track: Creative Commons Attribution 3.0. Attribution: Ruben Schade.

Released June 2020 on The Overnightscape Underground, an Internet talk radio channel focusing on a freeform monologue style, with diverse and fascinating hosts; this one notwithstanding.

Subscribe with iTunes, Pocket Casts, Overcast or add this feed to your podcast client.


Text::Template as a Perl Jinja alternative

Software

Ruben likes
Programming Perl

The Camel Book was my first *nix programming tome, so even after all these years I couldn’t resist making a terrible CSS omage to it! But I digress.

Jinja2 is Python’s killer app for me. I’m familiar enough with it from using Ansible scripts and internal work projects, but I’d be the first to admit I only know enough Python to be dangerous. What I’d love is something with similar flexibility and syntax, but using Perl data structures with which I’m more familiar.

I’ve been playing around with Text::Template by Michael Schout, and so far it does everything I want. It has substitution, easy iterators, and inline code blocks. You can use it to create everything from mail merged forms to fully-blown website templates.

Here’s a simple example of a hash being passed to a template:

#!/usr/bin/env perl    
    
use strict;
use warnings;
use 5.016;
use Text::Template;
binmode(STDOUT, ":utf8");    
    
## An example data structure
my %data(
    name    => 'Kenny Rogers',
    message => 'when to hold it, when to fold it...'
);    
    
## Create a template
my $template = Text::Template->new(
    ENCODING => 'UTF-8',
    SOURCE   => 'my-template.tmpl',
    TYPE     => 'FILE'
) or die "Can't parse template: $Text::Template::ERROR\n";
    
## Pass hash to template and print
my $page = $template->fill_in(HASH => \%data);
say $page;

And the template:

Hello {$name}, you told me: {$message}.

Nice! And I can already see how this would integrate with a Moose program. meta::cpan has more details.


COVID resources from our building’s strata

Thoughts

This came from a pamphlet distributed to everyone in our apartment building. Some of this would only be specific to Australia, but I’m passing on in case it’s useful.

Looking after your health and well-being during COVID-19

These are unprecedented times and it is normal to experience a wide range of feelings and emotions. When we experience concern for our own and for others well-being, it is import to acknowledge that these are natural and common reactions:

  • Irritability and trouble reliaxing
  • Feelings of stress and confusion
  • Nervosness and concer
  • A racing mind with many thoughts at once
  • Eagerness to help
  • Restlessnes and disturbed sleep

While responeses are likely to affect everyone in different ways, looking after our well-being during this time can help to reduce the level of stress and help us to feel calmer.

Tips and strategies for looking after yourself

Acknowledge your feelings and focus on daily self-care habits to support a healthy mind and body:

  • Eat a range of healthy foods and maintain a balanced diet

  • Connect with loved ones and those you care about

  • To help manage stress and anxiety start a daily mindfullness practice. For tips and tricks, visit happify.com or mindful.org.

  • Maintain your exercise routine: even 30 minutes of movement per day will help your well-being

  • Minimise alcohil consumption

  • Unplug now and then: aim to get the news you need and not much more

  • Maintaining a routine with some fun and interesting activities will help keep thoughts and feelings healthy.

Support guide


Installing pkgsrc fonts on macOS

Software

NetBSD’s pkgsrc is a cross-platform package manager I use wherever I can, including my Macs and Linux machines. It works out of the box for most things, but macOS searches for fonts in a different place. It also doesn’t seem to pick up on symlinks, so you can’t just link the pkgsrc version to the macOS fonts folder.

The cleanest workaround I’ve found is to create a new pkgsrc folder:

# mkdir /Library/Fonts/pkgsrc/ 

Then copy the required fonts over after installing:

# pkgin install Code-New-Roman
# cp /opt/pkg/share/fonts/X11/OTF/* /Library/Fonts/pkgsrc/
# cp /opt/pkg/share/fonts/X11/TTF/* /Library/Fonts/pkgsrc/

Part of the reason for using pkgsrc over Homebrew is you get a system-wide install in /opt by default. But you can replace target with ~/Library/Fonts if you only want to install for the local user.