1. install vscode

The vscode is currently the most convenient IDE for developers.
I used an open source project ‘code-server’ to use vscode instantly.

  • Get the pack of code-server from github and unzip ```bash pushd /usr/local/share/applications mkdir code-server

cd /usr/local/bin/ wget https://github.com/cdr/code-server/releases/download/3.0.2/code-server-3.0.2-linux-x86_64.tar.gz tar xvzf code-server-3.0.2-linux-x86_64.tar.gz —strip-components=1 -C ./code-server

ln -s /usr/local/share/applications/code-server/code-server /usr/local/bin/code-server

  1. - To run vscode on server
  2. ```bash
  3. code-server --port 8080
  4. # run without password
  5. code-server --port 8080 --auth none

or set as the auto server()

  1. cat > /etc/systemd/system/codeserver.service <<EOF
  2. [Unit]
  3. Description=remote server of vscode
  4. After=network-online.target syslog.target
  5. [Service]
  6. Type=simple
  7. WorkingDirectory=/root/SourceCode/
  8. User=root
  9. ExecStart=/usr/local/bin/code-server --host 0.0.0.0 --port 8080 --auth none
  10. Restart=on-failure
  11. LimitNOFILE=65536
  12. Restart=on-abnormal
  13. RestartSec=10s
  14. TimeoutSec=0
  15. StandardOutput=syslog
  16. StandardError=syslog
  17. SyslogIdentifier=codeserver
  18. [Install]
  19. WantedBy=multi-user.target
  20. EOF
  21. systemctl enable codeserver
  22. systemctl start codeserver

and access with (server ip):(port) and the password.
For exmaple:

  1. info code-server 3.0.2 e480f6527e11344a7c69b7cd024bce9379cea7f0
  2. info HTTP server listening on http://127.0.0.1:8080
  3. info - Password is 158591e8d28f1db42b4ce06d
  4. info - To use your own password, set the PASSWORD environment variable
  5. info - To disable use `--auth none`
  6. info - Not serving HTTPS
  7. info Automatic updates are enabled
  8. info SSH server listening on localhost:35870

2. install golang

2.1. install golang

  1. wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz
  2. tar -C /usr/local -xzf go1.14.1.linux-amd64.tar.gz

2.2. set GOROOT and GOPATH

  • GOROOT is where Go package is installed in my system, set in /etc/profile by creating a new file go.sh, and this is set for all users to apply this environment variable

    1. # /etc/profile.d/go.sh
    2. export GOROOT=/usr/local/go
  • GOPATH is my work directory, set in ~/.bash_profile by modifying it, while there is a new path appended in PATH, either

    1. # ~/.bash_profile
    2. export PATH=$PATH:$GOROOT/bin
    3. export GOPATH=~/SourceCode/go
  • After that, update and verify new environment variables ```bash source /etc/profile.d source ~/.bash_profile

echo $GOROOT echo $GOPATH

env |grep GO

  1. <a name="6HXtP"></a>
  2. ## 3. Chrome install
  3. - searched and installed "liberation-fonts" to prepare for Chrome install
  4. - unzip google-chrome pack
  5. ```bash
  6. yum provides liberation-fonts
  7. yum install liberation-fonts-1.07.2-16.el7.noarch
  8. rpm -iUh google-chrome-stable_current_x86_64.rpm
  • to run Chrome in a command line:

    1. google-chrome --no-sandbox

    4. Verify golang ide is working

  • golang is similar to Python

  • Sample “Hello World” Program ```go package main

import “fmt”

func main() { fmt.Println(“Hello World”) } ```