Skip to content

Instantly share code, notes, and snippets.

View gautamkrishnar's full-sized avatar

Gautam krishna R gautamkrishnar

View GitHub Profile
@gautamkrishnar
gautamkrishnar / main.py
Last active October 23, 2021 11:44
Python code to split a large PDF file into muliple files
import PyPDF2
input_pdf = PyPDF2.PdfFileReader(open("document.pdf", "rb"))
num_of_pages_per_file = 10
doc_counter = 1
counter = 0
output = PyPDF2.PdfFileWriter()
for split_range in [range(input_pdf.numPages)[x:x + num_of_pages_per_file] for x in
range(0, input_pdf.numPages, num_of_pages_per_file)]:
@gautamkrishnar
gautamkrishnar / Readme.md
Last active April 29, 2023 09:24
Automated script to fetch current and daily BSNL network usage and show it on your MacOS menu bar

Preview

Screenshot 2022-04-13 at 1 03 23 PM

How to use

  1. Open your terminal
  2. Install brew if it is not installed: https://brew.sh/
  3. Install jq by running the following command
brew install jq
@gautamkrishnar
gautamkrishnar / README.md
Last active July 10, 2022 09:31
Shell script to force kill a Proxmox VE VM when it stop responding using the VM ID

Usage

./kill-vm.sh <vm_id>
@gautamkrishnar
gautamkrishnar / Readme.md
Last active April 29, 2023 09:21
Script to add alias to cut / trim any video file using ffmpeg faster

Usage

cutvid <source video> <destination video> <start time> <end time>

example:

cutvid bigBucksBunny.mp4 bigBuck1.mp4 00:01:00 00:02:10
@gautamkrishnar
gautamkrishnar / Readme.md
Last active July 17, 2023 04:47
A zero dependency shell script for running 2 commands in paralell, combining their output into a single stdout. Also prepending a static string to differentiate the output.

Concurrent Command Execution with Unified Output

This lightweight shell script demonstrates running two commands in parallel while combining their outputs into a single stdout. The script also prepends a static string to differentiate the output of each command. This solution requires zero external dependencies, making it efficient and easy to use.

run.sh

#!/bin/bash

# replace command1 and command2 with command you need to execute
@gautamkrishnar
gautamkrishnar / README.md
Last active January 4, 2024 17:35
Script to automatically download a youtuber's live stream as soon as it becomes live. It also respects youtube's free API limitations.