Using Webpack in Codeigniter 3 – Part 1 Set-Up

Webpack is a brilliant tool for bundling all your assets and their dependencies into one single file to distribute with your website. Out of the box Codigniter doesn’t include any kind of modern front-end tooling so we will have to import webpack and set it up from scratch. This will most likely be a multi part series to cover this topic.

We can compile our Javascript modules, build any SASS/LESS files and even minify everything, so lets get started.

Continue reading Using Webpack in Codeigniter 3 – Part 1 Set-Up

Using the Laravel Blade templating engine in Codeigniter 3

As anyone who reads this blog or knows me personally, my love for Laravel is deep. That’s great for greenfield projects but a lot of code I deal with on a daily basis is mostly written in Codeigniter. One thing I really miss in CI (among many other things) is a template system. In this tutorial I will show you how to include the Laravel Blade template system in your Codeigniter project.

Continue reading Using the Laravel Blade templating engine in Codeigniter 3

My next Linux work station

My Criteria 

CPU: Speed and Cores are very important to me with compiling code and editing video on a daily basis. Ideally I would like a Xeon processor with hyper threading
but this looks unlikely so an i7 model would do the job.

Memory: Due to the reasons listed above I need at least 16GB ram with the room to upgrade to 32GB would be a nice to have (let’s not go Apple and lock ourselves to just 16GB).

Continue reading My next Linux work station

Laravel Eloquent – Integrity constraint violation: 1452 foreign key constraint or General error: 1005

Are you trying to set-up a foreign key constraint on one of your tables and you’re getting a 1452 error?

[Illuminate\Database\QueryException]
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

 

You might also get a General error: 1005

[PDOException]
  SQLSTATE[HY000]: General error: 1005 Can't create table `app`.`#sql-33d4_1a2` (errno: 150 "Foreign key constraint is incorrectly formed")

 

This is a MySql issue and not a Laravel one.

Continue reading Laravel Eloquent – Integrity constraint violation: 1452 foreign key constraint or General error: 1005

Installing OnlyOffice on Elementary OS

There are a number of office suites for Linux and I have used most of them. One I hadn’t heard about until recently was OnlyOffice, which is available for Windows, Mac and Linux for free. I believe it is a Javascript/Electron based application but it performs very well for your office needs so lets give it ago.

OnlyOffice on Linux Elementary OS

Continue reading Installing OnlyOffice on Elementary OS

Apache Invalid command ‘Header’

I recently had a vagrant box which was giving a 500 internal error and when checking the Apache error log I found the following error:

/vagrant/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

The problem is that headers module is not loaded in Apache so you need to load it and restart. SSH into your vagrant instance (or open a terminal if you’re having this problem on your local LAMP stack) and enable the module:

a2enmod headers

Then restart Apache

service apache2 restart

Edit the bashrc file in Elementary OS

Editing the bashrc file in Elementary OS is an easy task, simply open it in your favorite text editor (Elementary OS comes with nano so you can use that).

sudo nano ~/.bashrc

Make any changes you need to that file and then press ctrl+o to save the file and ctrl+x to exit.

Don’t forget to reload your bashrc!

source ~/.bashrc

North Korean DNS Leak reveals North Korean websites

One of North Korea’s top level DNS servers was mis-configured today (20th September 2016) accidentally allowing global DNS zone transfers. This allowed anyone who makes a zone transfer request (AXFR) to retrieve a copy of the nation’s top level DNS data.

Continue reading North Korean DNS Leak reveals North Korean websites

Installing PHP Phalcon on Elementary OS

PHP Phalcon is one of my favourite PHP frameworks its so quick and powerful. Here is a quick guide on how to install it on Elementary OS. This guide presumes you are using Apache and have it working. If not please follow this guide to get Apache install on Elementary OS.

Continue reading Installing PHP Phalcon on Elementary OS