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*")]

A Better Feature Branch Naming in Intellij IDEA

Intellij Idea has a very nice feature: you can customize feature branch name. When create a new task, the Intellij IDEA will help you create a new (git) branch. The default name of the branch is the task number, e.g. FOO-1 for Jira, or #1 for gitlab.

However, we can make the branch name better by adding the task summary to it. It will be like FOO-1-add-a-new-feature. To configure it, goes to Preferences->Tools->Task and change the Feature branch name format to {id}-{summary}

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)