Welcome to My Blog

read
Welcome to bah! This is your first blog post to help you get started.

Welcome to bah!

Congratulations! 🎉 You've successfully set up your new blog with Blogr. This is your first blog post, and it's here to help you understand how everything works.

What is Blogr?

Blogr is a modern CLI static site generator specifically designed for blogs. It focuses on:

  • Simplicity - Easy to use command-line interface
  • Speed - Fast builds and optimized output
  • Developer Experience - Live reload, hot reloading, and great tooling
  • Themes - Beautiful, customizable themes
  • GitHub Integration - Seamless deployment to GitHub Pages

Getting Started

Here are some commands to help you get started:

Create a New Post

blogr new "My Second Post"

This will create a new markdown file in your posts/ directory with the proper front matter.

Start Development Server

blogr serve

This starts a local development server with live reload. Any changes you make to your posts or configuration will automatically update in your browser.

Build Your Site

blogr build

This generates the static files for your blog in the dist/ directory.

Deploy to GitHub Pages

blogr deploy

This builds and deploys your site to GitHub Pages automatically.

Writing Posts

All your blog posts go in the posts/ directory as Markdown files. Each post needs front matter at the top with metadata:

---
title: "Your Post Title"
date: "2024-01-15"
author: "Your Name"
description: "Brief description for SEO and previews"
tags: ["tag1", "tag2", "tag3"]
status: "published"  # or "draft"
slug: "url-friendly-slug"
featured: false      # Set to true for featured posts
---

Supported Markdown Features

Blogr supports all standard Markdown features plus some extras:

  • Headers - Use #, ##, ###, etc.
  • Links - [Link text](https://example.com)
  • Images - ![Alt text](path/to/image.png)
  • Code blocks - Syntax highlighting included
  • Tables - Standard markdown table syntax
  • Lists - Both ordered and unordered

Code Syntax Highlighting

Code blocks are automatically highlighted:

fn main() {
    println!("Hello, Blogr!");
}
function greet(name) {
    console.log(`Hello, ${name}!`);
}
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)

Customizing Your Blog

Theme Configuration

Your blog uses the Minimal Retro theme. You can customize colors, fonts, and other settings in your blogr.toml file:

[theme.config]
primary_color = "#FF6B35"
secondary_color = "#F7931E"
background_color = "#2D1B0F"
font_family = "Monaco, 'Courier New', monospace"
show_reading_time = true
show_author = true

Static Files

Put images, custom CSS, JavaScript, and other static files in the static/ directory. They'll be copied to your built site automatically.

Project Structure

your-blog/
├── blogr.toml          # Configuration
├── posts/              # Your blog posts
│   ├── welcome.md      # This post
│   └── about.md        # About page
├── static/             # Static assets
│   ├── images/
│   ├── css/
│   └── js/
├── themes/             # Custom theme files (optional)
└── dist/               # Built site (generated)

Tips for Blogging Success

  1. Write consistently - Regular posting keeps readers engaged
  2. Use good titles - Make them descriptive and SEO-friendly
  3. Add descriptions - These appear in previews and search results
  4. Use tags wisely - Help readers find related content
  5. Include images - Visual content makes posts more engaging
  6. Preview before publishing - Use blogr serve to check how posts look

Next Steps

Now that you have Blogr set up, here are some things you might want to do:

  1. Edit this post - Customize it or delete it entirely
  2. Create your About page - Tell readers about yourself
  3. Write your first real post - Share something you're passionate about
  4. Customize your theme - Make it match your personal style
  5. Set up deployment - Get your blog online for the world to see

Need Help?

  • Check out the Blogr documentation
  • Run blogr --help for command reference
  • Use blogr project check to validate your setup

Happy blogging! 🚀

This post was automatically generated when you initialized your Blogr project. Feel free to edit or delete it.

About

read
Learn more about bahdotsh and bah

About Me

Hello! I'm bahdotsh, and welcome to bah.

Who Am I?

This is where you can introduce yourself to your readers. Consider including:

  • Your background and experience
  • What you're passionate about
  • Why you started this blog
  • What readers can expect to find here

What I Write About

Describe the topics you cover on your blog. For example:

  • Technology and programming
  • Personal experiences and lessons learned
  • Industry insights and trends
  • Tutorials and how-to guides

My Journey

Share your story - what led you to start blogging? What experiences shaped your perspective?

Connect With Me

Add your contact information and social media links:

About This Blog

This blog is built with Blogr, a modern CLI static site generator. The site uses the Minimal Retro theme, chosen for its clean design and focus on readability.

Fun Facts

Share some interesting or fun facts about yourself:

  • I've been coding for X years
  • I love coffee and usually drink X cups per day
  • My favorite programming language is X
  • When I'm not coding, I enjoy X

Thanks for visiting! Feel free to reach out if you have any questions or just want to chat.

Last updated: 2025-09-20

giff

read
git diff terminal visualizer

giff

giff visualizes the differences between the current HEAD and a specified branch in a git repository using a formatted

table output in your terminal. The differences are displayed with color-coded additions and deletions for better readability.

Features

  • Branch Comparison: Compare changes between the current HEAD and a specified branch.
  • Color-coded Output: Additions are displayed in green and deletions in red.
  • Table Formatting: Uses comfy_table to format the output.

Requirements

  • Rust (latest stable version)
  • Git
  • A terminal supporting ANSI escape codes for color output

Dependencies

This project uses the following Rust crates:

  • clap: For command-line argument parsing.
  • comfy_table: For creating and formatting tables.
  • crossterm: For terminal manipulation.
  • regex: For parsing git diff output.

Installation

cargo install giff

From source

git clone https://github.com/bahdotsh/giff.git
cd giff
cargo install --path .

Usage

giff -b branch //by default, the branch will be main

Termgpt

read
A programming and system administration assistant, powered by chatGPT!

Install

Cargo

cargo install termgpt
termgpt --help

From source

git clone git@github.com:bahdotsh/termgpt.git
cd termgpt
cargo install --path .

Usage

For the first time you have to to enter your OpenAI API key.

termgpt --api <your api-key>

This key will then be saved to:

// Linux:   /home/alice/.config/termgpt
// Windows: C:\Users\Alice\AppData\Roaming\Foo Corp\termgpt
// macOS:   /Users/Alice/Library/Application Support/termgpt

To be reused later

Questions

For now you can ask ChatGPT anything related to managing your operating system or writing code. Eventually you'll be able to ask any question to ChatGPT (couple more prompts to go) with termgpt (P.S try to avoid using '?' at the end of your questions for now).

termgpt <any question>

Executing commands

You can ask to execute the generated command using --exec argument.

termgpt --exec list all the files in this folder

Help message

termgpt --help


A cli tool to interact with ChatGPT

Usage: termgpt [OPTIONS] [CHAT]...

Arguments:
  [CHAT]...

Options:
      --api <API>  Your API key for OpenAPI
  -e, --exec       Execute the commands generated
  -h, --help       Print help
  -V, --version    Print version

Example questions

termgpt How do I list all files in the current directory
termgpt How can I find the number of lines in a file
termgpt How do I create a new directory
termgpt How can I check the available disk space
termgpt How do I delete a file
termgpt How can I search for a specific string in a file
termgpt How do I copy a file to a different location
termgpt How can I see the contents of a file
termgpt How do I move a file to a different location
termgpt How can I change the permissions of a file or directory

Inspirations

Why I built zp!

read
Talks about the process behind building zp!

For those of you who don't know, (which is going to be most of you), I recently published my very first crate; zp. zp is just a simple tool to copy contents from a file. I built zp so that I can learn rust properly. And by properly, I mean learning something and understanding it in a way I can use it to build cool/useful things in the future.

The process was relatively simple than I expected and as everyone says, the toughest thing was deciding what to build. Thankfully, I didn't overthink it this time and decided to build something not complex at all. My problem statement was simple, "I need a tool to copy things from inside a file to the clipboard from my terminal". Since the problem statement was so clear, I was able to break it down into smaller parts and publish it in a day!

I was really excited when the development reached the final stages as it was working exactly how I wanted it to work. I don't know if you know, but the following are the steps to publish your crate to crates.io :

  • Add a license to your project.
  • Put up a proper README.md file.
  • Set your package information like version, description, license, etc. in the Cargo.toml file.
  • Build your project, cargo build --release
  • And finally, publish your project with cargo publish (you need to first create an account in crates.io and generate an API key to log in to your account from the terminal).

Yup, that's it! You have now published your crate. And what that means is that people will see your project and may even use it! That reality hit me a little late. I was really proud of my accomplishment and posted it everywhere I could think of.

This is when the reality of other people using my project hit kind of hard. A couple of developers used it and as it turns out, my project doesn't work at all in Linux and Windows! I should've checked it, but I didn't. My embarrassment has never reached highs like this before and was kind of hard to deal with.

Followed by this, an interesting phenomenon started to happen, people started giving me suggestions to improve my project. It was so refreshing and humbling to see really cool people giving me some really cool feedback!

What that means is that I will get to learn rust a little bit more in-depth, and of course, improve my project in the process. The first obvious feedback I'm going to work on is to make my project cross-platform compatible, and will soon be dropping a blog on that later.

Also since you have read this much, do check out my blog!

Zp

read
A cli tool to copy things!

zp

zp is a cli command to copy the contents of the source file or of the std output buffer to the clipboard. To use the zp,

simply open your terminal or command prompt (well install it first) and type zp followed by the name of the source file. For example:

zp my_file.txt

To get the first n words of the file :

zp -s n my_file.txt

To get the lines between a range, i.e., to get lines from n till m of the file:

zp -s n -e m my_file.txt

Also you can use zp to copy from the std output buffer :

cat sample_file.txt | zp

This copies the entire output of the file.

You can use get a range of lines and the first n words also from the std output buffer :

cat sample_file.txt | zp -s 2

cat sample_file.txt | zp -s 2 -e 5

This gets the first 2 words and lines from 2 to 5 of the sample_file.txt respectively

This will copy the contents of "myFile.txt" to the clipboard.

Logs and History

Every copied content is saved to a history file, allowing you to revisit previously copied entries. To view the copy history, use:

zp --logs

The "zp" command is particularly useful for quickly copying text or data from one file to another without having to manually select and copy the text. This can save time and effort, especially when working with large or complex files.

Install

It's best to use rustup to get setup with a Rust toolchain, then you can run:

cargo install zp

From source

git clone https://github.com/bahdotsh/zp.git
cd zp
cargo install --path .

Art, Time and Life

read
An essay on art, time and life.

He drew in haste. He had deadlines to meet. It was ridiculous. This is not how it was supposed to be. You can never rush art. But he had to. He was bringing art to the realm of time. And he knew that it would bounce. He had no choice. The world is moving fast and he had to keep up with it.

You can never complete a work of art on time. Art never belonged to that dimension. The concept of time is foreign to Art. And in a way, it’s the gateway out of it. You can submerge yourself in art and let time fly by. And since art doesn’t belong to the dimension of time, you can never define art with time. The equations would seem completely ridiculous. Art is concentrated patience. It demands patience, to create, and to enjoy.

The moment you realize that patience creates art, why not make your life an art? Be patient and be prepared. Remember, art is really powerful, as it can change not only you but also the people around you. Immerse yourself in your art, whatever it is, and witness the magic that would unfold. And if you’re waiting till you find something that you’re good at, don’t forget that the one thing you can be good at is living your life and that one thing is all that matters.

Are your thoughts really yours?

read
Are your thoughts really yours?

Are your thoughts really yours? You may be wondering why I’m asking such a bizarre question again and again. Of course, my thoughts are mine, you may say. But, are they? That may take some time. So, let’s just focus on “the how” part for now. How do you think? Well, all of us think in some kind of a language. Most probably our mother tongue. If you are someone whose mother tongue is English, then most probably you would be thinking in English, you just have 26 letters to form the words for your thoughts.

Why are there only 26 letters in the English alphabet? In my mother tongue, which is Malayalam, I have 52 letters to form the words for my thoughts. Does that mean I have the potential to think more(double) than what an English speaking folk can?

Now as we have messed up the ‘how’ part let’s move back to the ‘what’ part. Whatever your mother tongue is, it was taught to you by the people around you. Not only your mother tongue, whatever language you learn, somebody taught it to you. They taught you that language not to make you a poet or a writer, but to exchange their opinions and believes onto you.

What does this mean? Your thoughts are not yours. Your thoughts are the byproduct of your interactions with an “educated” environment. You are getting influenced everyday. You are totally blind to what you are learning. You are only thinking what you are supposed to think. The reason you can’t think beyond the 26 letters of the English alphabets is only because you don’t have to. Everybody around you thinks with those 26 letters. You’re just thinking whatever you’re thinking only because you want to co-exist with the people around you.

If our thoughts are not really ours, then what do we have?

Let me end with something one of my professors said

“Whatever you have learnt was taught to you. And whatever taught to you were somebody else’s opinions”

I don’t think this thought is mine. And I can’t be right, can I?

How does the blockchain work? Part 2

read
How does the blockchain work? Part 2

Before looking at Merkle trees, let’s see what a tree actually is when it comes to programming. In simple terms, trees are nothing but representations of how data is stored in the memory.

Trees

               P (Root)
              /      \
            Q          R
           / \        /  \
         A   B      C    D
                    |
                    M
                   / \
                  H   I (Leaf nodes)
                 (Leaf nodes)
           L (Parent)
         /  |  \
        E   F   G (Children)

When you look at the above picture you’ll see some of the terms we use while defining trees. P is the root node. Root node is the node which is present at the topmost part of the tree. Keys are the values stored inside each of the nodes. Edges are the connection between one node and the other. Parent nodes(R is the parent of C and D)are nodes which have a branch from one node to the another and the child nodes(A and B are the child nodes of Q) are the nodes connected to the parent nodes. The children of the same parent node are called sibling nodes(E, F, G and A, B and C, D and H, I and Q, R are all siblings respectively). And the nodes with no children are called leaf nodes(H, I, D, and B are all leaf nodes). Now the number of edges between a node and the root node is called the depth of the node. For example, let’s take the node ‘A’. A is connected to Q and Q is connected to P(root node). There are two edges between A and P. Therefore the depth of A is 2. Note that the depth of the root node is 0. Level of a node is nothing but depth of the node + 1. Which means the level of A is 3.

Whew, that was a lot of definitions. The good news is you don’t have to try hard and remember any of those. Once you have compared the definitions to the picture of the tree above, you can easily understand what they mean. And then the next time you see a tree, you can easily understand them in a glance.

So after knowing the terms used in building trees, we can say that a tree is nothing but a collection of nodes.

Merkle Trees

Ok, as you are now familiar with trees let’s get to business. What are these Merkle trees? Merkle trees are a fundamental part of blockchain technology. One of the main reasons why blockchain is super famous is because of the security and efficient storage of data. Merkle trees are used to achieve this. It helps in efficient and secure verification of content in a large body of data.

If you forgot what hashing means, quickly go to my previous previous article and read up on it and come back. It’ll only take you a few minutes and will help you understand what I’m going to tell you next better.

In a Merkle tree, each leaf node is a hash of a block of data, and each parent node is a hash of its children. Yeah, that’s it. It’s that simple. Also to make things more simpler, Merkle trees usually have a branching factor of 2. Don’t frown, my friend, it just means that each node has children. Merkle trees are created by repeatedly hashing pairs of nodes until there is only one hash left (this hash is called the Root Hash, or the Merkle Root). They are constructed from the bottom up, from hashes of individual transactions. The Merkle Root summarizes all of the data in the related transactions and is stored in the block header (a block header is the unique identity of a particular block on a blockchain and is hashed by miners for rewards). It maintains the integrity of the data. If a single detail in any of the transactions or the order of the transactions changes, so does the Merkle Root. Using a Merkle tree allows for a quick and simple test of whether a specific transaction is included in the set or not.

Merkle trees are powerful and indispensable tools for miners and users on the blockchain. They are extremely robust and are at the heart of several peer-to-peer networks such as BitTorrent, Git, Bitcoin, and Ethereum.

How does the blockchain work? Part 1

read
How does the blockchain work? Part 1

Blockchain is a combination of several different technologies. For making it easier for you, I have broken it down into simpler parts. This is the first part of this series and it’s all about one of the most important technologies used in blockchain; cryptography

What is cryptography? The prefix “crypt” means “hidden” and the suffix “graphy” means “writing.” Since that is out of the way, let’s see what it is. But before that let’s do something fun. Let’s create a secret code. Exciting, isn’t it? Let’s say that we have to subtract ‘1’ from each of the letters in our code to find the original letter. Cool. Since we have created a code and both of us know how to read it, if I write “BQQMF” both of us can easily understand what that means. But if you show it to your friend who has no clue about our secret code, it’d just be a senseless word for him.

This is what cryptography is. It’s a technique to secure information and communications through codes which only the sender and receiver can understand. When I changed “APPLE” to “BQQMF” what I did was encryption. And when you cracked the code, what you did is called decryption

When you learn about a particular technique you’ll have to remember some terms associated with it. Like encryption and decryption, there are a bunch of other simple words associated with cryptography. Let’s see what they mean.

Let’s take our example. In the world of cryptography, the word APPLE which we encrypted is called plain text, and the code BQQMF is called ciphertext. You won’t be able to read BQQMF as APPLE if I didn’t tell you how to read it, that is, to subtract 1 from each letter. So ‘-1’ is what we call the key of our cryptographic algorithm. Without which we won’t be able to understand what each of us is saying.

Now let’s see some of the types of cryptography.

Symmetric Key Cryptography

In this system both the sender and receiver use a single key for encryption and decryption. Our cryptographic algorithm is an example of Symmetric key cryptography.

Asymmetric Key Cryptography

You can easily guess what this would mean from the previous definitions. Yes, you’re correct, in this cryptographic system, there are two types of keys, a public key and a private key. The public key is used for encryption and the private key is used for decryption. Both the keys would be different. Even if the public key is known to everyone, only the intended receiver can decode it because he alone knows the private key.

Asymmetric encryption can be likened to a mailbox on the street. The mailbox is completely public — anyone who knows its location could go to it and drop in a letter. However, only the owner of the mailbox has a key which allows him to access it and read the letters. The location of the mailbox is the public key, something that is known to the public. The private key is with the owner of the mailbox, which is used to access the mailbox.

Hash Functions

In this algorithm, there is no key. These functions change the entire plain text to a new encrypted form, called the hash value. The hash value will be of the same length for whatever plain text fed into it. Since there is no key it is nearly impossible for the contents of the plain text to be recovered.

Public key cryptography and hash functions are used throughout blockchain. There is also another interesting cryptographic technique used inside blockchain called Merkle Trees. A Merkle tree (or hash tree) is a tree that utilizes cryptographic hash functions to store hash outputs instead of raw data in each node. We’ll see what they mean in-depth in the coming articles.