Skip to content

Instantly share code, notes, and snippets.

@AlmogBaku
Last active April 15, 2025 10:52
Show Gist options
  • Save AlmogBaku/97e8514a93350340bfff384f9910b690 to your computer and use it in GitHub Desktop.
Save AlmogBaku/97e8514a93350340bfff384f9910b690 to your computer and use it in GitHub Desktop.
New environment

Installations required on a new environment

  1. Install Bitwarden from App Store
  2. Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install Xcode Command Line Tools

    1.  xcode-select --install
    2. Then, accept the license terms, and install necassary dependencies
      sudo xcodebuild -license accept
      brew install openssl readline sqlite3 xz zlib tcl-tk
  2. Setup your console:

    1. Install zsh and fonts
      brew install zsh
      brew tap homebrew/cask-fonts
      brew install --cask font-fira-code
      chsh -s /bin/zsh
    2. Change your terminal font to Fira Code
    3. Install go and antibody
      brew install go
      go install github.com/getantibody/antibody@latest
    4. Setup your ~/.zshrc
      ## ~/.zshrc
      
      alias pico='nano'
      
      # Go
      export GOPATH=$HOME/go
      export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
      
      # Antibody
      source <(antibody init)
      antibody bundle < ~/.zsh_plugins.txt
      
      # Pinentry
      alias pinentry='pinentry-mac'
      
      # PGP
      export GPG_TTY=$(tty)
      
      # JDK
      export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
      
      [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
      
      # LUAROCKS
      eval "$(luarocks path --bin)"
      
      # bun completions
      [ -s "/Users/almogbaku/.bun/_bun" ] && source "/Users/almogbaku/.bun/_bun"
      
      # bun
      export BUN_INSTALL="$HOME/.bun"
      export PATH="$BUN_INSTALL/bin:$PATH"
      
      # CARGO
      export PATH="$HOME/.cargo/bin:$PATH"
      
      # NVM
      export NVM_DIR="$HOME/.nvm"
      [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
      [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_com>
      
    5. Install Fzf
      brew install fzf
      /opt/homebrew/opt/fzf/install
      
    6. Configure zsh plugins in ~/.zsh_plugins.txt:
      # ~/.zsh_plugins.txt
      
      AlmogBaku/kubectx branch:patch-1 path:completion kind:fpath # <-- this MUST be before ohmyzsh
      ohmyzsh/ohmyzsh
      
      # Bundles from the default repo (robbyrussell's oh-my-zsh)
      ohmyzsh/ohmyzsh path:plugins/git
      ohmyzsh/ohmyzsh path:plugins/colorize
      ohmyzsh/ohmyzsh path:plugins/python
      ohmyzsh/ohmyzsh path:plugins/macos
      ohmyzsh/ohmyzsh path:plugins/golang
      ohmyzsh/ohmyzsh path:plugins/redis-cli
      ohmyzsh/ohmyzsh path:plugins/virtualenv
      ohmyzsh/ohmyzsh path:plugins/command-not-found
      ohmyzsh/ohmyzsh path:plugins/docker
      ohmyzsh/ohmyzsh path:plugins/common-aliases
      ohmyzsh/ohmyzsh path:plugins/docker-compose
      ohmyzsh/ohmyzsh path:plugins/helm
      ohmyzsh/ohmyzsh path:plugins/kubectl
      ohmyzsh/ohmyzsh path:plugins/mvn
      ohmyzsh/ohmyzsh path:plugins/python
      ohmyzsh/ohmyzsh path:plugins/ssh-agent
      ohmyzsh/ohmyzsh path:plugins/terraform
      ohmyzsh/ohmyzsh path:plugins/pip
      ohmyzsh/ohmyzsh path:plugins/lein
      ohmyzsh/ohmyzsh path:plugins/common-aliases
      ohmyzsh/ohmyzsh path:plugins/compleat
      ohmyzsh/ohmyzsh path:plugins/git-extras
      ohmyzsh/ohmyzsh path:plugins/git-flow
      ohmyzsh/ohmyzsh path:plugins/npm
      ohmyzsh/ohmyzsh path:plugins/web-search
      ohmyzsh/ohmyzsh path:plugins/z
      ohmyzsh/ohmyzsh path:plugins/fzf
      ohmyzsh/ohmyzsh path:plugins/poetry
      ohmyzsh/ohmyzsh path:plugins/uv
      ohmyzsh/ohmyzsh path:plugins/kind
      
      # Extra zsh completions
      zsh-users/zsh-completions
      zsh-users/zsh-autosuggestions
      zsh-users/zsh-syntax-highlighting
      zsh-users/zsh-history-substring-search
      
      
      # Theme
      denysdovhan/spaceship-zsh-theme
      
    7. start a new console to see the changes
  3. Install the following

brew install --cask arc
brew install nano yq poetry uv
curl https://sh.rustup.rs -sSf | sh -s -- -y
sudo ln -s /opt/homebrew/bin/nano /usr/local/bin/pico

brew install zsh go aws-iam-authenticator awscli gnupg golangci-lint helm kind kubernetes-cli node corepack \
java tree virtualenv pre-commit protobuf bufbuild/buf/buf luarocks kubectx sops nvm
brew link corepack
corepack enable
corepack prepare yarn@stable --activate

mkdir $ZSH/completions/
kind completion zsh > $ZSH/completions/_kind
poetry completions zsh > $ZSH/completions/_poetry
uv generate-shell-completion zsh > $ZSH/completions/_uv

brew tap hashicorp/tap
hashicorp/tap/vault

brew tap weaveworks/tap
brew install weaveworks/tap/eksctl

brew install boz/repo/kail
brew install --cask docker zoom slack medis google-cloud-sdk
  1. Create SSH Key
  2. Create GPG Signature
    1. Don't forget git config --global commit.gpgSign true !
  3. Install JetBrains Toolbox
    brew install --cask jetbrains-toolbox
  4. Install pinentry for gpg
brew tap jorgelbg/tap
brew install pinentry-mac pinentry-touchid
pinentry-touchid -fix
#reboot
  1. install the logi options + and karibiner
brew install --cask logi-options+
brew install --cask karabiner-element
  1. in logi-options+ —> disable "Always keep the keyboard in Mac layout"

  2. hit fn+p long press to switch to Windows layout

  3. Karibiner complex modifiers json for MX Keys:

{
    "description": "Custom Mac Mapping for Logitech MX Keys",
    "manipulators": [
        {
            "conditions": [
                {
                    "identifiers": [
                        {
                            "product_id": 45944,
                            "vendor_id": 1133
                        }
                    ],
                    "type": "device_if"
                }
            ],
            "from": {
                "key_code": "left_command",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "key_code": "left_option" }],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "identifiers": [
                        {
                            "product_id": 45944,
                            "vendor_id": 1133
                        }
                    ],
                    "type": "device_if"
                }
            ],
            "from": {
                "key_code": "left_option",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "key_code": "left_command" }],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "identifiers": [
                        {
                            "product_id": 45944,
                            "vendor_id": 1133
                        }
                    ],
                    "type": "device_if"
                }
            ],
            "from": {
                "key_code": "right_control",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "key_code": "right_option" }],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "identifiers": [
                        {
                            "product_id": 45944,
                            "vendor_id": 1133
                        }
                    ],
                    "type": "device_if"
                }
            ],
            "from": {
                "key_code": "right_option",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "key_code": "right_command" }],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "input_sources": [{ "language": "en" }],
                    "type": "input_source_if"
                }
            ],
            "from": {
                "key_code": "insert",
                "modifiers": { "optional": ["any"] }
            },
            "to_if_alone": [{ "select_input_source": { "language": "he" } }],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "input_sources": [{ "language": "he" }],
                    "type": "input_source_if"
                }
            ],
            "from": {
                "key_code": "insert",
                "modifiers": { "optional": ["any"] }
            },
            "to_if_alone": [{ "select_input_source": { "language": "en" } }],
            "type": "basic"
        }
    ]
}
  1. Replace quick sequential double dash (--) with em dash (—)
{
    "description": "Replace quick sequential double dash (--) with em dash (—)",
    "manipulators": [
        {
            "conditions": [
                {
                    "name": "dash-pressed",
                    "type": "variable_if",
                    "value": 1
                }
            ],
            "from": { "key_code": "hyphen" },
            "to": [
                { "key_code": "delete_or_backspace" },
                {
                    "key_code": "hyphen",
                    "modifiers": ["left_shift", "left_alt"]
                }
            ],
            "to_after_key_up": [
                {
                    "set_variable": {
                        "name": "dash-pressed",
                        "value": 0
                    }
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "name": "dash-pressed",
                    "type": "variable_if",
                    "value": 0
                }
            ],
            "from": { "key_code": "hyphen" },
            "to": [{ "key_code": "hyphen" }],
            "to_after_key_up": [
                {
                    "set_variable": {
                        "name": "dash-pressed",
                        "value": 1
                    }
                }
            ],
            "to_delayed_action": {
                "to_if_canceled": [
                    {
                        "set_variable": {
                            "name": "dash-pressed",
                            "value": 0
                        }
                    }
                ],
                "to_if_invoked": [
                    {
                        "set_variable": {
                            "name": "dash-pressed",
                            "value": 0
                        }
                    }
                ]
            },
            "type": "basic"
        }
    ],
    "parameters": { "basic.to_delayed_action_delay_milliseconds": 500 }
}
@kelet-blink
Copy link

Here,

brew tap hashicorp/tap
hashicorp/tap/vault

I think you mean this instead:

brew tap hashicorp/tap
brew install hashicorp/tap/vault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment