Wednesday, 16 October 2013

Fixing the 403 Error on Mac OS X 10.8 Web Sharing

It seems to become increasingly difficult to get the built-in apache on our Macs to play nicely with virtualhosts...
Following the standard procedure from a numberof forums and support pages, I changed on "AllowOverride None" to "AllowOverride All" in my /etc/apache2/users/USERNAME.conf file, and all of my sites started to be forbidden.
I changed it back and and then changed it only for one site in my httpd-vhosts.conf file, and only that site was forbidden.
After looking at the logs and seeing the problem was with url rewriting and the lack of FollowSymLinks, I went back to the USERNAME.conf file. I switch "AllowOverride None" to "AllowOverride All" and added "Options +FollowSymLinks" on the next line.
Things started working. I came from using xampp on windows and it had a lot of these settings already set server-wide for dummies like me.

Tuesday, 21 May 2013

Adobe Creative Suite for Free (CS2)

This is from a really old post, but it still works and was dead useful when we were ressurecting an old PowerPC G4 Mac.

Don’t get excited, yes it seems to be free but no, it is not the latest version. I have read on multiple Web sites that Adobe is giving away CS2 suite, it seems to be real but the download page reports errors. That may be due to the heavy demand to download overloading the servers. Although it is several generations old, the core feature set of Photoshop will be there, of course you can download the other products in the suite as well.
Keep the following information handy if you are interested in downloading the software:
The download link: CS2 Download
Full suite serial number: 1130-0412-8377-1896-9751-5759
Photoshop CS2′s serial number (Win): 1045-1412-5685-1654-6343-1431
Photoshop CS2′s serial number (Mac): 1045-0410-5403-3188-5429-0639
First heard on PetaPixel

Thursday, 16 May 2013

SagePay Test Card Numbers and Payment Details


Sagepay is one of the most popular online payment processors in the UK. These details come from a couple of support pages and blogs but give you all the detail you should need in one place. Remember to set the url of the test server to test.sagepay.com...

Test Card Details:

Card TypeCard NumberCard ExpiryIssue NumberCV2 ValueAddress NumberPost Code
Visa492900000000612/15N/A12388TE4 12ST
Visa Delta446200000000000312/15N/A12388TE4 12ST
Visa Electron UK Debit491730000000000812/15N/A12388TE4 12ST
Mastercard540400000000000112/15N/A12388TE4 12ST
UK Maestro564182000000000512/150112388TE4 12ST
International Maestro30000000000000000412/15N/A12388TE4 12ST
Solo633490000000000512/15112388TE4 12ST
American Express37420000000000412/15N/A123488TE4 12ST
Japan Credit Bureau356999000000000912/15N/A12388TE4 12ST
Diners Club3600000000000812/15N/A12388TE4 12ST



Additional Details for all cards:
  1. Expiry Date: any date in the future
  2. CV2: 123
  3. Billing Address: 88 (you only have to use this on the first line)
  4. Billing Postcode: 412
  5. 3D Secure Password: password



For Testing Server Only

Please note that there are no card details that will work with their live server setting, all of the above details will only work with the Sagepay test server.

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.

Tuesday, 29 November 2011

Copy an.ISO image to a USB Stick on a Mac

Disk Utility, for whatever reason, is prohibited from writing Joliet (ISO 9660) onto MS-DOS FAT 32 Flash Drives, though it should definitely work.

The best way to accomplish your goal is the following:

Open Terminal

Type 'diskutil list'. You'll see your primary hard drive (probably listed under /dev/disk0) and your Flash Drive, which will be listed as /dev/disk#, with # being any number that isn't zero. REMEMBER THE DISK LOCATION

In the next line, type 'diskutil unmountDisk /dev/disk#'. You'll see this message on success:
Unmount of all volumes on disk# was successful

Now type, 'dd if=(DRAG ISO/DMG HERE) of=/dev/disk# bs=1m'

Thursday, 27 October 2011

Install iLife from MacBook Air USB Key

Stick the USB stick into another Mac and try the command below in Terminal:

open /Volumes/Mac\ OS\ X\ Install/Packages/iLife/iLife.pkg

Friday, 21 October 2011

Get the text from a PDF

I needed this at short notice, and it works flawlessly.


I like the use of PDF’s, they work well and (usually) appear the same on ever computer. One of the advantages of PDF’s is the text embedded within the file, and the abilty to manipulate. Although many PDF readers have functions to copy and paste text, whats quicker than creating an Automator script to extract PDF text into a text file.
This process only take a couple of steps so read carefully.
1) Open Automator, found in Applications > Utilities
2) In Automator drag out “Get Selected Finder Items”, then “Extract PDF Text”. I recommend changing the output option to Rich Text.
3) Save the file. Either as an application or a file.
4) Test. Drag a PDF file onto the Automator file and let it do its work, after a short time you will have a text file with the extracted text.

Wednesday, 15 June 2011

How To scp, ssh and rsync without prompting for password


Whenever you need to use scp to copy files, it asks for passwords. Same with rsync as it (by default) uses ssh as well. Usually scp and rsync commands are used to transfer or backup files between known hosts or by the same user on both the hosts. It can get really annoying the password is asked every time. I even had the idea of writing an expectscript to provide the password. Of course, I didn't. Instead I browsed for a solution and found it after quite some time. There are already a couple of links out there which talk about it. I am adding to it...

Lets say you want to copy between two hosts host_src and host_dest. host_src is the host where you would run the scp, ssh or rsyn command, irrespective of the direction of the file copy!
  1. On host_src, run this command as the user that runs scp/ssh/rsync
    $ ssh-keygen -t rsa
    This will prompt for a passphrase. Just press the enter key. It'll then generate an identification (private key) and a public key. Do not ever share the private key with anyone! ssh-keygen shows where it saved the public key. This is by default~/.ssh/id_rsa.pub:
    Your public key has been saved in <your_home_dir>/.ssh/id_rsa.pub
  1. Transfer the id_rsa.pub file to host_dest by either ftp, scp, rsync or any other method.
  1. On host_dest, login as the remote user which you plan to use when you run scp, ssh orrsync on host_src.
  2. Copy the contents of id_rsa.pub to ~/.ssh/authorized_keys
    $ cat id_rsa.pub >>~/.ssh/authorized_keys
    $ chmod 700 ~/.ssh/authorized_keys
    If this file does not exists, then the above command will create it. Make sure you remove permission for others to read this file. If its a public key, why prevent others from reading this file? Probably, the owner of the key has distributed it to a few trusted users and has not placed any additional security measures to check if its really a trusted user.
  1. Note that ssh by default does not allow root to log in. This has to be explicitly enabled on host_dest. This can be done by editing /etc/ssh/sshd_config and changing the option of PermitRootLogin from no to yes. Don't forget to restart sshd so that it reads the modified config file. Do this only if you want to use the root login.
Well, thats it. Now you can run scp, ssh and rsync on host_src connecting to host_dest and it won't prompt for the password. Note that this will still prompt for the password if you are running the commands on host_dest connecting tohost_src. You can reverse the steps above (generate the public key on host_dest and copy it to host_src) and you have a two way setup ready!