Wednesday, November 11, 2020

gpg create key pairs

Reference: https://www.howtogeek.com/427982/how-to-encrypt-and-decrypt-files-with-gpg-on-linux/

Create gpg rings on both sides: you and your client
# List existing keys
gpg --list-keys
# Generate new key
--full-generate-key might not be available in your environment, in the case, you can use --gen-key instead.
$ gpg --full-generate-key
$ gpg --list-keys
# Export private and public keys
gpg --export-secret-key -a "<uid>" > myprivate.key
$ gpg --export --output fei.asc -armor <pub id>
# Export public key in ssh key
gpg --export-ssh-key  <pub id>! 
gpg --export-ssh-key  6352600EF7A9D369A20FF584739E316C0B08E9A5!
gpg --edit-key "user id"


ModuleNotFoundError: No module named 'yaml'

Task:

$ ansible-galaxy init myrole

Problem: 

ModuleNotFoundError: No module named 'yaml'


Solution:

$ pip3 list pyyaml

$ pip3 install pyyaml


Set environment variable PYTHONUSERBASE

$ export PYTHONUSERBASE=/Users/aniu/Library/Python/3.7

$ python3 -m site --user-site

/Users/aniu/Library/Python/3.7/lib/python/site-packages

Friday, November 6, 2020

Mac to erase ubuntu bootable usb

$ gpt destroy /dev/disk2

gpt destroy: unable to open device '/dev/disk2': Permission denied 

Grant full access to terminal in Security and Privacy:



Format the disk with diskutil

$ diskutil zeroDisk /dev/disk2