Sunday, July 30, 2017

Script to group files/directories to reach the closest desired/target size.

Program takes a list of files and directories as a set of last arguments and outputs the paths of each of the files/directories which has been selected to reach the target size (which is the first argument). Will ignore files which do not exist.

First argument -- target size in bytes.

Off the selected files, will print each of them in a new line with their size, separated with a tab in the same line. Specify units as KB, MB, GB, TB in the environment variable UNIT.

script --

Before you run, install run 'gem install ClosestSum' on your system as root. This'll install the
ClosestSum gem which's a library implementing the algorithm.

Monday, July 24, 2017

lxc-console prints duplicate characters (crippled/corrupt console).

This happen on Debian. After an upgrade to lxc 2.0.x, lxc-console does not work well. Produces duplicate characters, cannot log in because of the same reason.

In lxc-1.x you must have made getty@tty*.service somewhere in /etc/systemd/system/. They're no longer needed. Remove them to fix the issue.