Modelling arithmetic calculator in Fallout 4 game: Four bit adder

On the past weekend a friend of mine has asked if I really understand how all those bits are running inside computers. I answered positively for sure, but nevertheless decided to build a bicycle electronic device that require binary logic and operation. Having no Arduino, Raspberry or even soldering iron at my place I put my eyes on emulator … Fallout 4 game. Guys, really, who needs some boring emulator if we can have lots of fun, playing a game with amazing 3D graphic?

See my short video about switching tumblers on a huge concrete structure of CalcWall version 0.1:

I was planning to build at least Adder and Subtractor parts along with some kind of display and keyboard, but unfortunately my vacation is now over, so I have lost a chance to construct something more than a simple Adder implementation in a nearest future.

Current CalcWall schematic, not fully compliant to standards, is shown below:

Posted in My projects, Offtop | Tagged , , , , , , , | Leave a comment

Simple snake/wormlike creatures mod for Minetest game

Slugs. Find them on grass and dirt. A simple snake/wormlike creatures mod for Minetest to please my son who loves crafting 🙂

This is the very first, initial release. Don’t expect much, it’s very buggy and ugly. Slugs are brainless, they just move.

Download it from

Installation: copy into Minetest mods directory, unpack, enable in the game.

Any ideas, suggestions and fixes are strongly welcome!

Short video is here:

Posted in My projects | Tagged , , , , , , , , | Leave a comment – Report IBM SVC/Storwize storage system performance statistics in CLI using SMI-S interface

My *stat-like utility to report IBM SVC/Storwize storage system performance statistics in CLI using SMI-S interface.

Report IBM SVC/Storwize storage system performance statistics in CLI using SMI-S interface

  • Requires Python 3 with ‘pywbem’ module
  • Before running, enable statistic on SVC/Storwize system:
    svctask startstats -interval <1-60 minutes>

Download from GitHub

Usage: -n|-v|-m|-d -a address -u user -p password [-f minutes] [-ht]

-n, -v, -m or -d
option -q not recognized
Show nodes, vdisks, mdisks or drives performance statistics.

-a address -u user -p password
Valid IP/DNS address, username and passwors to connect with IBM SVC/Storwize storage system
[-f minutes]
Optional report frequency interval. Must not be less then default "StatisticsFrequency" value.
Disable column headers.
Show report date/time creation timestamp on the storage system

IBM SVC/Storwize CIM agent documentation

Project page:

Posted in My projects, Storage, Storage Automation | Tagged , , , , , , , , , , , , | Leave a comment

Extracting Performance Data from IBM Storwize

Vadim Zaigrin

Universal Storage Collector could extract performance data not only from EMC Storage Systems 🙂

New Extractor extracts data from IBM Storwize storage family.

View original post 116 more words

Posted in Copy-paste, Storage | Tagged , , , | 1 Comment

Executing a batch of commands on multiple IBM SVC/Storwize storage systems

Sometimes you have to change several configuration parameters or run multiple commands over a list of IBM SVC storage systems. Here is my small Python 3 script to do the stuff quickly. It requires Paramiko module to handle SSH interactions.

Edit to set targets, logins, passwords and all other parameters.

Usage: ./


# - using SSH, execute a batch of commands on multiple IBM SVC/Storwize storage systems
# Python 3 and paramiko module are required
# Edit to set targets, logins, passwords and all other parameters
# Usage:
#  ./
# 2017.09.14  v 1.0   Mikhail Zakharov <>

import sys
import datetime
import paramiko

# Configurable values are in
import svcrun_conf

def ssh_exec(command, target, port=22):
    """Execute a command via SSH and read results"""

    client = paramiko.SSHClient()

        client.connect(target[0], username=target[1], password=target[2], port=port)
        return 'Error: {user}@{target}: is inaccessible: {error}'.format(user=target[1], target=target[0],

    stdin, stdout, stderr = client.exec_command(command)

    error =
    if error:
        error = error.decode('US-ASCII')
        return 'Error: {user}@{target}: "{command}" has failed: {error}'.format(target=target[0], user=target[1],
                                                                                command=command, error=error)

    data =

        data = data.decode('UTF-8')
    except UnicodeDecodeError:
        data = data.decode('US-ASCII')

    return data

def runcommand(target, command):
    dt = '{0:%Y-%m-%d-%H-%M-%S}'.format(

    print(dt, 'Run command: "{cmd}"'.format(cmd=command), file=sys.stderr)
    print(ssh_exec(command, target), file=open(dt + '_' + target[0] + '_' + command.split()[0] + '.out', 'a'))

for target in svcrun_conf.svc_targets:
    for command in svcrun_conf.svc_commands:
        runcommand(target, command)

print('Done', file=sys.stderr)

Configuration file is required:

# Configuration file for

# Default SVC/Storwize credentials
svc_username = 'username'
svc_password = 'password'

# SVC/Storwize systems to run commands on
svc_targets = {
    # 'Hostname/IP', 'Login', 'Password'),
    ('', svc_username, svc_password),
    ('', 'anotheruser', 'secret')

# Commands to run one by one on each SVC/Storwize system
svc_commands = [
    'lssystem -delim \,',
    'lsvdisk -nohdr -bytes -delim \,'

Download it from GitHub

Posted in Storage Automation, Tips & tricks | Tagged , , , , , , , , , | Leave a comment

Scan IBM SVC/Storwize system for “SCSI ID Mismatches”

A small addition to the SAN/Storage CLI Toolbox which shows so called SCSI ID (LUN) mismatches on IBM SVC/Storwize systems. This Bourne shell/awk script shows the list of the same vdisks that are mapped with different SCSI IDs. Should be useful for clusters, especially VMware.


# -----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return Mikhail Zakharov
# -----------------------------------------------------------------------------

# - Scan IBM SVC/Storwize system for "SCSI ID Mismatches"
# 2017.08.31    v1.0

delim=","			# Main delimiter
delim2=";"			# Second layer delimiter
fashion="../fashion/fashion"	# fashion SSH wrapper. Comment/uncomment the
				# appropriate lines below if you want pure SSH

lshostvdiskmap="lshostvdiskmap -nohdr -delim $delim"

# ----------------------------------------------------------------------------- 
usage() {
    echo "Usage:"
    echo " <target> <user> <password>"
    exit 1
# ----------------------------------------------------------------------------- 
[ "$#" -ne 3 ] && usage


awk="gawk"				# We need gawk to do the stuff

# Uncomment ssh and comment fashion if you like
#ssh "$user"@"$target" "$lshostvdiskmap" | $awk -F "$delim" -v d2=$delim2 '
$fashion "$target" "$user" "$password" "$lshostvdiskmap" | 
	$awk -F "$delim" -v d2=$delim2 '
	# Put all records into an array
	for (f = 1; f <= NF; f++)
		dm[NR, f] = $f
	dm[NR, NF + 1] = 0		# Mapping count
	dm[NR, NF + 2] = ""		# SCSI ID List
	for (l = 1; l <= NR; l++)
		for (l1 = 1; l1 <= NR; l1++)
			if (dm[l, 4] == dm[l1, 4]) {
				dm[l, NF + 1] += 1
				dm[l, NF + 2] = dm[l, NF + 2] dm[l1, 3] OFS
	# Pack SCSI ID List
	for (l = 1; l <= NR; l++) if (dm[l, 9] > 1) {
			len_sidlst = split(dm[l, NF + 2], sidlst)
			# get unique SCSI IDs only
			delete usidlst
			for (le = 1; le <= len_sidlst; le++)
			# Save unique SCSI IDs back to the list
			delete dm[l, NF + 2]
			for (sid in usidlst)
				if (sid != "")
					dm[l, NF + 2] = dm[l, NF + 2] sid d2
	# Print out report
	print "Host ID", "Host Name", "SCSI ID", "Vdisk ID",\
		"Vdisk Name", "Vdisk UID", "IO Group ID",\
		"IO Group Name", "Mapping count", "SCSI ID List"
	for (l = 1; l <= NR; l++) if (split(dm[l, NF + 2], sidlst, d2) > 2) {
			for (f = 1; f < NF + 2; f++)
				printf dm[l, f] OFS
			# Ugly strip of the last "d2" occurrence
			printf substr(dm[l, NF + 2], 1, length(dm[l, NF + 2]) - 1)"\n"

Download it from GitHub.

Posted in Storage Automation, Tips & tricks | Tagged , , , , , , , , , , , , | Leave a comment

Accessing HP/3PAR storage systems using Python and SSH

I have just found a small script on Python 3 which I wrote for D81S to test a connection with HP/3PAR 7xxx arrays. It still looks like a good example of the subject, so I decided to store it for the future reference.

Posted in Storage Automation, Tips & tricks | Tagged , , , , , | Leave a comment