Mon 06 Jan 2020 12:33:15 PM UTC

Test asciinema

Posted by Shaarad | Permanent link

Sat 26 Oct 2019 03:51:39 PM UTC

Messaging over the Internet (and why I like XMPP)

Given the current state of messaging/chatting over the Internet, the popular options are WhatsApp, Facebook Messenger, Telegram and so on. All these are owned by corporations and pretty much black boxes. Apps like Signal and Keybase are also available that primarily advertise privacy and encryption. They are also partially open-source. However, they lack one important aspect that I will come to shortly. Since all these are pretty-much well-known alternatives, let me cover a couple of others briefly.


Around 2011, I came across IRC where lots of open-source developers hang out on "channels". It is their Slack. These channels are open to public where you can join and ask around your questions (in a smart way, though) and talk directly to developers. I found this accessibility really cool and started to hang out on few channels. However the problem with IRC is that once you lose connectivity even for a short time, you are disconnected from server and you lose messages during that time. So it is kind of stateless. I wondered why there isn't something that is more like Yahoo! Messenger (Remember?), but didn't dig into it much. Shortly after having an Android phone, I installed an IRC client on it and used it a few times to chat while on the go. But that much was as far as my interaction with IRC.


Sometime in early 2019, I came across as an alternative to few Google services and while browsing the services they offered, I saw XMPP as one of the services. I tried it and found that it was what I was looking for in an IRC alternative years ago as XMPP stores messages on server when you are not logged in. I browsed couple of XMPP servers and group chats (or MUCs - Multi User Chats in XMPP parlance) but found majority of them either Russian or other Europian languages, so was kind of put off. XMPP, however, is an old protocol and Google Talk used XMPP too, although, it dropped support for it and went onto a different path.

Fast forward to couple of months back, when I started setting up this server I was looking for things that people host on their own. And there I found XMPP server! I will cover the details of that part in another post, but since then I became a regular user of XMPP. Using the profile I created on my server, I joined few group chats (MUCs) and made few friends with whom I often chat 1:1.

After using XMPP, what do I look for in a messaging solution?

With the experience of using different messaging platforms and hosting own XMPP server, I have few preferences for an Internet messaging solution.

  • Federation: This is the aspect that I talked about that most messaging platforms lack. It means that through common standards, multiple providers achieve interoperability and provide compatibility to users. Today you can not sign up on WhatsApp and talk to someone on Facebook Messenger even though they are now owned by a single company. They would be having totally different standards and implementation that would take Facebook some work to achieve interoperability. Why this compatibility is not present out of the box brings me to the second aspet that I look for.
  • Protocol, not platform: When choosing one solution over the other, I would see which one is a defined protocol and not a developed 'platform'. The reason why WhatsApp and Facebook Messenger wouldn't easily talk to each other is because neither declares - "Hey! I talk this standard protocol. Anyone talking according to this protocal can talk to me!". Internal to companies there may be a design specfication but it's not public. In contrast to these, let's talk about XMPP now. As the name itself suggests - it's "eXtensible Messaging and Presence Protocol". Since it's a simple protocol, it allows for two huge benefits - first, anyone is open to implement it in whatever way they like; and second, anyone is open to host their own server and it would be able to talk to any other XMPP server! This allows federation out of the box without any overhead. Even IRC is an application layer protocol. But by its specification it doesn't allow federation. A user has N different identities on N different IRC servers. However, it being a protocol allows you to host your own IRC server in case you wish so.
  • Easy to self-host: If the above two aspects are theoretical, this one manifests as a strong practical effect of both. A solution that gives you ability to self-host gives you the entire ownership that is not achieved by any solution that lacks it. Self-hosting in general gives you control over where and how your data lives, what information is logged and how secure you have kept things. Talking about XMPP, it is fairly simple to bring up your own instance with security enough for practical purposes. If you wish that only your friends and family register on it, you can always do that too. Or otherwise if you just want to get started quickly, you can register on any of the available public servers, both free and paid.
  • Encryption: Today when every possible solution advertises encryption among their top three features, lacking it isn't an option on the table. XMPP has support for OMEMO as well as OpenPGP, so it is a pretty strong contender there as well.

All in all, after using XMPP for couple of months, I have realized that it has everything that can be expected from a modern Internet messaging solution. You can log in simultaneously from multiple devices from your mobile as well as computers, you can send images, videos, files, etc., emoji support (yay!) and just one XMPP account allows you to talk to any other user and group on any XMPP server! I am hopeful that more and more people will use it.

Posted by Shaarad | Permanent link | File under: linux

Fri 20 Sep 2019 05:25:22 PM UTC

Accounting with GnuCash - Basics

About 6 months back, I felt the need to maintain my expenses and to be able to analyze them at a later point of time. Before that I had used couple of Android apps like Money Lover Majority of money management apps have this workflow:

  • Create categories (and possibly sub-categories, etc.) where you want to track your spendings are going
  • When you spend money, add the amount spend under the category it belongs
  • The app will show you statistics and charts based on your recorded spendings

GnuCash works on a different methodology called "Double-entry bookkeeping". It means that for you to add an entry as "spending" into one of the category you defined, another entry must be added into the category where the money "came from". This is a simple but very powerful concept that adds more accountability to the process of accounting (pun intended)! Rather than me trying to explain the whole thing, Chapter 2.1 - Accounting Concepts in GnuCash concepts guide explains it very well.

Result of this framework put in place is that you don't end up just defining the categories or bins where your money is going, but you also end up defining your money sources. In language of GnuCash, all these entities that hold money are 'accounts'. You can define an account where your salary gets credited, another where you "deposit" the money spent on movies etc. For GnuCash, everything is just X amount transferring from account A to account B.

Do I have to add an entry in each of the account involved in a transaction to work with this double-entry bookkeeping stuff?

No, GnuCash is smart in that aspect. Once you add an entry, for example in your bank account about an amount being transferred to your coffee expense account, GnuCash automatically adds another entry into coffee expense account about the same amount getting transferred from your bank account.

But if everything is an account, how does GnuCash know which one is meant for income and which one for expense?

GnuCash tells you to categorize every account you create into one of the five categories:

  1. Asset: These accounts represent the wealth you have. Asset can be anything from the money in your bank account to your house, car and so on.
  2. Liability: These accounts represent the amount you owe to others. This can be your credit cards/loans etc.
  3. Income: These represent your income sources. It may be your salary, profit from business, interest on bank balances and other like these.
  4. Expense: These represent the various expenses you are making. The extent of details and tracking depends on how much you wish to audit. For example - you can choose to ignore the tax deductions on your salary and just put an income entry of the amount that you get in your bank account or you can choose to consider your salary before deductions as your income, put tax deductions under 'tax' expense account and then put the amount you received in bank account as your asset.
  5. Equity: These represent the curent valuation by subtracting your liabilities from your assets. Accounts in this category are primarily used for recording the initial/opening balances when you start to track something new on GnuCash.

It follows what is called as the accounting equation that should always be balanced for GnuCash to be happy.

		Assets - Liability = Equity + (Income - Expense)

Here's how you can quickly start with GnuCash -

  • You can start with a fresh GnuCash file and setup your accounts as per above categories. You can also create a hierarchy like Expenses -> Tax -> Income Tax and so on.
  • Start small. If you are only tracking your bank account and payments made from that, put your current bank account balance as a transfer from Equity -> Initial balance to your account. Equity type of accounts are primarily used for such kinds of initial balance adjustments.
  • Whenever you spend money, make sure to add a corresponding entry in GnuCash. As I said, even if double-entry in place, you only have to enter it in either of your accounts involved in a transaction and GnuCash will make sure to add the complementary entry in other account.

Posted by Shaarad | Permanent link | File under: accounting

Sat 14 Sep 2019 03:46:36 PM UTC

Why I moved from Ghost to NanoBlogger

I am in process of setting up a web presence independent of giant Internet-based service providers like Google. This website is running on a Nanode that runs a web server and a mail server. (I use arch, BTW).

When I configured Ghost blog, I also needed to configure MySQL instance. While Ghost is a powerful blogging platform, it runs on Node. Following are the RAM usages for the two processes that together consume ~20% of RAM resources.

Server's status

Process status

Stopping these two services effectively brings down my RAM usage to ~100MBs.

I liked the lack of exernal dependencies of NanoBlogger. The only dependency it takes is on bash and few other common *nix utilities. Everything like blog posts is stored in files. (Everything is a file, remember?) It's easy to find and edit existing posts, you also write HTML for them by hand.. Blog can be updated anywhere via SSH. (That's the only way I have set up currently. It is possible via FTP too.) After using clunky remote desktop tools, I have really come to love SSH! And honestly, I hadn't expected a blog management system to be available in pure bash!

As I continue using it and use different features of NanoBlogger, I will talk about them from time to time!

Posted by Shaarad | Permanent link | File under: linux

Sat 14 Sep 2019 02:20:36 PM UTC

Hello world!

This is a first post to the nanoblogger-based weblog. I will follow-up with a more detailed post about why I switched to nanoblogger soon!"

Posted by Shaarad | Permanent link

Sat 14 Sep 2019 01:49:38 PM UTC

Welcome to NanoBlogger 3.4.2!

Welcome to NanoBlogger, a small weblog engine for the UNIX command line.

Quick Reference

  • create new weblog (directory) ... nb -b <blog_dir> add weblog
  • create new article ... nb add article
  • create new entry (w/o tag) ... nb add entry
  • create new tag ... nb add tag
  • tag new entry ... nb --tag [tag_id] add entry
  • list entries ... nb list <query>
  • list tags ... nb list tags
  • list entries by tag ... nb list tag [tag_id]
  • edit entry ... nb edit entry [entry_id]
  • tag entry ... nb --tag [tag_id] tag-entry [entry_id]
  • untag entry ... nb --tag [tag_id] delete entry [entry_id]
  • delete tag ... nb delete tag [tag_id]
  • delete entry ... nb delete entry [entry_id]
  • draft entry or article ... nb draft [draft_file]
  • import draft as entry ... nb import entry [draft_file]
  • import draft as article ... nb import article [draft_file]
  • update weblog ... nb update <all|DATE|main|max|articles|feeds>

<query> may equal all,tag,DATE or max (defaults to all)

Thank you for choosing NanoBlogger. Please direct comments and suggestions to the mailing list or submit a bug report to the project page over at

Posted by n1xt3r | Permanent link | File under: nanoblogger-help