Articles & Snippets

Search for content...
/

Start typing to search

Encrypt sensitive data with PHP

Posted by Cătălin on Sat, 7 Jan 2017

Encrypt sensitive data with PHP and MySQL

Class created with construct now add methods to encrypt and decrypt: class Encryption { const CIPHER = MCRYPT_RIJNDAEL_128; // Rijndael-128 is AES const MODE = MCRYPT_MODE_CBC; ...

Read More...
code

GST/HST calculator

Posted by Cătălin on Tue, 8 Nov 2016

GST/HST calculator to find out the amount of tax that applies to sales in Canada.

Province or territory SelectAlbertaBritish ColumbiaManitobaNew BrunswickNewfoundland and LabradorNorthwest TerritoriesNova ScotiaNunavutOntarioPrince Edward IslandQuebecSaskatchewanYukon...

Read More...
code

Script to Backup Mysql Databases

Posted by Cătălin on Mon, 31 Oct 2016

Shell Script to Backup Mysql Databases, you can keep as many versions as you like

Create a cron with this script to backup your databases: #!/bin/sh # List of databases to be backed up separated by space dblist="DATABASE1 DATABASE2 DATABASE3" # Directory for backups backupdir=/PATH/FOR/MYSQL/BACKUPS/gz ...

Read More...
code

Archive with tar excluding certain files/folders

Posted by Cătălin on Wed, 26 Oct 2016

Here is how to run the tar command with the --exclude functionality

Here is how to run the tar command with the --exclude functionality tar -czvf backup.tar.gz /path/site.com --exclude='/path/site.com/uploads'

Read More...
code

Linux - How to fix “Read-only file system”?

Posted by Cătălin on Thu, 6 Oct 2016

Read the full article by clicking the title

# /etc/init.d/apache2 start Starting web server: apache2(30)Read-only file system: apache2: could not open error log file /var/log/apache2/error.log. Unable to open logs Action 'start' failed. The...

Read More...
code