How to create a self-signed certificate with OpenSSL

linux

You can do that in one command:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365

You can also add -nodes (short for no DES) if you don't want to protect your private key with a passphrase. Otherwise it will prompt you for "at least a 4 character" password.

. . .


Firewall or iptables settings

linux

Letz say you need configure firewall. There is one simple way by iptables.

  1. Create sh file with shell commands. Example in the end this article.
  2. Execute this sh file for settings iptables: sudo ./myIptables.sh
  3. Execute next command for save applyed settings iptables in some file on your directory: sudo iptables-save > myIptables.up.rules
  4. For allowing system restore iptables settings every time after restart add new file to the directory /etc/network/if-pre-up.d/ with next content:

. . .


Eazy stuff with linux

linux

Watching to the connection

    netstat -nputw
    ss -nputw

Watching content changing in the file

    tail -f log.txt

. . .


tar, zip, etc stuff

linux

Watching archive file content

    unzip -l example.zip

Update archive file

    zip -u example.zip file
    zip -ur example.zip folder