If you just got the keyboard and downloaded the latest Wootility software, it is possible that it will be unable to detect the keyboard. From what I heard from technical support, I figure that this is because somewhere along the way the software lost the ability to communicate with old versions of keyboard firmware (and it has old firmware from the factory). So the solution is to get an old version (v2.1.0) of the software, run it with sudo and go through the restore procedure which includes a firmware update. Then latest software will work properly.

This is a basic evaluation of the Wooting Oneanalogmechanical keyboard from the perspective of a Linux user. Perhaps it does not deserve a full blog post, I just wanted to separate subjectivity from the technical article, which you should check out:

I can never get around to writing this blog post. It's an ambitious one, with great examples an schematics
planned. Anyway, maybe someone will still find the beginnings of it useful.

This is a writeup in layman's terms about how memory is being allocated and managed in most modern programming languages. Its target audience is users of Crystal programming language, but the parts specific to that language will be on purple background. Expect some omissions and inaccuracies for the purpose of explanation.

At this point you've probably heard something like "structs are stored on the stack, and classes are stored on the heap", but what does it really mean?

Crystal Programming Language does not yet support Windows, but the progress is ongoing, and programs that use isolated parts of the standard library can be properly cross-compiled. Note that, even though there are multiple mentions of Windows Subsystem for Linux here, it is used only for one of the build steps. The resulting binaries run natively on Windows, no strings attached.

You need a POSIX-compatible system that Crystal officially supports (like Linux) and also Windows. If you are already on Windows 10, the obvious choice is Bash on Ubuntu on Windows. If on a different OS, use a virtual machine with Windows — VirtualBox is a good choice.

ksshaskpass is a KDE-based passphrase dialog for use with OpenSSH. It is intended to be called by the ssh-add(1) program and not invoked directly. It allows ssh-add(1) to obtain a passphrase from a user
[...]

So this utility is useful if you want to store the passphrases to your SSH keys in the KDE Wallet (there are plenty of instructions on how to do that).

But all it really does is receive a string as an argument, tries to query KWallet for a password saved under this key string (or asks for this password in a dialog and stores it), then writes it to stdout. This means that ksshaskpass can be used to store any kind of password in KWallet for use in your Bash scripting.

Sometimes in Python you may need to diagnose some format strings. Maybe they are supposed to be provided by the user and you need to know which keys to fill it with. Another prominent example is translation software: format string placeholders are definitely a thing there, and you may want to do something special about them.

First, let's get the old-style format strings out of the way. I haven't seen any introspection capabilities for them in the standard library, so instead this neat workaround can be used: a format string is formatted by a dict-like object, which really just stores every key that it gets asked for.

The problem of intersection of two rectangles is very easy to solve. But difference of two rectangles is something considered much less frequently.

To clarify, we will be looking only at rectangles that are parallel to the 2D axes.

Obviously, when one rectangle chomps away a part of another, typically it can no longer be represented as just one rectangle. The illustration shows these different cases. The solution described here represents the difference as a sum of multiple rectangles. It does not try to represent it in as few rectangles as possible, because there are multiple ways to do that and no objective way to pick one.

This example is about Flask-Admin, which is a library that adds a smart automatic CRUD panel according to your data models (typically SQLAlchemy models).

If you have a simple website or want to separate your normal user authentication system from the admin login, or just want a quick temporary solution for securing your admin panel, here is how you can do it using simple HTTP authentication:

If you are the sole user of your computer, you may want to just enable autologin without asking for password. But most often this is not an option. So when you turn on your computer, you wait for the login screen to appear, then enter the password, then wait for the auto-start programs to complete loading (or cope with the slowness).

Instead, you can have your system automatically log into your account and let the startup process take place, but also lock the screen, so the password still needs to be entered. The difference is, you can turn on your computer, then walk away somewhere, and be sure that it's 100% ready for work when you come back. Even without walking away, the time you take to enter your password is used for startup, so it's still quicker.

I realize that suspending may be an even better solution, but it's not always an option.

It's a useful function, and all is well. But what if you want to give the result of urandom(32) to a function that takes an array of 32 bytes? Converting a seq to an array of fixed size is surprisingly complicated and dirty (but I may be missing something).

Long story short, you can use static[T] to provide an alternative generic function that returns arrays of fixed size.