Month: December 2016

ASN.1 encoding tutorial


Recently I in my work I had to encode an Inap (to be more precise – Sinap) content “by hand”. It’s not a rocket science however when you need to repeat this action several times it’s worth to prepare an “automatic” solution.

Input data

As an imput I have description of Furnish Charging Information in ASN.1:

FurnishChargingInformation ::= OPERATION 
   ARGUMENT FurnishChargingInformationArg 
   ERRORS {MissingParameter , 
                 TaskRefused , 
                 UnexpectedComponentSequence , 
                 UnexpectedDataValue , 
                 UnexpectedParameter } 
FurnishChargingInformationArg ::= FCIBillingChargingCharacteristics
FCIBillingChargingCharacteristics ::= OCTET STRING (SIZE (minFCIBillingChargingLen..maxFCIBillingChargingLen))

Ok, how to read it? (S)INAP message FurnishChargingInformation has an argument FurnishChargingInformationArg which is eqal to FCIBillingChargingCharacteristics. FCIBillingChargingCharacteristics is a limited size octet string.


Withings to Garmin Connect

Since a while I’m owning great Withings Scale which has a capability to store measurements in a cloud. Because I’m using Garmin GPSes (and Garmin Connect), I’d love to synchronize the measurements to the Garmin Connect site.

Lucky, I found a great script garmin-withings.

Unfortunately, after latest changes in the Garmin Connect (implementation of SSO on march 2014) the script stopped to work. I’ve compiled changes proposed by and it seems that the script with my updates works again (well, at least until further changes in Garmin Connect…)

You can find the script on


Garmin Connect can display a lot of other parameters, not only weight and body fat level:


It would be great to calculate all these figures and post them to Garmin Connect, right? 🙂

How to disable and remove usbecm2 device from Solaris 11 server

After fresh installation of T4-1 server, I’ve noticed a network interface which I didn’t expect – the usbecm2:

root@slc:/# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet netmask ff000000
net0: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 7
        inet netmask ffffff00 broadcast
        ether 0:10:e0:9a:2e:6
usbecm2: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 14
        inet netmask ffffff00 broadcast
        ether 2:21:28:57:47:17
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128
net0: flags=120002000840<RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 7
        inet6 ::/0
        ether 0:10:e0:9a:2e:6
usbecm2: flags=120002000840<RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 14
        inet6 ::/0
        ether 2:21:28:57:47:17


Half-Life 1 on Wine

Almost 20 years after game release I wanted to play it to check if it provokes same feelings.

As I’m on MacOS now, the obvious choice was to use Wine to run the game.

After setting Wine environment and installing the game, it turned out that although the game starts up, it’s completely un-usable as we can see just 1/3 of the screen, without any option to change the resolution:

$ wine hl.exe -startwindowed