Chandra Sekar's Blog

Productivity as an Employed Software Engineer

15 Nov, 2023 · 5 min read · #productivity #employment

There has been a lot of talk about employee productivity in recent days, with some Indian tech entrepreneurs asking people to work 70 hours a week. Productivity is not the sole purpose of life. Health and relationships that we value are more important and productivity must never come at the cost of these. With that out of the way, here is my view of productivity and ways to improve it as a software engineer working as a full-time employee.

 Read more

The Tale of a Corrupt Backup

25 Feb, 2023 · 4 min read · #backup #restic #hardware

As I mentioned in the post about my backup system, I run restic check regularly, to test the integrity of my backup. It has never reported any error in my repository. It performs a quick, shallow check, and does not verify that all the data is intact. I also restore a random file, whenever I run restic check, to test recoverability.

Shortly after I wrote the previous post, I decided to run restic check --read-data for the first time ever. This reads every file in the repository and simulates a full restore. To my utter horror, it reported many errors like these!

Pack ID does not match, want 5e66c2ac, got e80051de
pack d64be86d contains 1 errors: [Blob ID does not match, want 8ebf2c10, got 350f6ba1]

 Read more

My Personal Backup System

24 Dec, 2022 · 5 min read · #backup #restic #rclone #b2

Computing devices and online services can fail catastrophically and take our data with them. It is crucial that we have a robust system to backup and restore our data, to protect against such events. This post details what I wanted from the backup system for my personal data and the tools I use to achieve them. This system has served me well over the last 5 years, across fat-fingerings and disk failures.

 Read more

Connection Leak in PgBouncer Behind AWS NLB

10 May, 2020 · 3 min read · #postgresql #aws #database

At a previous job, we had several instances of Ruby on Rails applications connecting to PostgreSQL through PgBouncer. The services and databases were deployed on bare-metal servers and chugged along fine. We then decided to migrate to AWS. Upon migration, we noticed that PgBouncer started leaking connections to PostgreSQL like a sieve, leading to exhaustion of the maximum number of connections configured in RDS.

 Read more

Using Command-Line Tools on Vim Buffers

23 Apr, 2020 · 3 min read · #vim #command-line #tips #linux

Vim offers many ways to use the command-line tools available on your system when editing. You can:

  1. insert the output of a command into the current buffer - e.g., insert the current date.
  2. process lines of the current buffer through a command - e.g., sum up a list of numbers in the file.
  3. manipulate lines of the current buffer using a command - e.g., sort a list of names in the file.

 Read more

GnuCash for Personal Finance: Online Quotes

28 Jul, 2018 · 2 min read · #gnucash #personal-finance #mutual-fund

This is third in the series of posts describing how I use GnuCash to manage my finances. In previous posts, I had discussed how I organize my accounts, record transactions and handle taxation in GnuCash. In this post I’ll show how GnuCash can be configured to fetch the current NAV of mutual funds from the Internet.

 Read more

GnuCash for Personal Finance: Transactions and Taxes

26 Jul, 2018 · 8 min read · #gnucash #personal-finance #accounting #mutual-fund

This is second in the series of posts describing how I use GnuCash to manage my finances. In the previous post I had discussed how I organize my accounts in GnuCash. In this post I’ll describe how I record transactions and use GnuCash to help with computation of taxes and filing of tax returns.

 Read more

GnuCash for Personal Finance: Chart of Accounts

22 Jul, 2018 · 5 min read · #gnucash #personal-finance #accounting

GnuCash is an open-source double-entry bookkeeping software. In a series of posts this week, I will describe how I use GnuCash to manage my finances. The series will be biased towards a portfolio composed primarily of Indian mutual funds. This post describes the chart of accounts involved and the purpose of each account.

 Read more

Safe and Convenient Password Management

09 Oct, 2017 · 6 min read · #security #password

For better or worse, passwords are central to the safety of almost all our online accounts. 2-factor authentication systems are meant to protect users from compromise of their passwords. However, not all services support it. Also, several online services (including banks), use OTP sent over SMS as the second factor. This has several vulnerabilities and has been deprecated by NIST. That leaves password as a critical piece of these accounts’ security.

 Read more

Prepared Statements Without Additional Round-Trip

09 Jul, 2017 · 2 min read · #postgresql #database #sql

Prepared statements are the best way to avoid SQL injections in applications accepting user input. However they require an additional round-trip to prepare the query, which increases latency when your queries are dynamic and the statements are not re-used. PostgreSQL allows execution of such queries without the additional cost!

 Read more

  Older Posts →