Skip to content

Instantly share code, notes, and snippets.

View saravanabalagi's full-sized avatar

Saravanabalagi Ramachandran saravanabalagi

  • Ireland
View GitHub Profile
@saravanabalagi
saravanabalagi / ad_removal_jdownloader.md
Created April 14, 2020 14:33
Removing Ads in Jdownloader

Remove ads in JDownloader

Search for the following keywords in "advanced settings" and disable (uncheck) the options which appear.

premium alert
oboom
Special Deals
Donate
Banner
@saravanabalagi
saravanabalagi / Add_GLU_torch_pruning.md
Last active April 10, 2024 22:29
Add GLU to Torch Pruning lib WIP

In dependency.py, add a new update fn in DependencyGraph

    def _update_glu_index_mapping(self, glu_node: Node):
        if glu_node.type != ops.OPTYPE.GLU:
            return

        # GLU halves the number of channels by applying sigmoid
        input_node = glu_node.inputs[0]
        in_channels = self.get_out_channels(input_node)
@saravanabalagi
saravanabalagi / .pre-commit-config.yaml
Last active March 6, 2024 16:45
Ruff all rules with description
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
@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
@saravanabalagi
saravanabalagi / img_combine_h.py
Created December 11, 2023 13:55
Combines images horizontally using imagemagick in the specified directory based on filename suffixes: img_01.jpg, img_02.jpg, img_03.jpg will be combined into img.jpg
from pathlib import Path
import subprocess
import argparse
def find_and_append_images_with_pathlib(directory):
"""
Adjusted script using pathlib to find images in the specified directory with a given pattern
and append them horizontally using the 'convert' command from ImageMagick.
It supports both .jpg and .png files and handles different suffix patterns.
@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
This is a sample text file
@saravanabalagi
saravanabalagi / .zshrc
Last active March 15, 2023 16:47
My .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/saravanabalagi/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@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 / 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