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?

why each game does not provide the option to download only one graphic quality, instead of having to download low, medium, high and ultra graphics?

This is because texture size is not really a barring factor for performance. When you say download in the graphics option context, the only thing you would exclude from download is larger size textures, shadow maps, and that’s generally about it. Even high poly models take very little in the way of memory when they are on the disk.

Memory and performance are often confused as one in the same, but in reality larger textures incur very little in the way of performance. In general, the largest performance gains when selecting lower graphics options come from the algorithms used (or rather, not used). For example, antialiasing can be very expensive depending on the algorithm selection. Even better examples of new tech are things like super-sampling, real-time ray tracing and reflections. They will literally make your computer hot because they are so taxing on your hardware. Meanwhile, the downloaded bits are only a drop in the bucket.

As far as why they don’t allow you to download them separately, that is a matter of design decision. World Of Warcraft has historically allowed you to play the game even as it downloads because they download the smallest things first. Other games choose not to, typically because when someone changes the graphics settings, they would despise having to wait another half hour to play their AAA game. That, or the fact that games are now designed with multiple platforms in mind make the task both expensive to coordinate and lacking in a decent gain.

nvidia – Launch Steam – CLI only option

Running Ubuntu with KDE. I have recently identified that I can only launch Steam via the CLI, and not by the application launcher. If I search “Steam” and run, it does not present a GUI but does seem to spawn a process:

(nank@thessalonica)-(0)-(11:34 PM Fri Nov 27)->
m-(~)-(14 files, 1.5Mb)--> ps aux | grep steam
nank      7353  0.0  0.0  10236  6256 ?        S    23:34   0:00 /tmp/dumps/assert_20201127233433_1.dmp uptime 2179 StartupTime 1606484854 CrashTime 1606485036 BuildID 20201028233425 GL_RENDERER GeForce RTX 2070 SUPER/PCIe/SSE2 GL_VENDOR NVIDIA Corporation GL_VERSION 4.6.0 NVIDIA 435.21 Platform Linux ProductName steam STEAM_RUNTIME /home/nank/.steam/ubuntu12_32/steam-runtime SteamUniverse Public URL www.steampowered.com UserID 0 Vendor Valve Version 1603992987

I noted that there is no unique log, but I could see this on /var/log/syslog for Steam:

l(nank@thessalonica)-(0)-(11:34 PM Fri Nov 27)->
m-(~)-(14 files, 1.5Mb)--> more /var/log/syslog | grep steam
Nov 27 23:34:35 thessalonica kernel: ( 1220.686389) steam(7262): segfault at 0 ip 0000000000000000 sp 00000000ffbde3fc error 14 in steam(56562000+456000)

I did a brief checkup of Segfaults, but am unsure the cause here. If I launch nohup steam & I am able to spawn Steam. Process looks fine:

nank      8240  0.0  0.0  11956  3776 pts/1    S+   23:38   0:00 bash /home/nank/.steam/steam.sh
nank      8369 37.5  1.4 728064 479984 pts/1   Sl+  23:38   0:19 /home/nank/.steam/ubuntu12_32/steam
nank      8378  0.0  0.1 148212 55608 ?        Ss   23:38   0:00 /home/nank/.steam/ubuntu12_32/steam
nank      8379  0.0  0.0   4852   440 ?        S    23:38   0:00 sh -c '/home/nank/.steam/ubuntu12_64/steamwebhelper.sh' '-lang=en_US' '-cachedir=/home/nank/.steam/steam/config/htmlcache' '-steampid=8369' '-buildid=1603992987' '-steamid=0' '-steamuniverse=Public' '-clientui=/home/nank/.steam/clientui' --enable-blink-features=ResizeObserver,Worklet,AudioWorklet --enable-media-stream --enable-smooth-scrolling --password-store=basic '--log-file=/home/nank/.steam/steam/logs/cef_log.txt'

I have had a look around the logs, and identified this:

(1127/233851.858125:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1127/233851.865216:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1127/233851.865884:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1127/233856.515949:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1127/233856.743663:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer

I had a quick Google to see suggestings surrounding locale and theme settings – neither worked. I launched via the CLI again to confirm it still worked, and this is the output:

Running Steam on ubuntu 19.10 64-bit
STEAM_RUNTIME is enabled automatically
Pins up-to-date!
Steam client's requirements are satisfied
/home/nank/.steam/ubuntu12_32/steam
STEAM_RUNTIME_HEAVY: ./steam-runtime-heavy
(2020-11-27 23:38:45) Startup - updater built Oct 28 2020 23:34:22
Looks like steam didn't shutdown cleanly, scheduling immediate update check
(2020-11-27 23:38:45) Loading cached metrics from disk (/home/nank/.steam/package/steam_client_metrics.bin)
(2020-11-27 23:38:45) Using the following download hosts for Public, Realm steamglobal
(2020-11-27 23:38:45) 1. http://media4.steampowered.com, /client/, Realm 'steamglobal', weight was 100, source = 'update_hosts_cached.vdf'
(2020-11-27 23:38:45) Checking for update on startup
(2020-11-27 23:38:45) Checking for available updates...
(2020-11-27 23:38:45) Downloading manifest: media4.steampowered.com/client/steam_client_ubuntu12
(2020-11-27 23:38:46) Download skipped: /client/steam_client_ubuntu12 version 1603992987, installed version 1603992987, downloaded version 0
(2020-11-27 23:38:46) Nothing to do
(2020-11-27 23:38:46) Verifying installation...
(2020-11-27 23:38:46) Performing checksum verification of executable files

The previous CEF log demonstrates:

(1124/002516.546026:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002516.611648:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002516.683883:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002517.484860:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002517.487504:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002517.492947:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002519.169714:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002519.279031:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002520.420315:ERROR:frame_sink_video_capturer_impl.cc(206)) Invalid resolutions constraints: 0x0 must not be greater than 0x0; and also within media::li
mits.
(1124/002941.989973:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer
(1124/002942.564417:ERROR:frame_sink_video_capturer_impl.cc(206)) Invalid resolutions constraints: 0x0 must not be greater than 0x0; and also within media::li
mits.
(1126/222946.560396:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: browser
(1126/222946.602406:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: gpu-process
(1126/222946.701433:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: utility
(1126/223020.241899:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: browser
(1126/223020.303146:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: gpu-process
(1126/223020.463620:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: utility
(1126/223059.874613:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: browser
(1126/223059.935571:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: gpu-process
(1126/223100.096729:INFO:crash_reporting.cc(247)) Crash reporting enabled for process: utility
(1126/223103.363000:INFO:crash_reporting.cc(270)) Crash reporting enabled for process: renderer

Hardware is as follows:

(nank@thessalonica)-(0)-(11:48 PM Fri Nov 27)->
m-(~)-(14 files, 1.5Mb)--> hwinfo --short
cpu:                                                            
                       Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz, 4133 MHz
                       Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz, 4104 MHz
                       Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz, 4180 MHz
                       Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz, 4120 MHz
                       Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz, 4100 MHz
                       Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz, 4125 MHz
                       Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz, 4100 MHz
                       Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz, 4100 MHz
keyboard:
  /dev/input/event5    Microsoft Wireless Receiver 1461C
                       Integrated Technology Express ITE Device(8595)
mouse:
  /dev/input/mice      Microsoft Wireless Receiver 1461C
graphics card:
                       nVidia VGA compatible controller
sound:
                       Intel Cannon Lake PCH cAVS
                       nVidia Audio device
                       Blue Microphones Yeti Stereo Microphone
                       Creative Sound BlasterX G6
storage:
                       Intel SSD Pro 7600p/760p/E 6100p Series
                       Intel SATA Controller (RAID mode)
network:
  wlo1                 Intel Wireless-AC 9560 (Jefferson Peak)
  eno2                 Intel Ethernet Connection (7) I219-V
network interface:
  wlo1                 Ethernet network interface
  eno2                 Ethernet network interface
  lo                   Loopback network interface
  docker0              Ethernet network interface
disk:
  /dev/nvme0n1         Intel SSD Pro 7600p/760p/E 6100p Series
  /dev/sdb             Micron_1100_MTFD
  /dev/sdc             WDC WDS500G2B0B
  /dev/sda             TOSHIBA MD03ACA4
partition:
  /dev/nvme0n1p1       Partition
  /dev/sdb1            Partition
  /dev/sdb2            Partition
  /dev/sdb3            Partition
  /dev/sdc1            Partition
  /dev/sda1            Partition
usb controller:
                       nVidia USB Controller
                       Intel Cannon Lake PCH USB 3.1 xHCI Host Controller
bios:
                       BIOS
bridge:
                       Intel Cannon Lake PCH PCI Express Root Port #1
                       Intel Z390 Chipset LPC/eSPI Controller
                       Intel Cannon Lake PCH PCI Express Root Port #21
                       Intel Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16)
                       Intel Cannon Lake PCH PCI Express Root Port #17
                       Intel 8th Gen Core 8-core Desktop Processor Host Bridge/DRAM Registers (Coffee Lake S)
                       Intel Cannon Lake PCH PCI Express Root Port #9
                       Intel Cannon Lake PCH PCI Express Root Port #14
hub:
                       Linux Foundation 2.0 root hub
                       Genesys Logic Hub
                       Linux Foundation 3.0 root hub
                       Linux Foundation 2.0 root hub
                       Linux Foundation 3.0 root hub
                       Genesys Logic Hub
memory:
                       Main Memory
bluetooth:
                       Intel Bluetooth Device
unknown:
                       FPU
                       DMA controller
                       PIC
                       Keyboard controller
                       Intel Cannon Lake PCH HECI Controller
                       Intel Cannon Lake PCH SPI Controller
                       Intel Cannon Lake PCH Thermal Controller
                       nVidia Serial bus controller
                       Intel Cannon Lake PCH Shared SRAM
                       Intel Cannon Lake PCH SMBus Controller
                       Serial controller
  /dev/input/event4    Blue Microphones Yeti Stereo Microphone
                       Creative Sound BlasterX G6
  /dev/input/event9    Microsoft Wireless Receiver 1461C
                       Razer Kiyo

Checking drivers. All packages are up-to date, so unsure the issue there. Any suggestions?

finder – BigSur upgrade breaks the share menu option in Safari

I’ve just upgraded to Mac OS X Big Sur (Version 11.01) from Catalina. Normally in the browser or finder you can select the ‘Share’ to send information to another application. For example, if browsing a site and want to save the information I would typically select the ‘Share to’ icon, select Notes and then my information would be saved.

After upgrading to Big Sur I’ve hit the following issues:

  1. Share menu in Safari is empty
  2. Selecting the ‘More’ option pops up
    the Extensions preference which is all blank

enter image description here

Now if I try the path of going to the Safari option to add an extension the new functionality in BigSur pops open the App Store. I can select an option and after installing it then says to return to the Extensions ‘management’ screen but nothing is able to be selected or activated.

Net result – stuck !

Does anyone have any suggestions

mysql – Which AWS RDS; current t3.medium over CPU baseline, but not sure what’s the next best option

I currently have one RDS instance, db.t3.medium running Aurora MySQL.

Due to increase workload (expected), the CPU is, on average running just over its baseline and therefore in about 10 days will run out of CPU credits and then start getting expensive. The 15-minute average CPU Utilization is around 22% (baseline is 20%).

RDS doesn’t support any larger db.t3. versions for Aurora MySQL so I either need to change instance class, or move to Aurora Serverless, or look at a second instance alongside. I’m not sure what’s going to be the best move so keen to get some advice.

Second Instance

Up until now I’ve avoided running a second db instance because:

  1. I don’t fully understand how to set it up correctly to share the workload (adding different endpoints for read vs write in my applications would be tricky)
  2. I’m not familiar if this would actually share the load like an EC2 load balancer does
  3. most of my MySQL CPU usage is from reading (relatively little write), so I don’t predict splitting it to a reader and a writer helping too much (the reader will probably still run high). But my understanding around how this all works is patchy.

I’m aware of the pitfalls of a single instance around availability/fallover etc so it would be nice to mitigate this as a bonus from this upgrade.

Switch Instance Type

If I switch instance types, a db.r5.large is twice the cost of a db.t3.medium but still only has 2 x vCPU. It has a lot more Memory (16 v 4) but my issue is CPU.

I’m not sure how the ECU (the actual relative measure of processing power) compares on db.r5.large vs db.t3.medium as it’s documented as ‘variable’, so not sure if I’m comparing apples with oranges between the r5 and the t3.

  • db.r5.large ECU = 10
  • db.t3.medium ECU = Varaible

The db.r5.xlarge has 4 vCPU but would quadruple my RDS costs.

Sidenote:
I have 9 months left on a t3.medium reserved instance, so would lose that if I do anything other than setup a second t3 instance.

Serverless

Based on the fairly vague documentation around serverless resources (1 ACU has approximately 2 GB of memory with corresponding CPU and networking, similar to what is used in Aurora user-provisioned instances.), I would guestimate 2 ACUs is the equivalent of a db.t3.medium, so 4 ACUs would give me double the CPU as my current setup, for roughly the same cost as a db.r5.large.

Serverless would throw in the added benefit of built-in availability and replication.

The RDS load is fairly steady, rather than spiky, so I wouldn’t benefit from any time the Serverless scales down to 1 ACU for example.

What’s best?

What would you do, and why?!

Thanks!

7 – reference field option limit “changing the explanation”

Hello I am using the reference field option limit module in D7 and I want to change the explanation text that says : No options are available for the current form values ..and I want to put instead: please select a value below. I tried hook form alter but the new phrase is appearing even when there is an option selected in the matching field, which is not what I want. So any idea which hook function should I use?
Ps: I don’t want to change that from the module core.

optional – Rust idiomatic option handling

Is there a neater way of handling the option response from req.cookie() in this code block (line 3 onwards)? Id like to avoid the nested if statements, and multiple returns if at all possible. req.cookie() returns an Option<Cookie> and the Cookie struct has a value function. If the cookie is present but has the wrong value, i want to return a bad request, however i also want to return a bad request if the cookie is not present at all. If the cookie value is OK, i want to continue and do further work:

#(get("/callback"))
async fn callback(req: HttpRequest, client: web::Data<BasicClient>, web::Query(cb): web::Query<Callback>) -> Result<HttpResponse> {
    if let Some(state_cookie) = req.cookie(STATE_COOKIE_NAME) {
        if state_cookie.value() != cb.state {
            return Ok(HttpResponse::BadRequest().finish())
        }
    } else {
        return Ok(HttpResponse::BadRequest().finish())
    }

    let token_result = client.exchange_code(AuthorizationCode::new(cb.code)).request(http_client);

    return match token_result {
        Ok(token_details) => Ok(handle_success(token_details)),
        Err(token_error) => Ok(handle_error(token_error))
    }
}