Alias Creation in Windows Using Python

One thing I’ve missed in Windows post my switch from Linux is the ability to create aliases for commands. In Linux, you can create an alias for a command by adding the following line to your .bashrc or .bash_profile file - alias ll='ls -l' This would allow you to use ll instead of ls -l in your terminal. In Windows, you can create a similar alias by creating a batch file and adding it to your PATH environment variable. ...

February 17, 2025 · 2 min · Abhiram R

Postgres (post 1)

Installing Postgres locally and connecting to it from Python First of all, what is Postgres and why do I care? Over the course of our working with data, we come across a lot of ways of storing data - cache, in-mem, files, file based databases, SQL databases, NoSQL databases etc. Each option has a specific set of usecases that are best satisfied by said storage mechanism. Postgres DB is one such storage mechanism - specifically an Open Source, Relational Database. ...

August 1, 2024 · 4 min · Abhiram R

Learning how to use FFMpeg

What is FFmpeg? In their own words, FFmpeg is “A complete, cross-platform solution to record, convert and stream audio and video.” I’ve been recording Bangpypers videos for the last few months and I haven’t really had access to a proper solution to edit videos and audio that I could have got for free/ low-cost. A good friend of mine, Vinay Keerthi, (who incidentally presented the webinar under discussion) told me to chuck GUI based fronts for editing them and told me to try FFmpeg, the CLI tool directly, which these tools probably use in the background anyway. ...

December 6, 2020 · 4 min · Abhiram R

Bangpypers PreWorkshop Setup

A guide to installing a newer version of Python is available here. We at Bangpypers conduct a lot of workshops and some steps are common for all of them. To that end, this post is meant to serve as guide for people to install Python on Ubuntu and Windows (if required), setting up virtualenv and installing the package(s) germane to the corresponding Workshop. Ubuntu Check your existing version of Python to see if you already have what’s required. ...

February 22, 2019 · 2 min · Abhiram R

F U Python Commands

The previous post was for commands Unix. This post is about the Python commands I use or Google frequently. To find the absolute path of the directory of the current file being executed - abs_path = os.path.dirname(os.path.realpath(file)) To copy a file from source to destination (using shutil)- from shutil import copyfile copyfile(src, dst) To copy a file or directory from source to destination (using shutil)- from shutil import copy copy(src, dst) ...

January 9, 2019 · 1 min · Abhiram R

Unix Commands I Use

I keep Googling commands for some of these situations regularly - General - 1) To find files one level below your current directory - I was trying to find which repos in my set of folders have a setup.py file. So, this is what I’d use. find . -maxdepth 2 -iname setup.py 2) To find what process is running on port 2181 - sudo lsof -n -i :2181 | grep LISTEN ...

December 24, 2018 · 1 min · Abhiram R

Memory Monitor Widget Using Python

I use Ubuntu 16.04 and I’ve been searching for a good memory monitoring desktop widget to no avail. I found a couple of taskbar widgets but none that would tell me the free memory left in addition to the used/swap/cache memories. So I decided to write my own (with loads of help from the Internet of course). Component 1 — The widget I didn’t know how to do this. Thankfully Stuart Langridge had already done this for me. I tweaked the override_background_color parameter to get a red background for my widget and the size of the widget itself to be 400*20 so it would be a nice small strip rather than a big blob of a rectangle. ...

June 5, 2018 · 2 min · Abhiram R