Upload file with bash/curl to endpoint (with password)

This example takes the file as a parameter and asks for a password that is sent along with the file.

 

Send attachments with wp_mail()

Like so:

Certbot – Reload Nginx after renewing certificates

renew-hook has been deprecated in recent versions of certbot. Plus, debian moved from using cronjobs for automatic renewals to systemd timer if they are available. On the other hand, now certbot supports having hooks in configuration files. Create a file  /etc/letsencrypt/renewal-hooks/deploy/01-reload-nginx with the following content:

Don’t forget to make the file executable.

Recursively utf8_encode arrays and objects

 

Stop SSH bruteforce attacks

If we receive 4 failed login attempts within 60 seconds; drop the following attempts.

Laravel 5.4: Specified key was too long

If you’re running an earlier version of mysql than 5.7.7 you may get this error. [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is …