Download Old Sent Emails on POP Account with Thunderbird

POP mail accounts can only access and download inbox messages. However you can use a smart workaround to download also old sent messages, in short what you can do is create a new IMAP mail account, download the sent emails there, then select all sent emails, copy them to the POP mail account’s sent folder, […]

Problems with /etc/cron.d/certbot on Debian

If you are using certbot (Let’s Encrypt) with Nginx on Debian Buster you may have encountered problems in auto-renewal of your certificates. This may be because the /etc/cron.d/certbot didn’t actually execute, ore information can be read here: https://community.letsencrypt.org/t/cerbot-cron-job/23895/5 It looks like that if the directory /run/systemd/system/ exists it won’t execute the renew command, because you […]

Get Number of CPU Threads on Linux Debian

You can get the number of CPU threads with this command: nproc –allnproc –all Here is an example output on an AMD Ryzen 5 3600 Hexa-Core: 1212 That is correct, the AMD Ryzen 5 3600 has 12 threads. The command supports also multi-sockets servers. Get number of CPU cores

Get Number of CPU Cores on Linux Debian

Get the correct number of CPU cores on a Linux Debian server: grep "cpu cores" /proc/cpuinfo |sort -u |cut -d":" -f2 | awk ‘{s+=$1} END {print s}’grep "cpu cores" /proc/cpuinfo |sort -u |cut -d":" -f2 | awk ‘{s+=$1} END {print s}’ Here is an example output on an AMD Ryzen 5 3600 Hexa-Core: 66 That […]

NodeJS ETIMEDOUT, ESOCKETTIMEDOUT, ENOTFOUND

While using request package with a NodeJS script I noticed it was causing a lot of errors like ETIMEDOUT, ESOCKETTIMEDOUT and also getaddrinfo ENOTFOUND after some HTTP requests on the same URL. That was very strange because the remote URL was working correctly… So I started to analyze a few things and I noticed that […]

jQuery Trigger Form Submit with Parameters

You can submit a form using jQuery .trigger() function: $(‘#myForm’).submit(function (e, pass_through) { if(typeof bypass_checks == ‘undefined’ || bypass_checks == false) { e.preventDefault(e);   // Do some Ajax checks here   $(‘#myForm’).trigger("submit", [true]); } });$(‘#myForm’).submit(function (e, pass_through) { if(typeof bypass_checks == ‘undefined’ || bypass_checks == false) { e.preventDefault(e); // Do some Ajax checks here $(‘#myForm’).trigger("submit", […]

NodeJS Disable SSL Verification on Request

You can set strictSSL to false on NodeJs request: var options = { url: ‘http://url’, strictSSL: false }   request(options, function(err, resp, body) {});var options = { url: ‘http://url’, strictSSL: false } request(options, function(err, resp, body) {}); More information can be found here: https://github.com/request/request#user-content-requestoptions-callback strictSSL – if true, requires SSL certificates be valid. Note: to […]

Modify NodeJS Request Default Timeout

You can modify the default request timeout like this: var options = { url: ‘https://www.google.com/’, timeout: 120000 }   request(options, function(err, resp, body) {});var options = { url: ‘https://www.google.com/’, timeout: 120000 } request(options, function(err, resp, body) {}); Details of the param timeout can be found here: https://github.com/request/request#user-content-requestoptions-callback timeout – integer containing number of milliseconds, controls […]

Advanced Logs Queries with Google Cloud Logs Viewer

With Google Cloud Logs Viewer you can perform advanced logs queries to search, for example, all Load Balancer requests that returned a status code different from 200 (useful to spot connection errors) or you can search all requests where the URL contains a specific string. The official documentation is here: https://cloud.google.com/logging/docs/view/advanced-queries Available search operators: = […]

Access Values Created by SerializeArray in JQuery

Here is a quick example of using jQuery .serializeArray() function and then convert all the serialized data into an array, so you can easily access single POST values: $(document).ready(function() { $("form").submit(function(e){ e.preventDefault(e);   var fieldsArray = $("form").serializeArray();   fieldsLen = fieldsArray.length;   fieldsObj = {};   for (i=0; i<fieldsLen; i++) { fieldsObj[fieldsArray[i].name] = fieldsArray[i].value; } […]