Difficulty activating SSL on an old EC2 instance running Apache and Amazon Linux 1

Hello. I had trouble understanding why my Amazon Linux EC2 instance (1) does not serve my site at the https:// address, although I confirmed that the SSL protocol is configured, see https://www.ssllabs.com/ssltest/. I've been browsing the web looking for answers and I'm always running out. I've got the following header information from two site queries; one with and one without https://. www.example.net and the nonwww work but only without https://. Much of this is alien to me, though.

GET / HTTP/1.1
Host: example.net
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 5949
Content-Type: text/html; charset=utf-8
Date: Fri, 18 Oct 2019 19:18:46 GMT
Keep-Alive: timeout=5, max=99
Server: Apache/2.4.39 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
Vary: X-Requested-With,Accept-Encoding
X-Frame-Options: SAMEORIGIN
X-Powered-By: Nette Framework
GET / HTTP/1.1
Host: example.net:443
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36

HTTP/1.1 301 Moved Permanently
Content-Length: 98
Content-Type: text/html; charset=utf-8
Date: Fri, 18 Oct 2019 19:09:13 GMT
Location: http://example.net/
Server: Apache/2.4.39 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
Vary: X-Requested-With
X-Frame-Options: SAMEORIGIN
X-Powered-By: Nette Framework

Can someone confirm what could be wrong? My configuration files all seem to point to my certificate files (generated from Lets Encrypt after following this article: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux -2 .html). I also do not think I've seen anything confusing in the .htaccess, and when I redirect him to HTTPSyes, but the page she leads is empty.

What is the problem? Is there anything else that I can look at that might need to be updated? Thank you in advance.

unit – i want to block each instance of the same prefab on the y axis only

I instantiated the "paddle" prefabricated twice, then tried to block it only on the y-axis; using Mathf.Clamp, however, the min and max values ​​end up being applied to both instances of "paddle" and can therefore move in the x-axis

ok so i'm trying to make a 2D mobile pong game, i have a prefabricated "pallet" which are the rackets / bats with which the balls collide

I've instantiated the same prefab twice one on each side of the screen:

Paddle paddle1 = Instantiate(Paddle) as Paddle;
Paddle paddle2 = Instantiate(Paddle) as Paddle;
paddle2.Init(true); //right paddle
paddle1.Init(false); //left paddle

Now, I want each paddle to move only on the y-axis (up and down).

I've tried to block them with:

var poss = transform.position;
poss.x =  Mathf.Clamp(transform.position.x, -1.0f, 1.0f);
transform.position = poss; 

However, this prevented the left palette from always moving to the right and the right palette to the left (I do not want at all that they move in the axis).

This is the Gamemanager.cs file:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

Public class GameManager: MonoBehaviour
{

public Ball Ball;

public Paddle Paddle;

public static Vector2 topRight;

public static Vector2 bottomLeft;


// Start is called before the first frame update
  void Start() 
  {
    bottomLeft = Camera.main.ScreenToWorldPoint(new Vector2 (0,0));
    topRight = Camera.main.ScreenToWorldPoint(new Vector2 
    (Screen.width,Screen.height));


    Instantiate(Ball); 

   //Paddle paddle1 = Instantiate(Paddle) as Paddle;
   Paddle paddle1 = Instantiate(Paddle) as Paddle;
   Paddle paddle2 = Instantiate(Paddle) as Paddle;
   paddle2.Init(true); //right paddle
   paddle1.Init(false); //left paddle


}
void Update()

  {

  }

}
This is the paddle.cs file:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Paddle: MonoBehaviour
{

         Rigidbody2D rb;
         float directionY;
         float speed;
          float height;


              float distance;
              string input;  
              bool isRight;
              // Start is called before the first frame update
              void Start()
              {
                height = transform.localScale.y;
                 speed=5f;   

            }

            public void Init(bool isRightPaddle){

            isRight = isRightPaddle;
            Vector2 pos = Vector2.zero;




            if(isRightPaddle){
                //Place paddle on the right of the screen
                pos = new Vector2(GameManager.topRight.x, 0);
               pos -= Vector2.right * transform.localScale.x; //Move a bit to the 
                       left

                        }
                         else 
                         {

                //Place paddle on the left of the screen
                pos = new Vector2(GameManager.bottomLeft.x, 0);
                pos += Vector2.right * transform.localScale.x; //Move a bit to 
                 the right

               } 

                //Update this paddle's position

               transform.position = pos;




              }

          void Update()
             {


        var poss = transform.position;
        poss.x =  Mathf.Clamp(transform.position.x, -8.0f, 8.0f);
        transform.position = poss; 
        }

}
I expect that each pallet can not move in the x-axis. Only in the y-axis

c # mobile unit3d

Charged for EC2 in the absence of running instance

I'm trying to figure out why I'm being charged for EC2 instances while none of my instances are running (and in fact I have not even stopped any of them!) 39; instances). See the screen shot below. Also please ask if there is more information that I should provide. Thank you!
enter the description of the image here

enter the description of the image here

Network – Static NAT Windows Server Mapping – Instance Not Found

I have a Windows 2016 server running on an external location with a specific IP address defined as a static IPV4 in the network adapter configuration.

On this server, I run a few virtual machines in a NAT network. These virtual machines run in their own Docker Swarm environment, to which the bare metal server is not part.

I have configured a nat network with the range of addresses 192.168.137.0/24

Virtual machines are configured with static IP addresses within this network and they have Internet access. The Bare Metal server can also ping the virtual machine.

However, I have not accessed the server for a long time, and I can not remember exactly how it was configured.

Now I am trying to route the PORT 80 to a specific virtual machine. First, I run Get-NetNat, which returns the following text:

Name                             : NatNetwork
ExternalIPInterfaceAddressPrefix :
InternalIPInterfaceAddressPrefix : 172.31.70.0/24
IcmpQueryTimeout                 : 30
TcpEstablishedConnectionTimeout  : 1800
TcpTransientConnectionTimeout    : 120
TcpFilteringBehavior             : AddressDependentFiltering
UdpFilteringBehavior             : AddressDependentFiltering
UdpIdleSessionTimeout            : 120
UdpInboundRefresh                : False
Store                            : Local
Active                           : False

The first thing I noticed was that InternalIPInterfaceAddressPrefix did not match my NAT networks.

However, I tried to add a static mapping, which gave me the following information:

PS C:UsersAdministrator> Add-NetNatStaticMapping -ExternalIPAddress "0.0.0.0/24" -ExternalPort 8080 -Protocol TCP -Int
ernalIPAddress "192.168.137.101" -InternalPort 8080 -NatName "NatNetwork"
Add-NetNatStaticMapping : Instance Nat NatNetwork not found
At line:1 char:1
+ Add-NetNatStaticMapping -ExternalIPAddress "0.0.0.0/24" -ExternalPort ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (MSFT_NetNatStaticMapping:root/StandardCi...atStaticMapping) (Add-NetN
   atStaticMapping), CimException
    + FullyQualifiedErrorId : Windows System Error 50,Add-NetNatStaticMapping

I have therefore thought that NetNat was misconfigured, so I tried to delete it, but even that will not work:

PS C:UsersAdministrator> Remove-NetNat NatNetwork

Confirm
Are you sure you want to perform this action?
Performing operation Delete on Target NatNetwork PolicyStore Local
(Y) Yes  (A) Yes to All  (N) No  (L) No to All  (S) Suspend  (?) Help (default is "Y"): Y
Remove-NetNat : The requested operation is not supported.
At line:1 char:1
+ Remove-NetNat NatNetwork
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (MSFT_NetNat (In..."NatNetwork;0"):root/StandardCimv2/MSFT_NetNat) (Re
   move-NetNat), CimException
    + FullyQualifiedErrorId : Windows System Error 50,Remove-NetNat

Now I am running out of ideas. I have tried many other things too, but I can not keep my mind upright anymore.

The NatNetwork network was originally created according to the following post: https://blog.areflyen.no/2012/10/10/setting-up-internet-access-for-hyper-v-with-nat -in-windows-8 /

How to AUTOMATICALLY deploy a new mySQL instance with docker in a secure way?

I would like to be able to run a script that deploys my application on a new server with as little manual manipulation as possible, without exposing the password of the database to the world.

The application consists of a web application (nginx + custom stuff) and a mysql database. I know how to deploy it automatically, but not in a secure way: just store the root password in docker-dial and somewhere in the web application configurations. This, of course, is not secure at all.

I know how to deploy it safely: the current MySQL documentation suggests to deploy the default mySQL image, grep the generated root password, and then run mysql in the container to change this password in "password of your choice". Then I guess I should put this "password of my choice" in the web application configuration so that my web application can connect to the database.

What I do not know is what is the recommended way to deploy mySQL both automatically AND securely. I can generate the "password of my choice" when deploying, but if I put it in the configs anyway, what is the point of worrying about the mySQL password generated once so random? Can someone give me the best practices?

SQL Server – Finding a User Name in Instance Objects

If it's in the text of a proc / function, you can use the simple and free third-party plugin from redgate: SQL Search, there are also ways to do it with TSQL. See the answer to the question about stackexchange for searching procedures.

However, it is very likely that your proc will look for the value in a table that stores it, so it does not need to be hard-coded.
If you want to perform a simultaneous search in several columns, this link can be useful:
String search in different tables

python – Get "sequence index is not an integer, slice or instance with __index__" on pylint

Im doing a python code that does the data validation, but suddenly I got this error and I donI do not know why, can anyone explain it to me?

import sys
import math 
from math import pi


class SetShape:
        def __init__(self):
            self.IV_set_shape=0
            self.IV_set_shape_valid=False
            self.IV_set_color=""
            self.IV_set_color_valid=False
        def setShape(self,shapechoosing=None):
            call_function= {}
            debug_data= ()
            return_msg= "ClassName:setShape"
            call_function=(((shapechoosing,True, len(1))))
            debug_data.append(call_function)
            if call_function("sucess") !=True:
                self.IV_set_shape= False
                return_msg= "input validation failed"
                return {"return message":return_msg,'debug data':debug_data}
            self.IV_set_shape= shapechoosing

How to get the Jupyter Notebook URI open in a VM cloud instance for use in VS code?

I need help to connect to an open Jupyter notebook server in a google cloud VM instance. I was able to open a Jupyter notebook session in a browser with SSH on the virtual machine by following this article and Google documentation https://towardsdatascience.com/running-jupyter-notebook-in-google-cloud -platform-in-15- min-61e16da34d52.

I then tried to enter "ip-address: port-no" for the jupyter notepad server in vs code, where ip is the external IP address of the instance of the virtual machine and port no is the port on which jupyter is open. job. The VS code says that the URI is invalid. I have not found any information or help regarding this site online.

Can someone who has any experience whatsoever with this could help me since it's the first time I've been using VS code and Google Cloud in this way.

Thank you!

Why would a Google Cloud instance tag drop packets?

I have a VPC with two VM Compute Engine instances. One of them, vpn-server, acts as a VPN for a cluster of on-premises computers. L & # 39; other, test-instance, is configured with an instance tag route-through-vpn which routes traffic to the vpn-server if it's okay 10.10.0.0/19.

There is also an AppEngine instance that has the route-through-vpn instance tag. The webapp that runs on it can connect directly to our on-premises cluster.

This configuration worked well for over a year. Then yesterday, a small number of IP addresses suddenly stopped working.

By "stopped working" I mean this:

  • It is still possible to SSH in IP addresses that do not work if you are connected to the vpn-server.
  • But traffic from test-instance can not reach these IPs.

One of the failing IP addresses is 10.10.0.8. An IP address that always works is 10.10.0.47. As far as I know, all addresses correctly match the range of addresses 10.10.0.0/19.

To debug, I connected to vpn-server and the test-instance and tried to send ICMP packets from test-instance to various IP addresses in the cluster. I've also run tcpdump on the vpn-server so that I could see the traffic as it passed.

For IP addresses that still work, I saw ICMP packets in the output of tcpdump, as expected. But for IP addresses that do not work anymore, I do not see anything in tcpdump, indicating that the Gcloud routing layer does not even send traffic to my vpn-server.

To test further, I stopped one of the local machines whose traffic was correctly routed and I tried to ping it. The ICMP echo request packets appeared in the output of tcpdump unanswered, exactly as planned.

The Google Cloud routes do not offer many options and there is no information available that could help me further my research. So it's now up to someone to know why this would happen.

Has anyone solved a problem of this type or does he have any idea of ​​what might be causing it?

c # – Retrieve lists from a static class method or instance method?

I'm trying to check the integrity of the lists of a database.

Can I use a static method to return a modified list based on a past parameter?

Also, to what extent can I use static methods to return lists? Can any one give me concrete examples? The code works well, but recently had an epiphany.

Here is an example:

            /// 
            /// Returns list of All Projects based on array of enum StatusOfProject
            /// 
            /// 
            /// 
            public static IEnumerable List(params Status() theStatus)
            {
                ThrowIf.Argument.IsNull(theStatus);
                var selectedStatus = new List();
                foreach (Status nextStatus in theStatus)
                {
                    string theQuery = "select JobNo from ProjectLog where StatusID = " + (int)nextStatus + "  order by JobNo desc";
                    using (SqlDataAdapter theSqlAdapter = new SqlDataAdapter(theQuery, TheUtils.OurDBHelpers.GetOurConnectionString()))
                    {
                        DataSet theDataset = new DataSet();
                        theSqlAdapter.Fill(theDataset, "Table");
                        DataTable theDataTable = theDataset.Tables("Table");
                        selectedStatus.AddRange(theDataTable.AsEnumerable().Select(row => row("JobNo").ToString()));
                    }
                }

                return selectedStatus;
            }