How to image resize for specific folder or category? – Magento2

I found I need to run this to show images in front-end

php bin/magento catalog:image:resize

but it takes too much times

How to image resize for a specific folder or category?

I need help getting information from one google sheet to another sheets specific cell. Please look at the example

//Rotation List
function validateRotation() {
var ss = “TR_Page1”;
var sss = ss.SpreadsheetApp.getActiveSpreadsheet();
var trot = ss.getSheetByName(“TR_Page1”); //data entry page
var sdata = sss.getSheetByName(“Tcard2”); // result Sheet
var value = (“Anderson”,”Brinson”,”Brown”,”Gomez”,”Rodriguez”,”Siriboe”,”Thorne”,”Viera”);

// There are several locations that are rotated between managers. On “TR_Page1” is a list of those locations, each having a check box that when checked, links to cell (E1) on “Tcard2”. (By the way “Tcard2” represents 162 different sheets). Once all locations needed have been checked then the managers name has to be clicked. When that happens Cell (E1) on “Tcard2” has to reflect the managers name selected on “TR_Page1”. I have no idea how to make that happen!!!

 (trot.getRange("A3").setValue("Anderson"),
 trot.getRange("C3").setValue("Brinson"),
 trot.getRange("E3").setValue("Brown"),
 trot.getRange("G3").setValue("Gomez"),
 trot.getRange("I3").setValue("Rodriguez"),
 trot.getRange("K3").setValue("Siriboe"),
 trot.getRange("M3").setValue("Thorne"),
 trot.getRange("O3").setValue("Viera"));

}

// ————————————————————————————————
// Clear form
function clearCell() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var trot = ss.getSheetByName(“TR_Page1”);
var rangesToClear = (“B8:B”,”D8:D”,”F8:F”,”H8:H”,”J8:J”,”N8:N”,”P8:P”,”R8:R”,”T8:T”);
for (var i=0; i<rangesToClear.length; i++){
trot.getRange(rangesToClear(i)).clearContent();
}
//———————————————————————————————
// Assign function to Managers Names
function button() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var trot = ss.getSheetByName(“TR_Page1”); // Data Entry Sheet
var sdata = sss.getSheetByName(“Tcard2”) // Data Sheet
var values = ((sdata.getRange(“E1”).getValues(“Anderson”),
sdata.getRange(“E1”).getValues(“Brinson”),
sdata.getRange(“E1”).getValues(“Brown”),
sdata.getRange(“E1”).getValues(“Gomez”),
sdata.getRange(“E1”).getValues(“Rodriguez”),
sdata.getRange(“E1”).getValues(“Siriboe”),
sdata.getRange(“E1”).getValues(“Thorne”),
sdata.getRange(“E1”).getValues(“Viera”),
sdata.getRange(sdata.getFirstRow()+1,1,1,5).setValues(values)));
clearCell();

}}

jwt – Multiple user specific APIs with a single Authentication Server

I’m currently in need of some clarification for an authentication/overall strategy. First I will describe the use case and then the questions that arise for me.

Use Case

I want to have a single docker container consisting of an API and a database for each group of users. So for the sake of this example let’s say we have three docker containers A, B and C and three users for every container (A1, A2, A3, B1, B2, …). Each of these users should only have access to their corresponding API. So e.g. user B1 can only read/write with API B.

The APIs should be consumed with multiple SPA FrontEnd Apps. To not have to log in on each app I want to implement a SSO flow with a single authentication Server. My thought was to let the user log in with the authentication server that responds with a jwt token (access and refresh) with the unique username in the payload. So on every request to an API Gateway that routes the user to the correct API (e.g. A1 -> A), the user sends the access token. The API then makes a request to the Authentication Server to verify the correctness of the jwt. If that‘s successful the API can log in the user with the specified username (because it also has a database entry of this unique user) over a remote user backend for example. This way if the routing or anything would go wrong the access token would be verified by the Authentication Server but the user A could not be logged into API B because there‘s no user with that name in the database of API B. The remote user header could also not be tempered with because every malicious request that sets this header would be prefixed with HTTP_.

Questions

  1. Is this even a secure/feasible authentication/authorization flow?

  2. Is there any default strategy for a use case like this (oidc?)?

  3. How do I safely store access/refresh tokens? Refresh token in a httpOnly cookie and the Short lived Access Token in-Memory of the Browser with a WebWorker or with Private static fields?

  4. Any possible obvious attack vectors?

On Facebook, how to list all events for a specific month a long time ago when your event history is huge?

I have more than 12 000 past events on Facebook. Now I want to see all events I attended in August 2015. I spent a few hours scrolling backwards but so far I have only reached March 2019. Is there a way to jump directly to a specific date in the list of past events or similar?

I have also tried downloading an iCalender-file but it stops before (after) 2015.

magento2 – Magento 2 how to assign a custom order status when canceling an order with a specific payment method

You can use event order_cancel_after and change status this way:

$order = $observer->getEvent()->getData('order');
$order->setStatus('your_custom_status_code');

Then order will be saved by the OrderService in the cancel method:

public function cancel($id)
{
    $order = $this->orderRepository->get($id);
    if ($order->canCancel()) {
        $order->cancel(); // <<< Inside this method the event fired
        $this->orderRepository->save($order); // Magento saves order with new custom status
        return true;
    }

    return false;
}

The payment method you can check inside observer using $order->getPaymentMethod(), it will return string (code).

exploit – Is there a term for one specific step before/during reconnaisance?

If the hacker decides to attack the system, the first step is reconnaissance.

But if the system the hacker attacks is exotic, sometimes they’d need to develop the tools or “drivers”, or modify the existing software/tools for them to be “tap-able”.

For example, suppose the hacker tries to attack the telephone network, and for some reason the dial-up modems are not available, the hacker may need to reverse engineer the telephone cable I/O, figure out a way to connect to the telephone network using the makeshift hardware and software (maybe connect to the sound card, and make use of the Fourier transform algorithms; and then figure out the commands sent across the telephone network) — all to just be able to perform reconnaissance.

I wonder if there is a term for this.

How do I create a shortcut where if I tap it, it changes the system time to a specific time/timezone?

Everytime I connect to a VPN, I have to go to Settings > Date & time > Select time zone…scroll through the list to pick the time zone of my VPN ip location. I want to be able to just tap on an icon on my home screen and it would automatically change it. And when I’m done, I’d tap another icon and it would select these…these

How can I achieve this?

And if there is a way that the system time would change according to the ip location, that…would…be…AWESOME!

Afroid 7 | Rooted

How do I create a shortcut where if I tap it it changes the system time to a specific time/timezone?

Everytime I connect to a VPN, I have to go to Settings > Date & time > Select time zone…scroll through the list to pick the time zone of my VPN ip location. I want to be able to just tap on an icon on my home screen and it would automatically change it. And when I’m done, I’d tap another icon and it would select these…these

How can I achieve this?

And if there is a way that the system time would change according to the ip location, that…would…be…AWESOME!

Afroid 7 | Rooted

sql server – collation specific problem when querying the execution plan and sys.dm_exec_requests

I like to find missing indexes on the go,
looking at the execution plans!

It can potentially give me an indication where further to look at if I want to improve something that is currently running.

for doing this I use the following query:

SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED


SELECT 
    er.session_id,
    er.blocking_session_id,
    er.start_time,
    er.status,
    dbName = DB_NAME(er.database_id),
    er.wait_type,
    er.wait_time,
    er.last_wait_type,
    er.granted_query_memory,
    er.reads,
    er.logical_reads,
    er.writes,
    er.row_count,
    er.total_elapsed_time,
    er.cpu_time,
    er.open_transaction_count,
    er.open_transaction_count,
    s.text,
    qp.query_plan,
    logDate = CONVERT(DATETIME,GETDATE()),
    logTime = CONVERT(DATETIME,GETDATE())
FROM sys.dm_exec_requests er 
CROSS APPLY sys.dm_exec_sql_text(er.sql_handle) s
CROSS APPLY sys.dm_exec_query_plan(er.plan_handle) qp
WHERE 
    CONVERT(VARCHAR(MAX), qp.query_plan) LIKE '%<missing%'

it generally works fine, however, I have recently, met a problem with collation and XML:

enter image description here

Error message says:

Msg 6355, Level 16, State 1, Line 40
Conversion of one or more characters from XML to target collation impossible

I have already found out what is causing it:

 -- get only the applications from Italy:
exec usp_sel_outstandingItems            
                                    @startdate='2021-04-07 00:00:00',           
                                    @endDate='2021-08-15 00:00:00',           
                                    @statusDateStart=NULL,           
                                    @statusDateEnd=NULL,           
                                    @office=N'UK',           
                                    @country=N'IT ',           
                                    @userState=N'ParticipantPlaced',           
                                    @outstandingBalance=0

my question is:

what inside my query gets upset about the collation?
What can I do to possibly get over this error?

collate hints?

select @@version

Microsoft SQL Server 2016 (SP2-CU15-GDR) 
(KB4583461) - 13.0.5865.1 (X64)   Oct 31 2020 02:43:57   
Copyright (c) Microsoft Corporation  Enterprise Edition: 
Core-based Licensing (64-bit) 
on Windows Server 2012 R2 Datacenter 6.3 <X64> (Build 9600: ) 
(Hypervisor) 

applescript – How do I allocate a keyboard to a specific app

I’m searching for an app or script that would allow me to have two keyboards connected to my Mac.
One would be for normal usage and the other one should be allocated to a specific app. I think it could be very handy especially if you have to change between different apps all the time and don’t want to use cmd + tab.

I often have to watch videos and like many others I control them via “Video speed controller” which allows me to advance, rewind, pause, increase and decrease speed and many more. Likewise, I thought about getting a “half keyboard” with which this could be possible and also pretty cheap.

Is there any chance to make this happen?