Wednesday, 19 September 2012

Zencart on NGINX: Cannot Login to Admin

This week, we're set up a new server with Ubuntu 12.04 and NGINX. When we put a copy of Zencart on it, everything was great apart from teh admin login, which went into an 'infinite loop' and refused to log us in.

The solution was simple to do, although desperately hard to find - hence its appearence here:

Login to the server as root and edit the /etc/nginx/fastcgi_params file:

Simply comment out (add # at the beginning of the line) to the line that says:

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

Now restart nginx and you're done!

[UPDATE: you may need to check the lines in your configure.php file from the admin directory - they need to point correctly, without using the PHP_SCRIPT line:


  define('DIR_WS_ADMIN', '/#your admin folder#/');
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_ADMIN', '/#your admin folder#/');

Monday, 30 July 2012

Lose 'Duplicate' and Replace with 'Save As' in Mountain Lion

A great post using keyboard shortcuts and the System Preferences from:
http://www.tuaw.com/2012/07/29/get-save-as-back-on-mountain-lions-file-menu-easily-and-without/



Much rejoicing accompanied the news that Mountain Lion brought back the "Save As..." option (which had been taken away in Lion and replaced with the not-nearly-the-same-thing "Duplicate" command). Unfortunately, Save As was relegated to a sub-menu which could only be seen if you held down the Option key, or you could use the not-very-convenient keyboard shortcut Command+Shift+Option+S.
For some reason, that keyboard shortcut never worked for me, so I decided to remap it using System Preferences.
Since I am never, ever, ever going to use the "Duplicate" item, I decided that I would remap "Duplicate" to something else, and restore Command+Shift+S back to its rightful spot as "Save As..."
I went to System Preferences » Keyboard » Keyboard Shortcuts and selected "All Applications" on the right side. Then I clicked the plus-sign under the right column and added "Duplicate" for "All Applications" to be the keyboard shortcut Command+Shift+Option+D (aka "I am never going to use this shortcut and don't want to press it accidentally").
Then I did the exact same thing, except this time I used "Save As..." for the menu. Note that both "Save" and "As" must be capitalized, and you must use a proper ellipsis character at the end. On a Mac with the US-English keyboard, you can get this by holding down the Option key and typing a semi-colon.
VoilĂ ! This will now work in every Mac application which has a Duplicate and/or Save As... menu. If an app does not have one of those menus, it will just ignore the keyboard assignment. You could also assign this for specific apps if you only want to use it in certain apps.
An unexpected but very pleasant side effect of making this change is that OS X makes the "Save As..." menu item visible again even without holding down the Option key.
Before (no Save As... visible):
After (welcome back old friend!):
Quite frankly, I think I would have paid $20 for this alone.
If you don't mind Apple's suggested keyboard shortcut for Save As... but would like it to show up on the menus, all you have to do is rename the Duplicate menu item (as described above). Once that was renamed, the "Save As..." menu item appeared. I only added the custom keyboard shortcut for that because I wanted it to respond to Command+Shift+S as it had always done before Lion.
Update: Great tip from 'rbascuas' in the comments: if you remap "Duplicate" to "Shift+Command+Option+S" then "Duplicate" will be hidden (until you hold down the Option key) and "Save As..." will still be shown. That is even better because then I don't even have to see the Duplicate command, unless I want to use it, which I never will.

Friday, 25 May 2012

Panic 2 - The best web editor/creator for Mac - install and configure with SVN

If you've been waiting for the best web editor for MACs, its available now - Panic's Coda 2. There are some fantastic new features, including a MYSQL feature that seems to do everything I used Navicat for - this alone is worth the price.

Configuring Coda to work with SVN is fairly straight forward. I've copied this code from :



http://www.midwinter-dg.com/permalink-how_to_use_subversion_version_control_with_coda_on_the_mac_2010-11-18.html


mainly as it works well but the site its on is almost unreadable.
For those of you who don't know, Subversion is a version control system. Basically it enables you to track all changes to a project. It gives added security and control to the integrity of your work enabling you to compare a document with any previously saved version, and revert to, or merge different versions of a document.
Coda for MacIn this tutorial I will show you how to set up Subversion to work with Coda on the Mac. Coda from Panic Inc. is my app of choice when it come comes to web development on the Mac — it may not do everything, but it does a lot and it makes working with Subversion a cinch!
1.First you need to get yourself a copy of Subversion. Go tohttp://www.open.collab.net/downloads/community/ and download the latest binaries, then install. (the installer will install Subversion to: /opt/subversion/bin/svn).
terminal.app2.The next thing you need to do is create a repository. The repository is where all of your versioned data will be stored. You can locate it anywhere you like, personally I have mine in my home directory, where I also have the directory that is the root level of my localhost server. To create the repository, you need to access the command line. Open a terminal window and navigate to your chosen location (in my case: cd/Users/duncan/) and then create the repository: svnadmin create SVNrep - this will create a repository in the home folder called SVNrep.
3.OK, now that SVN is installed and you've created a repo, you need to configure it. In the Finder, open the directory 'conf' that resides inside your repo. (in this case/Users/duncan/SVNrep/conf/). Using a text editor, open the files svnserve.conf and passed. In svnserve, you need to uncomment and amend the following lines:
anon-access = none

auth-access = read

password-db = passwd

realm = My Repo
Save and close this file, then add a line to the passwd file to set your username and password, for example:
myusername = mypassword
Then save and close the passwd file.
4.Now to add your project to the repo - again, this will be done using the command line. Again, I'm assuming that you have many sites on the go, and each is sitting in a separate folder on your server - let's say you have one called 'my_great_site'. To add this to the repo type the following:
svn import my_great_site file:///Users/duncan/SVNrep/my_great_site -m "Initial import"
The path will be different for you depending on where you have put your repo and what you have called it.
5.Now you can delete you site as its safely stored in the repo (OK, you don't want to delete it, just move it out of the root level of your server and archive it somewhere).
6.To work on your site, you need to checkout a 'working copy' from your repository (terminal again!). Type the following:
svn checkout file:///Users/duncan/SVNrep/my_great_site Webserver/my_great_site-SVN
As before you may need to adjust the paths depending on A. where you repository is (in this case: /Users/duncan/SVNrep, and where your server root is:/Users/duncan/Webserver/ ). The final -SVN is not necessary, it's just my way of visually marking the project as being under version control.
Coda preferences
7.OK, now the project has been checked out, it's time to update your site settings in Coda. First, open the preferences - Coda > Preferences... and click on the 'Files' tab. Enter/opt/subversion/bin/svn into the 'Subversion Tool Path:' field, then close the preferences.
8.Nearly done, now it's time to update your site settings in Coda. Open the 'Sites' tab and click on the 'i' icon for your site. (pic). If you added -SVNto your checked out copy (or called it something different entirely, you will need to adjust the 'Local URL:' and 'Local Root:' fields). Now scroll down to the bottom, and expand the 'Source Control' section. Check the 'Enabled' checkbox and then enter you username and password that you set up in stage 3. If the Repository URL is not already set, close the sites panel and open it again. If it's still not set you may need to add it manually - in this case it would be:file:///Users/duncan/SVNrep/my_great_site
Coda sites panel
9.That's it - your site is now under source control, check out the 'Managing Files With Source Control' section of the Coda Help files - enjoy!

Thursday, 22 March 2012

Paying Online for School Trips

One fo the sites we look after is the school website where the children go:


http://www.longfleet.poole.sch.uk


A new link went on today - http://www.scopay.com/longfleet. It even gets a nice little logo - but the simple idea is to let people pay for the school trips online. Does that mean we have even fewer excuses now?

Dead iPhone4 - nope, no just yet!

Bad news this morning - the iPhone (4) went dead... Just after my youngest had finished watching Peppa Pig...


So at least I had someone to blame.


No amount of charging/connecting/disconnecting could get anything out of it.


No silver Apple logo, nothing.


BUT it turns out that it just needed a 'Hard Reset':


Do a hard reset. Hold down both the power button and the home screen button at the same time for 30 seconds. It probably got locked up.


Nice, easy, and a lot cheaper than a drive to the nearest Apple Store!

Monday, 12 March 2012

Create a Bootable Lion Install DVD


Part 1: For all types of media
  1. Once you’ve purchased Lion, find the Lion installer on your Mac. It’s called Install Mac OS X Lion.app and it should have been downloaded to /Applications.
  2. Right-click (or Control+click) the installer, and choose Show Package Contents from the resulting contextual menu.
  3. In the folder that appears, open Contents, then open Shared Support; you’ll see a disk-image file called InstallESD.dmg.
  4. Launch Disk Utility (in /Applications/Utilities).
  5. Drag the InstallESD.dmg disk image into Disk Utility’s left-hand sidebar.

Part 2: Burn the Image

1. Burn the Image...


Wednesday, 29 February 2012

Using a D-Link 615 to Extend an Exisiting Wireless Network

So, this is a bit obscure, but, let's say you have a D-Link 615 wireless router spare (maybe the old one Virgin Media used to send out...) and you'd like to use it to let 3 or 4 wired clients connect to an exisiting wireless network.


There are 2 links to check out, and I've copied the content from the second one here - Its a run down of the instructions of how to set up Wireless Client Mode - once you have got the relevant firmware onto the route.


I used the firmware for version D3 on my router, which is officially version D4.
Once you have the DD-WRT firmware installed - which is dead easy - teh next bit is easy, assuming you take it one step at a time.


With Those thoughts in mind, here is how to configure it:
  1. Download the current recommended build for your router. Check the forum for your chipset to find recommended builds and general information related to your hardware. If you are using a Broadcom based router, read the peacock thread prior to starting. DO NOT USE SP1!
  2. Do a HARD reset on your router.
  3. Connect a cable from your computer to the LAN port on your router.
  4. Set your computer to a static IP address (e.g. 192.168.1.7)
  5. Open a web browser and connect to 192.168.1.1 to view the DD-WRT GUI.
  6. You should be asked to change your password and username. Carefully type these in. If you aren't asked for a password and username, do a hard reset, this time doing it properly! Hit change password.
  7. FIRST go to Wireless -> Wireless Security and enter the Security Mode and other key information that matches your primary router that you will be connecting to over wireless.
  8. Hit SAVE (not apply)
  9. NEXT go to the Wireless -> Basic Settings and change the Wireless Mode to Client.
  10. On that same tab set the Wireless Network Name (SSID) to exactly the same SSID as your primary router you will be connecting to over wireless. Make sure spelling and capitalization match. Note: If there are multiple routers broadcasting the same SSID, and you would like to connect to a specific one (IE, the primary router, instead of the repeater), enable MAC Filtering on the Wireless Tab, and add the MAC Address of the correct Access Point. The MAC Address can be found on the "Site Survey" page, linked from the "Wireless" Sub-tab of the "Status" Tab. - Conjur
  11. (Optional) Set the correct ack timing in meters. (Where?)
  12. Hit SAVE (not apply)
  13. NEXT go to Setup -> Basic Setup and change Connection Type to Automatic Configuration - DHCP (most likely, but see NOTE below).
  14. On that same tab in the Network Setup section set the Local IP Address to 192.168.2.1 (Your Client subnetMUST differ from the Primary Router subnet!).
  15. (Optional) Set Static DNS servers in the Network Address Server Settings section if your WAN type does not provide them or you want to use different ones than the AP provides.
  16. (Recommended) Change your Time Zone and DST to match where you are.
  17. (Optional) Set a Server IP/Name for in Time Setting section for NTP (it will use a hidden default server if you leave it blank).
  18. Hit SAVE (not apply)
  19. (Optional) Go to Security -> Firewall and disable the SPI Firewall if you do not need to worry about security between the AP and Client router.
  20. Hit Apply.
  21. Set your computer back to auto IP and auto DNS if you like. You will get a DHCP address from the router.
You are done and the Client router should connect to the AP within a minute or so. You may need to unplug the router for 17 seconds if the router doesn't reset. After you ensure that it does connect and work properly then you may configure any other settings you wish to (Virtual Interface for wireless connection for example).

Links:

Thursday, 23 February 2012

Tweaking content for IE6

The bane of our lives - corporate users at Thomas Cook and various police authorities still use IE6.
So, we stopped trying to update the lovely popup menus, and created subject homepages for top level access to subpages.
Rather nice, simple,  results at:
http://pwluk.com
- click on 'About Us' rather than a sub option...

Speed Up 2009 MacMini

Soooo, we have a brilliant MacMini that we use as a server and occasional workhorse.

It was in need of a boost, so we put in a Corsair SSDIII 120Gb Hard Drive using the video from OWC:



http://www.youtube.com/watch?v=tIiSaunTWWM




The result - fantastic performance and at least another 2 years' work!

Friday, 13 January 2012

Why the World should use 'Time Machine'


So...


Yesterday afternoon, my 2009 MacMini froze and would not reboot.


"Not to worry" I thought. I have a script that shuts down Time Machine at 9am, but turns it on at 9pm - in effect forcing it to do a daily backup without crushing the performance of the Mac during the day.


So I inserted the OS disc (Lion) and restored the drive. I've never had to do this before, but its awesome - took 4.5 hours, but that seems fair given the amount of stuff on it.


Everyone should have Time Machine - or buy a Mac to get it. I've always assumed it would work, but never needed to test it.


The end result is I've lost a few client files I was working on, but nothing major.


The only question that remains is - am I right in thinking that the HDD is on its way out - it kept hanging on boot-up, but did not show errors in Disk Utility? The restored system seems fine, so I can't imagine its a logic board/RAM thing.

Thursday, 12 January 2012

Resetting Home Key on iPhone 4

So, the home key on my iPhone was becoming really unresponsive, like pretty much broken. Of course the phone is out of warranty.


BUT never fear - I found this at the Apple community:


Reset Home Button Steps:

(1) Tap Settings App, when open:
(2) Hold Power button until "slide to power off" bar appears.
(3) Don't slide it, release power button.
(4) Gently, continuously press Home button for few seconds until home screen appears.
(5) Done.

If this does not help, further points to Hardware Problem.