Lenix

Use the Free command to view the memory usage of the Linux server (-/+ buffers/cache detailed explanation)

free command optional parameters -b,-k,-m,-g show output in bytes, KB, MB, or GB -h human readable output (automatic unit scaling) -l show detailed low and high memory statistics -o use old format (no -/buffers/cache line) -t display total for RAM swap -s … The post Using the Free Command to View Linux Server Memory Usage […]

Use the Free command to view the memory usage of the Linux server (-/+ buffers/cache detailed explanation) Read More »

Native php recursively delete files + folders

Native php recursively delete files + folders <?php function deldir($dirname){ if(file_exists($dirname)) {//Determine whether there is a folder $dir=opendir($dirname);//Open the folder while($filename=readdir($dir)){//Read the 123 folder the data if($filename!=”.” && $filename!=”..”){//remove.and..except $file=$dirname.”/”.$filename; if(is_dir($file)){ deldir($file); //Use recursive deletion of subdirectories, that is to say, to determine whether there are folders in the 123 folder, if there is traversal

Native php recursively delete files + folders Read More »

js prohibits the right mouse button and prohibits F12 to view the source code

In the case of F12 censored elements, it is possible to randomly change the code, inject malicious JS, etc. to avoid this situation as follows: 1. Block F12 censorship elements <script> document.onkeydown = function () { if (window.event && window.event.keyCode == 123) { alert(“F12 is disabled”); event.keyCode = 0; event.returnValue = false; } if (window.event

js prohibits the right mouse button and prohibits F12 to view the source code Read More »

How to get directory size with PHP

How to get directory size with PHP function GetDirectorySize($path){ $bytestotal = 0; $path = realpath($path); if($path!==false && $path!=” && file_exists($path)){ foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $object){ $bytestotal += $object->getSize(); } } return $bytestotal; } … The post How to Get Directory Size with PHP first appeared on Lenix Blog . This article is reprinted from

How to get directory size with PHP Read More »

js format timestamp

//datetime is the timestamp obtained var date = new Date(datetime);//If the timestamp is 10 digits, *1000 is required, and if the timestamp is 13 digits, it does not need to be multiplied by 1000 var year = date.getFullYear(), month = (“0” + (date.getMonth() + 1)).slice(-2), sdate = (“0” + date.getDate()).slice(-2), hour = (“0” + date.getHours()).slice(-2),

js format timestamp Read More »

Find things in Linux Introduction to locate, whereis, which and find commands

Let’s take a look at these commands: locate whereis which find locate Order_ This command will traverse your entire filesystem and find every occurrence of that keyword, so as you can imagine the results can be overwhelming. locate keyword locate Uses a database that is usually updated daily, so if you’re searching for something recently created, it

Find things in Linux Introduction to locate, whereis, which and find commands Read More »

How to fix WordPress “The optional mod imagick is not installed or has been disabled”

Resolved “The optional mod imagick is not installed or has been disabled ” in the WordPress 5.x Site Health check. Enter the following command to install imagick: pecl install imagick At this point, it will prompt Please provide the prefix of ImageMagick installation [autodetect] enter: <div /usr If php is compiled and installed from its

How to fix WordPress “The optional mod imagick is not installed or has been disabled” Read More »

wordpress reports session_start() function call to generate a PHP session. The session interferes with the REST API and loopback request issues.

Recently, I was doing the optimization of my personal WordPress site. I checked it with the official site inspection tool. The following two errors occurred. The problem prompts are as follows: site health status WordPress Site Health Check shows you critical issues about your WordPress configuration, and items that require your attention. 2 key questions

wordpress reports session_start() function call to generate a PHP session. The session interferes with the REST API and loopback request issues. Read More »