SSL

Crossed-signed chain

cat example.com.crt GandiStandardSSLCA2.pem USERTrustRSAAddTrustCA.crt > example.com.sha2crossed.crt

Let’s Encrypt

$ sudo apt-get install certbot -t jessie-backports
$ certbot certonly -w /var/www/example.com -d example.com --config-dir ~/letsencrypt/etc --work-dir ~/letsencrypt/lib --logs-dir ~/letsencrypt/log
$ cat /etc/nginx/sites-available/example.com | grep ssl         ssl_certificate ~/letsencrypt/etc/live/example.com/fullchain.pem;         ssl_certificate_key ~/letsencrypt/etc/live/example.com/privkey.pem;
$ certbot renew --dry-run --config-dir ~/letsencrypt/etc --work-dir ~/letsencrypt/lib --logs-dir ~/letsencrypt/log

Ref:

https://letsencrypt.org/getting-started/
https://certbot.eff.org

Windows wakes up soon after going to sleep

I think there are two main reasons why Windows would wake up “by itself” (without pressing a key on the keyboard or clicking the mouse).

  1. Scheduled tasks;
  2. Devices allowed to wake up the computer.

Scheduled tasks are fairly simple to look into and it was not the problem at the time of writing this post, so I’ll skip straight to the second point.

We can get a list of devices that are allowed to wake up the computer from sleep by typing at the command prompt:

powercfg -devicequery wake_armed

At the time, I had 3 allowed devices:

  • Intel(R) 82579V Gigabit Network Connection
  • HID-compliant mouse
  • Microsoft USB Natural Ergonomic Keyboard 4000 (Mouse and Keyboard Center) (001)

I don’t need WOL or anything like that so I disallowed the network card to wake up the computer using Device manager:

Untitled

And voilà, my computer now stays asleep until I use the mouse or keyboard. I started having this problem after moving the computer to another network, so I suspect the new router or other network connected computers sent packets that waked it up.