diff --git a/docker/config.json b/docker/config.json index faf515b..dabba2a 100644 --- a/docker/config.json +++ b/docker/config.json @@ -1,28 +1,21 @@ { - "experimental" : "disabled", - "stackOrchestrator" : "swarm", - "credHelpers" : { + "auths": { + "gcr.io": {}, + "ghcr.io": {}, + "https://index.docker.io/v1/": {} + }, + "credsStore": "desktop", + "credHelpers": { + "194055617947.dkr.ecr.us-east-1.amazonaws.com" : "ecr-login", "public.ecr.aws" : "ecr-login", - "gcr.io" : "gcloud", - "staging-k8s.gcr.io" : "gcloud", - "us.gcr.io" : "gcloud", - "asia.gcr.io" : "gcloud", - "marketplace.gcr.io" : "gcloud", - "eu.gcr.io" : "gcloud" - }, - "auths" : { - "ghcr.io" : { - - }, - "gcr.io" : { - - }, - "registry.digitalocean.com" : { - - }, - "https://index.docker.io/v1/" : { - - } - }, - "credsStore" : "desktop" + "asia.gcr.io": "gcloud", + "eu.gcr.io": "gcloud", + "gcr.io": "gcloud", + "marketplace.gcr.io": "gcloud", + "staging-k8s.gcr.io": "gcloud", + "us.gcr.io": "gcloud" + }, + "experimental": "enabled", + "stackOrchestrator": "swarm", + "currentContext": "desktop-linux" } \ No newline at end of file diff --git a/docker/daemon.json b/docker/daemon.json index 0a79994..8fa6456 100644 --- a/docker/daemon.json +++ b/docker/daemon.json @@ -1 +1,12 @@ -{"experimental":false,"features":{"buildkit":true}} \ No newline at end of file +{ + "builder": { + "gc": { + "defaultKeepStorage": "20GB", + "enabled": true + } + }, + "experimental": true, + "features": { + "buildkit": true + } +} diff --git a/docker/features.json b/docker/features.json new file mode 100644 index 0000000..edb194e --- /dev/null +++ b/docker/features.json @@ -0,0 +1,3 @@ +{ + "composeV2": "enabled" +} diff --git a/firefox/user.js b/firefox/user.js index 3ad0cf7..b45de17 100644 --- a/firefox/user.js +++ b/firefox/user.js @@ -83,8 +83,6 @@ user_pref("datareporting.policy.dataSubmissionEnabled", false); user_pref("device.sensors.enabled", false); user_pref("dom.battery.enabled", false); user_pref("dom.disable_window_move_resize", true); -user_pref("dom.enable_performance_navigation_timing", false); -user_pref("dom.enable_performance_observer", false); user_pref("dom.enable_performance", false); user_pref("dom.enable_resource_timing", false); user_pref("dom.event.contextmenu.enabled", false); diff --git a/install.sh b/install.sh index e964480..d438bfa 100755 --- a/install.sh +++ b/install.sh @@ -14,6 +14,7 @@ git clone --recurse-submodules https://github.com/jakejarvis/dotfiles.git "$YOU_ ln -sf "$YOU_ARE_HERE/zsh/.zshrc" ~/.zshrc ln -sf "$YOU_ARE_HERE/git/.gitconfig" ~/.gitconfig ln -sf "$YOU_ARE_HERE/git/.gitignore_global" ~/.gitignore_global +ln -sf "$YOU_ARE_HERE/nano/.nanorc" ~/.nanorc mkdir -p ~/.ssh ln -sf "$YOU_ARE_HERE/ssh/.ssh/config" ~/.ssh/config diff --git a/macos/macos.sh b/macos/macos.sh index 3d07308..ea3bbcb 100755 --- a/macos/macos.sh +++ b/macos/macos.sh @@ -3,7 +3,8 @@ set -euo pipefail # This shouldn't be run if not on macOS, but make double sure -if test ! "$(uname)" = "Darwin"; then +if [ ! "$(uname)" = "Darwin" ]; then + echo "Skipping macOS steps." exit 0 fi @@ -24,7 +25,7 @@ sudo xcodebuild -license accept # This whole thing kinda hinges on having Homebrew... # Check for it and install from GitHub if it's not there # shellcheck disable=SC2230 -if test ! "$(which brew)"; then +if [ ! "$(which brew)" ]; then /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi @@ -48,6 +49,11 @@ chsh -s "$(brew --prefix)/bin/zsh" chmod 755 "$(brew --prefix)/share/zsh" chmod 755 "$(brew --prefix)/share/zsh/site-functions" +# 1Password SSH integration +# https://developer.1password.com/docs/ssh/get-started#step-4-configure-your-ssh-or-git-client +mkdir -p ~/.1password +ln -sf ~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock ~/.1password/agent.sock + # Install all apps from the Brewfile, ignore errors brew tap homebrew/bundle brew bundle || true diff --git a/nano/.nanorc b/nano/.nanorc new file mode 100644 index 0000000..51dd6a4 --- /dev/null +++ b/nano/.nanorc @@ -0,0 +1,30 @@ +# Enable built-in syntax highlighting +include "/opt/homebrew/Cellar/nano/*/share/nano/*.nanorc" + +# Non-default settings +set historylog # Save the last 100 history searches for later use. +# set positionlog # Saves the cursor position between editing sessions. +set zap # Allows you to highlight text (CTRL+SHIFT+ARROW) and delete it with backspace. +set autoindent # A new line will have the same number of leading spaces as the previous one. +# set tabsize 2 +# set tabstospaces +set afterends # Ctrl+Right moves to end of word instead of beginning. +set wordchars "_" # Recognize _ as part of a word. + +# Fix option+left/right word skipping +# https://unix.stackexchange.com/a/392309 +unbind M-B all +unbind M-F all +bind M-B prevword main +bind M-F nextword main + +# Muscle memory adaptations +bind ^s writeout main # Ctrl+S for save. +bind ^f whereis main # Ctrl+F for search. +# bind ^h replace main # Ctrl+H for find/replace. +bind ^z undo main # Ctrl+Z for undo. +# bind ^y redo main # Ctrl+Y for redo. +# bind ^x cut main # Ctrl+X for cut. +# bind ^c copy main # Ctrl+C for copy. +# bind ^v paste all # Ctrl+V for paste. +bind ^/ comment main # Ctrl+/ for (un)commenting current line. diff --git a/ssh/.ssh/config b/ssh/.ssh/config index 8770352..fe2a7bb 100644 --- a/ssh/.ssh/config +++ b/ssh/.ssh/config @@ -27,12 +27,12 @@ Host * AddKeysToAgent yes UseKeychain yes PreferredAuthentications publickey - IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" + # https://developer.1password.com/docs/ssh/get-started#step-4-configure-your-ssh-or-git-client + IdentityAgent "~/.1password/agent.sock" Host tufts HostName linux.eecs.tufts.edu User jjarvi01 - IdentitiesOnly yes ForwardAgent yes Host mastodon diff --git a/zsh/.zshrc b/zsh/.zshrc index 96c9b74..0b1fdfd 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -11,7 +11,7 @@ export ZSH=$HOME/.oh-my-zsh export EDITOR="nano" export VISUAL="code" # export BROWSER="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" -export BROWSER="/Applications/Firefox.app/Contents/MacOS/firefox" +# export BROWSER="/Applications/Firefox.app/Contents/MacOS/firefox" # Adjust history for speed HISTFILE=~/.zsh_history diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 2fdbeea..400e3a1 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -64,6 +64,17 @@ alias dcd="docker-compose down" alias dcr="docker-compose down && docker-compose up -d" alias dcl="docker-compose logs -f" +# Multipass +alias mp="multipass" +mpl() { + # creates VM and opens its bash shell + # `mpl test1 20.04` + multipass launch ${2:-22.04} --cpus 4 --mem 4G --disk 20G --name "$1" && \ + multipass shell "$1" +} +alias mpd="multipass delete" +alias mps="multipass shell" + # Node/NPM/Yarn alias npr="npm run" alias fresh_npm="rm -rf node_modules package-lock.json && npm install" @@ -94,6 +105,9 @@ alias moshalt="mosh --ssh=\"ssh -p 2222\"" alias pubkey="more ~/.ssh/id_ed25519.pub | pbcopy | echo '=> Public key copied to clipboard.'" alias pubkey_rsa="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to clipboard.'" +# Tailscale: https://tailscale.com/kb/1080/cli/?tab=macos +alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale" + # youtube-dl alias ytdl="youtube-dl -f bestvideo+bestaudio" alias ytmp3="youtube-dl -f bestaudio -x --audio-format mp3 --audio-quality 320K" diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 3ee24d3..f33df58 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -49,7 +49,7 @@ gitio() { # https://github.com/rtomayko/dotfiles/blob/rtomayko/.bashrc push_ssh_cert() { local _host - test -f ~/.ssh/id_ed25519.pub || ssh-keygen -t ed25519 + [ -f ~/.ssh/id_ed25519.pub ] || ssh-keygen -t ed25519 for _host in "$@"; do echo $_host diff --git a/zsh/macos.zsh b/zsh/macos.zsh index 7528b5c..3fab627 100644 --- a/zsh/macos.zsh +++ b/zsh/macos.zsh @@ -1,12 +1,12 @@ # Rosetta hacks for M1 Macs alias intel="arch -x86_64 /bin/zsh" -alias arm="arch -arm64 /opt/homebrew/bin/zsh" +alias arm="arch -arm64 "$HOMEBREW_PREFIX"/bin/zsh" # My own creation! See: https://github.com/jakejarvis/simpip alias ipv4="curl -4 simpip.com --max-time 1 --proto-default https --silent" alias ipv6="curl -6 simpip.com --max-time 1 --proto-default https --silent" alias ip="ipv4; ipv6" -alias iploc="ipconfig getifaddr en0" +alias ip-local="ipconfig getifaddr en0" alias ips="ip; ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" alias dns-clear="networksetup -setdnsservers Wi-Fi" @@ -28,27 +28,30 @@ system_update() { brew upgrade $(brew outdated --greedy --verbose | awk '$2 !~ /(latest)/ {print $1}') brew cleanup - echo -e "${YELLOW}Updating NPM/Yarn packages...${NC}" - volta install node@latest - volta install npm@8 + echo -e "${YELLOW}Updating global NPM/Yarn packages...${NC}" + volta fetch node@latest + volta install node@lts volta install yarn@1 - volta run --node latest --npm 8 --no-yarn -- npm update --global - volta run --node latest --yarn 1 -- yarn global upgrade + volta run --node lts --no-yarn -- npm update --global + volta run --node lts --yarn 1 -- yarn global upgrade - echo -e "${YELLOW}Updating Ruby gems...${NC}" - gem update --system + echo -e "${YELLOW}Updating Ruby and gems...${NC}" + CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS" \ + rbenv install --skip-existing $(rbenv install -l | grep -v - | tail -1) && \ + rbenv global $(rbenv install -l | grep -v - | tail -1) + gem install bundler foreman gem update - # gem upgrade --user-install gem cleanup + rbenv rehash # https://stackoverflow.com/a/3452888 echo -e "${YELLOW}Updating pip packages...${NC}" pip3 list --outdated --format=json | jq -r '.[] | .name+"="+.latest_version' | cut -d = -f 1 | xargs -n1 pip3 install -U - echo -e "${YELLOW}Updating MAS apps...${NC}" + echo -e "${YELLOW}Checking for App Store updates...${NC}" mas outdated - echo -e "${YELLOW}Check for macOS system updates...${NC}" + echo -e "${YELLOW}Checking for macOS system updates...${NC}" softwareupdate --list echo -e "${YELLOW}Updating Oh-My-ZSH...${NC}" diff --git a/zsh/path.zsh b/zsh/path.zsh index e98ade6..8391d13 100644 --- a/zsh/path.zsh +++ b/zsh/path.zsh @@ -1,4 +1,5 @@ -if test ! "$(uname)" = "Darwin"; then +# ignore literally everything here if this isn't macOS +if [ ! "$(uname)" = "Darwin" ]; then exit 0 fi