Homebrew/Linuxbrew 安装常有工具

Homebrew
https://brew.sh/

Install:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Linuxbrew
http://linuxbrew.sh/

Install:
sudo yum install git -y (sudo apt-get update && sudo apt-get install git-core -y)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile

--------
Get local install history:
history | grep 'brew install' | awk '{ for(i=2; i<NF; i++) printf "%s", $i OFS; if(NF) printf "%s",$NF; printf ORS}' | grep '^brew ' | sort | uniq

Pin go and bubu:
brew pin go
brew update && brew outdated && brew upgrade && brew cleanup
--------
## zsh
brew install zsh  (yum install zsh) [freeBSD #pkg install zsh]
where zsh (whereis zsh)
	/usr/local/bin/zsh
	/home/linuxbrew/.linuxbrew/bin/zsh
cat /etc/shells
	/bin/sh
	/bin/bash
	...

将 zsh 加入到 /etc/shells 中
如果是mac:
echo "/usr/local/bin/zsh" | sudo tee -a /etc/shells
chsh -s /usr/local/bin/zsh
如果是linux:
vi ~/.bash_profile

export SHELL=`which zsh`
[ -z "$ZSH_VERSION" ] && exec "$SHELL" -l

如果改变失败,可以用usermod命令:
sudo usermod -s /usr/bin/zsh $USER

zsh
选择相应的数字2,生成默认配置文件~/.zshrc

###### antigen
cd ~
curl -L git.io/antigen > antigen.zsh
vi ~/.antigenrc

source $HOME/antigen.zsh
antigen use oh-my-zsh
antigen bundles <<EOBUNDLES
    git
    #gitfast
    git-extras
    heroku
    sudo
    z
    history
    cp
    rsync
    #encode64
    #osx
    brew
    #brew-cask
    #command-not-found
    zsh-users/zsh-syntax-highlighting
    zsh-users/zsh-autosuggestions
    zsh-users/zsh-completions
EOBUNDLES
#antigen theme lambda
antigen theme ys
#antigen theme clean
antigen apply

echo source \$HOME/.antigenrc>~/.zshrc
重启会话进入zsh
--------
cd ~
brew install git git-lfs git-flow git-extras gpg pinentry unzip xz p7zip unrar
brew install curl wget axel httpie sqlite3 jq yq
brew install gawk ack the_silver_searcher fd bat fzf htop ncdu diff-so-fancy tldr

brew install luarocks vim
brew install markdown pandoc
brew install node npm python@3

brew install mpv youtube-dl you-get ffmpeg
mpv 一个优酷地址
you-get -p mpv 一个爱奇艺地址

macOS:
brew install pinentry-mac prettyping telnet
brew install macvim --with-cscope --with-lua --with-override-system-vim
brew cask install marp typora wkhtmltopdf
brew cask install android-file-transfer

others:
brew install go
brew pin go

配置
$(brew --prefix)/opt/fzf/install

vim ~/.zshrc
source $HOME/.antigenrc
#export GOPATH=$HOME/go
#export PATH=$PATH:$GOPATH/bin
#export GPG_TTY=$(tty)
#alias ping='prettyping --nolegend'
alias preview="fzf --preview 'bat --color \"always\" {}'"
export FZF_DEFAULT_OPTS="--bind='ctrl-o:execute(code {})+abort'"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
#alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules"
#如果是中文macOS,加入下面命令使终端工具不使用中文语言
#unset LANG

--------

brew install lolcat boxes figlet
clear;cal|boxes -d diamonds -p a1t2l3|boxes -a c -d scroll|lolcat;sleep 3;while :;do echo $LINES $COLUMNS $(($RANDOM%$COLUMNS)) $(printf "\u2744\n");sleep 0.1;done|gawk '{a[$3]=0;for(x in a) {o=a[x];a[x]=a[x]+1;printf "\033[%s;%sH ",o,x;printf "\033[%s;%sH%s \033[0;0H",a[x],x,$4;}}'

 

posted @ 2019-02-19 06:55  Bob-wei  阅读(2000)  评论(0编辑  收藏  举报