4/30/2021

python source code to print list of all subfolder and files

 

for path, subdirs, files in os.walk('/your_folder/'):
for name in files:
print(os.path.join(path, name))

4/29/2021

Install python 3.8 on Linux

 

Following below step:

-------------

wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz

tar xvf Python-3.8.3.tgz

cd Python-3.8*/

./configure --enable-optimizations

make altinstall

-------------



Run amazon-linux 2 on local computer using Docker

 

I suppose you already installed docker.


1. pull Amazon Linux image

> docker pull amazonlinux

* https://hub.docker.com/_/amazonlinux


2. run container and enter the os

> docker run -it amazonlinux /bin/bash


3. check version

bash-4.2# > cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

or

bash-4.2# > cat /etc/system-release
Amazon Linux release 2 (Karoo)


Thank you.

🙇🏻‍♂️

4/20/2021

error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8) fatal: the remote end hung up unexpectedly

 

I encounter this error when I push my repo.


>>>

error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)

fatal: the remote end hung up unexpectedly

<<<


I am trying following things to solve, It comes from stack overflow.


1.

git config --global http.version HTTP/1.1
git push 
git config --global http.version HTTP/2


2.

git config http.postBuffer 524288000



I tired both, but I failed.

In luck you could success.


Thank you.


4/16/2021

jupyter print clear

 

Use Ipython.disply to make printed thing clear.

from IPython.display import clear_output

for i in range(10):
clear_output(wait=True)
print("Hello World!")


Thank you.

🙇🏻‍♂️

2/19/2021

TeamViewer, can't access remote computer on ubuntu after a reboot

It works for me.

 

sudo gedit /etc/gdm3/custom.conf

Uncomment this line in custom.conf file:

WaylandEnable=false

and Reboot.


1/29/2021

Importerror: libgl.so.1: cannot open shared object file: no such file or directory opencv error

Try this one first:

pip install opencv-python--headless


or 

install follow in case centos or aws linux docker

RUN yum install whatprovides libGL.so.1 -y

install follow in case linux docker

ENV TZ=Europe/Minsk
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get install libgtk2.0-dev -y

 

Thank you, Good luck!