Skip to content

Instantly share code, notes, and snippets.

View miquelbrazil's full-sized avatar

Miquel Brazil miquelbrazil

View GitHub Profile
@miquelbrazil
miquelbrazil / prodoc-transfer.sh
Created October 20, 2020 13:52
CLI snippet for batch transferring ProDocs to DigitalOcean Spaces using rClone
ls ~/Downloads/clv_jobs | head -10000 $1 | while read x; do find "$HOME/Downloads/clv_jobs/$x" -type f -execdir echo "$x/{}" \; ; done | rclone move --files-from - ~/Downloads/clv_jobs/ clv-prodocs:clv.prodocs/job --delete-empty-src-dirs -vP
@miquelbrazil
miquelbrazil / .zshrc
Created June 28, 2020 17:29
ZSH Configuration
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
source /usr/local/share/antigen/antigen.zsh
antigen use oh-my-zsh

Keybase proof

I hereby claim:

  • I am miquelbrazil on github.
  • I am miquelbrazil (https://keybase.io/miquelbrazil) on keybase.
  • I have a public key ASBkxtbL0jZWZEjVB6Uj6fox_jbKEwFU2QycgLp4IBN8tQo

To claim this, I am signing this object:

@miquelbrazil
miquelbrazil / setup-ssh.sh
Last active June 11, 2020 15:23
Setup persistent SSH key in GitHub Action using a passphrase protected private key and without writing decrypted key to disk
# SSH Setup for GitHub Actions `run` keyword
# Previous Approaches
# Most pre-built GitHub Actions for CD with SSH keys don't allow for encrypted SSH keys.
# Current Approach
mkdir -p ~/.ssh
ssh-keyscan -H $HOST >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
openssl rsa -in - <<< "${{ secrets.SSH_PRIVATE_KEY }}" -passin pass:${{ secrets.SSH_PASSPHRASE }} | ssh-add -
@miquelbrazil
miquelbrazil / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console