Aug 132018

One of my XigmaNAS machines had a curious issue. Upon boot, it wouldn’t display the console menu. After boot it would go directly to the bash prompt – no password asked. While practical, this was completely insecure as anyone capable of connecting monitor and keyboard would get a full access.

Upon checking configuration, culprit was obvious – I changed the default shell. As console menu execution is part of .cshrc configuration file and bash ignores that file, the console menu was forever lost.

I definitely didn’t like that.

Since I really wanted bash prompt but also preferred to have the console menu (that can be disabled), I decided upon a slightly different shell selection approach without system-wide consequences . Simply adding exec bash command at the end of .cshrc works nicely without the nasty side-effects The following PostInit script will do the trick:

printf '\\nif ($?prompt) then\\n\\texec bash\\nendif\\n' >> /root/.cshrc

And yes, check if we’re working with interactive shell ($?prompt part) is necessary because commands executed without terminal (e.g. directly over SSH or cron jobs) will fail otherwise.

Aug 082018

When it came to setup my remote backup machine, only three things were important: use of 4K disks, two disk redundancy (raidz2), and a reasonably efficient storage of variously sized files. Reading around internet lead me to believe volblocksize tweaking was what I needed.

However, unless you create zvol, that knob is actually not available. The only available property impacting file storage capacity is recordsize. Therefore I decided to try out a couple record sizes and see how storage capacity compares.

For the purpose of test I decided to create virtual machine with six extra 20 GB disks. Yes, using virtual machine was not ideal but I was interested in relative results and not the absolute numbers so this would do. And mind you, I wasn’t interested in speed but just in data usage so again virtual machine seemed like a perfect environment.

Instead of properly testing with real files, I created 100000 files that were about 0.5K, 33000 files about 5K, 11000 files about 50K, 3700 files about 500K, 1200 files about 5M, and finally about 400 files around 50M. Essentially, there were six file sizes with each set being one decade bigger but happening only a third as often. The exact size for each file was actually randomly chosen to ensure some variety.

After repeating test three times with each size and for both 4 and 6 disk setup, I get the following result:

4 disks 6 disks
Record size Used Available Used Available
4K 0 61,557 17,064
8K 0 61,171 17,450
16K 34,008 4,191 31,223 47,398
32K 34,025 4,173 31,213 47,408
64K 31,300 6,899 31,268 47,353
128K 31,276 6,923 31,180 47,441
256K 30,719 7,481 31,432 47,189
512K 31,069 7,130 31,814 46,807
1024K 30,920 7,279 31,714 46,907

Two things of interest to note here. The first one is that small record size doesn’t really help at all. Quantity of metadata needed goes well over available disk space in the 4-disk case and causes extremely inefficient storage for 6 disks. Although test data set has 30.2 GB, with overhead occupancy goes into the 60+ GB territory. Quite inefficient.

The default 128K value is actually quite well selected. While my (artificial) data set has shown a bit better result with the larger record sizes, essentially everything at 64K and over doesn’t fare too badly.

PS: Excel with raw data and script example is available for download.

PPS: Yes, the script generates the same random numbers every time – this was done intentionally so that the same amount of logical space is used with every test. Do note that doesn’t translate to the same physical space usage as (mostly due to transaction group timing) a slightly different amount of metadata will be written.

Aug 032018

My only console – X-Box 360 – is a bit aged by any standard. I don’t find that too bothersome except in one aspect – network connection. Being aged means it has only wired ethernet. Considering I “bought it” for actual cost of $0, paying $50 for wireless adapter would be a bit of a premium.

Fortunately, I had Mikrotik mAP Lite lying around. It’s a small device with 2.4 GHz and a single 100 Mbps RJ-45 Ethernet connector. While not obviously designed to be a wireless client, its powerful software does allow for this.

The very first step is not only resetting Mikrotik mAP lite configuration but actually deleting it fully. Either using System, Reset Configuration, and selecting No Default Configuration or going via terminal is equally good:

reset-configuration no-defaults=yes

Starting with the blank slate would be problematic for many devices, but not Mikrotik as one can always use WinBox and its neighbor search option to connect using MAC address.

On the empty device, the first step is creating the security profile and connecting to the wireless via the bridge. In my case I used WPA2 and with n-only wireless. While default of b/g/n (2.4ghz-b/g/n) does offer a bit more flexibility when it comes to compatibility with other devices, using n-only does help with network’s speed (e.g. beacons are always transmitted at the slowest speed standard allows). Of course, you will also need to know the wireless SSID.

In the Mikrotik’s language these steps can be expressed with the following commands:

/interface wireless security-profiles
add name=security-profile authentication-types=wpa2-psk mode=dynamic-keys \

/interface wireless
set [ find default-name=wlan1 ] disabled=no band=2ghz-onlyn frequency=auto \
    mode=station-pseudobridge security-profile=security-profile ssid=SSID

The only thing remaining is creating the bridge and putting all devices into it.

/interface bridge
add name=local-bridge

/interface bridge port
add bridge=local-bridge interface=wlan1
add bridge=local-bridge interface=ether1

Connecting Mikrotik’s mAP to X-Box via RJ45 and USB cable (for power) will now dutifully transfer all the packets via the wireless interface.

Jul 292018

Well, Microsoft learned one thing from the whole forced Windows 10 upgrade fiasco. If users don’t want to use your product because it lacks functionality, just force the upgrade on them as often as possible. Although with Skype they had opportunity to go further – just intentionally brick the old version short time in the future.

Yes, Skype Classic is going the way of the dodo. Is the new Skype good at least?

Well, the most notable change is the removal of a split (multi-window) mode. This makes is impossible to track two conversations without a load of clicking back and forth. Of course, Copy/Paste from the far history in one conversation will result in loads of scrolling since Skype will always jump to the last message as you switch.

And of course, just in case that hasn’t caused too much trouble, they had to be sure docking it to the display’s edge (so it doesn’t use too much space) also makes it unusable unless you are actively monitoring messages. You see, if you get into discussion when window is too small, any message that comes will be only indicated by tiny counter in title bar. And yes, of course they would remove advanced filtering, why not?

To ensure you feel as uncomfortable as possible, Escape key is no longer supported. It used to be possible to close window using a single key – no more – now you get to use Alt+F4. Just be careful which window is selected because, unlike every other tray icon since the dawn of time, double-clicking on Skype in the system tray actually deselects its window. But that is not a major issue since using keyboard to navigate is exercise in futility anyhow.

And there are multiple smaller issues too. For example, not following the system settings for time. Regardless of me using 24h time format (H:mm) in Windows, Skype insists on AM/PM nonsense. And no, before you ask, it doesn’t respect my date format either.

I believe you get the gist of it – the new Skype and its app-like behavior is again design winning over functionality and force-feeding the least common denominator on everybody. Considering amount of substandard applications we got with Windows 10 (don’t let me start about Calculator) I guess this was expected.

Well player Sir!

[2018-08-07: Microsoft decided not to kill proper desktop client – for now. They didn’t really specify the date so there’s no way to know for how long. My guess is that they’ll just have Skype 7 remind you to upgrade even more than now. And yes, their pages don’t have Skype 7 for download anymore, so one wrong click is all that’s needed to make you “happy” version 8 user. Fortunately direct link still works (SHA256 for 1e4ca5d441a00ac6 91c58e0aa5890c3f eb395d2dc53dbae8 2faec7c9df4e52fc).]

[2018-08-11: Yep, as anticipated, Microsoft is pushing upgrade whether you want it or not. I got asked 4 times in the last 24 hours to download the new version. Frankly, at this time I am looking for alternative chat application to replace Skype altogether on my desktops.]