Skip to content

Instantly share code, notes, and snippets.

@pydanny
Last active October 3, 2024 12:51
Show Gist options
  • Save pydanny/b11f61cde65b984fe442cb7cc8d71d84 to your computer and use it in GitHub Desktop.
Save pydanny/b11f61cde65b984fe442cb7cc8d71d84 to your computer and use it in GitHub Desktop.

Revisions

  1. pydanny revised this gist Oct 3, 2024. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -96,6 +96,10 @@ export PIP_REQUIRE_VIRTUALENV=tru

    First, make sure you have a [Nerd font](https://www.nerdfonts.com/) installed and enabled in the terminal.

    ```bash
    brew install font-hack-nerd-font
    ```


    Add to end of `.zshrc`

  2. pydanny revised this gist Sep 29, 2024. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -149,6 +149,14 @@ venv_wrapper() {
    alias venv=venv_wrapper
    ```

    ## Install Jupyter Notebook extensions

    ```bash
    pip install jupyter_contrib_nbextensions
    pip install -U "notebook<7"
    jupyter contrib nbextension install --user
    ```


    ## Clone all your repos

  3. pydanny revised this gist Sep 26, 2024. 1 changed file with 42 additions and 17 deletions.
    59 changes: 42 additions & 17 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -5,27 +5,27 @@

    ## Install homebrew

    ```
    ```bash
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    ```

    ## Install uv

    Might need to also add miniconda, let's first see how well UV works with pytorch and cuda

    ```
    ```bash
    curl -LsSf https://astral.sh/uv/install.sh | sh
    ```

    Then install some pythons

    ```
    ```bash
    uv python install 3.10 3.11 3.12
    ```

    Setup and activate a python environment

    ```
    ```bash
    uv venv --python 3.10.0
    source .venv/bin/activate
    ```
    @@ -34,7 +34,7 @@ source .venv/bin/activate

    Going to try to use gh cli (Github CLI) for everything

    ```
    ```bash
    brew install gh
    gh auth login
    ```
    @@ -43,7 +43,7 @@ You may need to add ssh keys, instructions [here](https://docs.github.com/en/aut

    ## Install utilities

    ```
    ```bash
    brew install --cask visual-studio-code
    brew install bat # Really nice cat replacement
    brew install tokei # counts lines of code
    @@ -55,30 +55,30 @@ brew install starship # General shell improvements

    In a virtualenv:

    ```
    ```bash
    uv pip install nbdev setuptools
    nbdev_install
    ```

    Add to `.zshrc`

    ```
    ```bash
    alias prep='nbdev_export && nbdev_clean && nbdev_trust'
    ```

    ## More `.zshrc` tricks

    function to remove deleted merged branches

    ```
    ```bash
    function git-delete-merged-branches(){
    git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs git branch -d
    }
    ```

    Python directory cleanup. Not as necessary as it used to be, but needed about once every few months

    ```
    ```bash
    function rmpyc () {
    find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
    }
    @@ -87,7 +87,7 @@ function rmpyc () {

    Force pip to only work in a virtualenv

    ```
    ```bash
    export PIP_REQUIRE_VIRTUALENV=tru
    ```

    @@ -99,40 +99,65 @@ First, make sure you have a [Nerd font](https://www.nerdfonts.com/) installed an

    Add to end of `.zshrc`

    ```
    ```bash
    eval "$(starship init zsh)"
    ```

    Add a starship config file:

    ```
    ```bash
    mkdir -p ~/.config && touch ~/.config/starship.toml
    ```

    Then use the nerd-font-symbols preset to make the shell explode in usefulness

    ```
    ```bash
    starship preset nerd-font-symbols -o ~/.config/starship.toml
    ```

    ## Install Atuin

    Awesome shell history tool

    ```
    ```bash
    brew install atuin
    echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
    ```

    ## Configure pip and venv to use uv

    ## Clone all your repos
    ```bash
    # pip just calls uv
    function pip() {
    uv pip "$@"
    }

    # Overwrite the venv caller so it uses our version of things
    venv_wrapper() {
    if [[ "$1" == "activate" ]]; then
    source "$2/bin/activate"

    # Override pip in the virtualenv
    pip() {
    command uv pip "$@"
    }

    else
    virtualenv "$@"
    fi
    }
    alias venv=venv_wrapper
    ```


    ## Clone all your repos

    ```bash
    gh repo clone ORG_NAME/REPO_NAME
    ```

    An example might be:

    ```
    ```bash
    gh repo clone pydanny/daniel-blog-fasthtml
    ```
  4. pydanny revised this gist Sep 26, 2024. 1 changed file with 17 additions and 10 deletions.
    27 changes: 17 additions & 10 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,15 @@
    # Concept for install
    ## Terminal first!

    1. Try to avoid downloading anything directly. Rather, use homebrew, uv, and gh cli to install everything.
    2. At the end of each install, add the items suggested for going into the `.zshrc`

    # Install homebrew
    ## Install homebrew

    ```
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    ```

    # Install uv
    ## Install uv

    Might need to also add miniconda, let's first see how well UV works with pytorch and cuda

    @@ -30,7 +30,7 @@ uv venv --python 3.10.0
    source .venv/bin/activate
    ```

    # Setup gh cli
    ## Setup gh cli

    Going to try to use gh cli (Github CLI) for everything

    @@ -41,7 +41,7 @@ gh auth login

    You may need to add ssh keys, instructions [here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)

    # Install utilities
    ## Install utilities

    ```
    brew install --cask visual-studio-code
    @@ -51,15 +51,22 @@ brew install tmux # many panes for your shell
    brew install starship # General shell improvements
    ```

    # nbdev enhancement
    ## Install nbdev

    In a virtualenv:

    ```
    uv pip install nbdev setuptools
    nbdev_install
    ```

    Add to `.zshrc`

    ```
    alias prep='nbdev_export && nbdev_clean && nbdev_trust'
    ```

    # More `.zshrc` tricks
    ## More `.zshrc` tricks

    function to remove deleted merged branches

    @@ -84,7 +91,7 @@ Force pip to only work in a virtualenv
    export PIP_REQUIRE_VIRTUALENV=tru
    ```

    # Starship config
    ## Starship config


    First, make sure you have a [Nerd font](https://www.nerdfonts.com/) installed and enabled in the terminal.
    @@ -108,7 +115,7 @@ Then use the nerd-font-symbols preset to make the shell explode in usefulness
    starship preset nerd-font-symbols -o ~/.config/starship.toml
    ```

    # Install Atuin
    ## Install Atuin

    Awesome shell history tool

    @@ -118,7 +125,7 @@ echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
    ```


    # Clone all your repos
    ## Clone all your repos

    ```
    gh repo clone ORG_NAME/REPO_NAME
  5. pydanny revised this gist Sep 26, 2024. 1 changed file with 13 additions and 4 deletions.
    17 changes: 13 additions & 4 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    # Concept for install

    Use homebrew, uv, and gh cli to install everything. Try to avoid downloading directly.

    At the end of each install, add the items suggested for going into the `.zshrc`.
    1. Try to avoid downloading anything directly. Rather, use homebrew, uv, and gh cli to install everything.
    2. At the end of each install, add the items suggested for going into the `.zshrc`

    # Install homebrew

    @@ -12,7 +11,7 @@ At the end of each install, add the items suggested for going into the `.zshrc`.

    # Install uv

    Might need to also add miniconda, let's first see how it works with pytorch and cuda
    Might need to also add miniconda, let's first see how well UV works with pytorch and cuda

    ```
    curl -LsSf https://astral.sh/uv/install.sh | sh
    @@ -109,6 +108,16 @@ Then use the nerd-font-symbols preset to make the shell explode in usefulness
    starship preset nerd-font-symbols -o ~/.config/starship.toml
    ```

    # Install Atuin

    Awesome shell history tool

    ```
    brew install atuin
    echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
    ```


    # Clone all your repos

    ```
  6. pydanny revised this gist Sep 26, 2024. 1 changed file with 11 additions and 12 deletions.
    23 changes: 11 additions & 12 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -42,18 +42,6 @@ gh auth login

    You may need to add ssh keys, instructions [here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)

    # Clone all the repos

    ```
    gh repo clone ORG_NAME/REPO_NAME
    ```

    An example might be:

    ```
    gh repo clone pydanny/daniel-blog-fasthtml
    ```

    # Install utilities

    ```
    @@ -121,3 +109,14 @@ Then use the nerd-font-symbols preset to make the shell explode in usefulness
    starship preset nerd-font-symbols -o ~/.config/starship.toml
    ```

    # Clone all your repos

    ```
    gh repo clone ORG_NAME/REPO_NAME
    ```

    An example might be:

    ```
    gh repo clone pydanny/daniel-blog-fasthtml
    ```
  7. pydanny revised this gist Sep 26, 2024. 1 changed file with 26 additions and 7 deletions.
    33 changes: 26 additions & 7 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -64,12 +64,6 @@ brew install tmux # many panes for your shell
    brew install starship # General shell improvements
    ```

    Add to `.zshrc`

    ```
    eval "$(starship init zsh)"
    ```

    # nbdev enhancement

    Add to `.zshrc`
    @@ -101,4 +95,29 @@ Force pip to only work in a virtualenv

    ```
    export PIP_REQUIRE_VIRTUALENV=tru
    ```
    ```

    # Starship config


    First, make sure you have a [Nerd font](https://www.nerdfonts.com/) installed and enabled in the terminal.


    Add to end of `.zshrc`

    ```
    eval "$(starship init zsh)"
    ```

    Add a starship config file:

    ```
    mkdir -p ~/.config && touch ~/.config/starship.toml
    ```

    Then use the nerd-font-symbols preset to make the shell explode in usefulness

    ```
    starship preset nerd-font-symbols -o ~/.config/starship.toml
    ```

  8. pydanny revised this gist Sep 26, 2024. 1 changed file with 38 additions and 0 deletions.
    38 changes: 38 additions & 0 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -62,5 +62,43 @@ brew install bat # Really nice cat replacement
    brew install tokei # counts lines of code
    brew install tmux # many panes for your shell
    brew install starship # General shell improvements
    ```

    Add to `.zshrc`

    ```
    eval "$(starship init zsh)"
    ```

    # nbdev enhancement

    Add to `.zshrc`

    ```
    alias prep='nbdev_export && nbdev_clean && nbdev_trust'
    ```

    # More `.zshrc` tricks

    function to remove deleted merged branches

    ```
    function git-delete-merged-branches(){
    git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs git branch -d
    }
    ```

    Python directory cleanup. Not as necessary as it used to be, but needed about once every few months

    ```
    function rmpyc () {
    find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
    }
    ```

    Force pip to only work in a virtualenv

    ```
    export PIP_REQUIRE_VIRTUALENV=tru
    ```
  9. pydanny revised this gist Sep 26, 2024. 1 changed file with 12 additions and 5 deletions.
    17 changes: 12 additions & 5 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -31,16 +31,12 @@ uv venv --python 3.10.0
    source .venv/bin/activate
    ```

    # Install utilities

    - brew install --cask visual-studio-code
    - brew install gh

    # Setup gh cli

    Going to try to use gh cli (Github CLI) for everything

    ```
    brew install gh
    gh auth login
    ```

    @@ -56,4 +52,15 @@ An example might be:

    ```
    gh repo clone pydanny/daniel-blog-fasthtml
    ```

    # Install utilities

    ```
    brew install --cask visual-studio-code
    brew install bat # Really nice cat replacement
    brew install tokei # counts lines of code
    brew install tmux # many panes for your shell
    brew install starship # General shell improvements
    ```
  10. pydanny revised this gist Sep 26, 2024. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion install-notes.md
    Original file line number Diff line number Diff line change
    @@ -46,4 +46,14 @@ gh auth login

    You may need to add ssh keys, instructions [here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)

    # Clone all the repos
    # Clone all the repos

    ```
    gh repo clone ORG_NAME/REPO_NAME
    ```

    An example might be:

    ```
    gh repo clone pydanny/daniel-blog-fasthtml
    ```
  11. pydanny revised this gist Sep 26, 2024. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -43,3 +43,7 @@ Going to try to use gh cli (Github CLI) for everything
    ```
    gh auth login
    ```

    You may need to add ssh keys, instructions [here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)

    # Clone all the repos
  12. pydanny revised this gist Sep 26, 2024. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -31,11 +31,15 @@ uv venv --python 3.10.0
    source .venv/bin/activate
    ```




    # Install utilities

    - brew install --cask visual-studio-code
    - brew install gh

    # Setup gh cli

    Going to try to use gh cli (Github CLI) for everything

    ```
    gh auth login
    ```
  13. pydanny revised this gist Sep 26, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-notes.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ Use homebrew, uv, and gh cli to install everything. Try to avoid downloading dir

    At the end of each install, add the items suggested for going into the `.zshrc`.

    # Install homebrew
    # Install homebrew

    ```
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  14. pydanny revised this gist Sep 26, 2024. 1 changed file with 14 additions and 2 deletions.
    16 changes: 14 additions & 2 deletions install-notes.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    # Concept for install

    Use homebrew, uv, and gh cli to install everything. Try to avoid downloading directly
    Use homebrew, uv, and gh cli to install everything. Try to avoid downloading directly.

    At the end of each install, add the items suggested for going into the `.zshrc`.

    # Install homebrew

    @@ -22,8 +24,18 @@ Then install some pythons
    uv python install 3.10 3.11 3.12
    ```

    Setup and activate a python environment

    ```
    uv venv --python 3.10.0
    source .venv/bin/activate
    ```




    # Install utilities

    - brew install vscode
    - brew install --cask visual-studio-code
    - brew install gh

  15. pydanny revised this gist Sep 26, 2024. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion install-notes.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    Idea: Use homebrew, uv, and gh cli to install everything
    # Concept for install

    Use homebrew, uv, and gh cli to install everything. Try to avoid downloading directly

    # Install homebrew

  16. pydanny renamed this gist Sep 26, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  17. pydanny created this gist Sep 26, 2024.
    27 changes: 27 additions & 0 deletions New mac installation
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    Idea: Use homebrew, uv, and gh cli to install everything

    # Install homebrew

    ```
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    ```

    # Install uv

    Might need to also add miniconda, let's first see how it works with pytorch and cuda

    ```
    curl -LsSf https://astral.sh/uv/install.sh | sh
    ```

    Then install some pythons

    ```
    uv python install 3.10 3.11 3.12
    ```

    # Install utilities

    - brew install vscode
    - brew install gh