Docker memory limit

There are some options to control application memory consumption. Docker has a couple of flags to control application inside the container. –memory flag defines non swap memory limit –memory-swap flag defines total memory limit (swap + non swap memory) Details can be found here Moreover, there is a cgroups limit at the os level. To check it cat /sys/fs/cgroup/memory/memory.limit_in_bytes When you try to check is, in some situations you can see some huge magic number

Addict

There is a nice python library addict which is interesting for a couple of reasons. First of all, it simplifies creating a nested dictionary (see readme). Secondly, it represents an another nice example of using python magic methods.

Fix flash drive block size

Let’s suppose you want to format flash drive but while you are trying to start formatting you see an error like this ‘The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes’. Moreover, partitions can not be removed using neigher gnome disk nor gparted. In that case you can use fdisk with privileged access: fdisk /dev/sdX To show partition you can use ‘p’ command, to remove partition - ‘q’ command.