8 – Load a block content dynamically / through AJAX?

I need to have a custom block on the page (it will be throughout the site) that has two states: one for when a cookie is present and has a certain value, and the other for when that cookie is not there or the value is outdated. Think of it as logon states, but without authentication through Drupal.

What is the correct way to do this with the block build () method? Do I implement a deferred loader that has the logic that builds the rendering matrix? Do I also add a cache context based on this cookie and its value to be exclusive to those users?

Amazon web services – the HTTPS site does not load on the NGINX web server

Below is my NGINX configuration. My website is implemented in the AWS EC2 instance. I checked the firewall settings and port 443 is open for public access.

I can access my website from http://example.com. But I can't access the website from https://example.com.

If I change the settings of listen 443; to listen 443 ssl;. I receive an error when restarting the NGINX service.

I have secured the AWS Certificate Manager SSL certificate.

Configuration File:

server {
    listen 80;
    listen [::]:80;

    listen 443;

    # listen 443 ssl; 

    root /opt/bitnami/apps/my_website;
    index index.html;

    server_name example.com www.example.com;

    location / {
            try_files $uri $uri/ =404;

centos7 – iowait linked server – Load calculations and process programming

I have a script that I write that runs defective blocks against a disk shelf full of drives and I am trying to understand the server load that develops and at what point the server load is critical in this use case.

In general, I have adhered to the general guidelines that having a server load <= # of_cores is ideal, while <= 2x #of_cores will generally not cause significant performance degradation unless it serves sensitive workloads in real time, but I don't think the generality applies in this use case

In the following screenshot from the top, you see that I am running badblocks against 8 devices, the associated load is ~ 8, which I understand since there are 8 processes effectively stuck in the queue due to the nature of the badblocks. But only 2 CPU cores are linked by these processes. Then a couple of questions:

1.> Am I slowing my badblock by trying to try so many tests simultaneously and, if so, why not use the available cores?

2.> Do I assume that this generally "non-ideal" CPU load would not affect the service of other requests, such as data shared from other units on the server? (assuming there is no bottleneck on the sas card) because 2 cores are free and available, correct?

3.> If 2 cores are capable of supporting 8 incorrect blocking processes without impact between them (as shown), why is it that 2 incorrect blocking processes use a core while a third makes a second core be used? one to assume that 8 processes should consume 3-4 cores, not 2 optimally programmed, right?

The platform is Centos 7 | – | The processor is Intel e3-1220 v2 (quad-core without hyper-threading) | – | The disk shelf is connected to the server through an external SAS HBA (no incursion)

top - 16:03:12 up 6 days, 15:21, 13 users,  load average: 7.84, 7.52, 6.67
Tasks: 171 total,   2 running, 169 sleeping,   0 stopped,   0 zombie
%Cpu0  :  0.0 us,  0.0 sy,  0.0 ni, 99.7 id,  0.3 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu1  :  0.3 us,  6.0 sy,  0.0 ni,  0.0 id, 93.6 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  :  0.0 us,  0.0 sy,  0.0 ni, 95.7 id, 4.3 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu3  :  2.3 us,  3.0 sy,  0.0 ni,  0.0 id, 94.7 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  7978820 total,  7516404 free,   252320 used,   210096 buff/cache
KiB Swap:  4194300 total,  4194300 free,        0 used.  7459724 avail Mem

22322 root      20   0  122700   9164    832 D   3.3  0.1   18:36.77 badblocks
22394 root      20   0  122700   9164    832 D   1.3  0.1  15:52.98 badblocks
23165 root      20   0  122700   9152    820 D   1.3  0.1   0:36.94 badblocks
23186 root      20   0  122700   5792    808 D   1.3  0.1   0:02.54 badblocks
23193 root      20   0  122700   5004    768 D   1.3  0.1   0:02.17 badblocks
23166 root      20   0  122700   9152    820 D   1.0  0.1   0:36.11 badblocks
23167 root      20   0  122700   9148    820 D   1.0  0.1   0:39.74 badblocks
23194 root      20   0  122700   6584    808 D   1.0  0.1   0:01.47 badblocks

Windows 7 – Load the SYSTEM hive offline, win7 / winXP

Using Win7-32, I have attached a WinXP system disk. I would like to edit the WinXP SYSTEM section. I open regedit (Win7), navigate to HKLM, select "load hive", navigate to "G: Windows System32 Config" – and the open file dialog tells me

"No article matches your search"

You can't see anything at all. In Windows Explorer I can see


… and also SECURITY and SOFTWARE files, but the Load Hive file opening dialog box sees nothing.

I did something wrong? Is there something wrong with the disk? Does Win7 not support this action? Or what?

node.js: load php through curl nodejs

Good evening, I'm 2 days trying to send data from curl php to nodejs
when I do outer curl it works …
but I needed it to be like that …
1 php attempt:

       $this->ch = curl_init();
     curl_setopt($this->ch,CURLOPT_URL, $url);

  curl_setopt($this->ch,CURLOPT_POST, 1);
  curl_setopt($this->ch,CURLOPT_POSTFIELDS, $data);
  curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
  curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($this->ch, CURLOPT_POST, true);

  $result = curl_exec($this->ch);
 return curl_close($this->ch);

test 2:

    $ch = curl_init();
  curl_setopt($ch,CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
//curl_setopt($ch, CURLOPT_PORT, 2403);   //<----- Commented out !
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(    //<--- Added this code block
        'Content-Type: application/json',
        'Content-Length: ' . strlen($data))
$data = curl_exec($ch)|

In nodejs, the method of publication in no way brings some kind of feedback that I have tried a bit of everything and I am missing ideas on how to do it or what I am doing wrong. Basic shipping is underway, so I feel frustrated ... 4 days in trouble and I'm just crawling ...

  app.post('/teste', function (req, res,next) {

//   console.log(util.inspect(req));
//console.log(util.inspect(req, false, null, true /* enable colors */));;

  console.log('receiving data ...');
    console.log('body is ',req.body);


This method I can get the items and the returns are fine:

app.get('/agencia2', function (req, res,next) {

//  console.log(req.params);
//  console.log(req.body);

   res.send("quase teste"); 

networks: how to configure Azure External Load Balancer to allow access only from a defined IP range or network?

I am configuring Azure External Load Balancer and I would like my External Load Balancer IP address to be accessible only to some public IPs that I include in the white list.

I am aware of how this can be done at the VM level by enabling NSG rules to allow or deny IP with port. But I am looking for the same in Load Balancer Level.


Amazon web services: Apache redirect loop when rewriting HTTP to HTTPS behind AWS Network Load Balancer

The existing solutions did not help me, so I must be missing something else.

So I am trying to set up a website with Apache 2.4 / CentOS 7 behind an AWS network load balancer.

I am using this in httpd.conf to rewrite HTTP-> HTTPS, which is also considered the right way to achieve HTTPS only behind an AWS load balancer.

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule .* https://%{SERVER_NAME}/$1 (L,R=permanent)

where SERVER_NAME It is the DNS name of my server that is resolved in the IP address of the load balancer.

https://%{HTTP:Host}/ It was tried without success too.

Without this, it is possible to access the server without problems (except that it is possible to use HTTP, of course).

Since the load balancer is the encryption endpoint for the client, I am only listening on port 80 on the web server. That is the expected form of implementation by AWS.

However, by using this, the server will redirect my request endlessly until the browser gives up. Cast also It happens when you try to connect to HTTPS initially.

The output of the Apache debug level log shows no error, except that the request is running out and the load balancer logs are also not very useful. But maybe you can make sense of it.

I was also thinking about SELinux causing problems, but it is set to permissive. So, I really shouldn't do anything.

Apache access_log: https://textuploader.com/10cjh

Apache Error_log: https://textuploader.com/10cjx

Load balancer: https://textuploader.com/10cjg

Any Help is greatly appreciated.

High load in the database caused by taxonomy

OUR RDS database is reading 100% CPU and more than 100 connections. After the investigation, we track it to this query.

SELECT object_id, term_taxonomía_id FROM wp_term_relationships INNER JOIN wp_posts ON object_id = ID WHERE term_taxonomy_id IN (2,3,5,14,13,77,19,9,17,46,1,11,10758,10757,12,339,38,28 , 83,69,6835,42,29,35,16,15,30,30334,6,8775,72,4,22,18,87,306,300,110,130,81,33,97,60,11419,248,7827,8784 , 305.37,975,80,8,25318,1407.47,3114,33088,277,144.39,127.82.55,135.68,7,34,2937.73,,118,121.53.95,32,58,116 ,,70.64.66,10,28047.48,3665,530.63,145,10781,94,340,11092,50,1516,22719,91,71,204)

It is creating more than 76 connections and causes the database to increase due to high load time.

After the investigation, we were able to trace the query to include / taxanomy.php, in the _pad_term_counts () function

// Get the object and term ids and stick them in a lookup table.
    $tax_obj      = get_taxonomy( $taxonomy );
    $object_types = esc_sql( $tax_obj->object_type );
    $results      = $wpdb->get_results( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (" . implode( ',', array_keys( $term_ids ) ) . ") AND post_type IN ('" . implode( "', '", $object_types ) . "') AND post_status = 'publish'" );
    foreach ( $results as $row ) {
        $id                                   = $term_ids( $row->term_taxonomy_id );
        $term_items( $id )( $row->object_id ) = isset( $term_items( $id )( $row->object_id ) ) ? ++$term_items( $id )( $row->object_id ) : 1;

We have searched our application and have not called any taxonomy. How can we resolve or avoid this query?

The website takes 30 seconds to load, which affects the SEO ranking …

It took me more than 30 seconds. Disable all add-ons you don't have to use. Your site has to do dozens of "handshakes" before you can start displaying the contents. This is absolute madness:

Code (marked):

Is there any reason why you need to use all those add-ons and include?

Disable them one by one to see which one slows down your site. Then, find a way to run the site without those add-ons, add-ons, javascripts.

Products are not loaded in Load More in magento 2.3

The load more button does not work to load products as shown here. Https://prnt.sc/p45em5
When I click load more, Loading is displayed. https://prnt.sc/p45f11
But, again, it shows loading more https://prnt.sc/p45em5.

The products are not loading.
Can the script not be called?