DRM Exceptions

A few days ago The Library of Congress has published Exemption to Prohibition on Circumvention of Copyright Protection Systems for Access Control Technologies. To make a long document short, you get to bypass a bit of DMCA (Digital Millennium Copyright Act) rules.

Most of the media talk about playing older games and fixing consoles or jail-breaking your phone but that’s not the full scope. For example, there is a security research exception. Without this exception any company ending as butt of a joke could sue the security researcher. And, the way how DMCA was written, they would prevail. Mind you, they still get to sue you, but now their victory is unlikely.

For Nth year in row, these rules also plug a hole in e-book accessibility. For example, without this exception, blind people would depend on the mercy of DRM-protected content producers. With this exception, they can use software of their choice to help them read and, if software has to break DRM to do it, so be it.

Lastly, one important category is fixing your vehicles. Quite a few manufacturers (John Deer comes first to mind but they are not alone) have been using DRM as a way to prevent you from fixing your vehicle yourself. There is quite a lot of revenue to get if you can block those pesky independent repairmen. Well, at least now they cannot use DRM to do this.

However, it’s not all good news as these provisions expire every three years and thus there is always a possibility of “LoC giveth, LoC taketh away” situation in the future. And just having right to DRM circumvention doesn’t mean shit if you still cannot get replacement parts and/or any replacement parts you do obtain are potentially seized.

But it is a good step forward.

Checking XigmaNAS Network Speed

If your XigmaNAS server is a bit slow, it’s often beneficial to see what is your network speed before changing settings - especially if you are on wireless. If your network cannot handle more than 50 Mbps, you cannot complain when you have only 5 MB/s Samba transfer rate.

While there are many ways you can check the speed, I usually find iperf3 the best choice. Not only it comes preinstalled on XigmaNAS, but you can also download precompiled binaries for Windows, Linux, and BSD to start with. If that’s not enough, you can always use freely available source and compile it yourself.

My approach is first starting server on XigmaNAS (or FreeNAS if that’s your NAS platform of choice):

iperf3 -s

Once server is listening I run the following commands on client, giving it IP address of that server:

iperf3 -c ^^192.168.0.1^^

And that’s it. This command will send data for 10 seconds toward server and receive back the same from it.

Armed with the number you can now deal with that pesky SMB3 performance.

Displaying EOL Symbol in Visual Studio Code

inline right

As soon as I started playing with Visual Studio Code a bit more, I found it’s whitespace rendering function lacking. While it does render spaces and tabs, I found it hard to deal with the absence of EOL marking. Yes, Visual Studio Code does show that information in status line and the whole thing is not really per line setting as Code will “normalize” line endings upon load but I simply missed those buggers.

I did find a couple extensions doing it but none really worked seamlessly as I wanted them. For one, they had a separate setting for turning them on/off. While I do love my EOL characters, I don’t want to see them all the time and I definitely don’t want to go into settings to change their state when there’s perfectly good Toggle Render Whitespace menu option available. Moreover, I wanted color of EOL to fit with the existing whitespace theme rendering instead configuring it separately.

I guess it was time to make my own extension.

Well, first, there is a really good guide through building simple extension. While it might not go deep into the topic, you will have both working extension and knowledge how to debug it by the time you’re done.

Secondly, if you go into %USERPROFILE%\.vscode\extensions directory (on Windows), you will see all extensions there - including their source code. I might not be the biggest fan of JavaScript (or TypeScript) but I am definitely the fan of learning by example. If you see some other extension doing something really close to what you need, you can see how it’s working and start from there.

Lastly, publishing extension is easy too. Assuming you got your package setup correctly, you’re just a few lines away from having it in the wild world.

To sum it up, creating and publishing extension was rather interesting and easy experiment. While JavaScript and occasionally flaky documentation did cause me to spend way too much time on this, it wasn’t all too bad. Debugging experience is acceptable and it feels nice to actually make something you’ll use. Not sure I’ll repeat it any time soon but I will definitely keep it in mind.

If it sounds interesting, you can install extension from within Visual Studio Code if you search for Render CRLF, check it’s marketplace page, or take a look at the source code.

RoboCopy Bandwidth Limitting

If you are using RoboCopy to make backups, you might have noticed it’s a bandwidth hog. Once you start copying, it will saturate the network making it a bit annoying to copy anything else at the same time.

While RoboCopy has no understanding of bandwidth limiting, there is a concept of inter-packet gap pause. Yes, you can go and calculate it (with a varying degree of success) or you can just test a few runs with different IPG number.

I personally found that /IPG:7 works wonderfully for my background backups.

CAN Bus Decoding Using PicoScope

Illustration

When it comes to CAN bus protocol decoding, beating PicoScope is hard considering that even the cheapest 2000 series member has full support for it. Converting such scope to one with the floating ground is as easy as unplugging your laptop (or running your desktop of an UPS’ battery). However, there are a few issues you might want to avoid.

The very first step would be to properly trigger on the CAN bus message. Reasons for this are twofold. If there is any issue with your signal, this will allow you to catch it early so you can sort out basic electrical stuff before going on the higher level. Secondly, reliable triggering will help software decoder properly detect message start.

While exact trigger level might depend on the exact use case, in 95% of cases we are talking of 5V differential signal. Roughly speaking, your CAN L (low) signal will be either at 2.5 V or 0 V logical level and your CAN H (high) signal will be at either 2.5 V or 5 V level. Since signal between those two lines is mirrored, you only need to probe one of those two lines. I usually select L but that’s just because I already have cable made for it. All instructions are essentially the same whichever polarity you select. Good starting trigger level for low line is 2 V (3 V for high line). If your resting signal is further away from 2.5 V that would either point to termination issue or gross impedance mismatch and you should sort “electricals” first before continuing further.

Illustration

I like to set pre-trigger level to 5% as it allows me to use most of the screen for actual signal. To receive the maximum screen real estate you might be tempted to use 0% pre-triggering but I find seeing a bit of signal before my CAN message does help if you have a busy bus. Even better, this also allows you to ignore trigger edge setting completely (should be falling for low line).

Only once you can reliably catch your CAN signals, you can add serial decoder - Tools / Serial Decoding / Create / CAN. After selecting channel with your signal (named Data on this form), you will reap the benefits of getting triggers right. First and foremost, you should have bitrate set correctly as soon as channel is selected. More over, your threshold level should be automatically calculated from the signal. Yes, you can manually set it to 2 V but Murphy says you’ll forget it and then be confused as why decoding has errors or even misses a message completely. Lastly, you select High or Low setting appropriately depending on the line you are probing.

Congratulations! If all went good, you have just successfully decoded CAN bus message.