Obtain and configure the position of the window in the Windows command shell?

I am looking for a way to get and set the position and size of a window from the command shell.

However, I could only find how to do it using PowerShell:

Add-Type @"
using System;
using System.Runtime.InteropServices;
public class Window {
    (DllImport("user32.dll"))
    (return: MarshalAs(UnmanagedType.Bool))
    public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
}
public struct RECT
{
    public int Left;
    public int Top;
    public int Right;
    public int Bottom;
}
"@

$Handle = (Get-Process -Id $Args(0)).MainWindowHandle
$WindowRect = New-Object RECT
$GotWindowRect = (Window)::GetWindowRect($Handle, (ref)$WindowRect)
ConvertTo-Json($WindowRect)

Is there an equivalent that does this on the command line?

Configure bitcoind for a quick response

I need to make many requests in bitcoind (suppose I want to get all the blocks within the blockchain and save all the scripts within the transactions).

What is the best bitcoind configuration to do this operation? further -txindex??

18.04 – How do I configure my power options in all TTY?

I am using a laptop on which I installed Ubuntu 18.04.3 LTS, with xfce-desktop as my main x server (I know there is a more appropriate term here, but excuse me, I don't remember it) and I realized that, yes Well my laptop can resume from standby mode coupled with the lid closed, it seems to be the case of Ubuntu's default tty7. When I then switch to another, it seems to probe the power state and then go into standby mode since the lid is closed.

Is there any way to set the power settings so that the lid closes while it is connected to the air conditioning power and the laptop remains active? I didn't have much luck with Google search, but I recognize that I might not be looking in the right places.

Thank you

apache2 – How do I configure Apache so that a vhost without SSL is not answered by the first vhost with SSL?

When Apache (v2.4) assigns a request to a virtual host, it will use the first ServerName / ServerAlias ​​matching in all configurations, but if nothing matches, it will use the first (ignoring the ServerName / ServerAlias ​​definitions).

https://httpd.apache.org/docs/2.4/vhosts/details.html

The first vhost based on the name in the configuration file for a given
IP: the port pair is significant because it is used for all requests
received at that address and port for which there is no other vhost for that
IP: The port pair has a matching ServerName or ServerAlias.

The problem I have is in a shared host with a control panel. Some domains have an SSL certificate and others do not. When someone tries to access your domain without a certificate using HTTPS, I prefer to return a 404 instead of someone else's content after a security warning.

I tried to configure a vhost *: 443 that matches ServerAlias ​​* and that didn't work. I have successfully configured a global vhost that matches each IP: 443 individually, but this means that I will have to remember to edit this file when an IP is added to the server.

Is there any way to configure explicit ServerName / ServerAlias ​​matches just so that vhost only does it match specific hostnames, or is the only way to solve this problem to configure a higher priority "catchall" host with a shared SSL certificate?

magento 1 – How to configure store settings (system settings)

This should work

/*
*turns notice on
*/
Mage::getConfig()->saveConfig('design/head/demonotice', '1', 'default', 0);
/*
*turns notice off
*/
Mage::getConfig()->saveConfig('design/head/demonotice', '0', 'default', 0);
class Mage_Core_Model_Config
{

    /**
     * Save config value to DB
     *
     * @param string $path
     * @param string $value
     * @param string $scope
     * @param int $scopeId
     * @return Mage_Core_Store_Config
     */
    public function saveConfig($path, $value, $scope = 'default', $scopeId = 0)
    {
        $resource = $this->getResourceModel();
        $resource->saveConfig(rtrim($path, '/'), $value, $scope, $scopeId);

        return $this;
    }


}

I can't configure php

I ran php -v and this error:

PHP warning: PHP start: dynamic library cannot be loaded & # 39; /usr/lib/php/20151012/mcrypt.so' – /usr/lib/php/20151012/mcrypt.so: Unable to open the shared object file: There is no such file or directory in Unknown on line 0
PHP warning: PHP start: dynamic library cannot be loaded & # 39; /usr/lib/php/20151012/pdo_dblib.so' – /usr/lib/php/20151012/pdo_dblib.so: Unable to open the shared object file: There is no such file or directory in Unknown on line 0
PHP 7.0.33-1 ~ dotdeb + 8.1 (cli) (NTS)
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33-1 ~ dotdeb + 8.1, Copyright (c) 1999-2017, by Zend Technologies

How to configure a VNC server in Windows 10 and secure it with SSH?

I need to use OpenGL on a Win 10 remote computer, so I can't use RDP. I also need a secure connection so that VNC over SSH seems like a good solution.

So far I have installed and configured the OpenSSH and TightVNC servers on the remote Windows computer. I have confirmed that the TightVNC server is listening on port 5900.

Then I followed this guide to configure PuTTy with port tunneling.

I have also configured AllowTcpForwarding yes in sshd_config on the remote computer.

I can successfully connect / log in to the Windows remote computer using PuTTy with tunnel configuration for port 5900.

But when I try to connect to 127.0.0.1::5900 or localhost: 5900 in the TightVNC viewer, it cannot connect and the error "The connection has been successfully closed" appears.

What am i missing?

SSL certificate – httpd and curl: Configure the https prom connection for a p12 file form client validation

I am displaying an httpd. I need to configure ssl to validate the client according to its client certificate.

To do that I have a p12 file containing private key, client certificate and ca chain certificates:

CA chain certificates:

➜ ~ openssl pkcs12 -in fitxers.p12 -cacerts -nokeys
Bag Attributes
    ...
-----BEGIN CERTIFICATE-----
$$$$$$$...
-----END CERTIFICATE-----
Bag Attributes
    ...
-----BEGIN CERTIFICATE-----
$$$$$$$...
-----END CERTIFICATE-----

Customer certificate:

➜ ~ openssl pkcs12 -in fitxers.p12 -clcerts -nokeys
Bag Attributes
    ...
-----BEGIN CERTIFICATE-----
$$$$$$$...
-----END CERTIFICATE-----

Client's private key:

➜ ~ openssl pkcs12 -in fitxers.p12 -nocerts
Bag Attributes
    ...
-----BEGIN PRIVATE KEY-----
$$$$$$$...
-----END PRIVATE KEY-----

To divide this p12 separate cert file and key files:

➜ ~ openssl pkcs12 -in container.p12 -nocerts -out client.key.pem
➜ ~ openssl pkcs12 -in fitxers.p12 -clcerts -nokeys -out client.crt
➜ ~ openssl pkcs12 -in fitxers.p12 -cacerts -nokeys -out cacerts.crt

So, from now on, I configured my httpd as:

SSLEngine On
SSLCACertificateFile /usr/local/apache2/conf/cacerts.crt
...

I am trying to make the connection using curl:

curl --cert client.crt --key client.key.pem https://localhost:8080/token -v
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
Enter PEM pass phrase:
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Unknown (8):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

In the httpd server logs I get:

(Tue Sep 17 11:17:28.144219 2019) (ssl:info) (pid 8:tid 139871525332736) (client 10.0.2.4:52926) AH01964: Connection to child 68 established (server 10.0.2.47:443)
(Tue Sep 17 11:17:28.148318 2019) (ssl:debug) (pid 8:tid 139871525332736) ssl_engine_kernel.c(2375): (client 10.0.2.4:52926) AH02645: Server name not provided via TLS extension (using default/first virtual host)
(Tue Sep 17 11:17:28.155178 2019) (ssl:info) (pid 8:tid 139871525332736) (client 10.0.2.4:52926) AH02008: SSL library error 1 in handshake (server 10.0.2.47:443)
(Tue Sep 17 11:17:28.155569 2019) (ssl:info) (pid 8:tid 139871525332736) SSL Library Error: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown (SSL alert number 46)
(Tue Sep 17 11:17:28.155609 2019) (ssl:info) (pid 8:tid 139871525332736) (client 10.0.2.4:52926) AH01998: Connection closed to child 68 with abortive shutdown (server 10.0.2.47:443)
(Tue Sep 17 11:19:01.114529 2019) (ssl:info) (pid 8:tid 139871448463104) (client 10.255.0.2:48060) AH01964: Connection to child 69 established (server 10.0.2.47:443)
(Tue Sep 17 11:19:01.114667 2019) (ssl:debug) (pid 8:tid 139871448463104) ssl_engine_kernel.c(2354): (client 10.255.0.2:48060) AH02044: No matching SSL virtual host for servername localhost found (using default/first virtual host)
(Tue Sep 17 11:19:01.114674 2019) (ssl:debug) (pid 8:tid 139871448463104) ssl_engine_kernel.c(2354): (client 10.255.0.2:48060) AH02044: No matching SSL virtual host for servername localhost found (using default/first virtual host)
(Tue Sep 17 11:19:01.114679 2019) (core:debug) (pid 8:tid 139871448463104) protocol.c(2314): (client 10.255.0.2:48060) AH03155: select protocol from , choices=h2,http/1.1 for server 10.0.2.47
(Tue Sep 17 11:19:01.117705 2019) (ssl:info) (pid 8:tid 139871448463104) (client 10.255.0.2:48060) AH02008: SSL library error 1 in handshake (server 10.0.2.47:443)
(Tue Sep 17 11:19:01.117827 2019) (ssl:info) (pid 8:tid 139871448463104) SSL Library Error: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca (SSL alert number 48)
(Tue Sep 17 11:19:01.117858 2019) (ssl:info) (pid 8:tid 139871448463104) (client 10.255.0.2:48060) AH01998: Connection closed to child 69 with abortive shutdown (server 10.0.2.47:443)

I have also tried to use cacerts.pem with curl --cacert ./cacerts.pem --cert client.crt --key client.key.pem https://localhost:8080/token -v

Any ideas?

How do I configure my sheet to go directly to a certain column when opening the document?

I have dates at the top of the document and I would like it to go to the date & # 39; of today & # 39; when I open the document instead of scrolling each time.