Skip to content

Instantly share code, notes, and snippets.


Gautam krishna R gautamkrishnar

View GitHub Profile
gautamkrishnar /
Last active July 10, 2022 09:31
Shell script to force kill a Proxmox VE VM when it stop responding using the VM ID


./ <vm_id>
gautamkrishnar /
Last active April 14, 2022 20:20
Automated script to fetch current and daily BSNL network usage and show it on your MacOS menu bar
#!/usr/bin/env bash
curl '' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36' \
--data-raw \
'actionName=manual&_search=false&rows=4&page=1&sidx=&sord=asc' \
--silent | /usr/local/bin/jq --raw-output '.rows[0] | "\(.totalUsage)\n---\nToday \(.dailyTotalUsage)"'
View example.yaml
name: Release Image
- v*
name: Publish Image
runs-on: ubuntu-latest
gautamkrishnar /
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 /
Last active October 29, 2017 10:29

Keybase proof

I hereby claim:

  • I am gautamkrishnar on github.
  • I am gkrish ( on keybase.
  • I have a public key ASA7kdEWVJClHLW8EkVu1aRXGE9Ldn6JuZOrPHEAbpS7CQo

To claim this, I am signing this object:

gautamkrishnar /
Created July 30, 2017 11:22
A python script to increase the views of your pastebin profile. See the results:
import requests
import threading
import os
import random
pastebinurl = ""
def loaduseragents():
Loads the list of user agents from user_agents.txt
gautamkrishnar /
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:
global x
gautamkrishnar /
Created July 12, 2017 11:04
simple program to do python multiprocessing
import multiprocessing as mp
process_list = []
def pr1(test,test1):
@:param: test,test1 (Integer)
process 1
print("Pr 1 prining... '"+str(test)+"','"+str(test1)+"' recieved...")
gautamkrishnar /
Created December 27, 2016 08:54
Script to generate a coma seporated file(.csv) from a given input file with normal english words and unicode characters...
from nltk.corpus import wordnet #Using Natural language toolkit (
import codecs
def check(str):
if not wordnet.synsets(str):
return 1
return 0
if __name__ == '__main__':
View sri.go
package sri
import (
func Generate256(file string) (string, error) {