Productivity

Productivity

So you probably have a couple thousand and a half things to do and 99% of them should have been done by now, but you didn’t get enough time and that’s why you will start tomorrow fresh again on achieving these, where tomorrow is some mystical land where 99% of the human productivity lives. Do you see a common pattern over the years where you wanted to do a lot of things but weren’t able to? Yes there probably are a lot of things that were done wrong, and you might need to even start to rethink from scratch not just when would you achieve your goals or when your tomorrow or monday will come, but rather rationalise your thinking about goals and productivity. This page will contain some of the things that I do or I learnt the hard way.

You own all your time

What you are doing at the moment is the best use of your time according to you. Stop saying I don’t have time rather say it’s not my priority and then reflect in your subconscious head Is what I am doing right now really my priority over the thing I am choosing not to do? But have a conviction either you are going to do or you are not, don’t stay in between. This is one of my favourite tips which genuinely lets me take more control over my time.

Use a to-do list

Are you a software developer? Are you a product manager? Do you have a list of what needs to be done in the quarter or in a sprint for the company that you are working for? You most probably do. You can’t even imagine starting a sprint without having a proper to-do list for the sprint. Then why don’t you have a to-do list for your life outside of the company you work for? But I have all of this in my head(whatever I need to do)- Our brain is unfortunately optimized for having ideas. not storing them. The idea is inspired from Getting Things Done by David Allen. Have an inbox accessible to you most of the time, whenever you have an idea or a todo task, add it in your inbox. Delegate a project to it, and it should vanish from your inbox. Keep delegating your todos from inbox to projects to make space for new todos. I usually assign them labels which usually falls in one of these categories ["high-energy","low-energy","bed","mobile","desk"] and I can look at my todo list and grab the high-energy,desk tasks in the morning and low-energy tasks in the evening and make sure they are completed. I have a recurring task- plan out tomorrow where I need to look at my projects or the jira for my company and plan out what my tomorrow would look like. I have another recurring task retrospect today where I need to look at how my day went. A simple todoist app works too, no need to go fancy and build custom dashboards for GTD in notion or anywhere else. Just make sure, everything goes in the todo list. If watching netflix for 5 hours is what you are going to do tomorrow, put it up in the todo list, but if not that should be the first thing that goes out of that list.

Use a time tracker tool

Use a time tracker tool better something that integrates with your todo tool and track your time spend on a task. I use clockify which integrates nicely with todoist and I can in one click start a clockify timer from either my chrome extension or inside the todoist app and it starts tracking time on my calendar and gives a nice visualization of where my time went on the calendar! But wait do I have to tick the timer for each meeting too? I already took the pain to scheduled it. No worries, clockify synchronizes nicely with google calendar too, and you can connect your calendar to have your events on the clockify calendar. But I schedule meetings on my official calendar, and that’s not permanent. What do you have for that? I use a tool called zapier which copies the events to my personal calendar in realtime- as soon as a new event is triggered in my official calendar and that’s how I am always on top of my time.

Reflect on your goals seldom

Always fell in love with the process, but no matter how beautiful the process is- seldom take out time to reflect on the goals. Since productivity isn’t about how much busywork you could cram in an hour, how organized you make your life, how beautiful your calendar looks, how everything is measured or how you have everything scheduled by a fancy tool/app. It’s about the results you product, if you’re not producing results in the things that matter, you’re not getting anymore productive, you are just doing more busy work more efficiently. Ultimately we would like to be able to get the things done, we never could.

Allocate the adequate time to the work

If you alot yourself a day to write a simple unit test, it would probably take all that much. This is the idea of parkinson’s law which states that work expands to fill the time that we allocate to it. The idea is to keep short deadlines for the tasks, sometimes even unrealistic deadlines would work too. You’ll not achieve 100% of the goal, but you know anyways that was an unrealistic deadline but that deadline would help you get way ahead in the progress. This I have learnt a hard way- if I don’t have anything planned out for the day, and I just have to write a unit test which should probably take not more than 10 minutes, I end up writing that unit test only in the entire day even though I was on my laptop the whole day. I just keep on beautifying it, make sure the table driven tests that I have written has the nicest table structure etc.

2-minute, 10-minute, 30-minute rule

Make a rule that if a task takes anything less than 2 minutes to complete, I will just complete it straight away rather than queuing it up in a pile and then dequeuing it when it is no longer even substantial. For example- I need to track the interview that I give on huntr or I just need to jot down the points for the rejection email that I just received, it is probably going to take somewhere in the 2 minutes range window, therefore I will just do it straightaway rather than stacking it down to the pile of tasks. The 10 minute rule states- if you are ever feeling unproductive or demotivated or are running away from your task, just say to yourself I am just going to do it whole heartedly for 10 minutes nothing less nothing more. Once you hit somewhere around 10 mintues mark, you’d have probably already developed interest in doing it and you can keep doing it further too. 30-minute rule is also known as pomodoro rule which is a chinese technique (here 30 minute is in no sense a hard limit as with the above 2 as well). So whatever work you are doing, start a timer, disable all distractions and start working until the timer ticks. It is like a sprint, and when you are sprinting you are just sprinting with your whole heart towards the track(here your task). No matter what don’t get distracted for those few minutes where you are sprinting to get your work done. Minus to disable some notifications and minimize distractions via popups.

Delegate

You are probably saying yes to everything in your inbox, do those things have to be done specifically by you? I use a simple Eisenhower Decision Marix to decide whether it can be delegated or not or when do I need to pick it up.

Eisenhower Decision Matrix

Refactor your resources- don’t read thousands of blogs, have some trusted sources where you would information about what’s happening in the world, what is the state of art technology or whatever is related to your job. Having a refactored inbox is a must- group all the CCs into a different inbox folder, don’t religiously read and act upon CC’d emails to you, and next time your boss asks you about a status of work that he CC’d you on, just tell him I thought you were informing me and not assigning the work to me. Please next time send a direct email to me for the work I need to get done. Have a strong spam filtering so that an ad for a commodity doesn’t make it to your inbox.

Automate the third time

Always opt for the easier method between the automating task or just getting it done for the first couple of times, but once you need to do it for the third time, please invest some time wondering if it can be automated, how much time is it going to save me? Is it worth automating it? I have seen almost 100% of the time it is worth automating the stuff you do in your daily work. Optimize for shorter commands or shortcuts that you use very often. I have more than 1100 aliases and more than a dozen shell functions to make my life easier.

The next section will just contain the tools I use daily and would recommend everyone-

  • xbar - this app, I last checked was specifically for mac and lets you put anything on your menu bar for mac. I have the PRs I have to review handy from anywhere and can go directly to that PR in one click, sometimes I do kprtfwd auth iden 8080 but don’t remember which kubecontext is currently active, here I go, I can just look at the menu bar no matter what foreground application I am running, and be sure about the kubecontext.
  • Finicky - this allows for customized rules for browsing particular endpoints on a spceific browser. Since, I have 3 github accounts, it makes my life easy to choose finicky as the default browser and let it decide on which browser shall it open the endpoint.
  • Yabai - A tiling manager for mac.
  • Warp - terminal for Mac. Other options are- iTerm2, kitty,alakritty, hyper. I have used all of them and any of them were absolutely amazing.
  • Todoist - to track my todos
  • Huntr - to track my job applications, where I have applied, where I have got the offer letters from etc.
  • Alfred - efficiency app for mac, replacement for spotlight searching.
  • Github Desktop - desktop client for github, I personally didn’t find it useful after I had to contribute to 3 different github accounts, rather gh-cli is what I use more.
  • Obsidian - notes taking app, with the amount of extensions and integrations available with obsidian, this notes taking app is simply amazing. Another alternatives are- notion, mem, one drive etc.
  • Clockify - to track my time.
  • BloomRPC - GUI to make gRPC calls easier.
  • Postman - GUI for HTTP rest APIs and somewhat API documentation.
  • reclaim - to reclaim my time and have some focus work time, so that colleagues don’t schedule a meeting in my claimed time until it’s p0.
  • cron - a smart calendar app.
  • pgAdmin4 - Postgres CLI

Apps that might be good to have but doesn’t aid much to productivity.

  • Pock - widget manager app for mac touchbar.
  • APowerMirror - mirror your phone on your mac, I don’t write mobile applications that’s why not very useful to me, but is very feature rich and reliant.

Some CLI tools that I use and would recommend everyone-

  • protoc - for code generating client and API documentation using protos.
  • github cli - to create issues directly from the CLi, create PRs etc.
  • br - a replacement for tree
  • exa - a replacement for ls
  • eva - REPL calculator
  • delta - diff tool
  • zsh - shell, some zsh plugins that I use- git, docker, zsh-autosuggestions, fzf
  • oh-my-zsh - configuration management for zsh
  • iredis - intuitive redis CLI with auto completion
  • pgcli - intuitive psql CLI with auto completion
  • procs - replacement for ps

Some useful shell functions-

  • extract , no need to remember the command to extract the specific file type.
 1extract () {
 2    if [ -f $1 ] ; then
 3        case $1 in
 4            *.tar.bz2)        tar xjf $1        ;;
 5            *.tar.gz)         tar xzf $1        ;;
 6            *.bz2)            bunzip2 $1        ;;
 7            *.rar)            unrar x $1        ;;
 8            *.gz)             gunzip $1         ;;
 9            *.tar)            tar xf $1         ;;
10            *.tar.xz)         tar xf $1         ;;
11            *.tbz2)           tar xjf $1        ;;
12            *.tgz)            tar xzf $1        ;;
13            *.zip)            unzip $1          ;;
14            *.Z)              uncompress $1     ;;
15            *.7z)             7zr e $1          ;;
16            *)                echo "'$1' cannot be extracted via extract()" ;;
17        esac
18    else
19        echo "'$1' is not a valid file"
20    fi
21}
  • uuid- to get a Universally Unique Identifier, this is very useful to me when I need to create some records with some uuid manually for testing, so have it handy, for this you need to have jq installed. The source code is encoded in --data-raw flag. You can find here for easier read- https://go.dev/play/p/9Nbnd3glsp_g . You can pipe it into pbcopy to copy it onto clipboard.
1uuid(){
2         curl 'https://go.dev/_/compile?backend=' -H 'accept: application/json, text/javascript, */*; q=0.01' -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' --data-raw 'version=2&body=package+main%0A%0Aimport+(%0A%09%22fmt%22%0A%0A%09%22github.com%2Fgoogle%2Fuuid%22%0A)%0A%0Afunc+main()+%7B%0A%09fmt.Print(uuid.New().String())%0A%7D%0A&withVet=true' --compressed | jq ".Events[0].Message"
3}
  • dip- print out ips of all running docker containers
 1function dip {
 2    echo "IP addresses of all named running containers"
 3
 4    for DOC in `dnames-fn`
 5    do
 6        IP=`docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}' "$DOC"`
 7        OUT+=$DOC'\t'$IP'\n'
 8    done
 9    echo -e $OUT | column -t
10    unset OUT
11}
  • wp- watch pods, watch pods for specific app label in case of deployment if they are crashing or not etc.
1function wp {
2        watch -n1 "kubectl get pods -l app=$1 -n $2"
3}
  • pods- get all pods in a specific namespace or in all namespaces, same can be done for other kubernetes resources too- for example- deployment, services, ingresses etc.
1function pods(){
2        if [ $# -eq 0 ]; then
3                kubectl get pods -A | while read -r line; do echo "${line} | font=Menlo"; done
4        else
5                kubectl get pods -n $1 | while read -r line; do echo "${line} | font=Menlo"; done
6        fi
7}
  • numPods- numPods just returns the number for the pods, same can be done with other kubernetes resources
1function numPods(){
2        if [ $# -eq 0 ]; then
3                kubectl get pods -A 2> /dev/null | grep -v NAME | wc -l | sed 's/ //g'
4        else
5                kubectl get pods -n $1 2> /dev/null | grep -v NAME | wc -l | sed 's/ //g'
6        fi
7}
  • kprtfwd can be used to port-forward a local port to service’s port. Most of my services run on 8080, therefore specifying 8080 each time is redundant, therefore if there are just 3 args, the default port is 8080, change it to your default port, but in some cases when the service is not running on 8080 and some other port, you can specify an extra argument.
1func kprtfwd(){
2        if [ $# -eq 4 ]; then
3                kubectl port-forward -n $1 svc/$2 $3:$4
4        elif [ $# -eq 3 ]; then
5                kubectl port-forward -n $1 svc/$2 $3:8080
6        else
7                echo "usage: kprtfwd <namespace> <service> <port-on-local> <port-on-container(by default 8080 if not given)>"
8        fi
9}

Comments