Tag: fish

  • Storm SSH Alternative for fish Shell

    It seems storm is no longer updated for years. So I found it’s actually really simple to implement Storm SSH’s searching feature via a simple function:

    function sshgrep
      grep -i -E -C 3 $argv ~/.ssh/config.d/*
    end

    Usage:

    ssh grep ixion
    /Users/sparanoid/.ssh/config.d/server-aws.conf-  Port 22
    /Users/sparanoid/.ssh/config.d/server-aws.conf-  User ssh-user
    /Users/sparanoid/.ssh/config.d/server-aws.conf-
    /Users/sparanoid/.ssh/config.d/server-aws.conf:Host ixion
    /Users/sparanoid/.ssh/config.d/signcl-aws.conf-  HostName 11.22.33.44
    /Users/sparanoid/.ssh/config.d/server-aws.conf-  Port 22
    /Users/sparanoid/.ssh/config.d/server-aws.conf-  User ssh-user
    
  • Migrate Homebrew from Intel Macs to Apple Silicon Macs

    Dump all your existing Homebrew packages:

    brew bundle dump

    If you’re using custom shell installed by Homebrew (ie. fish), change it back to bash temporarily:

    chsh -s /bin/bash

    You may also need to change this in System Preferences – Users & Groups (right click on your avatar and choose Advanced Options…)

    Uninstall existing Homebrew (and all its packages):

    curl -fsSL -o /tmp/uninstall.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
    /bin/bash /tmp/uninstall.sh --path=/usr/local
    (more…)
  • Current Working Directory for Different OS and Tools

    • Bash: $(pwd)
    • fish: (pwd)
    • Windows Command Line (cmd): %cd%
    • PowerShell: $(PWD) (Case-insensitive)
  • Make pyenv Play Nice with Homebrew in fish Shell

    # Make pyenv play nice with Homebrew
    # https://github.com/pyenv/pyenv/issues/106
    alias brew="env PATH=(string replace (pyenv root)/shims '' (echo $PATH)) brew"