Happy New Years everyone, some quick notes on things I’ve fixed in the last two days. Nice to really clean things up.
If you lose your 1Password
Well, Paul lost access to his 1Password (brand new) and also to a 2FA’ed Google Workspace. Here are the notes about how this doesn’t happen to you:
- It is a pain but when setting up 1Password, you want this to happen on at least two and preferably devices, so if you get locked out of one, then you are in another. That typically is your phone, iPad and PC.
- You will need a place to store the 2FA authentication for 1Password, so you can use Apple Passwords if you are on that, or Twilio Authy if want to be cross platform.
- To prevent lockouts on Google, you need to do a few things, first of all create a 2FA in your security area and create in 1Password find the item and then Edit > Add New Item > One-Time Password. And get the string of letters and paste it there. This will give you the 2FA in 1Password. Note that you can also paste into Authy or Passwords if you want some additional backups.
- Do the same with the Backup Codes
Untangle Python venv with asdf direnv
There are a zillion ways to do this, but I find that combining asdf and direnv which gives you per directory environments with asdf which manages versions the easiest way for any language. It is a little complicated to setup, but you first install with brew install asdf direnv
and then do a asdf install direnv
to get the direnv plugin. Then in your home directory do asdf direnv local python 3.11
for instance to get python 3.11 for all your personal directories.
It is a bit technical what happens, but basically, with asdf alone, you go through a pretty complex and slow process of looking through shims, but asdf direnv as a plugin makes this instant as it uses direnv to make this happen.
If you are using home-brew and hate asdf and direnv, the easiest thing to do is brew install python@3.11
or whatever is the stable version, otherwise you are going to be using some bleeding edge thing. This installed a link to python3
but not python
so add an alias in your .bashrc or .zshrc that does an alias if python is not there and python3 is with if ! command -v python >/dev/null && command --v python3 >/dev/null; then alias python=python3
and you will pick up the home-brew default.
Leave a Reply