Andrew Fletcher published: 31 August 2022 1 minute read
At first, I attempted
echo 1 > /proc/sys/vm/drop_caches
Response
-bash: /proc/sys/vm/drop_caches: Permission denied
Adding sudo in front of the command was met with the same result. What about if I execute the shell as root
sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches'
Success. Caches cleared.
Different types of clearing cache
Clear PageCache only
sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches'
Clear dentries and inodes
sudo sh -c 'echo 2 > /proc/sys/vm/drop_caches'
Clear pagecache, dentries, and inodes
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
Related articles
Andrew Fletcher
•
18 Aug 2023
How to set up password authentication with Nginx on Ubuntu 20.04
Goal: Restrict content access through username and password entry on an Nginx server.1: Apache Utilities PackageFirst, update your server’s package index:sudo apt updateCheck if the utilities package exists in your environment by executing the commanddpkg --get-selections | grep...
Andrew Fletcher
•
12 Feb 2023
How to install PHP 8.1 on Ubuntu 20.04
Update Ubuntu 20.04
To begin update the server using the command
sudo apt update && sudo apt upgrade -y
For more details about this process see How To Update All Packages Linux.
PHP version
Check the current PHP version using
php -v
The response I had...
Andrew Fletcher
•
23 Aug 2022
flask_debugtoolbar module doesn't exist
Error when running ckan.ini init
from flask_debugtoolbar import DebugToolbarExtension
ModuleNotFoundError: No module named 'flask_debugtoolbar'
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Then check your location is
cd...