Igor Bubelov
About Blog Notes Photos

June 2021

Notes · Jun 30, 2021

Table of Contents

US Antitrust Bills

It looks like US government starts to realize how harmful big tech companies are, which confirms my optimistic outlook on the future of tech industry. I remember times when companies like Apple, Google, and even Facebook offered a lot of value. Things started to change during the last decade. Slowly but surely, we started getting less value while paying ever-increasing direct and indirect costs. How is that possible? Well, that’s what happens when a few companies monopolize and divide the market. They turned their users into serfs, and they tax the hell out of millions of developers, kicking out anyone who dares to resist or even complain. That’s not healthy, but it’s nothing new. It’s what you get it you allow monopolies to thrive and break rules. Luckily, we already have antitrust laws, so let’s modernize them and make them work for public benefit.

Getting Rid of Bad Knowledge

Bad habits are hard to break. The first step is to realize that some of your actions are wrong and things can be and should be improved, but it’s not the hardest part. Staying at your “local maximum” is very appealing. For instance, I spent many years looking at my keyboard while typing. I got kind of good at it. I didn’t type fast, but my typing speed was kind of tolerable. It took a lot of time and effort to learn how to type properly, and my typing speed fell of a cliff for several months after I switched to touch typing. It took me a while just to reach my old speed, but once I did it, I was able to beat my old records with ease. Focusing my eves on screen also allowed me to notice mistakes faster, shortening the feedback loop. In order to learn something good, we often need to identify the things we’re doing wrong and actively un-learn some bad stuff.

For me, learning is pleasure, but I really, really don’t like to un-learn things. It feels like self-fighting, but it pays off in the long run.

“In the long-term we are all dead”

Indeed, that’s also a fun fact to reflect on.

vi

I use JetBrains IDEs for most of my programming tasks, and it works great on my local machine. Things change when I need to connect somewhere via SSH and write some scripts on a remote host or simply edit a few config files. For a long time, nano was my tool of choice when things get textual. It’s very easy to use, but it has certain limitations. Luckily for me, nano was available pretty much everywhere I went, except my old OpenWRT router. OpenWRT doesn’t have nano and you kind of supposed to use vi. This was the first time I really had to use it, and the experience wasn’t pleasant, to say the least. Time passed, and I started to get curious about vi and vim.

I mentioned this old book a couple of months ago. It was a fun read, and it encouraged me to finally try vi. It’s tough at start, but, the longer I use it, the more exciting it gets. Shells have the same effect. There are many “front-loaded” things in life, they require serious commitment, and they take a long time to pay off. We’re encouraged to take shortcuts and prioritize quick solutions over learning how to do things in the most productive way. Otherwise, we wouldn’t have Stack Overflow.

Learning vs Being Productive

Being productive is important, and it feels like something every responsible individual must try to achieve. Another important thing is learning. We don’t want our doctors to be very productive at practicing obsolete medicine, we expect them to spend decades sharpening their skills and broadening their understanding of human body. Is it really different with computer science? Time files, market demands change, and we need to adjust to those changes. There is definitely a conflict between being educated and being productive, in a common sense of this word. Both activities require the same resource: time, and everyone has only 24 hours a day. I’m not even talking about recreation, family time and so on. It’s pretty hard to find the right balance, but avoiding extremes seems like a sensible way to go.

Learning new things becomes harder with age, and I’m not talking about biological factors. People tend to commit to certain lifestyles and, more often than not, borrow from future selves by taking different forms of debt. More learning often means less short-term productivity and lower short-term income. Being able to afford education becomes a rarity. I don’t know many people who pay enough attention to education after they get their degrees and join the workforce. Interestingly, many things seem to have changed recently, with millions of people switching to remote work and flexible hours. It looks like this productivity craze may come to an end soon. There is more in live than being 100% productive and being productive at wrong things is, well, counter-productive.

Setting Up SSH Passwordless Auth

There are many ways to access remote servers, but the most popular is Secure Shell Protocol (SSH). All popular operating systems ship with an SSH client and server packages installed by default, which means you can connect to other computers as well as to allow them to use your machine. That’s cool, but also a bit concerning: how do we make sure only the right people can log in to our computers?

There are many ways to authorize via SSH, but the most popular are password auth and key-based auth. Among those two methods, key-based auth is preferable because it’s much harder to figure out average cryptographic key than the average password. You can use SSH to generate so-called public-private key pair. After that, you can copy your public key to a machine you want to access remotely and place it in authorized_keys directory. After that, you can go ahead and connect to that computer without typing any passwords. This method is both convenient and secure.

Let’s say we generated a key pair already, how do we copy our public key to a remote host? Looks like a chicken and egg problem. Many VPS providers solve this problem by asking for your public key before creating your first server, so they can add it to authorized_keys every time they bring up a fresh server for you. Another way to set up key-based auth is to start with password auth and then use a program called ssh-copy-id. It will attempt normal password auth and, once you type your password, it will add your public key to authorized_keys directory on the remote host. In other words, this program “pushes” your public key to a remote server. The downside? You have to enable less secure password auth first and then manually turn it off.

I’ve been happily using ssh-copy-id for years, but this mouth, I’ve found out that it’s also possible to “pull” my public key without setting up password auth. It’s especially useful when I have physical access to a new machine, and I want to be able to connect to it remotely from my main computer at a latter stage. How is it possible to pull a public key from a machine which might be out of reach? Even if it’s reachable, it won’t give any files to an unrecognized client. We have a chicken and egg problem again. Well, pretty much everyone uses GitHub, and it will happily give you public keys of any user. Public keys aren’t secret, so there is no reason to hide them anyway. The tool that can pull public keys of any GitHub user is called ssh-import-id and it’s installed by default on most Linux distributions.

RaspiBolt

I’m a big fan of Raspberry Pi, and I’m also a big fan of Bitcoin. What if there were a guide on how to combine these amazing things? It turns out, there are a few such guides, and my favorite one is RaspiBolt:

https://stadicus.github.io/RaspiBolt/

It can guide you through every step of setting up a fully functional Bitcoin node on a Raspberry Pi. It also has a section on enabling instant payments via Lightning Network. I enjoyed reading this guide and all the extra tips and tricks.

Breez Wallet

Bitcoin is hard to use, and Lightning Network just adds an insult to injury. Convincing everyone to run their own self-sovereign nodes is a pipe dream. It would be nice, but it’s impossible. It’s like some kind of communist utopia, but only radically capitalist one. I’m in no way discourage setting up self-hosted nodes, but we also need to think about the people who won’t do that, for various reasons. How do we connect them to Bitcoin infrastructure?

There are a few mobile wallets which look promising. Most of them are overly centralized, which makes them just an incremental improvement over our legacy financial system. We can do better, and Breez Wallet is a good example:

https://breez.technology/

Breez allows people to accept LN payments instantly, it’s open source, and it doesn’t rely on a centralized backend in any significant way. It’s a great option for merchants who want to accept Bitcoin but don’t know how. Needless to say, many merchants in developing countries doesn’t even have enough extra money to buy hardware for their own Bitcoin full node. Breez only needs a smartphone an Internet connection, which widens its audience quite a bit. This wallet can also be used for sending money, and the fee it charges is pretty low.

Learning Bitcoin From The Command Line

I like this guide, but it’s a bit outdated. Still worth a read if you’re curious how Bitcoin and Lightning Network work:

https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line

Bash Manual

I’ve been using Bash for a long time, but I never read the manual. Well, not reading the manual was clearly a mistake, which I was able to correct this month. Bash looks like a chaotic beast, but it becomes much more understandable if you read the manual instead of Stack Overflow:

https://www.gnu.org/software/bash/manual/

El Salvador

Time flies. Who could imagine that Bitcoin will be an official currency of a sovereign state? Some may say it’s just a PR move, and those cynical bastards are dead right, but still, I fill that this event is important, and it’s indicative of rising Bitcoin adoption.

Podcast: Chaincode Labs

It’s a great podcast for anyone interested in how Bitcoin actually works on a technical level. It also gives us some insights on what to expect in the near and not so near future:

https://podcast.chaincode.com/

Videos: Blockstream’s YouTube channel

Blockstream is one of the key companies in Bitcoin space, and it shares its expertise and products on YouTube. I’ve especially enjoyed Rusty Russel’s webinars on c-lightning.

https://www.youtube.com/channel/UCZNt3fZazX9cwWcC9vjDJ4Q