OpenVPN server on an Oracle Cloud computing instance: routing problems

I have an Ubuntu 20.04 LTS instance running in the Oracle Cloud “free tier”. I set up OpenVPN on this VM following this guide (it’s in German). Firewall port 1194/UDP open, IPv4 forwarding configured correctly (both in /etc/sysctl.conf and in /etc/default/ufw, UFW also does forwarding in /etc/ufw/before.rules with this magic incantation:

# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT (0:0)
# Allow traffic from OpenVPN client to ens3
-A POSTROUTING -s 10.27.0.0/8 -o ens3 -j MASQUERADE
COMMIT
# END OPENVPN RULES

ifconfig output on the server:

ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 10.0.0.4  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::200:17ff:fe02:52db  prefixlen 64  scopeid 0x20<link>
        ether 00:00:17:02:52:db  txqueuelen 1000  (Ethernet)
(....)
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.27.0.1  netmask 255.255.255.0  destination 10.27.0.1
        inet6 fe80::b07f:586a:c721:fddb  prefixlen 64  scopeid 0x20<link>

Looks good. The problem is that the client cannot connect to the server, the log says “TLS Error: TLS key negotiation failed to occur within 60 seconds”.

When I run sudo tcpdump -ni ens3 udp and port 1194, I can see that the packets do arrive from the client (IP address “X.X.X.X”):

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode 
listening on ens3, link-type EN10MB (Ethernet), capture size 262144 bytes
14:18:08.024761 IP X.X.X.X.20800 > 10.0.0.4.1194: UDP, length 54

I suspect the problem is related to how virtual networks are configured on the Oracle Cloud. My VM has an IP 10.0.0.4, therefore the OpenVPN server config contains an entry listen 10.0.0.4. Most likely some routing setting is missing so the server can’t answer the client’s connection request.

My question is: has someone set up an OpenVPN server on Oracle’s cloud successfully? And if yes, what was the extra configuration step that had to be performed?

FWIW, I checked the box “Skip source/destination check” in Instance Details > Attached VNICs > Edit in the Oracle Cloud web management GUI. Otherwise the networking setup is “standard”.

networking – Issues connecting to aws ec2 instance behind eip

I have an ec2 instance on which I’m running a dev server via parcel index.html --host 0.0.0.0 that ultimately listens on 0.0.0.0:1234. Before creating and associating an eip to my instance, I wanted to use the public ip address assoc’d with it and modified my iptables via

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 1234

This allowed me to visit my server via the browser using the public ip address assoc’d with my ec2 instance and receive the response I expect.

However, I’ve now created and assoc’d an eip with my instance (because it’s a dev server and I start and stop the instance regularly, I want a constant ip address) and although I can continue to ssh into my instance via the eip address, I can’t visit the server by using the eip address in my browser.

Since I’m able to ssh to the instance via the eip I wonder if there is some configuration local to the instance that I need to modify to make requests to my server.

Any help is greatly appreciated. Thanks.

domain name system – use dnsmasq server from another instance

I am trying to figure out something, but I am not sure if the concept is right at all.

here is my case:

I have dnsmasq server on my instance (INSTANCE_1) which is in a private subnet in AWS cloud.

/etc/resolve.conf

nameserver 127.0.0.1

/etc/dnsmasq.conf

port=53
domain-needed
bogus-priv
strict-order
expand-hosts
listen-address=127.0.0.1
cache-size=2024
domain=INSTANCE-1.io
address=/INSTANCE-1.io/127.0.0.1 
server=8.8.8.8
server=8.8.4.4

/etc/hosts

127.0.0.1 localhost
10.10.2.x ip-10-10-2-x
172.217.16.195 www.google.com
10.10.1.x INSTANCE-2

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

this configuration is working fine.

dig INSTANCE-1.io:

; <<>> DiG 9.16.1-Ubuntu <<>> INSTANCE-1.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64633
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;INSTANCE-1.io.             IN      A

;; ANSWER SECTION:
INSTANCE-1.io.      0       IN      A       127.0.0.1

;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Aug 08 11:29:34 UTC 2020
;; MSG SIZE  rcvd: 62

And it is also working for dig INSTANCE-2.INSTANCE-1.io:

Now my question; is it possible to have a new instance for example INSTANCE-3 and configure it in a way that it will use the dnsmasq server on INSTANCE-1? So I don’t have to re-configure everything again everytime I add new instance to the network?
if it possible can you please tell me how or send me some useful links, I researched it already but couldn’t find anythin.

linux – Site stopped working after restarting EC2 instance, shows this site can’t be reached

My wordpress blog site stopped working after I restarted my EC2 instance in AWS.. What could be the reason behind this ? I cannot access mysite.com/wp-admin as well..

Does anyone know how to fix this issue ??

Site response – this site can’t be reached

Hosting – AWS EC2 (Ubuntu 18.04)

amazon web services – Tomcat spontaneously updated when spinning up an AWS EC2 instance. What just happened?

I am once again attempting to get our development AWS box switched over to Let’s Encrypt.

This time, I’ve managed to get the httpd server working with the Let’s Encrypt cert. And this time, I’ve even managed to get Tomcat 8.5 to use it without crashing on takeoff. It’s not yet on speaking terms with Chrome, but Firefox can access it just fine. And that’s when I noticed the weirdness:

The mere act of spinning up a spot instance from last night’s backup caused Tomcat to update itself to the latest version (from 8.5.40 to 8.5.57).

This would not be a bad thing in and of itself, except for two side effects:
First, the default ROOT context was overlaid onto our ROOT context!

Second, Manager was disabled!

I spun up a new spot instance, the same way I did the one I’m using for my experiments, and sure enough, the ROOT context was changed: eleven files were added, and an undetermined number were changed.

The other contexts appear to all be there, but the “examples” context, which we remove from all our working Tomcat installations, was added back in.

But our server.xml appears to be completely intact, and so does our tomcat-users.xml.

Yet, as I said, Manager is disabled.

Can anybody shed any light on what happened?

command line – how to delete a docker instance?

Perhaps kill is incorrect terminology.

How do I destroy docker containers? Put them in the trash. Delete. Remove. Erase.

docker container kill $(docker ps -a -q  | awk '{print $1}')

doesn’t quite work:

Error response from daemon: Cannot kill container: 06e44d24ba8d: Container 06e44d24ba8d3df83e10a1829f04755cb9053faa68ab3dabccd10c3ee1c80322 is not running
Error response from daemon: Cannot kill container: 22539a069e3b: Container 22539a069e3b8bbbd27b062603a7667857ac1a5e64242004fe7b72411a9cdbca is not running
Error response from daemon: Cannot kill container: 1f7cf43ab398: Container 1f7cf43ab398e6e18416f69fc947b49d9792b1932a4b157f0514f9f6638ca185 is not running
Error response from daemon: Cannot kill container: 7fc8c24ccabe: Container 7fc8c24ccabef04215df9ba7b8c171df6b963942e6e90c92a462cc0ab9d5dcb0 is not running

See also:

https://stackoverflow.com/q/51015597/4531180

Como mapear correctamente una Query de un double en Firebase y Flutter – NoSuchMethodError: Class ‘double’ has no instance method ‘[]’

Tengo una base de datos como la siguiente…

> > loteActual:     
> >          pesoInicial: 100.0
> >          ultimoCrec: 350.0`

Quiero hacer una consulta simple del pesoInicial (tipo double) y llevo horas sin lograr hacerlo ya que siempre me encuentro con el siguiente error:

Exception has occurred. NoSuchMethodError (NoSuchMethodError: Class
‘double’ has no instance method ‘()’. Receiver: 350.0 Tried calling:
)

Como se observa, pareciera que está recibiendo bien el dato (350.0), pero tiene algún tipo de estructura que no me permite leerlo.

El código que tengo para la consulta es el siguiente:

Future<double> cargarPesoInicial( String idEmpresa, String idEstanque) async {

  double pesoInicial; 

  Query resp = db.child('PATH.../loteActual/pesoInicial');

  return resp.once().then((snapshot) {

      if (snapshot.value == null) return pesoInicial;
      if (snapshot.value('error') != null) return pesoInicial; 
      pesoInicial = snapshot.value;
      return pesoInicial;

      }
  );
} 

Y el error aparece cuando hago el llamado al método…

double _pesoInicial;
_pesoInicial      = await loteActualBloc.cargarPesoInicial(idEmpresa, idEstanque);

Terraform – can’t reach web server – instance out of service

I’m running the below terraform code to deploy an ec2 instance inside a VPC to work as web server but for some reason I cant reach the website and cant shh to it, I have set the ingress and egress rules properly I believe:

########Provider########

provider "aws" {
    region      = "us-west-2"
    access_key  = "AKIAJ6xxxxWHA"
    secret_key  = "7qyLys/A/5ZZpJxxxO8TMC"
}

########VPC########
resource "aws_vpc" "vpc1" {
  cidr_block       = "10.1.0.0/16"
  tags = {
    Name = "Production"
  }
}

########Internet GW########
resource "aws_internet_gateway" "gw" {
  vpc_id = aws_vpc.vpc1.id
}

########Route table########
resource "aws_route_table" "rt" {
  vpc_id = aws_vpc.vpc1.id
  route {
    cidr_block = "0.0.0.0/24"
    gateway_id = aws_internet_gateway.gw.id
  }

  route {
    ipv6_cidr_block = "::/0"
    gateway_id = aws_internet_gateway.gw.id
  }

}

########Sub Net########
resource "aws_subnet" "subnet1" {
  vpc_id     = aws_vpc.vpc1.id
  cidr_block = "10.1.0.0/24"
  availability_zone = "us-west-2a"
  map_public_ip_on_launch = "true"

  tags = {
    Name = "prod-subnet-1"
  }
}

########RT assosiation########
resource "aws_route_table_association" "a" {
  subnet_id      = aws_subnet.subnet1.id
  route_table_id = aws_route_table.rt.id
}

########Security Group########
resource "aws_security_group" "sec1" {
  name        = "allow_web"
  description = "Allow web inbound traffic"
  vpc_id      = aws_vpc.vpc1.id

  ingress {
    description = "HTTP from VPC"
    from_port   = 80
    to_port     = 80
    protocol    = "tcp"
    cidr_blocks = ["10.1.0.0/16"]
  }

        #SSH access from anywhere
  ingress {
    description = "SSH from VPC"
    from_port   = 22
    to_port     = 22
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }

  egress {
    from_port   = 0
    to_port     = 0
    protocol    = "-1"
    cidr_blocks = ["0.0.0.0/0"]
  }

  tags = {
    Name = "allow_web"
  }
}

########Net Interface for the Instance########
#resource "aws_network_interface" "wsn" {
#  subnet_id       = aws_subnet.subnet1.id
#  private_ips     = ["10.0.1.50"]
#  security_groups = [aws_security_group.sec1.id]
#}

########Load Balancer########
resource "aws_elb" "elb" {
    name = "lb"
    subnets = [aws_subnet.subnet1.id]
    security_groups = [aws_security_group.sec1.id]
    instances = [aws_instance.web1.id]

    listener {
        instance_port = 80
        instance_protocol = "http"
        lb_port = 80
        lb_protocol = "http"


    }

}

########EC2 Instance########
resource "aws_instance" "web1" {
    ami             = "ami-003634241a8fcdec0" #ubuntu 18.4
    instance_type   = "t2.micro"
    availability_zone = "us-west-2a"
    key_name = "main-key"
    subnet_id = aws_subnet.subnet1.id

    #network_interface {
    #        device_index = 0
    #        network_interface_id = aws_network_interface.wsn.id
    #}

    user_data = <<-EOF
        #!/bin/bash
        sudo apt update -y
        sudo apt install apache2 -y
        sudo systemctl start apache2
        sudo bash -c 'echo Hello world!!! > /var/www/html/index.html'

        
        EOF



    tags = {
    Name = "HelloWorld"
  }
}

output "aws_elb_public_dns" {
    value = aws_elb.elb.dns_name

}

The plan and the apply runs all fine but in the loadbalancer the instance is “outofservice”
what could be wrong here??

sharepoint server – Instance validation error: ‘ None ‘ is not a valid value for FrameType

I was making few UI changes to my SharePoint masterpage and I started getting following error, I also tried to restore previous versions of masterpage but that didnt work.
Can anyone help please.
In the error it says :

One of the properties of the Web Part has an incorrect format. Microsoft SharePoint Foundation cannot deserialize the Web Part.  Check the format of the properties and try again.)

but how I find which webpart has issue ?
My environment is SharePoint 2016.

Thanks in advance.

Server Error in '/' Application.

Instance validation error: '
                                            None
                                        ' is not a valid value for FrameType. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.InvalidOperationException: Instance validation error: '
                                            None
                                        ' is not a valid value for FrameType.

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



(InvalidOperationException: Instance validation error: '
                                            None
                                        ' is not a valid value for FrameType.)
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderContentEditorWebPart.Read7_FrameType(String s) +223
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderContentEditorWebPart.Read12_ContentEditorWebPart(Boolean isNullable, Boolean checkType) +710
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderContentEditorWebPart.Read13_WebPart() +119

(InvalidOperationException: There is an error in XML document (9, 53).)
   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +819
   Microsoft.SharePoint.WebPartPages.WebPart.ParseXml(XmlReader reader, Type type, String() links, SPWeb spWeb) +210

(WebPartPageUserException: One of the properties of the Web Part has an incorrect format. Microsoft SharePoint Foundation cannot deserialize the Web Part.  Check the format of the properties and try again.)
   Microsoft.SharePoint.WebPartPages.WebPart.ParseXml(XmlReader reader, Type type, String() links, SPWeb spWeb) +800
   Microsoft.SharePoint.WebPartPages.WebPart.AddParsedSubObject(Object obj) +1268
   System.Web.UI.ControlBuilder.BuildChildren(Object parentObj) +1067
   System.Web.UI.ControlBuilder.InitObject(Object obj) +479
   System.Web.UI.ControlBuilder.BuildObjectInternal() +285
   System.Web.UI.ControlBuilder.BuildChildren(Object parentObj) +888
   System.Web.UI.ControlBuilder.InitObject(Object obj) +479
   System.Web.UI.ControlBuilder.BuildObjectInternal() +285
   System.Web.UI.ControlBuilder.BuildChildren(Object parentObj) +888
   System.Web.UI.ControlBuilder.InitObject(Object obj) +479
   System.Web.UI.ControlBuilder.BuildObjectInternal() +285
   System.Web.UI.ControlBuilder.BuildChildren(Object parentObj) +888
   System.Web.UI.ControlBuilder.InitObject(Object obj) +479
   System.Web.UI.FileLevelPageControlBuilder.InitObject(Object obj) +42
   System.Web.Compilation.BuildResultNoCompileTemplateControl.FrameworkInitialize(TemplateControl templateControl) +168
   System.Web.UI.TemplateControl.FrameworkInitialize() +106
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +1247
   System.Web.UI.Page.get_Master() +65
   System.Web.UI.Page.ApplyMasterPage() +17
   System.Web.UI.Page.PerformPreInit() +53
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1132

linux – Ubuntu 18.04 custom Service start ( nginx ) on instance reboot/start

OS : Ubuntu 18.04

We have requirement, to service nginx reload after nginx service has started successfully on aws instance start / reboot.

I tried tinkering init.d/nginx but I don’t see reload happened or not

    start]
            log_daemon_msg "Starting $DESC" "$NAME"
            start_nginx
            case "$?" in
                    0|1] reload_nginx
                         log_end_msg $?
                         log_end_msg 0 ;;
                    2]   log_end_msg 1 ;;
            esac
            ;;
   

Am I doing in right way are in there any better way to do it.