Skip to content

Instantly share code, notes, and snippets.

View xbalaji's full-sized avatar

Balaji (xbalaji) V xbalaji

View GitHub Profile
@xbalaji
xbalaji / windows-cleanup.md
Created May 29, 2025 03:40
windows-cleanup.md

1. How to use WSL in a different partition of my Windows machine?

Answer:

You can install or move WSL distros to a different partition like this:

Option 1: Install a New WSL Distro to a Different Drive

  1. Download .appx file (e.g., Ubuntu).
  2. Extract it to D:\WSL\Ubuntu using Expand-Archive.
@xbalaji
xbalaji / customlog.R
Created September 14, 2024 22:44
customlog.R
# Set CRAN mirror
options(repos = c(CRAN = "https://cloud.r-project.org"))
# Install optparse if not already installed
if (!requireNamespace("optparse", quietly = TRUE)) {
install.packages("optparse")
}
library(optparse)
@xbalaji
xbalaji / filterjson.py
Created March 7, 2024 01:14
python script to extract key, value pair from a json based using a text file with keys as filter
# filterjson.py
#! /usr/bin/env python3
# python script to extract key, value pair from a json based using a text file with keys as filter
#
# contents.json
# {
# "031648494230": "ETUI-JNredServices-PrivateLink-Prod",
# "230148474224": "ETUI-JNSPlanningViewer-Test",
# "432541444253": "ETUI-JNCOE-Dev",
@xbalaji
xbalaji / wsl_host_port_forward.ps1.md
Last active May 28, 2025 02:15
wsl_host_port_forward.ps1

Execute the following from admin powershell

get the ip address seen by wsl servers

wsl hostname -I

connect from wsl to windows host

  • netsh interface portproxy add v4tov4 listenport=8000 listenaddress=0.0.0.0 connectport=8000 connectaddress=172.17.225.2
  • netsh interface portproxy add v4tov4 listenport=4443 listenaddress=0.0.0.0 connectport=4443 connectaddress=172.17.225.2
@xbalaji
xbalaji / oneliners-sed.sh
Last active February 19, 2023 02:57
oneliners-sed.sh
# extract all the links from firefox bookmarks export
# the following uses grep to get both http, https url
# then uses sed - non-greedy match to extract the link alone
grep 'HREF="http' bookmarks.html | sed -e 's,.*HREF="\([^"]*\)".*,\1,g' | sort | less
# replace a bunch of lines in the middle of a file with ... blah ...
cat 40lines.txt | sed -e '6,34d; 35{i ... blah ...' -e 'd}'
cat 40lines.txt | sed -e '6,33d; 34,36s,.*,,;35s// ... blah .../'
@xbalaji
xbalaji / rasa-readme.md
Created December 21, 2022 03:32
rasa-readme.md

document original source

https://rasa.com/docs/rasa/docker/building-in-docker/

start rasa in a docker container to avoid errors

docker run --user $(id -u):$(id -g) -v $(pwd):/app rasa/rasa:3.4.0-full init --no-prompt

starting the shell

docker run -it --user $(id -u):$(id -g) -v $(pwd):/app rasa/rasa:3.4.0-full shell