linux swap flush
sudo swapoff -a; sudo swapon -a#!/bin/bash
free_mem="$(free | grep 'Mem:' | awk '{print $7}')"
used_swap="$(free | grep 'Swap:' | awk '{print $3}')"
echo -e "Free memory:\t$free_mem kB ($((free_mem / 1024)) MiB)\nUsed swap:\t$used_swap kB ($((used_swap / 1024)) MiB)"
if [[ $used_swap -eq 0 ]]; then
echo "No swap is in use."
elif [[ $used_swap -lt $free_mem ]]; then
echo "Freeing swap..."
sudo swapoff -a
sudo swapon -a
else
echo "Not enough free memory. Exiting."
exit 1
fi
Also in C++:
- installing isomorphic-fetch and simply doing
- delete branches in bulk git
- how to convert pyqt5 to python
- install vue cli 3
- install owlready2
- yarn
- tr new line
- git push heroku master error: src refspec master does not match any error: failed to push some refs to 'https://git.heroku.com/write-any.git'
- linux install toilet
- install clasp
- npm install strapi
- install intellij linux command line
- configure apache in ubuntu
- unstash specific file
- disable sound tab windows 10
- remove branch git
- git reset head to commit remote
- how to run .sh file in background linux
- f.lux for ubuntu 18.04
- download woeusb for ubuntu 20.04
- download google drive file in linux
- bash concatenate two columns
- download file using cmd
- centos selinux set permissive