Log Rotate in Linux

Logging is an essential part of any system. It helps us to debug and monitor the system. Log files are a common way to store logs generated by a system or application. When there are a lot of logs generated by the system, it can consume a lot of disk space. To manage the log files, we can use the logrotate utility in Linux. Log rotate configuration Setting up log rotate to manage logs is simple....

Sharing files from SharePoint to Azure Blob Storage using Python

Let’s see how we can share files between two cloud storage solutions - SharePoint and Azure Blob Storage using Python. We will be simply copying all the files from a sharepoint site to an Azure Blob Storage container. Sharepoint sites will have a drive associated with it and we can access the files in the drive using the Graph API. We will be using the requests library to interact with the Graph API....

C - Overview

C is an amazing low-level programming language that has stood the test of time. It was developed by Dennis Ritchie in the early 1970s at Bell Labs and has since become one of the most widely used programming languages. C is known for its efficiency, flexibility, and portability, making it an ideal choice for system programming, embedded systems, and low-level programming. Few things I like about C are The ability to directly manipulate memory and hardware....

Golang Thread Blocking Entities

Golang has good concurrency support using goroutines. Goroutines are lightweight threads managed by the Go runtime. Goroutines are multiplexed to fewer OS threads. Goroutines are non-blocking, and they are not scheduled by the OS. The Go runtime schedules the goroutines. The scheduler uses a technique called M:N scheduling. M goroutines are multiplexed to N OS threads. The scheduler schedules the goroutines to the OS threads. The scheduler uses a technique called work-stealing to schedule the goroutines...

Using Pkl in Go

Pkl is a config managment language developed by Apple. It is a simple language to manage configuration files. It has plugin support for popular editors and support for golang. Sample project Let’s start with a simple go project. go mod init pkl-sample touch main.go package main import ( "fmt" ) func main() { fmt.Println("Hello, World!") } Install pkl First, let’s install pkl using brew. brew install pkl Then, Let’s install pkl-go library in our project....

Swagger Docs in Go

Golang is a very good language to create web api servers. I like gofiber framework for creating web api servers. In this article, we will see how to use Swagger in Go especially with gofiber framework. Install swaggo/swag go install github.com/swaggo/swag/cmd/swag@latest Create a new project go mod init github.com/username/projectname Setup Gofiber and Swagger In the code below, we have created a simple API using gofiber framework. The annotations are used to generate the swagger documentation....

Elixir Overview

Elixir leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems, while also being successfully used in web development and the embedded software domain. It’s functional paradigm and immutable data structures make it a great choice for building scalable and maintainable applications. Few things I like about Elixir are The syntax is very clean and easy to read. The built-in support for concurrency and fault-tolerance. The ability to write highly concurrent and distributed systems with ease....

Running AI Coder Locally

AI Coding tools like copilot, cody etc.. are becoming very relevant and helpful. But, the problem is that they are not available offline. This became a problem when I wanted to travel and had no internet access. So, I remembered about ollama and was looking for a way to use it for my local development. Ollama Ollama is a tool that allows us to run LLMs locally. You can get it simply by:...

Go has less features, so I'm more productive

Golang is well known for the simplicity and performance it offers. It follows a procedural programming paradigm and has a very minimalistic syntax. Sometimes, it’s too verbose compared to some enterprise languages like Java, C# and Python. But, it’s the same reason why I’m more productive with Go. Limited but essential features Go allows us to achieve something in one or only limited amount of ways. This itself is a huge productivity booster as there will be limited choices of patterns to choose from, which makes it easier to make decisions....

SSH Usage

SSH is an encrypted protocol used to connect between two systems. It’s widely used to gain access to remote server and run shell commands. It is also a common thing we use with VCS like github, gitlab etc. SSH Key Generation Creating ssh key is pretty simple, the CLI generates a public and private key pair. The public key is shared with the server and the private key is kept secret....