On the Subject of Sysadmin

sudo rm -rf /*

The module is a console. When it is waiting for command input you will see green  > _ symbols.

This console is connected to a bus topology network. The network contains 100 nodes. Each node is numbered from 0 to 99 without repetitions. All nodes are sorted by their id. Up to ten of these nodes are servers, the rest are data storages. Each storage is 1 TB in size. There is a virus on the network that damages the nodes. You can fix it, but you need to do it as soon as possible - the longer you are idle, the more nodes will be damaged.

If the node is damaged, then find the error code in the table on page #3. Then calculate the value in the last column on the same row (using the table on the current page). If this value is greater than 9 or less than 0, then subtract or add 10 until the number is in the range [0-9]. In the same column as the error code, find all codes that contains the calculated value. The recovering code is equal to the first characters of the found codes, starting from the next one after the error code and further down. This action is looped vertically, so after going through the last row, go back to the first.

Information on how to solve the module and in what cases the strikes will be received can be found on page #2. Page #2 contains a list and description of the commands available for entering into the console.

All commands (including codes) are case insensitive.

T Starting time in minutes
F Recovered nodes count
B Batteries count
I Indicators count
K Max least significant digit of two factor codes.
If there are no two factor codes, use solved modules count
R Remaining minutes count
M Modules count
S Min digit in serial number
E Strikes count

Commands:

  • serverlist - Displays information about all servers. For each server, information about the id of the node and the required storage size for work will be provided. If storage nodes have already been allocated to this server, then the range of allocated nodes will also be displayed.
  • status - Displays general information about the current state of the network. Here you can see the number of servers to which the storage nodes have been allocated; the required number of allocation that need to be made for the module to be solved; number of damaged and recovered nodes.
  • allocate {NODE_ID} {DIRECTION} - Allocates the required number of nodes in the specified DIRECTION to the server with the specified NODE_ID. Direction must be one of the following: left, down (decreasing id), right or up (increasing id). In order for the command to work correctly, the following conditions must be met:
    • The selected node must be a server;
    • * The allocation nodes must be data storages (not servers);
    • There should be no attempts to allocate nodes with id less than 0 or greater than 99;
    • The server node, as well as the allocation nodes, should not be damaged;
    • * The allocation nodes should not be allocated to another server.
    If the conditions marked with an asterisk are not met, all allocations will be reverted and the strike will be counted.
  • debug {NODE_ID} - Checks the status of a node by its NODE_ID. If it is damaged, then an error code will be displayed in the result.
  • recover {NODE_ID} {FIX_CODE} - Attempts to recover data on a node by its NODE_ID using FIX_CODE. If FIX_CODE is correct, then the node will be recovered. If FIX_CODE is incorrect or this node is not damaged, then all allocations will be reverted and a strike will be counted.
  • commit - Applies all changes. If the required number of allocations is reached, the module will be solved, otherwise all allocations will be reverted and a strike will be counted.
  • revert - Reverts all allocations and gives a strike.
  • clear - Clears the console