AnsChen's Home

Welcome to AnsChen's Home

0%

linux/mac工作环境配置

Prepare Work Env for Linux

Prepare your work environment for linux system ## Software install

git

Use git with ssh style: - generate private and public key:

1
cd ~/.ssh && ssh-keygen -o

- now github only support sha-2, we could use the following code to generate ```ssh-keygen -t ecdsa -b 521 -C "your_email"```
  • check whether it does generate id_rsa and id_rsa.pub
  • copy your id_rsa.pub to your git account setting

Note If you use git clone timeouts, you can use ssh -vT git_url to check port or other information

zsh

install oh my zsh - install zsh yum install zsh - change shell to zsh chsh -s /bin/zsh - install oh-my-zsh

1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

gcc

update gcc version #### centos under 7.6

  • install yum install centos-release-scl

  • find gcc related yum list dev\*gcc

  • install gcc related yum install devtoolset-x-gcc devtoolset-x-gcc-c++

  • valid temporarily source /opt/rh/devtoolset-x/enable

  • check gcc -v and g++ -v

  • valid permanently add source /opt/rh/devtoolset-x-gcc-c++ to your bashrc or zshrc

cento beyond 7.6

Note that devtools-x-gcc has been renamed as gcc-toolset-x - check yum list | grep gcc-toolset

  • use dnf to install dnf install gcc-toolset-x

  • source to activate source /opt/rh/gcc-toolset-x/enable

conda

follow the instruction Install Conda Linux

go

install golang - download wget https://go.dev/dl/go1.18.3.linux-amd64.tar.gz - remove the oldest go - use which go to find the current go - remove rm -rf $cur_go_dir such as rm -rf /usr/local/go - decompress tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz - env variable export PATH=$PATH:/usr/loca/go/bin, add to zshrc make permanently - remove source file rm go1.18.3.linux-amd64.tar.gz

protobuf

  • download the particular version
    1
    wget  https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-cpp-3.7.1.tar.gz
  • tar -xzvf protobuf-cpp-3.7.1.tar.gz
  • install
    1
    2
    3
    4
    5
    6
    cd protobuf-3.7.1
    ./configure
    make
    make check
    sudo make install
    sudo ldconfig
  • to support golang go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

tmux

If you want to install tmux2, just use yum or dnf

Install tmux 3.0 - install deps

1
yum -y install libtermcap-devel ncurses-devel libevent-devel readline-devel
1
2
3
4
5
6
git clone https://github.com/tmux/tmux.git
cd ./tmux
git checkout 3.0
sh autogen.sh
./configure && make
sudo make install

vim

follow the instruction by url

tldr

1
2
dnf install nodejs
npm install tldr

tensorflow

tensoflow 1.15 is not supported by python3.8 and later version. If you want to install 1.15, pls install python3.7

docker

remove images store position

vscode

vscode free key pass

  • local generate ssh-key ssh-keygen -o
  • copy id_rsa.pub to your remote server id_rsa.pub and authorized_keys

从零配置mac

系统

系统快捷键:

```Setting```->```Keyboard```->```Keyboard Shorcuts```->```Modifier Keys```
1
2

Safari地址栏搜索引擎修改:```Safari```->```Setting```->```Search

VSCode

  1. 选择使用github账号同步
  2. vim插件,repeated keys, 运行下面的指令:
    1
    2
    3
    4
    5
    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false              # For VS Code
    defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider
    defaults write com.visualstudio.code.oss ApplePressAndHoldEnabled -bool false # For VS Codium
    defaults write com.microsoft.VSCodeExploration ApplePressAndHoldEnabled -bool false # For VS Codium Exploration users
    defaults delete -g ApplePressAndHoldEnabled
    并且可以在光标移动的速度: System Preference->Keyboard

Terminal

  1. 安装iterm2
  2. 安装homebrew
  3. 安装oh-my-zsh
    • 安装插件https://mdnice.com/writing/6774c6693d374e548b0a4434f85dceb6
  4. 安装tldr: brew install tldr
  5. LazyVim配置:
    • brew install neovim
    • Follow https://www.lazyvim.org/installation
  6. 安装tmux
    • brew install tmux
    • 拷贝配置文件mac_tmux.conf
  7. 配置vim模式: 在.zshrc的plugin中加入vi-mode插件

Python

  1. 安装miniconda

git

1
cd ~/.ssh && ssh-keygen -t ecdsa -b 521 -C "your_email"

zsh

插件 - zsh-autosuggestions` -zsh-syntax-highlighting`

Welcome to my other publishing channels