November 27, 2022

How to fix the traffic jam in India

Fixing something is usually done by putting the resources towards the right place. One attempt might be to build more roads in the attempt that this will reduce the amount of traffic jams. But the most efficient resource allocation is done at a different location, namely the railroad system. Similar to the car roads, the train system in india has a high demand but low amount of ressources. And building new railroad networks is expensive. A cost effective alternative is to measure the existing traffic with more sensors.

So a cheap version to improve the efficiency is to buy a simple arduino based sensor and count how many trains are arriving at the trains station and how many are leaving. Also the sensor counts the time and date.

Such a single sensor won't be able to fix all the problems of India, but it is a first step towards a possible solution to the traffic jam problem.

November 17, 2022

Linux is a large hard drive

 Computers in the past were easy to explain. The commodore 64 consists of ROM which holds the operating system and MS DOS needs a single boot floppy drive which consists of only three files: command.com, io.sys and msdos.sys

In contrast, a modern operating system like Linux looks similar to a mess. There are endless amount of small files which contains of config files, man files, documentation, binary files and log files. The exact amount of all files can be determined either the in graphical "disc usage analyzer" or on the command line with:
df -i /

The amount of active inodes is equal to the files which includes directories. For most fresh installed Linux distribution the amount is around 500k. Only for comparison reason a fresh Windows installation needs around 300k files.

Most Linux beginners and even experts will struggle to explain what is stored in the these files. In most cases it contains of system programs, applications and helper files for the fonts, icons and so on. The only thing what is for sure is, that Unix will need all these files and many real life webservers will need much more additional files for the home directory. The huge file count is perhaps the most obvious difference between a commodore 64 and a unix system.

It is not possible to install the Unix operating system on a single flopp drive or in the ROM of a the hardware. This is an advantage and disadvantage at the same time.

It should be mentioned, that the amount of 0.5 million files on a standard linux system is a small amount of files. The reason is, that only the trunk version of each file which is the latest was installed. In addition the git repository contains many more versions which is available in the cloud. So we can say that the Linux operating system contains of a much more different files which were created over the years. It seems, that this is not perceived as a problem, but it is strength of Unix. Because it allows to growth the system endless.

Unix is working with some underlying assumptions. The idea is not about running a program on a CPU. Such a paradigm was valid for homecomputers. In contrast Unix is working with the assumption that there are 500k files on the harddrive and with each update, additional files are created. Also the existing files are modified by the upstream in a version control system. So the overall Unix system has much in common with a repository of programs and config files.

On the Commodore 64 and early CP/M computers the principle was to reduce the amount of files. Fewer files can be stored on less floppy disks and are running faster on the computer. In addition, fewer files can be compiled faster and contains of fewer bugs. With the advent of Unix, such a minimalist approach has been abandoned.