Skip to content

Darren Nolan

Computer Tech… and stuff

PHP AWS Elastic Beanstalk, RDS, Laravel 4 (with migrations on updates)

- Author: - 30 Comment(s)

SO! Let's recap my achievements for today. Sadly, much of what I read today on the internet was extremely unfriendly in terms of "what the hell do I _actually_ do" when it came to running custom commands after deployment, so I'll quickly recap the specifics where I found documentation not 100% hand-holding-friendly. The rest you can find on Amazon's extensive documentation site.

Today I wanted get started on my new blog code. I'm very tired of using Wordpress (I still love you Wordpress, honest) with one of the biggest factors I wish to address being the ability to simply deploy on Amazon Elastic Beanstalk. So today, it's get an RDS MySQL instance connected, throw Laravel on it, and then run any outstanding migrations (or just run them to start with). Dead simple.

Much of this I learnt from the developer guide on AWS documentation, which was extremely useful.  Following this guide, you'll get a new local git repo where you can throw laravel 4's app base onto (currently found here).  I won't go into it, it's already awesomely documented there on how to get to this point in the Beanstalk PHP getting started guide (Linked again in case you still haven't read that before reading on here).

Elastic Beanstalk has become even more awesome for users of Laravel, as 'composer install' is automatically run when it see's you have composer.json in your root folder of your app. So this helps a bunch in the fact we don't have to worry about either a) uploading the entire local vendor directory b) running composer on the instance ourselves after we push an update.


Categories: AWS | Elastic Beanstalk | Laravel 4 | MySQL | PHP | Programming | RDS MySQL

MAMP Stack (Mac Apache PHP MySQL)

- Author: - 0 Comment(s)

Install Apache PHP and MySQL on your Mountain Lion OS

Currently, there seems to be a lack of posts out there on how to get Mac Mountain Lion setup with a *AMP stack. I mean, there’s a lot of posts out there, but they’re not all helpful. The best post I’ve found is this – so I’ll be jumping into this as soon as I get apache working. Let’s try and consolidate that because at present – this mac ignorant (re: me) – has looked at too much junk to just get a dev stack running on his laptop

Mountain Lion, and a few previous versions – already have Apache and PHP installed. So absolute win on that front. Sadly when you search for MAMP or Mac Apache PHP MySQL – all you end up with is 3 odd packages you can “install” to give you what you already mostly have. Massive PITA imo.


Categories: Apache | MacOS | MySQL | PHP | Servers

Facebook Preview Thumbnail on Wordpress Site (Oh how I hate you both right now)

- Author: - 2 Comment(s)

Get facebook to show a default thumbnail for your Wordpress site, or a specific ‘featured’ image on post pages.

So because I’m lazy, for a really long time I’ve left facebook “attempt” to guess what image to use for my facebook shared links. Sadly facebook either gives me my twitter bird, or my white transparent logo (displayed on a white background of course…), despite having other images in my posts. So I’ve quickly hacked together this little script you can throw in your theme’s function file.

Basically, in the function – set your site’s default image location (I use my CDN because I’m awesome), guess if we’re using http or https – and if we’re on a singluar/post page – check for a featured image (you pick featured image when uploading or inserting the image into the actual post from the backend) and go from there.


Categories: Programming | Web | Wordpress

YouTube – Come back to the center

- Author:

Update 2014: This article is very much obsolete and this script is no longer maintained.

Get YouTube Centered in your browser again. Requires Chrome or Firefox. And a understanding how to copy/paste this script into a new script editor in Tamper(Grease)Monkey.

So if you’re like me, and hate YouTube following the new google theme of “stick to the left” like I do, install TamperMonkey (I assume you use Chrome… everyone should…) and install this script. Firefox users, you can use GreaseMonkey.


Categories: Chrome | FireFox

OpenCart – Adding Quantity to Category Page

- Author: - 52 Comment(s)

Mister Karl asked me today if I knew of any methods with OpenCart to add the Quantity field (qty) to the category page, that is the products listed either in a grid or list format.  While I have previously achived this with nasty horrible server-side hacks, I thought it was probably more appropriate to find a more consistent solution that would stay present even after updating OpenCart.

Turns out, the nicest place for me to achieve this fix, was in the Theme file itself.  This fix works in version of OpenCart and changes only one file.

The file you'll need to edit (assuming you're working with the default theme in OpenCart) is /catalog/view/theme/default/template/product/category.tpl

After you've seen the simple changes made, you should be able to adapt this to any theme you like.


Categories: OpenCart | PHP | Programming

<< Older Entries Newer Entries >>