magento2.3 – Magento Command for bulk Optimizing existing Product images

How to optimize existing Product images via commandline, similar to resize command.

php bin/magento catalog:images:resize

https://docs.magento.com/user-guide/catalog/product-image-resizing.html
This is Javascript optimization & Resize options for Product images at Upload time.

My query is how to optimize existing Product images, if I change Javascript optimization in Adminpanel to 90%, so it will only affect, further uploaded images via AdminPanel.

What about existing Images, how to batch process existing images?

Although, there is a resize command in Magento, is there a bulk optimize command?

postgresql – psql command output to print error via -L output.log

The file specified to -L cannot be made to include errors.

To have errors in the same log file than queries and results, both outputs should be redirected to the same file. For example:

$ cat >script.sql
select 1/0; 

select count(*) from pg_class;

$ psql -e -f script.sql &> output.log

$ cat output.log 
select 1/0;
psql:script.sql:1: ERROR:  division by zero
select count(*) from pg_class;
 count 
-------
   352
(1 row)

See psql --help for more options:

Input and output options:
  -a, --echo-all           echo all input from script
  -b, --echo-errors        echo failed commands
  -e, --echo-queries       echo commands sent to server
  -E, --echo-hidden        display queries that internal commands generate
  -L, --log-file=FILENAME  send session log to file
  -n, --no-readline        disable enhanced command line editing (readline)
  -o, --output=FILENAME    send query results to file (or |pipe)
  -q, --quiet              run quietly (no messages, only query output)
  -s, --single-step        single-step mode (confirm each query)
  -S, --single-line        single-line mode (end of line terminates SQL command)

force sips command to write output to stdout

I wrote a script that convert a icns file to png and then encode the png with base64.

I could do it in 2 steps:

  • sips -s format png test.icns -o test.png
  • base64 -w0 test.png

But since test.png is just an intermediary file, I’d like to pipe the output of the 1st command directly to base64, how do I do that?

Note that sips doesn’t seem to support /dev/stdout as the argument of -o.

macos – What is the exact equivalent of this netsh Windows command for MAC? The command is attached in the body

I want to block all networks from my PC with admin access and make it so that the user cannot reverse the changes. I will use admin access to only white list certain networks that will be visible to the user and all other WiFi networks are blocked. I am blocking all connections in Windows with the following command. Since I am just starting out with MAC, any help in this regard is appreciated.

netsh wlan add filter permission=denyall networktype=infrastructure

command line – terminal can not open from desktop or power menu?

use to install python3.9 following the instructions of the next link (http://ubuntuhandbook.org/index.php/2020/10/python-3-9-0-released-install-ppa-ubuntu/)
unfortunately, I tried a non recommended field of code
(4.) (NOT Recommended) To use Python 3.9 as the default python3, run commands:
sudo update-alternatives –install /usr/bin/python3 python3 /usr/bin/python3.8 1
sudo update-alternatives –install /usr/bin/python3 python3 /usr/bin/python3.9 2
now i can’t run the terminal for either power menu or desktop, but its works from file.

dnd 5e – Can the Command spell be used to force someone to drink poison?

It’s up to the DM.

The important bit here in the command spell description is:

The spell has no effect if the target is undead, if it doesn’t understand your language, or if your command is directly harmful to it.

If the affected creature discerns that the command is harmful to it, the spell fails. But how the creature interprets the command is up to the DM.

Command does not charm the target.

This is a reason this plan may not work. Command does not charm the target – they still understand you to be a foe. It seems reasonable that they would be suspicious of the liquid you offer to drink and may determine that it is directly harmful.

Because of this, I would rule that it wouldn’t work, but it would not be unreasonable to rule that it does work. Ask the DM.

After all, the spell description itself says it’s up to the DM:

Some typical commands and their effects follow. You might issue a command other than one described here. If you do so, the GM determines how the target behaves. If the target can’t follow your command, the spell ends.

windows 7 – How do you use gpg4win from command line to encrypt or decrypt a file?

This doesn’t make much sense to me but I just opened cygwin, which I haven’t tried installing gpg in.. and I found the gpg command worked(though I had to do ctrl-c when running it from cygwin but it worked). I did which gpg and it showed /cygdrive/c/Program Files (x86)/GnuPG/bin/gpg

I then opened a regular cmd prompt

C:Program Files (x86)GnuPGbin>dir gpg*
 Volume in drive C has no label.
 Volume Serial Number is 4645-5DCE

 Directory of C:Program Files (x86)GnuPGbin

03/09/2020  15:39           399,008 gpg-agent.exe
03/09/2020  15:39           171,680 gpg-connect-agent.exe
03/09/2020  15:39            84,128 gpg-preset-passphrase.exe
03/09/2020  15:39           216,736 gpg-wks-client.exe
03/09/2020  15:39         1,088,160 gpg.exe
03/09/2020  15:39           150,176 gpgconf.exe
03/09/2020  15:39            24,224 gpgme-w32spawn.exe
03/09/2020  15:39           496,800 gpgsm.exe
03/09/2020  15:39           158,880 gpgtar.exe
03/09/2020  15:39           514,208 gpgv.exe
              10 File(s)      3,304,000 bytes
               0 Dir(s)  34,930,319,360 bytes free

C:Program Files (x86)GnuPGbin>

gpg.exe has “magically” appeared and the date of the files (which is in the UK form dd/mm/yyyy)

C:UsersUser>date
The current date is: 20/11/2020
Enter the new date: (dd-mm-yy)
C:UsersUser>

The date of the files has shifted from 4th september 2020(see directory listing in my question), to 3rd september 2020.. All within 5 minutes.

So it works , and works well and properly , from cmd.exe and I see gpg.exe listed now. But it wasn’t there before!

C:UsersUserbbb>gpg -c a.txt_pwd_a
File 'a.txt_pwd_a.gpg' exists. Overwrite? (y/N) y

C:UsersUserbbb>gpg a.txt_pwd_a.gpg
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: AES.CFB encrypted data
gpg: encrypted with 1 passphrase
File 'a.txt_pwd_a' exists. Overwrite? (y/N) y

C:UsersUserbbb>

openstack command fails with SSL error on Ubunut 18.04 LTS

Openstack client commands fails after sourcing the rc file in Ubuntu 18.04 LTS with below error message; I tried the same operation in CentOS and it went well there. I am surprised why in Ubuntu 18.04 LTS it is failing.

  ubuntu@clover:~$ openstack image list
  Failed to discover available identity versions when contacting https://10.18.54.16:13000/v3. 
  Attempting to parse version from URL.
  SSL exception connecting to https://10.18.54.16:13000/v3/auth/tokens: 
  HTTPSConnectionPool(host='10.18.54.16', port=13000): Max retries exceeded with url: /v3/auth/tokens 
  (Caused by SSLError(SSLError(1, u'(SSL: CERTIFICATE_VERIFY_FAILED) certificate verify failed 
  (_ssl.c:727)'),))

  ubuntu@clover:~$ curl -g -i -X GET https://10.18.54.16:13000/v3 -H "Accept: application/json" -H "User-Agent: openstacksdk/0.17.2 keystoneauth1/3.10.0 python-requests/2.19.1 CPython/2.7.5"
  HTTP/1.1 200 Connection established
  Proxy-Agent: Fortinet-Proxy/1.0

  curl: (60) SSL certificate problem: unable to get local issuer certificate
  More details here: https://curl.haxx.se/docs/sslcerts.html

  curl failed to verify the legitimacy of the server and therefore could not
  establish a secure connection to it. To learn more about this situation and
  how to fix it, please visit the web page mentioned above.

On running in CentOS

    (centos@undercloud ~)$ curl -g -i -X GET https://10.18.54.16:13000/v3 -H "Accept:      application/json" -H "User-Agent: openstacksdk/0.17.2 keystoneauth1/3.10.0 python-requests/2.19.1         CPython/2.7.5"
    HTTP/1.1 200 OK
    Date: Thu, 19 Nov 2020 05:18:39 GMT
    Server: Apache
    Vary: X-Auth-Token,Accept-Encoding
    x-openstack-request-id: req-d2161611-5f92-4ae7-8799-dd7008939bc9
    Content-Length: 253
    Content-Type: application/json

    {"version": {"status": "stable", "updated": "2018-10-15T00:00:00Z", "media-types": ({"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}), "id": "v3.11", "links": ({"href": "https://10.18.54.16:13000/v3/", "rel": "self"}
        

bitcoin cash – Allowip block local cli command?

I am new to bitcoin node, recently I tried to running my node with rpcbind and rpcallowip, with the setting of rpcbind and rpcallowip, I am not able to stop the node with locall cli…

error: server returned HTTP error 403

it returning a 403 forbidden when I execute command.

Any idea how can I stop the node if I am not able to send command from the allowip…