Skip to content

Instantly share code, notes, and snippets.

View gautamkrishnar's full-sized avatar

Gautam krishna R gautamkrishnar

View GitHub Profile
@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.
@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 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 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 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 / 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 / add-all-empty-directory-git.sh
Last active June 28, 2019 15:01
Add all empty directories to github
#This shell script will find all empty directories and sub-directories in a project folder and creates a .gitkeep file, so that the empty directory
#can be added to the git index.
find * -type d -empty -exec touch {}/.gitkeep \;
@gautamkrishnar
gautamkrishnar / keybase.md
Last active October 29, 2017 10:29
keybase.md

Keybase proof

I hereby claim:

  • I am gautamkrishnar on github.
  • I am gkrish (https://keybase.io/gkrish) on keybase.
  • I have a public key ASA7kdEWVJClHLW8EkVu1aRXGE9Ldn6JuZOrPHEAbpS7CQo

To claim this, I am signing this object:

@gautamkrishnar
gautamkrishnar / pinger.py
Created July 30, 2017 11:22
A python script to increase the views of your pastebin profile. See the results: https://pastebin.com/u/gautamkrishnar
import requests
import threading
import os
import random
pastebinurl = "https://pastebin.com/u/gautamkrishnar"
def loaduseragents():
"""
Loads the list of user agents from user_agents.txt
:return:
"""
@gautamkrishnar
gautamkrishnar / lib.py
Created July 13, 2017 06:40
A simple python thread based random number generator
import threading
x=0 #to get a random number
killswitch = False # To kill thread after use
def threaded_return(que):
"""
Returning data from thread safely (Returns current value of x)
:param que:
:return:
"""
global x