Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active April 7, 2022 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Integralist/05e5415de6743e66b112574a1a5c1970 to your computer and use it in GitHub Desktop.
Save Integralist/05e5415de6743e66b112574a1a5c1970 to your computer and use it in GitHub Desktop.
[New Laptop Configuration: Summary] #new #laptop #configuration #macos

Backup

cd ~/
mkdir /tmp/keys
gpg --export-secret-keys --armor <NAME> > /tmp/keys/<NAME>.asc
gpg --symmetric /tmp/keys/<NAME>.asc
gpg --export-ownertrust > /tmp/keys/trustdb.txt 

zip -r /tmp/sshbackup ~/.ssh/
unzip -l /tmp/sshbackup.zip

Restore

mkdir /tmp/keys
cd /tmp/keys

gpg --symmetric --decrypt /tmp/keys/<NAME>.gpg
gpg —-import /tmp/keys/<NAME>.asc

rm ~/.gnupg/trustdb.gpg
gpg --import-ownertrust < /tmp/keys/trustdb.txt

gpg --symmetric --decrypt /tmp/keys/sshbackup.zip.gpg
unzip /tmp/keys/sshbackup.zip
mv /tmp/keys/.ssh/ ~/

rm -rf /tmp/keys

Steps

NOTE:

Encrypt/Decrypt files...

Encrypt: gpg --encrypt -r Pass --output ~/encrypted.png.gpg ~/example.png
Decrypt: gpg --decrypt --output ~/example.png ~/encrypted.png.gpg

OTP...

Generate from QRCode image: zbarimg -q --raw example.png | pass otp insert Foo/otp/example
Usage: pass otp -c Foo/otp/example

  • Vim
    • mkdir -p ~/Code/ && cd ~/Code
    • git clone https://github.com/vim/vim.git
    • cd vim
    • make clean distclean
    • ./configure --with-features=huge --enable-multibyte --enable-rubyinterp=yes --enable-python3interp=yes --with-python3-command=/Users/integralist/.pyenv/shims/python --enable-perlinterp=yes --enable-luainterp=yes --enable-gui=gtk2 --enable-cscope --prefix=/usr/local
    • make && make install
    • curl -sfLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    • :PlugInstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment