magento2 – Set all categories to use Config Settings for ‘Default Product Listing Sort By’ option via SQL

I want to set all of my Magento 2 categories to ‘Use Config Settings’ for the ‘Default Product Listing Sort By’ within the Category Display Settings.

I don’t want to do this manually as there are thousands of them.

What SQL command do I need to run to achieve this?

Where can I find all options for the electrum config file?

I need to add oneserver and my server’s IP to my electrum config on Mac. Also, I want to know which other options for the config there are.

I know that I can start with electrum --oneserver --server raspibolt.local:50002:s on Linux. How can I make this on a Mac – and with the config?

It seems to be that

"server": "bla.onion",
"port": "50002",

Are valid options, but what is with the :s?

EDIT: So,

"server": "bla.onion:50002:s",

worked! It did not work the first time, probably because I had set "auto_connect": "false".

I will still leave the question here.

8 – How can I add a new field from config inside hook_update_N?

I have to add taxonomy by php code. Taxonomy has to got 2 fields. I added new function to test_taxonomy.install, and it seems to work:

function taxonomy_update_8805() {

    $config_path = 'modules/feature/test_taxonomy/config/update/';
    $source = new FileStorage($config_path);

    Drupal::entityManager()->getStorage('taxonomy_vocabulary')
        ->create($source->read('taxonomy.vocabulary.regulation'))
        ->save();
}

Added new vocabulary to taxonomy.

Content of file:

langcode: pl
status: true
dependencies:
  module:
    - test_remote_vocabulary
third_party_settings:
  test_remote_vocabulary:
    is_remote: 0
name: 'Test'
vid: regulation
description: 'Test desc'
hierarchy: 0
weight: 0
 

The problematic part is when i try to add fields to the vocabulary.
I created 2 files

field.storage.taxonomy_term.field_regulation_test.yml

langcode: pl
status: true
dependencies:
  module:
    - taxonomy
    - text
id: taxonomy_term.regulation.test
field_name: test_field
entity_type: taxonomy_term
type: text_long
settings: {  }
module: text
locked: false
cardinality: 1
translatable: true
indexes: {  }
persist_with_no_fields: false
custom_storage: false

field.field.taxonomy_term.field_regulation_test.yml

langcode: pl
status: true
dependencies:
  config:
    - field.storage.taxonomy_term.field_regulation_test
    - taxonomy.vocabulary.regulation
id: taxonomy_term.regulation.test
field_name: test_content
entity_type: taxonomy_term
bundle: regulation
label: TEST
description: 'Tekst test'
required: true
translatable: false
default_value: {  }
default_value_callback: ''
settings: {  }
field_type: text_long

But i am not sure how can i load them in update_xxx function.

linux – Transmission Daemon running under custom user trying to load config from wrong path

I have transmission daemon 2.94 running as a service on a Debian 10 machine.

I changed the user running transmission daemon from default debian-transmission to www-data Apache user, since I want the save files to be readable by Apache and the opposite, Apache files to be readable by transmission.

To do that, I changed to the user setting from the following config files:

  • User=www-data in /lib/systemd/system/transmission-daemon.service
  • USER=www-data in /etc/init.d/transmission-daemon
  • setuid www-data and setgid www-data in /etc/init/transmission-daemon.conf

The transmission JSON config file still resides in /etc/transmission-daemon/settings.json. I made sure both directories /var/lib/transmission-daemon and /etc/transmission-daemon were owned by the new user www-data.

But when I relaunch the service with sudo systemctl start transmission-daemon or sudo service transmission-daemon start, I get the following in the transmission logs:

Couldn't create "/var/www/.config": Permission denied (file-posix.c:189)
Couldn't read "/var/www/.config/transmission-daemon/settings.json": No such file or directory (utils.c:238)
Couldn't save temporary file "/var/www/.config/transmission-daemon/settings.json.tmp.jq3qtN": No such file or directory (variant.c:1285)

…and other similar errors.

So it would seem transmission-daemon is trying to use the www-data user home path and recreate its config directory here.

Why is that and how can I make transmission using the previous default config path? I don’t see any transmission configuration depending on the user home path.

Side question: what is the difference between all those three config files where you set up the user running the service?

performance – JMeter: how to asign a single distinct value from CSV Data Set Config to each thread in thread group?

I have to make a load test for a relatively large number of users so I cant really use User Parameters pre-processor to parametrize each thread with custom user data. I’ve read that I should use CSV Data Set Config instead. However I run into a problem with how JMeter interprets the input of this Config.

Example:

I have a thread group of 3 threads and Loop Count:10 with one HTTP request sampler with server www.example.com and path: ${user}.
The csv file (bullet is a single line in file) for CSV Data Set Config to extract the user parameter:

Expected output is that for thread 1-x the path of the request should be: x. So the output file should consist of 10 samples per thread namely:

  • for thread 1-1 : 10 requests to www.example.com1
  • for thread 1-2 : 10 requests to www.example.com2
  • for thread 1-3 : 10 requests to www.example.com3

but instead i get requests to each 1 – 5 and then to EOF. Does anyone know how to achieve the expected effect with CSV Data Set Config in jmeter 2.9?

Donnot show date time value in field system config BE Magento 2

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="mycustom" translate="label" sortOrder="450">
            <label>My Custom Setting</label>
        </tab>
        <section id="mycustom" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>My Custom Setting</label>
            <tab>mycustom</tab>
            <resource>Magento_Checkout::config</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <field id="mydate" translate="label" type="date" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>My Date Field</label>
                    <frontend_model>VendorCheckoutBlockAdminhtmlSystemConfigDate</frontend_model>
                </field>
            </group>
        </section>
    </system>
</config>

How to fix it?

networking – ubuntu 18.04 ISO – Disable Network Configuration Prompts / Dialog via preseed config

During ubuntu iso 18.04 server install the network configuration manager dialog will showing if ethernet is not active.

Note: I have created unattended ubuntu 18.04 offline iso. hence I don’t want to show manual interaction like showing network configuration dialog. is there any way to disable the dialog since it has manually interacted?

Can we do it preseed file?

kindly help with this

Thanks,
Ramesh

ethernet – Miracast over infrastructure: Bypass discovery over Wi-Fi with config?

Miracast can work over ethernet however Wi-Fi is still needed for discovery. The documentation says Once the receivers have been identified, Windows 10 can then attempt the connection to the network.

Is the dicovered recievers stored somewhere? In that case, can the config be created once on an ethernet-only-desktop by plugging in a usb-wifi-adapter, copying config from another laptop or handwriting the config?

The goal is to use an ethernet-only-desktop as a source (and a laptop as receiver/second-screen).

sharepoint server – 2019 Search config with Azure AD auth issues

So I have converted SP2019 from NTLM to Azure AD auth, setup azureCP etc. To do this I extended the webapp from “servername:80” -default to “https://myurl.com” – intranet. The default zone “servername:80” has NTLM setup, and no azure ad. The intranet URL “https:myurl.com” has Azure AD setup with no NTLM. Search is crawling the default zone, and I have in a server name mapping. The issue is that the links in library / list alerts are pointing to the default URL “servername:80” and not the the intranet URL. URL links in workflows are correct.

Rewriting Apache .htaccess for Papaya CMS to Nginx Config

I realize that there are tons and tons of pre-existing questions about converting .htaccess files to nginx config, but I haven’t found anything I could apply for my specific situation.

So, I’m trying to make this Papaya CMS site work with nginx. This is the .htaccess:


# remove session id
RewriteRule ^/?sid(a-z)*((a-zA-Z0-9,-){20,40})(/.*) $2 (QSA)

# admin pages
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?papaya/module_((^/.)+).(a-z){3,4} /papaya/module.php?p_module=$1 (L,QSA)

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?papaya/(.*) /papaya/index.php (QSA,L)

# media files - public / static
RewriteRule ^/?(^./)*.(thumb).((.).*) - (E=mediaFile:/papaya-files/thumbs/$3/$2)
RewriteRule ^/?(^./)*.(media).((.).*) - (E=mediaFile:/papaya-files/files/$3/$2)
RewriteCond %{DOCUMENT_ROOT}%{ENV:mediaFile} -f
RewriteRule ^/?(^./)*.(thumb|media).((.).*) %{ENV:mediaFile} (L)

# page bootstrap
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !^/papaya/
RewriteRule .* /index.php (QSA,L)

My best effort so far is this, but the /papaya sub-pages don’t work at all and the rest of the website has no styling.

location / { 
    index  index.php;
    # Rewrite sessionID for front page
    rewrite "^/?sid(a-z)*((a-zA-Z0-9,-){20,40})(/.*)" /$2;
    #page bootstrap
    try_files $1 $uri $uri/ /index.php$args;
  }

  location ~ ^/papaya(.+)? {
        alias /var/www/dimensional.de/htdocs;
        index index.php;
        try_files $1 $uri $uri/ /index.php$args;
    }   

location ~ ^/index.php(.*)$ {
       fastcgi_index index.php;
       include fastcgi.conf;
       try_files $uri =404;
       fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}

Any help with this would be very appreciated.