Caddy and Cloudflare make it easy to get TLS certificates for your homelab. In this blog post I will walk you through how to set up Caddy and Cloudflare for automated TLS!
4 posts tagged with "command line"
View All TagsHow to use 1Password for Secrets in ~/.bashrc or ~/.zshrc
1Password is a password manager. Over the years, I have tried LastPass, BitWarden, and 1Password. Out of the three, 1Password has been my favourite. The Mac app, browser extension, and IOS app are well-polished. One of my favourite parts about 1Password is the ability to access passwords using the 1Password CLI.
Using op inject
for secrets
I recently discovered a pattern to use the 1Password CLI to store all of my secrets in my dotfiles:
# ~/.zshrc
op inject --in-file "${HOME}/.dotfiles/secrets.zsh" | while read -r line; do
eval "$line"
done
# ~/.dotfiles/secrets.zsh
export NOTION_API_KEY="op://private/notion.so/api-token"
export TEST_PYPI_TOKEN="op://private/test.pypi.org/token"
How to Send and Execute Code from The Editor to Terminal in VS Code
VS Code has a built in feature that allows you to send code directly from the editor to the terminal. By default, it is not assigned to any shortcut. You can assign it to a shortcut by adding the following to your keybindings.json
file.
- Open the command pallet using cmd + shift + p.
- Type
Preferences: Open Keyboard Shortcuts (JSON)
- Then edit the
keybindings.json
file:
[
// Send selected bash code to terminal
{
"key": "shift+enter",
"command": "workbench.action.terminal.runSelectedText",
"when": "editorTextFocus && !findInputFocussed && !replaceInputFocussed && editorLangId == 'shellscript'"
}
]
The when
key ensures that this shortcut is only active when you are working on a Shell Script file. Here is an example of the shortcut in action.
How to Open GitHub.com Repo from the Command Line
During my Masters of Data Science I was often working on many GitHub repos at the same time. Most of our homework was graded on GitHub.com, so it was important to ensure that after pushing my local repo to GitHub.com that everything rendered correctly.