I installed MySQL 5.7 from a .dmg package installer for Mac OS X. I followed the installer taking note of the temporary root password given. After the installation, I cannot login as root because the password expired. Here’s what I did. I stopped MySQL in System Preferences. Switched … Continue reading
This is what I do when I want to test if sending of emails from a Django web app works. First, in the project directory, I launched a manage shell session. Then I entered the following commands. A return of 1 means it’s working. A second later, the email came. … Continue reading
Remember: Replace everything that starts with “a_”. Login to MySQL console. Backup a MySQL database. Restore from backup. Update MySQL user password. It works!
Environment: Bash v4.2 PostgreSQL v9.5 Remember: Replace everything that starts with “a_”. psql launch psql. quit. List databases. Create user. Change user password. Create database. Drop database. Drop user. Adding PostGIS extension. pg_dump Backup as dump file (tested to work in migrating servers). To create a non-compressed backup. To create … Continue reading
I enabled the EPEL repository. Enable EPEL repository. I upgraded setuptools. I installed python-pip. I installed pre-requisites. I could have actually issued the above yum install commands in one-line but.. I downloaded Python 2.7.10. I extracted the compressed file. I installed Python 2.7.10 from source. I created a symlink to … Continue reading
I installed the EPEL repository. I updated the packages. That’s all there is to it. It works!!
These are my notes on how to create cron jobs in Mac OS X. Linux users are already familiar with cron. Cron jobs in Windows are called Scheduled Tasks. First, I set the default editor to be nano. I like the simplicity of nano compared to the default vim editor. … Continue reading
A common design pattern in Django Class Based Views (CBVs) is checking whether the user is logged-in (authenticated) or not. If the user is authenticated, the view proceeds. If not, the view throws a permission denied exception. A common security feature in web sites. For example, take a look at … Continue reading
I used SyntaxHighlighter Evolved for pasting codes in my blog site. Here’s a quick guide on how I used it. Sample Usage In my article: [python light=”false”]print ‘Hello, World!’[/python] The Output: Shortcode Parameters These are the parameters you can pass to the shortcode and what they do. For the booleans … Continue reading
I came across this error in my Apache error log file found in /var/log/apache2/error_log. PHP Warning: mysql_connect():  No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) I figured out that this is due to PHP not being able to find the MySql socket to connect to the MySql … Continue reading