[LINUX] WSL2 environment construction example Python, Node.js, Java, git-secrets, Docker

table of contents

  1. Install the basic packages for each Linux distribution
  2. Docker environment construction
  3. git-secrets
  4. Python installation
  5. Node.js installation
  6. Open JDK installation

*** This article is based on Ubuntu. RHEL and CentOS versions are also posted with one exception. *** ***

1. Install basic packages such as make, gcc, g ++

#Examine your Linux distribution What is Linux in the Python image on the Docker Hub? It may be convenient when it becomes
cat /etc/issue

#Debian,Run Ubuntu etc.
sudo apt install build-essential -y

#RHEL ,For CentOS etc., execute the following
sudo yum groupinstall "Development tools" -y

2. Docker environment construction

Please refer to "Running Docker using WSL2 on Windows 10 Home"

https://qiita.com/Yoshinari-Yamanaka/items/d9351053f2cd86a5e50e

3.git-secrets The git command itself should have been installed with apt install build-essential in 1. If it is not included, please install it separately. .. ..


git clone https://github.com/awslabs/git-secrets.git
cd git-secrets
make install

#To execute the following, please install awscli first by referring to "Python installation" below.
git secrets --register-aws --global

#If you are using Source Tree, you also need to do the following:
#reference
#https://qiita.com/yamaryu0508/items/d959dc32442b08b8a0a4
which git
which git-secrets
ln -s "git-Where the secrets are" "Where git is"
#Open the SourceTreew pre and open the "Git" tab from "Preferences"
#Click "Use system Git" in "Version of Git"
#Click the "git" file (at this time, the git that created the symbolic link earlier-Check if there are secrets)
#Go back to the "Preferences" screen and check that you have migrated from "Built-in Git version" to "System Git" in "Git version".
#

4. Python installation

The procedure to install python3.8.0 is posted. Please adjust the runtime according to each requirement.


wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tar.xz
tar -xf Python-3.8.0.tar.xz
cd Python-3.8.0
./configure --enable-optimizations
make -s -j4 #-Meaning of using 4 cores with j4
sudo make altinstall
which python3.8 #ex) /usr/local/bin/python3.8
ln -s "ex) /usr/local/bin/python3.8" "ex) /usr/local/bin/python"
python --version #Check if it is installed properly

#pip installation
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip --version  #Check if it is installed properly


#Virtual environment construction Use venv officially supported by Python
python -m venv env  #You will have a folder called env. Feel free to change the name.
#Enable virtual environment
echo "source ~/env/bin/activate" >> ~/.bashrc

#awscli installation
pip install awscli
# ~/.aws/Enter the information found in credentials. If you do not have it, please download it from the console first.
aws configure

5. Node.js installation


apt install nodejs npm -y
npm install n -g
n stable #node.Install js stabilizer
apt purge nodejs npm -y #Delete the first one(Also includes configuration files. Change purge to remove to remove config files
apt autoremove
exec $SHELL -l #Re-login
node --version #Check if it is installed properly

6. Open JDK installation


apt search openjdk-\(\.\)\+-jdk$
apt install openjdk-11-jdk
java --version
javac --version

PostgreSQL

#Add repository
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
#Add authentication key
sudo apt-get install curl ca-certificates
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
#Install PostgreSQL 12
sudo apt install postgresql-12

#Start PostgreSQL server
service postgresql start
#Create a user named user
createuser --pwprompt --interactive user
#Connection confirmation
sudo su - postgres
psql -h localhost -U user -d postgres

#If the connection is successful, check the current status
#Created DB information
\l
#Created schema information
\dn
#Created table information
\dt
#Clear screen
\! clear

Extra edition ssl-scan


git clone https://github.com/rbsec/sslscan.git
cd sslscan && make static

Recommended Posts

WSL2 environment construction example Python, Node.js, Java, git-secrets, Docker
[docker] python3.5 + numpy + matplotlib environment construction
Python environment construction
Environment construction (python)
python environment construction
Python --Environment construction
Python environment construction
python environment construction
Environment construction: GCP + Docker
python windows environment construction
homebrew python environment construction
Python development environment construction
python2.7 development environment construction
Mac environment construction Python
Python environment construction @ Win7
Virtual environment construction with Docker + Flask (Python) + Jupyter notebook
[Python] OpenCV environment construction with Docker (cv2.imshow () also works)
Python + Anaconda + Pycharm environment construction
Python environment construction (Windows10 + Emacs)
CI environment construction ~ Python edition ~
Python environment construction For Mac
Anaconda3 python environment construction procedure
Docker + Django + React environment construction
Prepare python3 environment with Docker
Python3 environment construction (for beginners)
Python environment construction under Windows7 environment
[MEMO] [Development environment construction] Python
Linux environment construction (on WSL environment)
Environment construction of python2 & 3 (OSX)
Python environment construction procedure memo using Docker on Windows10 Home
Environment construction of python and opencv
Python environment construction memo on Windows 10
Get started with Python! ~ ① Environment construction ~
Example of building python development environment on windows (wsl2, vscode, pipenv)
Anaconda python environment construction on Windows 10
Python + Unity Reinforcement learning environment construction
I checked Mac Python environment construction
Build Mysql + Python environment with docker
Python environment construction memo on Mac
Python environment construction (pyenv, anaconda, tensorflow)
[Python3] Development environment construction << Windows edition >>
Python development environment construction on macOS
Python environment construction (pyenv + poetry + pipx)
[Linux] Docker environment construction on Redhat
Environment construction of python3.8 on mac
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
Python3 TensorFlow for Mac environment construction
Emacs Python development environment construction memo
pytorch @ python3.8 environment construction with pipenv
Development environment construction (2020 version, WSL2 + VcXsrv)
Create a C ++ and Python execution environment with WSL2 + Docker + VSCode
Docker environment update: add Python package
Data science environment construction with Docker
Python3.6 environment construction (using Win environment Anaconda)
OpenCV3 & Python3 environment construction on Ubuntu
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Easy construction]
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Python (anaconda) development environment construction procedure (SpringToolsSuites) _2020.4
Python project environment construction procedure (for windows)
Using venv in Windows + Docker environment [Python]
[Python] Road to snake charmer (1) Environment construction