Skip to content

Instantly share code, notes, and snippets.

View raveensrk's full-sized avatar

Raveen Kumar raveensrk

View GitHub Profile
@raveensrk
raveensrk / aliases
Last active September 15, 2021 12:46 — forked from kaleb/aliases
Mutt Configs
#~/.mutt/aliases
alias nick Nicholas Levandoski <nick.levandoski@auglug.org>
alias tim Timothy Pitt <timothy.pitt@auglug.org>
alias steven Steven Jackson <sjackson@auglug.org>
alias kaleb Kaleb Hornsby <kaleb.hornsby@auglug.org>
alias alug-admin nick, tim, steven
@raveensrk
raveensrk / ,convert_image_to_a3_size.bash
Created July 30, 2022 13:29
Script to convert any image to a3 size, with cropping, scaling, done properly
#!/bin/bash
help () {
echo "
+-----+
|Usage|
+-----+
,convert_image_to_a3_size.bash -i image.jpg
+--------+
@raveensrk
raveensrk / settings.json
Created January 25, 2023 10:21
fira code font settings for windows terminal
"font":
{
"face": "Fira Code Retina",
"features": {
"cv01": 1,
"cv02": 1,
"cv03": 1,
"cv09": 1,
"cv12": 1,
"cv14": 1,
@raveensrk
raveensrk / .tmux.conf
Created August 25, 2023 10:02
You can have named tmux panes. Add this to ~/.tmux.conf.
set -g pane-border-status top
set -g pane-border-format " [ ###P #T ] "
bind-key T command-prompt -p "Enter pane title: " "run-shell 'tmux select-pane -T \"%1\"'"
@raveensrk
raveensrk / gist:224c8192f2f857e6285098a6a20f8528
Created August 25, 2023 13:26
How to Redraw the screen in tmux?
<prefix>R
@raveensrk
raveensrk / strip_extension.bash
Created August 26, 2023 14:48
Strip extension from a filename using bash
#!/bin/bash
name="$(basename "$1")"
name_without_extension="${name%\.*}"
echo "$name_without_extension"
@raveensrk
raveensrk / takeout_yt_subs_to_rss_feed
Created August 26, 2023 15:18
Convert all YouTube subscriptions to rss feed urls. subscriptions.csv from google takeout is the input.
#!/usr/bin/env bash
# This script basically converts input subscriptions.csv file from youtube takeout and converts to rss feed format. You can add this to ~/.newsboat/urls
get () {
url="$1"
rss="${url##*/}"
rss="https://www.youtube.com/feeds/videos.xml?channel_id=${rss}"
echo $rss
}
@raveensrk
raveensrk / align_csv
Created August 27, 2023 08:29
How to align a csv file?
#!/bin/bash
columns -t -s "," "$1"
@raveensrk
raveensrk / square_fit_image
Created August 27, 2023 15:09
How to square fit image using Bash and FFMPEG
#!/usr/bin/env bash
name=$(strip_extension "$1")
output_file_name="${name}-square.jpg"
ffmpeg -i "$1" -vf "scale='min(1080,iw)':'min(1080,ih)',pad=1080:1080:(1080-iw)/2:(1080-ih)/2" "$output_file_name"
echo "$output_file_name"
@raveensrk
raveensrk / How to find path to the module file from which a class is instantiated in system in python.md
Created August 29, 2023 14:09
How to find path to the module file from which a class is instantiated in system in python

In Python, you can find the path to the module file from which a class is instantiated using the inspect module. The inspect module provides functions for introspecting objects, including classes and modules. Here's an example of how you can achieve this:

import inspect
from your_module import YourClass  # Import the class you're interested in

# Get the path of the module containing the class
class_module_path = inspect.getfile(YourClass)