从头开始配置一台电脑(开发版)

本文最后更新于:2023年10月8日 下午

前言

对于开发人员来说,能够用到的工具还是有限的,但是每次lazy install也比较麻烦,所以写一篇博客,希望能条理清晰地罗列出从拿到电脑,到上手开发的一系列步骤。

对于开发人员,命令行是必不可少的,但是鉴于windows和Unix的命令相差较大,因此当遇到不同点时,都会分出两者都区别。

目前我的开发语言基本是Python + Windows / Linux 切换 + VSCode / Pycharm 切换。

环境

Python

  • Linux

    1
    2
    3
    4
    5
    6
    7
    8
    # Ubuntu:
    # location: /usr/bin/
    apt list python*
    sudo apt-get update
    sudo apt-get install python3.x
    python3.x --version
    # 将python命令默认指向给定的版本(符号链接)
    sudo ln -s /usr/bin/python3.x /usr/bin/python
  • Windows

    1
    2
    3
    4
    5
    6
    # Windows
    # location: "C:\Program Files\Python3.x"

    powershell:
    py -0 # show all installed python
    需要手动设置环境变量

Pip

一般随着python自带

  • Linux

    1
    2
    3
    wget https://bootstrap.pypa.io/get-pip.py
    python get-pip.py
    # 想要哪个python环境下的pip,就用哪个python去执行这个文件

SSH

  1. 安装

    Mac

    1
    2
    3
    # Mac 默认已经安装ssh服务端,确认是否开启
    sudo systemsetup -getremotelogin
    # Remote Login: On 表示已经开启

    Ubuntu

    1
    2
    3
    4
    5
    6
    sudo apt-get update
    sudo apt-get install openssh-server

    # check if start
    sudo systemctl status ssh
    # (active(running))

    Windows

    1
    2
    3
    4
    open settings
    click application
    find "Optional Function"
    Get-Service sshd
  2. 配置

    1
    2
    3
    4
    # Connect:
    Host xxx # 别名
    HostName ip/domain
    User username
    1
    2
    3
    4
    5
    ssh-keygen -t ed25519 -C "email@example.com"
    # gengerate a key and then transfer to server
    ssh-copy-id id ./id_ed25519.pub server

    # Or, copy the public key into authorized_keys in server

工具

Git

  1. 下载git

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    # Ubutun
    sudo apt-get update
    sudo apt-get install git
    git --version

    # Mac
    brew install git
    git --version

    # Windows
    一般是通过exe文件
  2. 配置git需要的环境

    1
    2
    3
    4
    5
    6
    7
    8
    git config --global user.name "name"
    git config --global user.email "email@example.com"

    ssh-keygen -t ed25519 -C "email@example.com"
    # 之后可以把生成的公钥文件复制到github上

    vim ~/.gitignore_global
    git config --global core.excludesfile ~/.gitignore_global

Vim

  1. 安装

    Mac

    1
    brew install vim

    Ubuntu

    1
    2
    sudo apt-get update
    sudo apt-get install vim

    Windows

    手动安装,网址:https://www.vim.org/download.php

  2. 配置

    1
    scp .vimrc server:

Tmux

  1. 安装

    Mac

    1
    brew install tmux

    Ubuntu

    1
    2
    sudo apt-get update
    sudo apt-get install tmux

    Windows

  2. 配置

    1
    scp .tmux.conf server:

软件

IDE – 通过登录账号来同步设置和插件

  • PyCharm
  • VSCode

从头开始配置一台电脑(开发版)
https://blogoasis.github.io/post/e2e1dfa2.html
作者
phInTJ
发布于
2023年10月7日
许可协议