AWS – EC2 : How to use a different public address for outbound connections

I have an AWS Ubuntu EC2 instance with an elastic IP address assigned to it and running a web application.

I would like to run a web scraping script on my server and I do not prefer my server / domain to be back-traced from the IP address my script connects to external websites.

For this purpose I decided to enable and use a NAT gateway on the VPC. However when I changed the default route on the VPC towards NAT gateway, I have also lost connection to my own server.

Here I will appreciate if you can guide me to create a solution via NAT gateway or by some other way?

Is a bitcoin address collision possible if generating 90 million addresses every 4 hours?

I am running a test to see if I can obtain a successful bitcoin address collision after generating billions of addresses. I am not entirely sure how I would check them yet. Basically I have an extra 10TB hard drive and am running supervanitygen on my 32-core, 128gb ram linux work computer. It seems to be generating about 90,000,000 (90 million) addresses (address + private key pair) every 4 hours.

Do you think it’s possible or likely to run into an address collision this way? Or perhaps if everyone in the world did the same thing? Or what if I waited 10-20 years, and then checked the addresses?

This is all just a test to see if the bitcoin system is secure enough for big investment decision.

Many websites allow passwords equal to username or e-mail address. Is this not a security risk?

I’m currently testing password policies on websites to get a feeling for what might be an acceptable policy/trade-off that provides good protection for our users without frustrating them.

I was surprised to find out that each and every website I tested allowed me to set a password that was equal to my username or e-mail address. If it couldn’t be set to the username, it was only because it didn’t meet the minimum length requirement. Equal to e-mail address worked every time. Even on sites that had rather strict policies otherwise.

Instinctively, I would think that this is no more secure than using a stupid password, such as “1234” or “password”. I’m also pretty sure that NIST SP 800-63B advises against such context-specific passwords (i.e. containing application name, username or user e-mail address). Unfortunately, I cannot verify this claim, as the NIST publication seems to be currently unavailable due to the US government shutdown.

Am I wrong in thinking that such context-specific passwords should be treated in the same manner as “stupid” passwords? If yes, what am I not seeing?

Python send my e-email to gmail, but not send to outlook or work address

My python code send a e-mail from my work aaddress to my gmail address, but they not send to any outlook address or work address. When I send the email it appears in the sent box, regardless of whether it was delivered or not.

import smtplib import mimetypes import email import email.mime.application from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.image import MIMEImage  _from = 'myaddress@work.com.br' _pass = 'pass'   _to = ['mygmail@gmail.com','myaddress@work.com.br']  msg = email.mime.multipart.MIMEMultipart() msg['Subject'] = 'Test' msg['From'] = 'myaddress@work.com.br' msg['To'] = ", ".join(_to)  body = MIMEText('Hi, this is a test email.<br><img src="cid:image"> <br>Thanks!.', 'html') msg.attach(body)  fp = open('C:/Users/renan.p.costa/img.png', 'rb') image = MIMEImage(fp.read()) fp.close() image.add_header('Content-ID', '<image>') msg.attach(image)  file='C:/Users/renan.p.costa/file.xlsx' _filename='file.xlsx' fp=open(file,'rb') excelfile = email.mime.application.MIMEApplication(fp.read(),_subtype="xlsx") fp.close() anexo.add_header('Content-Disposition','attachment',filename=_filename) msg.attach(excelfile)  s = smtplib.SMTP('smtp-mail.outlook.com', 587) s.ehlo() s.starttls() s.login(_from,_pass) s.sendmail(msg['From'],msg['To'], msg.as_string()) s.quit() 

nginx bind() to 0.0.0.0:443 failed (48: Address already in use)

I have Laravel Valet 2.1.6 installed on Mac OS 10.14.2.

nginx 1.15.8 is installed using brew.

I restarted my Mac without installing any updates or new software, and now all example.test sites are giving a 502 error with the following showing in the /usr/local/var/log/nginx/error.log log:

2019/01/17 20:38:47 [warn] 31277#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/etc/nginx/nginx.conf:1 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: still could not bind() 

At the same time, I get the following in the /Users/Myself/.config/valet/Log/nginx-error.log log:

2019/01/17 20:41:34 [error] 32071#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: example.test, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/Users/Myself/.config/valet/valet.sock:", host: "example.test" 

When I run ps ax -o pid,ppid,%cpu,vsz,wchan,command|egrep '(nginx|PID)' I see this list:

  PID  PPID  %CPU      VSZ WCHAN  COMMAND 32064     1   0.0  4306660 -      nginx: master process /usr/local/opt/nginx/bin/nginx -g daemon off; 32065 32064   0.0  4333284 -      nginx: worker process 32066 32064   0.0  4332260 -      nginx: worker process 32067 32064   0.0  4333284 -      nginx: worker process 32068 32064   0.0  4333284 -      nginx: worker process 32069 32064   0.0  4326116 -      nginx: worker process 32070 32064   0.0  4316900 -      nginx: worker process 32071 32064   0.0  4368236 -      nginx: worker process 32072 32064   0.0  4331236 -      nginx: worker process 32073 32064   0.0  4326116 -      nginx: worker process 32074 32064   0.0  4340452 -      nginx: worker process 32075 32064   0.0  4333284 -      nginx: worker process 32076 32064   0.0  4334308 -      nginx: worker process 36815  1406   0.0  4268060 -      egrep (nginx|PID) 

None of the following solves the issue:

  • sudo killall nginx
  • brew services restart nginx
  • brew services restart php
  • valet restart
  • Restarting my Mac
  • valet uninstall && valet install then valet park on the relevant dir

Apache is not running as a conflicting service.

I tried doing sudo /usr/local/opt/nginx/bin/nginx -g 'daemon off;' and got this:

nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] still could not bind() 

Running sudo lsof -i tcp:80 produces:

COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME nginx   42220 root    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42221 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42222 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42223 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42224 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42225 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42226 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42227 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42228 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42229 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42230 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42231 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42232 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) 

Basically the same output when I run that command for port 443.

This valet issue post suggests valet domain test might fix it, but that didn’t help.

Tried reinstalling PHP but no luck:

  • brew uninstall –force php
  • brew cleanup
  • brew install php
  • valet uninstall && valet install

Laravel valet bind() to 0.0.0.0:443 failed (48: Address already in use)

I have Laravel Valet 2.1.6 installed on Mac OS 10.14.2.

nginx 1.15.8 is installed using brew.

I restarted my Mac without installing any updates or new software, and now all example.test sites are giving a 502 error with the following showing in the /usr/local/var/log/nginx/error.log log:

2019/01/17 20:38:47 [warn] 31277#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/etc/nginx/nginx.conf:1 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: bind() to 0.0.0.0:443 failed (48: Address already in use) 2019/01/17 20:38:47 [emerg] 31277#0: still could not bind() 

At the same time, I get the following in the /Users/Myself/.config/valet/Log/nginx-error.log log:

2019/01/17 20:41:34 [error] 32071#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: vshred.test, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/Users/Myself/.config/valet/valet.sock:", host: "example.test" 

When I run ps ax -o pid,ppid,%cpu,vsz,wchan,command|egrep '(nginx|PID)' I see this list:

  PID  PPID  %CPU      VSZ WCHAN  COMMAND 32064     1   0.0  4306660 -      nginx: master process /usr/local/opt/nginx/bin/nginx -g daemon off; 32065 32064   0.0  4333284 -      nginx: worker process 32066 32064   0.0  4332260 -      nginx: worker process 32067 32064   0.0  4333284 -      nginx: worker process 32068 32064   0.0  4333284 -      nginx: worker process 32069 32064   0.0  4326116 -      nginx: worker process 32070 32064   0.0  4316900 -      nginx: worker process 32071 32064   0.0  4368236 -      nginx: worker process 32072 32064   0.0  4331236 -      nginx: worker process 32073 32064   0.0  4326116 -      nginx: worker process 32074 32064   0.0  4340452 -      nginx: worker process 32075 32064   0.0  4333284 -      nginx: worker process 32076 32064   0.0  4334308 -      nginx: worker process 36815  1406   0.0  4268060 -      egrep (nginx|PID) 

None of the following solves the issue:

  • sudo killall nginx
  • brew services restart nginx
  • brew services restart php
  • valet restart
  • Restarting my Mac
  • valet uninstall && valet install then valet park on the relevant dir

Apache is not running as a conflicting service.

I tried doing sudo /usr/local/opt/nginx/bin/nginx -g 'daemon off;' and got this:

nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:443 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:60 failed (48: Address already in use) nginx: [emerg] still could not bind() 

Running sudo lsof -i tcp:80 produces:

COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME nginx   42220 root    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42221 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42222 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42223 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42224 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42225 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42226 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42227 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42228 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42229 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42230 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42231 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) nginx   42232 Myself    7u  IPv4 0x7ac8eae7874ccb11      0t0  TCP *:http (LISTEN) 

Basically the same output when I run that command for port 443.

This valet issue post suggests valet domain test might fix it, but that didn’t help.

Find appropriate task manager host address for queryable state

I have 4 task managers and using map state backend(RocksDB) . using QueryableStateClient to query the state . 1.How to get correct task manager to query the state instead of querying all the task manager . (KvstateLocation ) can someone provide sample code unable to find it in the doc.

  1. How do we get jobid hex string using job name .

jump to MMIO address

In the ARM architecture, what happens on executing a jump instruction whose jump target address is an MMIO address (or in paging mode, a virtual address that is mapped to an MMIO address)? Would this such an instruction abort? If it succeeds and sets the EIP accordingly, what happens next: Will the CPU actually fetch the next instruction by reading MMIO address?

If it succeeds, reasoning about such a CPU seems problematic because reads and writes to IO addresses are potentially visible to the outside world, unlike DRAM. For example, the effect of out-of-order instruction prefetching will be visible to the outside world via IO.