Category «Uncategorized»

Google reCaptcha V2 & V3 javascript demo and php example code

<?php // google recaptcha v2 $siteKey = ‘siteKey222’; $secret = ‘secret2222’; // google recaptcha v3 $siteKey_v3 = ‘siteKey333’; $secret_v3 = ‘secret3333’; function getRrecaptchaResult($secret_key, $g_recaptcha_response) { $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_URL => ‘https://www.google.com/recaptcha/api/siteverify’, CURLOPT_POSTFIELDS => [ ‘secret’ => $secret_key, ‘response’ => $g_recaptcha_response, ‘remoteip’ => $_SERVER[‘REMOTE_ADDR’] ] ]); $response = …

How to pkill file name with space or with command parameter string

How to pkill file name with space or with command parameter string # more mqtt_subscribe.sh pkill -9 -f “php artisan extraction:analyze”; cd /www/backend.extraction/extraction/laravel; sudo -u www-data php artisan extraction:analyze 3 > ./storage/logs/mqtt_sub.log & tail -f ./storage/logs/mqtt_sub.log; accordingly to the pkill man page: -f The pattern is normally only matched against the process name. When -f …

How to check the mac memory and cpu information

How to check the mac memory and cpu information? The following works in OS X Lion: $ /usr/sbin/system_profiler SPHardwareDataType Hardware: Hardware Overview: Model Name: iMac Model Identifier: iMac7,1 Processor Name: Intel Core 2 Duo Processor Speed: 2.4 GHz Number of Processors: 1 Total Number of Cores: 2 L2 Cache: 4 MB Memory: 4 GB Bus …