clear swap memory linux
sudo swapoff -a; sudo swapon -a
clear swap memory linux
sudo swapoff -a; sudo swapon -a
linux swap flush
#!/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
javascript get current url
var currentUrl = window.location.href;
get the current url javascript
window.location.pathname; // Returns path only (/path/example.html)
window.location.href; // Returns full URL (https://example.com/path/example.html)
window.location.origin; // Returns base URL (https://example.com)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us