base64 encode and decode with openssl
openssl enc -base64 <<< ‘something to encode’ c29tZXRoaW5nIHRvIGVuY29kZQo= openssl enc -base64 -d <<< c29tZXRoaW5nIHRvIGVuY29kZQo= something to encode
openssl enc -base64 <<< ‘something to encode’ c29tZXRoaW5nIHRvIGVuY29kZQo= openssl enc -base64 -d <<< c29tZXRoaW5nIHRvIGVuY29kZQo= something to encode
To simplify URLs on sites I usually like to forward everything to an encrypted connection (HTTPS://) with the www subdomain. Here’s how you setup the Apache .htaccess for this. Just add the following lines to the top of the .htaccess file… RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www. RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] …
I have used variation of this backup script for quick backups of typical LAMP stack websites (e.g. based on Drupal or WordPress). This saves the database along with the files into an archive… Depending on the website, there may be various non-web-accessible (private) directories to include in the script as well. Once the script is …