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
- To run vscode on server```bashcode-server --port 8080# run without passwordcode-server --port 8080 --auth none
or set as the auto server()
cat > /etc/systemd/system/codeserver.service <<EOF[Unit]Description=remote server of vscodeAfter=network-online.target syslog.target[Service]Type=simpleWorkingDirectory=/root/SourceCode/User=rootExecStart=/usr/local/bin/code-server --host 0.0.0.0 --port 8080 --auth noneRestart=on-failureLimitNOFILE=65536Restart=on-abnormalRestartSec=10sTimeoutSec=0StandardOutput=syslogStandardError=syslogSyslogIdentifier=codeserver[Install]WantedBy=multi-user.targetEOFsystemctl enable codeserversystemctl start codeserver
and access with (server ip):(port) and the password.
For exmaple:
info code-server 3.0.2 e480f6527e11344a7c69b7cd024bce9379cea7f0info HTTP server listening on http://127.0.0.1:8080info - Password is 158591e8d28f1db42b4ce06dinfo - To use your own password, set the PASSWORD environment variableinfo - To disable use `--auth none`info - Not serving HTTPSinfo Automatic updates are enabledinfo SSH server listening on localhost:35870
2. install golang
2.1. install golang
wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gztar -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
# /etc/profile.d/go.shexport 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
# ~/.bash_profileexport PATH=$PATH:$GOROOT/binexport 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
<a name="6HXtP"></a>## 3. Chrome install- searched and installed "liberation-fonts" to prepare for Chrome install- unzip google-chrome pack```bashyum provides liberation-fontsyum install liberation-fonts-1.07.2-16.el7.noarchrpm -iUh google-chrome-stable_current_x86_64.rpm
to run Chrome in a command line:
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”) } ```
