Bimil 2.20

Illustration

This minor update essentially brings only two significant changes.

First is inclusion of NTP check before time-based two-factor authentication code is generated for the first time. If you are getting code on freshly installed computer with wrong date or your clock simply drifted more than required 30 seconds, Bimil is now going to check time and issue correct code regardless of your system clock.

Second important change is Debian package. While you could run Bimil on Linux before, you had to deal with installation and requirements yourself. Now it is enough just to download package and use your favorite (Debian-based) installer. And yes, it does install in /opt.

To check these changes together with a few minor improvements and bug-fixes, you can download Bimil from these pages or update it through application.

Your Evaluation Period Has Ended

Illustration

There are no better ways to spend nice weekend morning than programming - I am sure you agree. ;)

So, one Saturday morning I started Visual Studio Community edition, only to be greeted with “Your evaluation period has ended” message. Somehow my license went “stale” even though I have been using Visual Studio 2017 for months now. Easy enough, there is “Check for an updated license” link immediately below. Unfortunately, that button did nothing except informing me that license couldn’t be downloaded.

Actual solution was to log into the Microsoft account. Once credentials have been verified, dialog simply disappeared. My best guess is that inability to log into account has been the cause for this license covfefe.

Although story has a happy ending, it might not been so if I didn’t have Internet. If this happened in the air, my options would be limited to crying and/or sleeping. Or, if I am lucky, paying exorbitant price of airplane WiFi.

I guess logging off and back onto my Microsoft account should become my standard preflight procedure.

But the question in the back of my mind is: Why the heck would you even put this check in development tool you give away for free?

HDD Health Analysis

Every day I get a daily report from my NAS. It includes bunch of data about ZFS datasets and general machine health. However, one thing was missing - I didn’t really capture hard disk SMART errors.

As disk will report a bunch of values in SMART, I first had to decide which ones to use. A great help here came from BackBlaze as they publish hard drive test data and stats. It is wealth of information and I recommend reading it all. If you decide on shortcut, one of links contains SMART stats they’ve found indicate data failure quite reliably.

First one is Reallocated Sectors Count (5). It is essentially counter of bad sectors found during drive’s operation. Ideally you want this number to be 0. As soon as it starts increasing, one should think about replacing the drive. All my drives so far have this value at 0.

Second attribute I track is Reported Uncorrectable Errors (187). This one shows number of errors that could not be corrected internally using ECC and that resulted in OS-visible read failure. Interestingly only my SSD cache supports this attribute.

One I decided not to track is Command Timeout (188) as, curiously, none of my drives actually report it. Looking into BackBlaze’s data it seems that this one is also the most unreliable of the bunch so no great loss here.

I do track Current Pending Sector Count (197) attribute. While this one doesn’t necessarily mean anything major is wrong and it is transient in nature (i.e. its value can change between some number and 0), I decided to track its value as it indicates potential issues with platter - even if data can be read at later time. This attribute is present (and 0) on my spinning disks while SSD doesn’t support it.

Fifth attribute they mentioned, Uncorrectable Sector Count (198), I do not track. While value could indicate potential issues with platters and disk surface, it is updated only via offline test. As I don’t do those, this value will never actually change. Interestingly, my SSD doesn’t even support this attribute.

I additionally track Power-On Hours (9). I do not have actual threshold nor I plan to replace the drive when it reaches certain value but it will definitely come in handy in correlation with other (potential) errors as all my disks support this attribute. Interestingly, BackBlaze found that failure rates significantly rise after three years. I do expect my drives to last significantly longer as my NAS isn’t stressed nearly as much as BackBlaze’s data center.

Lastly, I track Temperature (194). Again, I track it only to see if everything is ok with cooling. All my drives support it and, as expected, SSD’s temperature is about 10 degrees higher than for spinning drives.

Here is a small and incomplete bash example of commands I use to capture these stats on NAS4Free:

DEVICE=^^ada0^^
DISK_SMART_OUTPUT=`smartctl -a /dev/$DEVICE 2> /dev/null`
DISK_REALLOCATED=`echo "$DISK_SMART_OUTPUT" | egrep "^  5 Reallocated_Sector_Ct" | awk '{print $10}' | cut -dh -f1`
DISK_HOURS=`echo "$DISK_SMART_OUTPUT" | egrep "^  9 Power_On_Hours" | awk '{print $10}' | cut -dh -f1`
DISK_UNCORRECTABLE=`echo "$DISK_SMART_OUTPUT" | egrep "^187 Reported_Uncorrect" | awk '{print $10}' | cut -dh -f1`
DISK_TEMPERATURE=`echo "$DISK_SMART_OUTPUT" | egrep "^194 Temperature_Celsius" | awk '{print $10}' | cut -dh -f1`
DISK_PENDING=`echo "$DISK_SMART_OUTPUT" | egrep "^197 Current_Pending_Sector" | awk '{print $10}' | cut -dh -f1`

Note that I capture the whole smartctl output into a variable instead of multiple calls. This is just a bit of a time saver and there is no issue (other than speed) with simply calling smartctl multiple times. If you do decide to call it only once, do not forget quotes around “echoed” variable as they instruct bash to preserve whitespace.

PS: For curious, drives I use are 2x WD Red 4 TB (3.5"), 2x Seagate 2 TB (2.5"), and Mushkin 120GB (mSATA) SSD cache.

[2018-07-22: NAS4Free has been renamed to XigmaNAS as of July 2018]

Changing Ls Colors on NAS4Free

There is one thing I hate on my NAS4Free server - dark blue color when listing directories using ls command. It is simply an awful choice.

From Linux I knew about LS_COLORS variable and its configuration. However, NAS4Free is not Linux. And while similarities are plentiful, some things are simply not working the same.

Fortunately, one can always consult man page and see FreeBSD uses LSCOLORS variable with wildly different configuration. Curious can look at full configuration but suffice to say I was happy with just changing directory entry from blue (e) to bright blue (E).

To do this in my .bashrc I added:

export LSCOLORS="^^E^^xfxcxdxbxegedabagacad"

PS: How to preserve .bashrc over reboots is exercise left to reader because it depends on your system. Suffice to say is that either ZFS mount point or simply appending in postinit script work equally well.

[2018-07-22: NAS4Free has been renamed to XigmaNAS as of July 2018]

Determining Windows 10 ISO Build

Illustration

Windows 10 releases are numerous. If you are using Microsoft Media Creation Tool to download ISOs, you know how hard is to track them. Fortunately, it is possible to get information about version from ISO file itself.

First order of business is mounting downloaded ISO file. It is as easy as double clicking on it.

Then find Setup.exe; right-click; Properties; and go to Details tab. There under product version you will find the build number - in my case it was 15063.

If you want to know more (e.g. which editions are present in .iso file) we need to open Administrator command prompt (or PowerShell) and run [dism](https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/what-is-dism). I will assume, ISO is mounted as disk W: and that your download includes both 32-bit and 64-bit Windows. Adjust path to install.wim as needed.

dism /Get-WimInfo /WimFile:W:\x64\sources\install.esd
 Deployment Image Servicing and Management tool
 Version: 10.0.15063.0
 Details for image : W:\x64\sources\install.esd
 Index : 1
 Name : Windows 10 Pro
 Description : Windows 10 Pro
 Size : 15,305,539,033 bytes
 Index : 2
 Name : Windows 10 Home
 Description : Windows 10 Home
 Size : 15,127,824,725 bytes
 Index : 3
 Name : Windows 10 Home Single Language
 Description : Windows 10 Home Single Language
 Size : 15,129,601,869 bytes
 Index : 4
 Name : Windows 10 Education
 Description : Windows 10 Education
 Size : 15,125,050,322 bytes
 The operation completed successfully.

As you can see, this disk consists of four editions. Which one gets installed is determined based on your product key.

And you can go even further with investigation, if you give it index parameter:

dism /Get-WimInfo /WimFile:^^W:\x64\sources\install.esd^^ /index:^^1^^
 Deployment Image Servicing and Management tool
 Version: 10.0.15063.0
 Details for image : W:\x64\sources\install.esd
 Index : 1
 Name : Windows 10 Pro
 Description : Windows 10 Pro
 Size : 15,305,539,033 bytes
 WIM Bootable : No
 Architecture : x64
 Hal : 
 Version : 10.0.15063
 ServicePack Build : 0
 ServicePack Level : 0
 Edition : Professional
 Installation : Client
 ProductType : WinNT
 ProductSuite : Terminal Server
 System Root : WINDOWS
 Directories : 19668
 Files : 101896
 Created : 2017-03-18 - 19:40:43
 Modified : 2017-08-26 - 21:33:30
 Languages :
         en-US (Default)
 The operation completed successfully.