Python how to list files under a directgory

There are so many ways, but in python 3 looks the most popular way is using pathlib. Here is an example to list all
files starting with bar under dir /foo

[x.absolute() for x in pathlib.Path("/foo").glob("bar*")]

Generate Random Numbers from Command Line

On mac or bsd, we can use jot.
jot -r 1 0 10000

jot -r 1 0 0x7fffffffffffffffL

On linux need to install the package athena-jot:
sudo apt-get install athena-jot

Docker How To Delete Everything

Just want fresh restart and delete all containers? Here is the code:

docker stop $(docker ps -a -q) docker rm $(docker ps -a -q)

If you want to delete all images too:
docker stop $(docker ps -a -q) docker rmi $(docker images -a -q)