Skip to content

Instantly share code, notes, and snippets.

View prateekrajgautam's full-sized avatar
🎯
Focusing

Dr. Prateek Raj Gautam prateekrajgautam

🎯
Focusing
View GitHub Profile
@prateekrajgautam
prateekrajgautam / Update liunmint behind proxy firstTimeUpdater.sh
Last active February 3, 2021 22:35
Update linuxmint behind mnnit proxy after fresh installation, install ns3 with supporting packages
#!/bin/bash
sudo apt-get install update -y
sudo apt-get install upgrade -y
sudo add-apt-repository ppa:christian-boxdoerfer/fsearch-daily -y
sudo add-apt-repository ppa:inkscape.dev/stable -y
wget -nc https://dl.winehq.org/wine-builds/winehq.key -y
sudo apt-key add winehq.key -y
sudo apt update -y
@prateekrajgautam
prateekrajgautam / vanilla-js-cheatsheet.md
Created April 2, 2020 16:17 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
#!/bin/bash
echo "Installing Nix"
sudo sh <(curl -L https://nixos.org/nix/install) --daemon
sudo rm /etc/apt/preferences.d/nosnap.pref
@prateekrajgautam
prateekrajgautam / AllInOne_Biber_Cleanup
Last active March 2, 2021 09:52
Texworks All In One compile script for Linux and windows
#!/bin/bash
pdflatex $1 $2 $3
#bibtex $2
biber $2
makeindex $2
makeglossaries $2
pdflatex $1 $2 $3
pdflatex $1 $2 $3
# Clean Auxilary files from Latex Folder
filetypes=(aux out log lof lot toc ind ilg idx glo bcf maf ist glsdefs mtc0 mtc gls glg 2i 2o blg run.xml bbl blg bcf mtc* mlf* mlt* ptc* plf* plt*)
@prateekrajgautam
prateekrajgautam / pdftkEncryptScript.sh
Created February 23, 2021 09:19
Encrypt pdf using pdftk
#!/bin/bash
read -p 'Input file name : ' input
read -p 'Input file name : ' output
read -s -p 'Input Secured Password : ' pass
echo ""
echo "trying to fine file in current folder"
pdftk ./$input input_pw encrypt output ./$output.pdf user_pw prateek owner_pw $pass encrypt_128bit compress flatten
echo ""

I have a Thinkpad T470p laptop with Linux Mint 20.1 (Xfce) installed for personal use and power management is one of the things I dislike in otherwise a pretty good laptop. Compared to my work laptop, a Macbook, the Thinkpad drains battery in sleep mode and I often find the battery completely drained if I happen to not to use the laptop for a couple of days.

Since Linux Mint does not come with Hibernation option enabled out of the box, following are the steps I did to enable this option.

Swap partitionPermalink

I found it is easier to have the right size of swap partition at installation time rather than trying hibernation support based on a swap file. Following instructions are based on my setup with a swap partition.

I created a swap partition of 25G since I have 24G of RAM at install time.

@prateekrajgautam
prateekrajgautam / ConvertPDFtoJPG.sh
Last active June 18, 2021 09:46
PDF to JPG batch conversion on linux
#!/bin/bash
sudo apt-get install poppler-utils
mkdir ConvertedJPG
echo "hi"
for f in *
do
echo "converting" $f
pdftoppm -jpeg -rx 300 -ry 300 "$f" JPG
echo "moving converted JPG to " $f "\n"
mkdir "./ConvertedJPG/$f"
@prateekrajgautam
prateekrajgautam / ESP32_GetRSSI.c
Created July 17, 2021 18:59 — forked from Staubgeborener/ESP32_GetRSSI.c
Grep and parse the RSSI of received packets
/* ESP32 Get RSSI of packets- Promiscuous Mode
(C) 2017, Staubgeborener
https://github.com/Staubgeborener/ */
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "lwip/err.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
#include "freertos/FreeRTOS.h"
#include "nvs_flash.h"
#include "lwip/err.h"
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
uint16_t offset = 0;
@prateekrajgautam
prateekrajgautam / FirefoxDevInstaller.md
Last active January 27, 2024 08:06
Firefox - Dev - Installer - Linux

Install Firefox Dev Installer on Linux

#!/bin/bash
echo "Installing Firefox Dev"
curl --location "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US"  | tar --extract --verbose --preserve-permissions --bzip2

mkdir -p ~/.local/opt
mv firefox ~/.local/opt