Skip to content

Instantly share code, notes, and snippets.

View LosAlamosAl's full-sized avatar

Allen McPherson LosAlamosAl

View GitHub Profile
@LosAlamosAl
LosAlamosAl / create-delete-branches.md
Created July 18, 2023 23:37
Create and delete Git(Hub) branches

Create a new local branch and push to remote (GitHub)

git checkout -b 1/delete-leftover-cruft
git push -u origin 1/delete-leftover-cruft

Delete local and remote (GitHub) branch

git branch -d 1/delete-leftover-cruft
git push origin -d 1/delete-leftover-cruft
@LosAlamosAl
LosAlamosAl / persist-zsh-vscode.md
Created January 12, 2022 00:58
Persist ZSH history in VSCode

By default, shell hsitory is not persistent across VSCode remote container restarts. To persist, a local (in the container) .zsh_history file must be makked to a file on the host computer. To do this you need to select a unique name to map the local file to. Here is how I do it in my .devcontainer file (only relevant lines shown):

{
    "name": "AWS Development (aws-dev)",
                              ^^^^       this will be the unique name of the history file on the local machine
    "mounts": [
        "source=${env:HOME}${env:USERPROFILE}/.vscode-zsh-hists/aws-dev.zsh_history,target=/home/devboy/.zsh_history,type=bind"
                                                                ^^^^     here's where the mapping occurs
    ]
}

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@LosAlamosAl
LosAlamosAl / dreamhost-deploy.md
Last active October 17, 2023 07:20
Deploy a GitHub-based static site to Dreamhost

Before begining, make sure your SSH keys are set so you can ssh to your Dreamhost account.

$ ssh-copy-id -i ~/.ssh/id_rsa.pub xxxxxx@cloverdale.dreamhost.com
(you'll need xxxxxx's password here)
$ ssh xxxxxx@cloverdale.dreamhost.com

On the Dreamhost server you should have a directory for your site (e.g. adubdub.com or ispeed.honeyimlost.com (if not, you'll need to make one). You now need to make a git repository for that site (at the same level in the tree) and initialize a bare repo:

In order to PGP sign GitHub commits we need to:

  1. Install GnuPG via brew install gnupg
  2. Add export GPG_TTY=$(tty) to .zshrc
  3. Create keys and add to GitHub
  4. Test gpg: echo "test" | gpg --clearsign
  5. Tell git (locally) about stuff or it screws up:
  6. gpg --list-secret-keys --keyid-format LONG
  7. Grab the long hex key and git config user.signingKey A...
  8. Tell git where pgp command is: git config gpg.program gpg Why?
@LosAlamosAl
LosAlamosAl / .zshrc
Last active August 13, 2021 20:45
My ZSH configuration file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="sunrise"
#ZSH_THEME="blinks"
#ZSH_THEME="random"