Skip to content

Instantly share code, notes, and snippets.


Abhyudaya Sharma AbhyudayaSharma

View GitHub Profile
AbhyudayaSharma /
Last active Jun 3, 2022
Generate a certificate signing request in one line

Generate a CSR using OpenSSL

openssl req -new -newkey rsa:4096 -keyout key.pem -noenc -out csr.pem -sha512 \
  -addext 'subjectAltName =,, IP:' \
  -subj '/C=IN/ST=State/L=Location/O=Organization/OU=OrgUnit/'

This creates a new RSA4096 key in key.pem and the corresponding CSR in csr.pem. The CSR can then be verified:

AbhyudayaSharma /
Last active Jul 25, 2020
HTTPS for Pi-hole using Nginx reverse proxy

This Nginx Configuration sets up Pi-hole behind HTTPS using an Nginx reverse proxy for secure credential transmission when accessing the UI.

Using the NXDOMAIN blocking mode makes sure that Pi-hole is not serving empty HTML pages for every ad.

Since I use ufw on my Raspberry Pi, the following rules are needed for the setup to work (SSH is optional):

sudo ufw status
Status: active
AbhyudayaSharma / block.list
Last active Mar 12, 2022
Pi-hole block list
View block.list