Quick fixes – Home

  • Uploading / Configuring a Laravel 4 app on cPanel type hosting ( public_html )

    Problem: This morning I wanted to quickly move a little Laravel test project onto my live server. The default file structure of Laravel stores all the framework resources in a vertical tree of files and directories, and then the ‘public’ directory is adjacent to these. Like so:

    - [app]
    - [bootstrap]
    - [public] etc

    To host it on my CentOS box running cPanel I want to adhere to the following (standardish) structure:

    - [.htpasswds]
    - [etc]
    - [mail]
    - [public_ftp]
    - [public_html] etc etc varies depending on server

    I could just upload everything in my Laravel project to the ‘public_html’ directory… but then to run the app I’d need to browse to http://example.com/public/. Worse still, my whole framework file-structure will be visible if I browse to http://example.com

    Solution: With a little path remapping in two files, this can be easily achieved. Here’s what I did:

    1) Create a new directory called ‘laravel4’ adjacent to ‘public_html’ so that your remote file structure now looks like this: (more…)

  • Accessing selected payment type in Shopp Summary.php (Checkout and Order Confirmation page)

    Problem: Someone on the Shopp Helpdesk asked how they could display the payment type that a customer had just selected, on the following Order Confirmation page. They were using multiple ‘Offline Payment’ type options, and presumably they needed the customer to be able to visually confirm what they’d selected. As far as I can see, there’s no template tag provided for this.

    Solution: All sorts can be pulled from the ShoppShopping() object directly. In this case the following worked:

    data->Order->Billing->cardtype; ?>

    Bonus: To display the same info in reciept.php, the following can be used:

  • cPanel Monthly Licensing in the UK for Rackspace Cloud Server

    Problem: Ok not really a problem, but I’m trying to create a server set comprising as much UK based kit/software/support as possible. The server is on Rackspace’s UK Cloud arm.

    Fix: After searching about it looks like LicensePal is a UK company.

    Help me: If you found this link useful, and you’re about to order, please visit License Pal via my Affiliate link (you’ll get one also as soon as you buy anything from them): – Cheers!

  • Using Mac Image Capture with Nikon D70 (Direct Cable connection)

    Problem: Recently I dug out my old Nikon D70 to take some pics on holiday. When I connected it to my Mac (OS X v10.8.4) via the USB cable, Image Capture fired-up as expected, but when I tired to Import them I got an error stating that Image Capture was unable to import the RAW images.

    Solution: It turns out that the USB mode needs to be ‘M’ now, (Mass Storage Device Mode). To set this:

    1. Press ‘Menu’ on the D70 (after disconnecting it from the Mac.
    2. On the far left of the menu, select the spanner icon to enter the ‘Settings’ sub-menu.
    3. In the Settings menu, scroll up/down to get to the ‘USB’ setting.
    4. Enter the USB setting, and set it to ‘M’ rather than ‘P’ (Picture Transfer Protocol).
    5. Reconnect the USB cable, and the images should now import ok.
  • Intel Rapid Storage Technology alerts to Google Apps account

    Problem: Intel Rapid Storage Technology allows for system warning and error alerts to be sent to an email address (or several if you want). In the mail settings it does allow for the port to be set, but there aren’t any authentication options.

    Solution: Contrary to my previous beliefs, Google DOES seem to allow you to send unauthenticated on port 25 as long as it’s addressed to an address in your own domain. So I set:

  • FROM address to ‘app@mydomain.com’
  • TO address to ‘myaddress@mydomain.com’
  • Port to ’25’
  • Host to aspmx.l.google.com
    • And it works.. now I don’t get this.. surely it’s an open relay then? Comments?

  • Get ID of the WordPress ‘Front Page’ in Theme’s functions.php

    Problem: I wanted to add some Meta Boxes to the homepage only, and have them only visible in WP-Admin when editing that page.

    Solution:  Provided that a page has been selected in wp-admin > General Settings > Reading Settings > A Static Page [Front Page], then this code can be used to pull that value out as a Page ID: (more…)

  • phpMyAdmin Fatal Error with imageftbbox() after clicking ‘Profiling’ checkbox

    Problem: I accidentally clicked the ‘Profiling’ textbox in the Browse view of phpMyAdmin (see image below) and it immediately redirected the page and spat the following error:

    Fatal error: Call to undefined function imageftbbox() in /Users/[whatever]/Sites/phpmyadmin/libraries/chart/pChart/pChart.class on line 1118

    (more…)

  • Fabia 1 vRS windscreen wipers and not working as expected…

    Problem: My front windscreen wipers stopped working yesterday. Oddly when trying to use the momentary front windscreen wash, the REAR wiper worked.

    Fix: Replace fuse 21.. simple but effective.

  • Remove Links menu item in WordPress

    Problem: I’m customising a WP install for a client, adding some Custom Post Types and wotnot, and they aren’t going to have any need for the Links thing.

    Fix: Adding this to your theme’s (or child-theme’s) functions.php removes the page and the menu link: (more…)

  • Cheap & simple fix for a leaking fermenting bin (homebrew)

    Problem: I’ve just put a brew on using some cheap equipment from an online retailer. The lid of the fermenting bin is loose fitting so the beer is gassing around the lid or through the airlock grommet and not through the airlock / bubbler itself. This is not really a problem while the Krausen is building and lots of gas is being produced, but can be a problem when things slow down, and air gets in. (more…)