Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ubuntu] 20.04 #24

Closed
Alice52 opened this issue Dec 1, 2020 · 11 comments
Closed

[ubuntu] 20.04 #24

Alice52 opened this issue Dec 1, 2020 · 11 comments

Comments

@Alice52
Copy link
Owner

Alice52 commented Dec 1, 2020

  • lap is F2 to bios
  • pc is F2/DEL to bios; F11 to choose system; ctrl + alt + f1 to command mode
  1. nvidia card

  2. yum

  3. vim

  4. nvidia card driver

    sudo vim /etc/default/grub
    # commend install config 
    # #GRUB_CMDLINE_LINUX="nouveau.modeset=0"
    sudo update-grub
    sudo reboot
  5. software

mkdir -p ~/software
  1. grub
sudo gedit /etc/default/grub 

# GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=5
#GRUB_CMDLINE_LINUX_DEFAULT="text"
sudo update-grub
sudo reboot
  1. shortcut

    • ctrl + shift + F7: command mode
    • ctrl + shift + F1: UI mode
  2. sleep issue

# disable sleep
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

# enable sleep
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
  1. ssh
# sudo apt-get purge openssh-client
sudo apt install openssh-server
@Alice52 Alice52 self-assigned this Dec 1, 2020
@Alice52
Copy link
Owner Author

Alice52 commented Dec 2, 2020

software

  • 1.搜狗输入法

  • 2.chrome: account + vpn

  • 3.vscode

  • 4.vim

    sudo apt-get purge vim-common -y
    sudo apt-get update -y
    sudo apt-get install vim -y
  • 5.git: config + repos

  • 6.zsh

  • 7.网易云

  • 8.vlc

  • 9.docker

  • 10.gcc

  • 11. curl

  • 12.wechat

  • 13.net-tools

  • 14. idea

    • config

    • font

    • compile annotation

    • plugins

    • maven

    • gradle

    • case sensitive: code completion

    • template new project

      private static final Logger LOG = LoggerFactory.getLogger($NAME$.class);
      /**
      * @author ${USER} <br/>
      * @create ${YEAR}-${MONTH}-${DAY} ${TIME} <br/>
      * @project ${PROJECT_NAME} <br/>
      */
    • setting>editor>inlay hints + setting>editor>genric>CompleteCode + setting>editor>genric>appearence

    • idea-class

    • idea remote develop

    • idea-plugins

      plugin function
      Alibaba Java Coding Guidelines --
      Arthas Idea --
      Codota --
      emmylua --
      google-java-format --
      CheckStyle --
      PMD --
      FindBugs --
      SonarLint --
      Grep console --
      GsonFormatPlus --
      jclasslib --
      SonarLint --
      save action --
      Rainbow Brackets --
      Protobuf support --
      MybatisX --
      Mybatisplus --
      maven helper --
      MapStruct --
      leetcode editor --
      lombok --
      apache avro --
      gsonformatplus --
      pojo to json --
      aspectj --
  • 15.opendir

  • 16.unzip

  • 17.indicator

@Alice52
Copy link
Owner Author

Alice52 commented Dec 2, 2020

env

export JAVA_HOME=/opt/java/jdk/jdk1.8.0_221
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib

export MAVEN_HOME=/opt/java/maven/apache-maven-3.6.1
export PATH=$MAVEN_HOME/bin:$PATH

export GRADLE_HOME=/opt/java/gradle/gradle-6.6.1
export PATH=$GRADLE_HOME/bin:$PATH

@Alice52
Copy link
Owner Author

Alice52 commented Dec 6, 2020

  1. ubunut init script
#!/bin/bash

echo '############ 0. INSTALL PIP3 ############'
sudo apt-get install python3-pip -y
sudo apt-get install python3-distutils -y
sudo pip3 install --default-timeout=1000  -U pip

echo '############ 1. INSTALL GCC ############'
sudo apt-get install gcc -y

echo '############ 2. INSTALL vim ############'
sudo apt-get purge vim-common -y
sudo apt-get update -y
sudo apt-get install vim -y

echo '############ 3.INSTALL NET-TOOLS ############'
sudo apt-get install net-tools -y

echo '############ 4.INSTALL UNZIP ############'
sudo apt-get install unzip -y

echo '############ 5.INSTALL OPENDIR  ############'
sudo touch /usr/bin/opendir
sudo chmod 777 opendir
sudo echo 'if [ -n "$1" ]; then
    nohup nautilus "$1" > /dev/null 2>&1
else
    nohup nautilus "$(pwd)" > /dev/null 2>&1
fi
' > /usr/bin/opendir

echo '############ 6.INSTALL CURL ############'
sudo apt-get purge libcurl4 -y
sudo apt-get install curl -y

echo '############ 7.INSTALL GIT ############'
sudo apt-get install git -y
git config --global user.name "Alice52"
git config --global user.email "zzhang_xz@163.com"

echo '############ 8.INSTALL zsh ############'
sudo apt-get install zsh -y



  • zsh: cannot use sudo to execute
#!/bin/bash

echo '############ 1.config zsh ############'
sudo apt-get install zsh -y
wget  https://gitee.com/alice52_xz/codes/ze89utkr0v3c2n6fb45ym25/raw?blob_name=ohmyzsh.sh -O zsh-install.sh
sed -i "s/\r//" zsh-install.sh
chmod +x ./zsh-install.sh
./zsh-install.sh
rm  ./zsh-install.sh

echo '############ 2.config ssh ############'
ssh-keygen -t rsa
echo -e "\033[44;37;5m please fill in ssh in github and gitee.\033[0m"
echo "ssh is : "
cat ~/.ssh/id_rsa.pub
read input1

echo '############ 3.CLONE REPOS ############'
mkdir -p ~/workspace/repos
cd ~/workspace/repos

git clone git@github.com:Alice52/java-ocean.git
git clone git@github.com:Alice52/tutorials-sample.git
git clone git@gitee.com:alice52_xz/personal-details.git
git clone git@github.com:Alice52/Alice52.git
git clone git@github.com:Alice52/project.git
git clone git@github.com:Alice52/go-tutorial.git
git clone git@github.com:Alice52/grpc-tutorials.git

@Alice52
Copy link
Owner Author

Alice52 commented Dec 6, 2020

  1. ubuntu software install
#!/bin/bash

cd ~/software

echo '############ 1.install netease-cloud-music ############'
sudo dpkg -i netease-cloud-music* 


echo '############ 2.install chrome ############'
sudo dpkg -i google-chrome*

echo '############ 3.install vscode ############'
sudo dpkg -i code_*   

echo '############ 4.install sogou ############'
sudo dpkg -i sogoupinyin*
# TODO: catch exception
sudo apt-get install -f -y
sudo dpkg -i sogoupinyin*

  1. baidunetdisk
  2. jmeter
  3. redis-plus
  4. workbench:
    # this is safe opertion
    # download apt-source from https://dev.mysql.com/downloads/repo/apt/, then install
    sudo apt install ./mysql-apt-config_0.8.17-1_all.deb
    
     sudo  apt-get update
     sudo apt install mysql-workbench-community
  5. flameshot
    sudo wget https://github.com/flameshot-org/flameshot/releases/download/v0.9.0/flameshot-0.9.0-1.ubuntu-20.04.amd64.deb
    
    sudo apt install ./flameshot-0.9.0-1.ubuntu-20.04.amd64.deb
    # customize shotcut

@Alice52
Copy link
Owner Author

Alice52 commented Dec 6, 2020

  1. ubuntu develop config
#!/bin/bash

echo '############ 0.install node&npm ############'
wget -qO- https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install nodejs # node -v npm -v
sudo npm install cnpm -g --registry=https://r.npm.taobao.org
# sudo apt-get purge nodejs
# sudo apt-get autoremove 

sudo rm -rf /opt/java
sudo mkdir -p /opt/java/jdk

sudo mkdir -p /opt/java/maven
sudo mkdir -p /opt/java/gradle
sudo mkdir -p /opt/java/maven-repository

echo '############ 1.install maven ############'
sudo cp ~/software/apache-mave* /opt/java/maven
cd /opt/java/maven
sudo tar -zxvf apache-mave* 
sudo rm apache-maven-3.6.1-bin*
cd apache-maven*     
cd conf 
sudo mv settings.xml settings.xml.bak
sudo  wget 'https://gitee.com/alice52_xz/codes/gkp1ytqi9xjz4h5c03vm726/raw?blob_name=settings.xml' -O settings.xml

echo '############ 2.install jdk ############'
sudo cp ~/software/jdk* /opt/java/jdk
cd /opt/java/jdk
sudo tar -zxvf jdk* 
sudo rm jdk-8u221-linux* 

echo '############ 3.install gradle ############'
sudo cp ~/software/gradle* /opt/java/gradle
cd /opt/java/gradle
sudo unzip gradle* 
sudo rm gradle*.zip

echo '############ 4.install idea ############' 
sudo cp ~/software/idea* /opt/java
cd /opt/java
sudo tar -zxvf idea* 
sudo rm idea*.gz
sudo mv idea* idea
  • add env
export JAVA_HOME=/opt/java/jdk/jdk1.8.0_221
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib

export MAVEN_HOME=/opt/java/maven/apache-maven-3.6.1
export PATH=$MAVEN_HOME/bin:$PATH

export GRADLE_HOME=/opt/java/gradle/gradle-6.6.1
export PATH=$GRADLE_HOME/bin:$PATH

export JMETER=/opt/java/jmeter5.4
export PATH=$JMETER/bin:$PATH
sudo vim ~/.zshrc 
# add env in last of file
source ~/.zshrc

sudo vim /etc/profile
# add env in last of file
source /etc/profile
  • verfiy
mvn -version
gradle -version
java -version 
javac -version
jmeter -v 

@Alice52 Alice52 closed this as completed Dec 10, 2020
@Alice52 Alice52 added the done label Dec 10, 2020
@Alice52
Copy link
Owner Author

Alice52 commented May 18, 2021

software upgrate

  1. download .deb for x64
  2. sudo dpkg -i netease-cloud-music*: please use sudo apt install ./path.deb

@Alice52
Copy link
Owner Author

Alice52 commented May 18, 2021

software uninstall

  1. sudo dpkg -r xxx
  2. apt-get --purge remove

@Alice52
Copy link
Owner Author

Alice52 commented May 22, 2021

install golang

  1. init struct
.
├── goland-2021-1
├── repo
│   └── protobuf
└── sdk
    └── go
  1. get source

    wget https://storage.googleapis.com/golang/go1.13.4.linux-amd64.tar.gz
    
     cd /opt/golang
     # move to opt
     sudo mv go1*.gz /opt/golang/sdk
    
     sudo tar -xzf go1.13.4*.gz
  2. source enable

    export GOPATH=/opt/golang/repo # this dic will store third-party dependency
    export GOROOT=/opt/golang/sdk /go # this do source code[sdk]
    export PATH=$GOPATH/bin:$PATH:$GOROOT/bin # expoer path
    
    # 1. enable ohmyzh
    sudo vim ~/.zshrc # then add above export
    source ~/.zshrc
    
    # 2. enbale profile
    sudo vim /etc/profile
    # add env in last of file
    source /etc/profile
  3. application

    [Desktop Entry]
    Encoding=UTF-8
    Version=1.0
    Type=Application
    Name=IntelliJ Goland IDE
    Icon=/opt/golang/goland-2021-1/bin/goland.svg
    Exec="/opt/golang/goland-2021-1/bin/goland.sh" %f
    Comment=The Smarter Way to Code
    Categories=Application;Development;Goland;IDE
    Terminal=false
    cd /usr/share/applications
    sudo vim jetbrains-golang.desktop 
    # fill in entry
  4. permission issue

    sudo chmod -R 757 /opt/golang/repo/
  5. install protobuf

    cd /opt/golang/sdk/plugins/protoc
    sudo wget https://github.com/protocolbuffers/protobuf/releases/download/v3.17.0/protoc-3.17.0-linux-x86_64.zip
    sudo unzip protoc*.zip
    sudo rm protoc*.zip
    sudo rm protoc*.zip
    sudo chmod -R 640 readme.txt
    sudo chmod -R 755 bin
    sudo chmod -R 755 include
    
    cd ~
    protoc --version

@Alice52
Copy link
Owner Author

Alice52 commented May 22, 2021

@Alice52
Copy link
Owner Author

Alice52 commented May 23, 2021

ubuntu yum replace

  1. notice the different between LTS

  2. LTS 20.04

    # 添加阿里源
    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    
    #添加清华源
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse
    
  3. LTS 18.04

    #添加阿里源
    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    #中科大源
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    #163源
    deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
    #清华源
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
    # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu focal stable

@Alice52 Alice52 added the common label Aug 23, 2021
@Alice52
Copy link
Owner Author

Alice52 commented Oct 23, 2021

tips

  1. 侧边栏双击

@Alice52 Alice52 transferred this issue from another repository Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant