Linux

Automatically confirming a command in Linux #

yes | ./script

In crontab you can do something like:

@monthly yes | ./script

OpenSSL #

Generating self-signed SSL certificates to be used in Nginx #

The same command works on macOS X.

openssl req -x509 -nodes -days 36500 -newkey rsa:2048 \
 -keyout private-selfsigned.key -out public-selfsigned.crt

Discovering the sha256 of a file using openssl: #

openssl sha256 OperaSetup.zip

GPG (GNU Privacy Guard) #

Generate a gpg key pair #

gpg --full-generate-key

List private and public keys #

gpg --list-secret-keys
gpg --list-keys

Delete private and public keys #

gpg --delete-secret-key "User Name"
gpg --delete-key "User Name"