Skip to content

Instantly share code, notes, and snippets.

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 / 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 ""
@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*)
#!/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 / vanilla-js-cheatsheet.md
Created April 2, 2020 16:17 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@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