linux memorandum

Overview

I will summarize it here as a memorandum so that I can remember the linux command as accurately as possible. We will update it from time to time.

Memorandums

check cpu

sudo lshw -class processor

check gpu

lspci | grep -i nvidia

check memory

Set input method switching to ctrl space

https://qiita.com/nabenabe0928/items/09affae67df9c150ad50 Follow here. Doing this will significantly reduce stress.

count file

ls -1 | wc -l

keyboard setting for ubuntu18.04

sudo dpkg-reconfigure keyboard-configuration
setxkbmap jp

I will try the above two for the time being.

pyenv & virtualenv environment for ubuntu on docker

apt update &&apt install -y wget git&& apt install build-essential -y&& git clone https://github.com/pyenv/pyenv.git ~/.pyenv &&\
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile &&\
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile &&\
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.profile &&\
source ~/.profile &&\
apt install -y gcc make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev &&\
pyenv install 3.6.3 &&\
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv &&\
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.profile &&\
source ~/.profile &&\
pyenv virtualenv 3.6.3 myenv && pyenv global 3.6.3

pyenv & virtualenv environment for ubuntu NOT on docker


sudo apt update &&sudo apt install -y wget git&&sudo  apt install build-essential -y&& git clone https://github.com/pyenv/pyenv.git ~/.pyenv &&\
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile &&\
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile &&\
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.profile &&\
source ~/.profile &&\
sudo apt install -y gcc make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev &&\
pyenv install 3.6.3 &&\
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv &&\
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.profile &&\
source ~/.profile &&\
pyenv virtualenv 3.6.3 myenv && pyenv global 3.6.3

user add su permission


adduser username
usermod -G sudo username

Put pyodbc in ubuntu18.04


apt-get install -y unixodbc unixodbc-dev &&\
pip3 install pyodbc==4.0.30

Insert gmpy2 (on docker)


cd ~/static &&apt update &&apt install -y wget && apt install build-essential -y&&\
wget https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz && tar xf ./m4-1.4.18.tar.gz && cd m4-1.4.18 && ./configure --prefix=/usr && make && make install &&\
cd .. && wget https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 && tar xf ./gmp-6.0.0a.tar.bz2 && cd gmp-6.0.0 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic && make &&make check&& make install &&\
cd .. && wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.bz2 && tar xf ./mpfr-3.1.2.tar.bz2 && cd mpfr-3.1.2 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static && make && make install &&\
cd .. && wget https://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz && tar xf ./mpc-1.0.3.tar.gz && cd mpc-1.0.3 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static --with-mpfr=$HOME/static && make && make install &&\
cd .. && wget https://github.com/aleaxit/gmpy/releases/download/gmpy2-2.1.0a1/gmpy2-2.1.0a1.tar.gz && tar xf ./gmpy2-2.1.0a1.tar.gz && cd gmpy2-2.1.0a1 && source ~/.profile && python setup.py build_ext --static=~/static install

Openssl 1.0.2 series (on docker)


 cd ~ && mkdir static && cd ~/static &&\
apt-get install -y build-essential wget m4 libgmp-dev file git vim libomp-dev&& cd ~/static && wget https://www.shoup.net/ntl/ntl-11.3.2.tar.gz && tar xf ntl-11.3.2.tar.gz && cd ntl-11.3.2/src && ./configure SHARED=on NTL_GMP_LIP=on NTL_THREADS=on NTL_THREAD_BOOST=on && make -j4 && make install&&\
cd ~/static && wget http://www.openssl.org/source/openssl-1.0.2a.tar.gz && tar -xvzf openssl-1.0.2a.tar.gz && cd openssl-1.0.2a && export CFLAGS=-fPIC && ./config shared --prefix=/usr && make && make install

Put docker & docker compose in ubuntu18.04

apt install -y \
     apt-transport-https \
     ca-certificates \
     curl \
     software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository \
     "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
     $(lsb_release -cs) \
     stable"
apt update
apt-get install docker-ce docker-ce-cli containerd.io
service docker start

gmpy2 on ubuntu (not docker)


cd ~/static &&sudo apt update &&sudo apt install -y wget && sudo apt install build-essential -y&&wget https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz && tar xf ./m4-1.4.18.tar.gz && cd m4-1.4.18 && ./configure --prefix=/usr && make &&sudo make install &&cd .. && wget https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 && tar xf ./gmp-6.0.0a.tar.bz2 && cd gmp-6.0.0 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic && make &&make check&&sudo make install &&cd .. && wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.bz2 && tar xf ./mpfr-3.1.2.tar.bz2 && cd mpfr-3.1.2 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static && make &&sudo  make install &&cd .. && wget https://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz && tar xf ./mpc-1.0.3.tar.gz && cd mpc-1.0.3 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static --with-mpfr=$HOME/static && make && sudo make install &&cd .. && wget https://github.com/aleaxit/gmpy/releases/download/gmpy2-2.1.0a1/gmpy2-2.1.0a1.tar.gz && tar xf ./gmpy2-2.1.0a1.tar.gz && cd gmpy2-2.1.0a1

sudo python3 setup.py build_ext --static=~/static install

openssl 1.0.2 on ubuntu (not docker)


cd ~/static &&sudo apt-get install -y build-essential wget m4 libgmp-dev file git vim libomp-dev&& cd ~/static && wget https://www.shoup.net/ntl/ntl-11.3.2.tar.gz && tar xf ntl-11.3.2.tar.gz && cd ntl-11.3.2/src && ./configure SHARED=on NTL_GMP_LIP=on NTL_THREADS=on NTL_THREAD_BOOST=on && make -j4 && sudo make install&&cd ~/static && wget http://www.openssl.org/source/openssl-1.0.2a.tar.gz && tar -xvzf openssl-1.0.2a.tar.gz && cd openssl-1.0.2a && export CFLAGS=-fPIC && ./config shared --prefix=/usr && make && sudo make install

Environment construction summary on ubuntu (with gmpy2, openssl 1.0.2)



#Pyenv
sudo apt update &&sudo apt install -y wget git&&sudo  apt install build-essential -y&& git clone https://github.com/pyenv/pyenv.git ~/.pyenv &&\
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile &&\
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile &&\
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.profile &&\
source ~/.profile &&\
sudo apt install -y gcc make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev &&\
pyenv install 3.6.3 &&\
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv &&\
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.profile &&\
source ~/.profile &&\
pyenv virtualenv 3.6.3 myenv && pyenv global 3.6.3 &&\


#Openssl
cd ~ && mkdir static&&cd ~/static &&sudo apt-get install -y build-essential wget m4 libgmp-dev file git vim libomp-dev&& cd ~/static && wget https://www.shoup.net/ntl/ntl-11.3.2.tar.gz && tar xf ntl-11.3.2.tar.gz && cd ntl-11.3.2/src && ./configure SHARED=on NTL_GMP_LIP=on NTL_THREADS=on NTL_THREAD_BOOST=on && make -j4 && sudo make install&&cd ~/static && wget http://www.openssl.org/source/openssl-1.0.2a.tar.gz && tar -xvzf openssl-1.0.2a.tar.gz && cd openssl-1.0.2a && export CFLAGS=-fPIC && ./config shared --prefix=/usr && make && sudo make install &&\

#GMPY2
cd ~/static &&sudo apt update &&sudo apt install -y wget && sudo apt install build-essential -y&&wget https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz && tar xf ./m4-1.4.18.tar.gz && cd m4-1.4.18 && ./configure --prefix=/usr && make &&sudo make install &&cd .. && wget https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 && tar xf ./gmp-6.0.0a.tar.bz2 && cd gmp-6.0.0 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic && make &&make check&&sudo make install &&cd .. && wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.bz2 && tar xf ./mpfr-3.1.2.tar.bz2 && cd mpfr-3.1.2 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static && make &&sudo  make install &&cd .. && wget https://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz && tar xf ./mpc-1.0.3.tar.gz && cd mpc-1.0.3 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static --with-mpfr=$HOME/static && make && sudo make install &&cd .. && wget https://github.com/aleaxit/gmpy/releases/download/gmpy2-2.1.0a1/gmpy2-2.1.0a1.tar.gz && tar xf ./gmpy2-2.1.0a1.tar.gz && cd gmpy2-2.1.0a1 && source ~/.profile && python setup.py build_ext --static=~/static install &&\

#ORCL
sudo mkdir -p /opt/oracle &&\
cd /opt/oracle &&\
sudo wget https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip&&\
sudo apt-get install unzip &&\
sudo unzip instantclient-basic-linux.x64-19.6.0.0.0dbru.zip &&\
sudo apt-get install libaio1 &&\
sudo sh -c "echo /opt/oracle/instantclient_19_6 > /etc/ld.so.conf.d/oracle-instantclient.conf" &&\
sudo ldconfig && export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_6:$LD_LIBRARY_PATH &&\

# temp done
###What you need 1 git clone
source ~/.profile && pip install cython setuptools==44.0.0&& python setup.py build_ext install
###Necessary thing 2 git clone

Environment construction summary (when divided) on ubuntu (with gmpy2, openssl 1.0.2)



#Pyenv
sudo apt update &&sudo apt install -y wget git&&sudo  apt install build-essential -y&& git clone https://github.com/pyenv/pyenv.git ~/.pyenv &&\
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile &&\
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile &&\
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.profile &&\
source ~/.profile &&\
sudo apt install -y gcc make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev &&\
pyenv install 3.6.3 &&\
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv &&\
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.profile &&\
source ~/.profile &&\
pyenv virtualenv 3.6.3 myenv && pyenv global 3.6.3 &&\


###Necessary thing 2 git clone
source ~/.profile && bash build_exe.sh &&

#Openssl
cd ~ && mkdir static&&cd ~/static &&sudo apt-get install -y build-essential wget m4 libgmp-dev file git vim libomp-dev&& cd ~/static && wget https://www.shoup.net/ntl/ntl-11.3.2.tar.gz && tar xf ntl-11.3.2.tar.gz && cd ntl-11.3.2/src && ./configure SHARED=on NTL_GMP_LIP=on NTL_THREADS=on NTL_THREAD_BOOST=on && make -j4 && sudo make install&&cd ~/static && wget http://www.openssl.org/source/openssl-1.0.2a.tar.gz && tar -xvzf openssl-1.0.2a.tar.gz && cd openssl-1.0.2a && export CFLAGS=-fPIC && ./config shared --prefix=/usr && make && sudo make install &&\

#GMPY2
cd ~/static &&sudo apt update &&sudo apt install -y wget && sudo apt install build-essential -y&&wget https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz && tar xf ./m4-1.4.18.tar.gz && cd m4-1.4.18 && ./configure --prefix=/usr && make &&sudo make install &&cd .. && wget https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 && tar xf ./gmp-6.0.0a.tar.bz2 && cd gmp-6.0.0 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic && make &&make check&&sudo make install &&cd .. && wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.bz2 && tar xf ./mpfr-3.1.2.tar.bz2 && cd mpfr-3.1.2 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static && make &&sudo  make install &&cd .. && wget https://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz && tar xf ./mpc-1.0.3.tar.gz && cd mpc-1.0.3 && ./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static --with-mpfr=$HOME/static && make && sudo make install &&cd .. && wget https://github.com/aleaxit/gmpy/releases/download/gmpy2-2.1.0a1/gmpy2-2.1.0a1.tar.gz && tar xf ./gmpy2-2.1.0a1.tar.gz && cd gmpy2-2.1.0a1 && source ~/.profile && python setup.py build_ext --static=~/static install &&\


#pyodbc
sudo apt-get install -y unixodbc unixodbc-dev &&\

#ORCL
sudo mkdir -p /opt/oracle &&\
cd /opt/oracle &&\
sudo wget https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip&&\
sudo apt-get install unzip &&\
sudo unzip instantclient-basic-linux.x64-19.6.0.0.0dbru.zip &&\
sudo apt-get install libaio1 &&\
sudo sh -c "echo /opt/oracle/instantclient_19_6 > /etc/ld.so.conf.d/oracle-instantclient.conf" &&\
sudo ldconfig && export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_6:$LD_LIBRARY_PATH &&\

# temp done
###What you need 1 git clone
cd ~/static/cython_ope-from-cryptdb && source ~/.profile && pip install cython setuptools==44.0.0&& python setup.py build_ext install && cp build/lib.linux-x86_64-3.6/cython_ope.cpython-36m-x86_64-linux-gnu.so /sdb/ && cp /home/ubuntu/static/gmpy2-2.1.0a1/build/lib.linux-x86_64-3.6/gmpy2.cpython-36m-x86_64-linux-gnu.so /sdb/


Recommended Posts

linux memorandum
Linux memorandum [links]
Linux basic command memorandum
Linux
manjaro linux configuration memorandum
Linux command memorandum [for beginners]
Matplotlib memorandum
Linux command # 4
jinja2 memorandum
Linux commands
Linux commands
Python memorandum
Django memorandum
Linux command # 3
Linux overview
Full-human self-made Arch Linux memorandum # 1 installation
Linux basics
Command memorandum
direnv (linux)
Python Memorandum 2
A memorandum to change to Manjaro Linux
Organize Linux
plotly memorandum
linux commands
Linux practice
Slackbot memorandum (1)
Ubuntu Linux 20.04
multiprocessing memorandum
Memorandum MetaTrader 5
[Linux/LPIC] Memorandum
Linux Summary
ShellScript memorandum
Linux process
Linux permissions
pip memorandum
Python memorandum
Linux command # 5
About Linux
pydoc memorandum
python memorandum
Pandas memorandum
Linux basics
python memorandum
DjangoGirls memorandum
Forgot linux
Command memorandum
About Linux
Python memorandum
Linux commands
Linux commands
pandas memorandum
python memorandum
About Linux
Python memorandum
About Linux
About Linux ①
Linux redirect
Linux command list
[Linux] About export
[Memorandum] Discord distribution environment built only with Linux
Python basics memorandum