Playing with xbar: Showing WordPress Site Page Views In Menu Bar

Today while reading a tech newsletter I discovered xbar. xbar[1] lets you put output from any script/program in your macOS menu bar. Xbar is built using Wails. Wails[2] allows you to build desktop apps using Golang and Web technologies.

Xbar has a plugin based architecture. There are hundreds of pre-built plugins that help you view information about AWS, cryptocurrency, weather, date & time, and many others.

Continue reading “Playing with xbar: Showing WordPress Site Page Views In Menu Bar”

Playing with htmlq, awk, and sed

Last week I discovered htmlq, a CLI tool to extract content from HTML. It is similar to jq, a very powerful and popular command-line JSON processor.

The best way to learn a tool is to use it for something useful. In this short post, I am showing you how I used htmlq to extract content from my Github profile

Finding name of all the repositories on the first page

curl --silent\?tab\=repositories \
| htmlq 'a[itemprop="name codeRepository"]' \
| htmlq --text --ignore-whitespace \
| awk '{$1=$1};1' \
| sed '/^$/d'

It lists the last updated 30 repositories.

Continue reading “Playing with htmlq, awk, and sed”

mssql-scripter: A CLI tool to generate data definition language and data manipulation language for SQL Server

Lately I have to use SQL Server for a Microservices based system that I am currently building. This is the first time in my 15 years of software development life I had to use SQL Server. I was looking for a tool that can help me generate database schema from the already created database schema. I wanted to do store schema in my version control system. The usual tool to do this kind of work is SQL Server Management Studio but it works only on Windows operating system. Since I use Mac I was looking for a tool that is cross platform. My search led me to discover mssql-scripter, a multi-platform command line experience for scripting SQL Server databases.

Continue reading “mssql-scripter: A CLI tool to generate data definition language and data manipulation language for SQL Server”

Tools Software Engineers Should Know: 6 Things You Can Do with NetCat

In the second post of the tools series, I am going to cover netcat utility. It comes prepackaged on most of the linux distributions. The netcat utility is often referred to as a Swiss army knife of networking tools. It has a long list of features. Few of them are mentioned below.

  1. Outbound or inbound connections, TCP or UDP, to or from any ports
  2. Full DNS forward/reverse checking, with appropriate warnings
  3. Ability to use any local source port
  4. Built-in port-scanning capabilities

Continue reading “Tools Software Engineers Should Know: 6 Things You Can Do with NetCat”

Tools Software Engineers Should Know: MTR: A network diagnostic tool

We software developers are good at debugging code related issues but when it comes to issues that require fighting with infrastructure or network then we find ourselves in a difficult position. We can solve these issues if we know the right tool to use. I faced a similar position this week. I am starting a new series where every week or two I will write about a new tool that can help us debug these kind of issues.

This week I was debugging an issue where few requests to the destination server were timing out. These types of issues typically fall under networking errors and require you to use a network diagnostic tool. Most developers start diagnosing the issue using ping and traceroute tool. Both these tools are useful but you have to run them both together to debug the issue. Recently, I discovered MTR which combines ping and traceroute tools in a single tool. I found that most developers that I work with are not unaware of this tool so I decided to document it for future me and others.

mtr stands for My traceRoute. It is useful when you need to figure out number of hops to the destination server or latency at each hop. It also help you see packet loss at each hop so that you can narrow down the place where you might be facing issue. MTR collects information regarding the state, connection, and latency of the intermediate hosts. Thus giving a complete overview of the connection between two hosts on the network.

Continue reading “Tools Software Engineers Should Know: MTR: A network diagnostic tool”