Skip to content

Instantly share code, notes, and snippets.

View saravanabalagi's full-sized avatar

Saravanabalagi Ramachandran saravanabalagi

  • Ireland
View GitHub Profile
@saravanabalagi
saravanabalagi / segment_trim_60_sec.sh
Created December 5, 2023 21:24
YouTube Trim into 60 second clips for Shorts
#!/bin/bash
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <input_video> [output_directory]"
exit 1
fi
input_video="$1"
output_directory="${2:-segmented}" # Use "segmented" as the default if no second argument is provided
This is a sample text file
@saravanabalagi
saravanabalagi / place_types.json
Created November 11, 2022 17:30
MACMORRIS Places of Literary Importance
[{"id":1,"name":"Province","created_at":"2022-03-28T14:09:46.016Z","updated_at":"2022-03-28T14:09:46.016Z"},{"id":2,"name":"County","created_at":"2022-03-28T14:09:46.032Z","updated_at":"2022-03-28T14:09:46.032Z"},{"id":3,"name":"City","created_at":"2022-03-28T14:09:46.047Z","updated_at":"2022-03-28T14:09:46.047Z"},{"id":4,"name":"Town","created_at":"2022-03-28T14:09:46.060Z","updated_at":"2022-03-28T14:09:46.060Z"},{"id":5,"name":"Townland","created_at":"2022-03-28T14:09:46.069Z","updated_at":"2022-03-28T14:09:46.069Z"},{"id":6,"name":"Barony","created_at":"2022-03-28T14:09:46.077Z","updated_at":"2022-03-28T14:09:46.077Z"},{"id":7,"name":"Street ","created_at":"2022-03-28T14:09:46.085Z","updated_at":"2022-03-28T14:09:46.085Z"},{"id":8,"name":"Village","created_at":"2022-03-28T14:09:46.094Z","updated_at":"2022-03-28T14:09:46.094Z"},{"id":9,"name":"River ","created_at":"2022-03-28T14:09:46.102Z","updated_at":"2022-03-28T14:09:46.102Z"},{"id":10,"name":"Other","created_at":"2022-03-28T14:09:46.109Z","updated_at"
@saravanabalagi
saravanabalagi / Dockerfile
Last active September 13, 2022 13:39
New Rails App using Docker
FROM ruby:3.1
RUN apt update -qq && apt install -y nodejs postgresql-client
RUN gem install rails -v '7.0.3.1'
ARG APP=/railsapp
WORKDIR ${APP}
ADD Gemfile ${APP}/
RUN bundle install
@saravanabalagi
saravanabalagi / scene_categorization_dataset_links.md
Last active November 19, 2024 15:11
Links to Scene Categorization Dataset
@saravanabalagi
saravanabalagi / inotify-limits.sh
Created June 1, 2022 12:25
Get the procs sorted by the number of inotify watchers
#!/bin/sh
# Get the procs sorted by the number of inotify watchers
# @author Carl-Erik Kopseng
# @latest https://github.com/fatso83/dotfiles/blob/master/utils/scripts/inotify-consumers
# Discussion leading up to answer: https://unix.stackexchange.com/questions/15509/whos-consuming-my-inotify-resources
usage(){
cat << EOF
Usage: $0 [--help|--limits]
@saravanabalagi
saravanabalagi / install_python.md
Last active April 27, 2022 15:24
Download and Install Python without sudo privileges

Install Python

Builds python from source and installs to ~/.local/share/python/python-version without requiring sudo privileges.

Quick Start

Specify python version when calling the script and it will download, build and install the specified python version from python.org

sh ./install_python.sh 3.8.1
@saravanabalagi
saravanabalagi / install_singularity_module.md
Last active October 20, 2022 17:23
Singularity Module

Singualarity Module

A convenience python script that helps create shortcuts in host machine to programs inside of singularity containers.

  • Place this inside ~/.local/bin and make sure you have export PATH="$HOME/.local/bin:$PATH" in .bashrc or .zshrc
  • Make module executable by running chmod +x ~/.local/bin/module
  • To load a shortcut to node from dev singularity instance into ~/.local/bin:
module load node dev
@saravanabalagi
saravanabalagi / wsl2_setup.md
Last active March 25, 2022 17:28
Install WSL2 in another drive and Create multiple instances

Install Windows Subsystem for Linux on a Non-System Drive

  1. Download ubuntu2004.appx from https://aka.ms/wsl-ubuntu-2004
  2. Open with WinZip or WinRAR and then open Ubuntu_2004.2021.825.0_x64.appx again as archive
  3. Extract contents of Ubuntu_2004.2021.825.0_x64.appx into a new folder e.g. V:/ubuntu_new
  4. To install, simply run ubuntu.exe

Installing multiple instances of Ubuntu in WSL2

Skip installing ubuntu.exe and follow the instructions below, the instructions will create a the new wsl instance Ubuntu2

@saravanabalagi
saravanabalagi / runafter
Last active September 25, 2023 19:36
Executes command after a process completes
#!/bin/bash
if [ $1 == '--help' ] || [ $1 == 'help' ] || [ $1 == '-h' ] ; then
echo "usage: runafter <pid> [-f] <command>"
exit 0
fi
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo "error: first arg must be a pid of a running process" >&2
exit 1