How to Clear Memory Cache on Linux

By default, every Linux OS has an efficient memory management system used to clear the buffer cache periodically. You can manually free up the memory cache with the following simple command:

# echo 3 > /proc/sys/vm/drop_caches"

However, if you want to force the Linux OS to do clearing memory cache on a particular interval, just add the command to cron job. Here, I show you how.

TIPS: “stdin is not a tty” when using SCP

SCP / SSH may not need a (pseudo-)terminal but something may expect it regardless on the remote end.

Does any global or personal shell resource files contain “stty” or “mesg” (‘egrep -r “stty|mesg” /etc/bashrc /etc/profile /etc/profile.d ~/.bashrc ~/.bash_profile;’)? For example:

root@server [/]# egrep -r "stty|mesg" /etc/bashrc /etc/profile /etc/profile.d ~/.bashrc ~/.bash_profile
/etc/bashrc:mesg y
root@server [/]#

If exactly as above, then you need just to comment this row in /etc/bashrc file.

Perl does not work because suexec denies execution

Short solution.

If you have for example:

[root@server]# suexec -V
-D AP_DOC_ROOT=”/var/www” <<<<<<<<<<<<<<<<<<<<<<<< correct place for suexec scripts -D AP_GID_MIN=100 -D AP_HTTPD_USER="apache" -D AP_LOG_EXEC="/var/log/httpd/suexec.log" -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D AP_UID_MIN=500 -D AP_USERDIR_SUFFIX="public_html" [root@server]# then: 1.) create a directory /var/www/cgi-bin (owner root / chmod 0701) 2.) create a directory /var/www/cgi-bin/YOUR_CUSTOMER (owner YOUR_CUSTOMER / chmod 0701) 3.) add symlink $HOME_of_virtualhost/cgi-bin which points to /var/www/cgi-bin/YOUR_CUSTOMER 4.) add path option which allows executing scripts (perl etc etc) in $HOME_of_virtualhost/cgi-bin CGI will work.

Disable or Enable crontab for specific user on Linux server

Most of the people use cron for scheduling tasks on hourly or daily basis. It is one of the very best tool which gives system administrators a lot of relief as computer can do their work when they are miles away from their systems.

Enabling/Disabling the cron for specific user is something which is not used by every person but could be useful for the system administrators or people who would like to put some restrictions on services which a normal user can use in a system.

“Disable or Enable crontab for specific user on Linux server”Continue reading

Scroll to top