Skip to content

Instantly share code, notes, and snippets.

@leonardobazico
leonardobazico / ssh-key-if-dont-exists-and-copy-gen.sh
Created October 25, 2023 14:44
Generate ssh key if doesn't exists and copy it
#!/bin/sh
KEY_PATH="$HOME/.ssh/id_rsa"; \
PRINT_PUBLIC_KEY="cat $KEY_PATH.pub "; \
GENERATE_KEY="ssh-keygen -t rsa -N '' -f $KEY_PATH"; \
COPY_KEY="$PRINT_PUBLIC_KEY | pbcopy"; \
{ sh -c $PRINT_PUBLIC_KEY || \
{ echo "Generating ssh key" && sh -c $GENERATE_KEY; }; } && \
sh -c $COPY_KEY && echo "Copied ssh key to clipboard"
# git config doc: https://git-scm.com/docs/git-config
[init]
defaultBranch = main # use main branch on init from git v2.28
[core]
attributesfile = ~/dotfiles/git/.gitattributes
editor = vim
pager = less -eFRX
autocrlf = input
@leonardobazico
leonardobazico / notes-to-evernotes.applescript
Created July 18, 2019 18:37
Export Apple Notes to Evernotes
tell application "Notes"
set myAccounts to every account
repeat with myAccount in the myAccounts
set myAccountName to the name of myAccount
set myAccountFolders to every folder of myAccount
repeat with myAccountFolder in the myAccountFolders

Keybase proof

I hereby claim:

  • I am leonardobazico on github.
  • I am lbazico (https://keybase.io/lbazico) on keybase.
  • I have a public key ASAjfshgVwpGxF5UBlQaDKIJu2MeeChjafDIBMHdccg-Xwo

To claim this, I am signing this object: