Install BitDefender on Linux / Ubuntu

I recently needed to install BitDefender on a Linux VM devbox. There doesn’t seem to be any up to date instructions on the web, so here’s what worked for me.

In the terminal:

sudo su
vim /etc/apt/sources.list

Add this line:

deb [trusted=yes] bitdefender non-free

Save and close the file. (:wq)

To sign the repo and install the software:

apt-key add bd.key.asc

apt-get update
apt install install bitdefender-scanner-gui

BitDefender can now be run from the Desktop.

“xz: Cannot exec” error when installing d12frosted/emacs-plus on homebrew

I want to try DoomEmacs as a scratchpad for quick notes while I’m working. I’m using the excellent FromScratch at the moment but I’m missing vim keybinds. As they say, after learning vim, any other text modality is like walking with a rock in your shoe.

I use this guide from Ethan Anderson and hit an error “xz: Cannot exec” when installing emacs-plus.

➜ arch -arm64 brew install emacs-plus
tar (child): xz: Cannot exec: No such file or directory

This error means that the required xz compression binaries aren’t installed on my machine. The easy fix is to install them using:

➜ arch -arm64 brew install xz 

I can now install emacs-plus successfully:

➜ arch -arm64 brew install emacs-plus

Full error trace

Full error trace

==> Installing d12frosted/emacs-plus/[email protected]
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/user/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz --directory /private/tmp/d20220818-3136-cvxxsn` exited with 2. Here's the output:
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Fix incorrect GIT author for multiple commits

I have separate GIT identities for my personal and client coding, and sometimes I’ve been working on a new codebase for a while under the wrong identity without noticing. This can be super fiddly to fix on a per-commit basis with the command line.

Here is a blunt-force way to change ALL of your personal commits to match your work account, without affecting other contributor history. ALWAYS make a copy of your project folder before attempting this kind of surgery as it can blat your entire repo history.

➜ git config
[email protected] # oops wrong identity
➜ git config "My Name"
➜ git config "[email protected]"
➜ git filter-branch --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ]; then [email protected]; GIT_AUTHOR_NAME="My Name"; GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL; GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; fi' -- --all

(read the scary warning and press <enter>)

Proceeding with filter-branch…
Rewrite 0ba49ecf8d03eacdbe082cbc6616c528efa7e839 (2263/2268) (164 seconds passed, remaining 0 predicted)
Ref 'refs/heads/develop' was rewritten
Ref 'refs/heads/feature/my-feature' was rewritten

I recommend immediately pushing to your remote repo and checking that the commit history looks ok so you can roll back if needed.

Git: fix secondary ssh key unable to access repo (MFA code problem)

The Problem

For some reason after enabling MFA on my secondary (work) GitHub account, I occasionally get a “broken” SSH key loaded into ssh-agent, possibly after entering an incorrect MFA code during my .bashrc login process in terminal.

When attempting to interact with a git repo using the secondary SSH key, access is denied.

The error from git is factual but not helpful:

> git pull
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The Fix

A reliable solution is to clear out all SSH keys from ssh-agent and re-add:

> ssh-add -D
> ssh-add -K ~/.ssh/customkeyname-id_rsa

Eventually I’ll troubleshoot the underlying issue but for now this fix is good enough.