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

I want to run LLM Models locally. What do I do?

One of the most sought after things to learn right now is about how to set up your own local LLM server and how to use LLM models locally. With the arrival of some things like Ollama and LM Studio etc, it has become very easy. Ollama is an orchestrator that lets you serve up models locally, models like Llama 3.1, Qwen-2.5, Phi, whatever models you have on HuggingFace. These are available to be served up and many more. ...

January 3, 2025 · 3 min · Abhiram R

Making your first blog with mkdocs

Now, why do this? What’s wrong with Medium and Substack and Blogger and Wordpress and all the tens of websites out there? Nothing. You could totally just create a blog there and publish. That’s why Content Management Systems exist - so you could focus on the content and not on the management . But if you’re like me and want some more control over how you publish your blogs, customize them etc. , you will find this and the other upcoming articles in this category interesting. ...

November 16, 2024 · 4 min · Abhiram R

Getting topics of Interest from HN

Building a Classifier Fetching stories from Hacker News Extracting key information from articles Using AI to determine article topics Code - {% gist 5181b0e3c9957617598d4b446609ba01 hn_scraper_llm_topics.py %} {% gist d6a97bbd3534c532d148ea8a1efc851b strings.py %} {% gist d2fc27b41a17497466621b7e25c924fa data_models.py %} {% gist 3bb526888e592de66c82eba391dd08ea keys.py %}

August 26, 2024 · 1 min · Abhiram R

LC Num 21

21. Merge Two Sorted Lists First I didn’t understand the problem I think. In the sense that I accepted the inputs as two lists and returned a list - Python list. Then I read it and realized they want the operation in Linked lists. i took some time to recall how to move along a list and finally figured it out. The other thing that gave me a minor ankle break was when the test case was two empty lists. ...

April 15, 2024 · 2 min · Abhiram R

Enabling Spark History Server Standalone

I’ve been using Spark for close to 2 years now but because I’ve always used it largely on clusters at work, I’ve never really had to struggle with the minutae of enabling monitoring pages like the Spark History Server UI etc. Now that I’m exploring some advanced concepts in Spark, one of the first things I learnt was enabling the Spark History Server locally i.e on a Standalone installation. Let’s assume that our Spark installation’s version is 2.3.2 and we’ve extracted the binary into /opt/spark-2.3.2-bin-hadoop2.7. ...

December 27, 2021 · 2 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

Custom CSS Jupyterlab Ext

Jupyterlab is a definite improvement on the older IPython notebook interface - both in features and in appearance. There is now even an in-built “Dark Theme” that can be enabled. But is that all? As we know, Jupyterlab is a browser based app and is ipso facto, written on a base of HTML, CSS and Javascript. So if we want to change the appearance over and above what we get out of the box with jupyterlab, we can. Now, it is possible to make any CSS changes by hacking into the internals of the notebook, but thanks to a nifty Jupyterlab extension by Adam Wallner, we don’t have to. ...

December 10, 2019 · 3 min · Abhiram R

Setting Up Python3.8 and Jupyterlab

I’m using Ubuntu 16.04 on this machine, so that’s what the steps of installation here will be for. But this installation shouldn’t largely vary on any distro that’s 14.04 and higher. Step 1 - Download Python source code Binary installations are available for Windows and Mac but you can either install Python3.8 on Ubuntu using “apt” or download and install from source. I did the latter. Obtain the gz file from here. ...

November 7, 2019 · 2 min · Abhiram R

Git Jupyterlab Ext

Disclaimer : Extensions in Jupyter-lab are still very much experimental. But this one seems to be working fabulously so far. jupyterlab-git is an extension that lets you stage and commit changes to notebooks made right from within the Jupyterlab interface. This is best installed within the confines of a virtual environment, as is anything experimental. Installation steps - a) Ensure that you have the latest version of jupyterlab (=1.2.0 at the time of this writing) and NodeJS(=12.13.0 at this time) ...

October 31, 2019 · 1 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

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

Django Filter To Shorten Naturaltime

This is a filter snippet to shorten the natural time value obtained using naturaltime function from humanize. #In templatetag file , say file_tags.py from django import template register = template.Library() @register.filter def shorten_naturaltime(naturaltime): naturaltime = naturaltime.replace(‘minutes’,’m’).replace(‘hours’,‘h’).replace(‘days’,’d’) naturaltime = naturaltime.replace(‘months’,‘mon’).replace(‘weeks’,‘w’).replace(‘week’,‘w’) return naturaltime #In Usage file {% load file_tags %} {{start_time|naturaltime|shorten_naturaltime}} #where start_time is the datetime object to be modified {% if page.comments %} Please enable JavaScript to view the comments powered by Disqus. ...

June 26, 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

Notes from Design of Everyday Thoughts by Don Norman - 1

This is the first design-related book I’m reading. I’ve read blogs in the past though. I picked this up because of its rave reviews and my own interest in wanting to design software and represent data better. Here I list some notes I made from the book peppered with my own thoughts during the reading. Chapter 1 : The psychopathology of everyday things In the reading of this chapter, Don Norman stresses that the 2 most important characteristics of good design are ...

2 min · Abhiram R