Using curl to test speed test of url

I like some fast way to test the connection speed from my local host or my server, so I often use this way to test the connect time speed. time curl -o /dev/null -s -w “Connect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal time: %{time_total}s\n” [URL] Replace [URL] with the URL you want to test. Here’s a breakdown of the command: time: This will measure the real elapsed time of the entire command. -o /dev/null: Discards the output of the curl command. -s: Makes curl operate in “silent”[…]

Using curl to test speed test of url Read More »

Optimize Redis on CentOS 7

Optimizing Redis configuration involves various parameters that you can tweak based on your specific use case and workload. Below are some key configurations that you might consider tuning in your Redis setup on CentOS 7. The configuration file for Redis is usually located at /etc/redis.conf. Steps to Apply Changes: Remember, the above options are general

Optimize Redis on CentOS 7 Read More »

10 sample use-cases of permission_callback in register_rest_route WordPress Plugin

The permission_callback parameter in register_rest_route allows you to define custom permission checks for your WordPress REST API endpoints. I’ve listed down 10 sample use-cases: 1. Open Access Allowing anyone to access the endpoint, effectively making it public. 2. Authenticated Users Only Only allowing authenticated users to access the endpoint. 3. Admin Users Only Restricting access

10 sample use-cases of permission_callback in register_rest_route WordPress Plugin Read More »

Using OVH S3 Object Storage on Discourse that using Docker in Centos 7

Using OVH S3 Object Storage on Discourse Deployed with Docker in CentOS 7 In this tutorial, we will guide you on how to effectively use OVH’s S3 Object Storage with Discourse deployed on Docker in CentOS 7. Using cloud-based storage, like OVH S3, is an effective way of managing, storing, and retrieving your Discourse data. It’s also a highly secure and scalable solution, making it suitable for applications of all sizes. Setting Up OVH S3 Object Storage First, you’ll need to create a container in[…]

Using OVH S3 Object Storage on Discourse that using Docker in Centos 7 Read More »

Solved Datatables CSV import using join table

The Problem : Dot nation Problem 1 Problem 2 Solution function ref(obj, str) { return str.split(“.”).reduce(function(o, x) { return o[x] }, obj); } var mapped = ref(data, field.name()); Using this way to read { tablename: { field1, field2 } } It will turn to read tablename.field1 and tablename.field2 Modified Code from Official CVS Import CVS Import selectEditor.on(‘submitComplete’, function (e, json, data, action) { // Use the host Editor instance to show a multi-row create form allowing the us[…]

Solved Datatables CSV import using join table Read More »

Use of undefined constant STDOUT – assumed ‘STDOUT’ (this will throw an Error in a future version of PHP)

Error from loading CLI script in Web Use of undefined constant STDOUT – assumed ‘STDOUT’ (this will throw an Error in a future version of PHP) Solution if(!defined(‘STDIN’)) define(‘STDIN’, fopen(‘php://stdin’, ‘rb’)); if(!defined(‘STDOUT’)) define(‘STDOUT’, fopen(‘php://stdout’, ‘wb’)); if(!defined(‘STDERR’)) define(‘STDERR’, fopen(‘php://stderr’, ‘wb’));

Use of undefined constant STDOUT – assumed ‘STDOUT’ (this will throw an Error in a future version of PHP) Read More »