• How to change a folder icon to a picture in Mac OS X

    In an earlier post I showed how I set my screenshots to save in a custom folder rather than onto my desktop (I seem to take a lot of screenshots). I also shared a little camera icon that I made for it. One of the comments asked how I changed the folder icon, so I’ve made a 30 second screen recording to show how.

    1. Go to web page that has the image you want
    2. Right click image (or ctrl + left click)
    3. choose Copy image
    4. select folder you want to change the icon for (single left click the folder)
    5. Press cmd + i keys together (opens the info pane)
    6. left click folder icon shown in the top left of the info pane (it will get a blue highlight border)
    7. Press cmd + v keys together (this is the shortcut for paste). You’ll see the image will have replaced the folder icon.


  • VMware consolidated backup missing a catalogue file – fixed!

    As always seems to be the case, a routine update of server software becomes a problem. This time it was updating VMware ESXi from 4 to 5. I know, I’m a little behind the times, but it was working, and it’s only a small office server… and I should have left it alone, sigh.

    So, shutdown the Virtual Machines, overnight copy them all over the network to my laptop and a handy external disk. – Done.
    Note: I probably should have used the VMWare standalone converter to copy them, rather than just copy them direct from the datastore.
    This morning, in at 8am, install the new ESXi (having lost two hours ’cause the DVD on the server was playing up).

    Start restoring the Virtual Machines. First a non important one… all good

    Second, the most important one, our file server…. uh oh.

    "The VMware Consolidated Backup source ... has a missing catalog file."

    Several hours of trying to fix it, editing files trying different versions of the VMWare standalone importer (which may have helped, I’m not sure),
    I solved it by Opening the Virtual Machine in VMware Player,
    which spotted the problem (I had the VM disks split across two datastores but I’d saved them into one folder), asked me to tell it where they were, and that fixed it for VMware player, which also meant the importer was happy again.

    PS – I also realised why I never upgraded from VMware ESXi 4. Version 5 takes away a lot of the essential functionality from the vSphere software. That makes ‘it not a lot of use’ for me. Still, it was free. So having fixed the import, I’m now waiting to import it back to a fresh install of version 4. At least I finally set up the 3+1 raid 5 (instead of the 2 sets of raid 1 left over from the original disks and an upgrade 2 years ago).


  • A quick note on my first steps using stripe.com

    I’m building a web site for a charity that needs to take credit cards for tickets being sold. I’ve chosen to use stripe.com as:

    • It’s simple to implement
    • They take care of all the security and PCI DSS (I never get any card details to save, that’s a good thing).
    • It’s not expensive (compared to other options like having a merchant account for the charity).
    • I couldn’t get away with using existing services (eg: eventbrite, picatic, etc)

    Users don’t have to register on this charity site (essentially it’s selling a one off event ticket) so my process is:
    1) Vistor completes form and submits [let’s call it ‘Registration’]
    2) Server validates form (email address present, other information entered, etc)
    3) Server sends page with Stripe pay now button. That button contains the code to precomplete some of the stripe form (eg: the email address).
    4) Vistor clicks stripe button, enters card details which are sent direct to the stripe server (ie: not through my server)
    5) stripe returns a ‘token’ that can be used to charge the credit card and visitor is directed to my ‘charge’ page with their token (sent as a https post request).
    6) when my /charge page is requested, My server can request the card is charged using the single use stripe token. Then thank the customer for paying.

    I wanted to record the payment as processed against my Registration_ID, and thought I would be able to use the browser session to link the stripe request with a specific registration. It didn’t work, every test transaction came back with nothing in the session. It was as if the session was being refreshed every time a Stripe transaction occurred.
    After several hours of frustration, I tracked it down to rails built in CSRF protection.
    As the post form is coming via Stripe, it won’t read the session cookie from the browser and resets it.

    All I have to match the registration record with the stripe transaction is the visitors email address. This obviously causes problems if:

    • A visitor wants to buy more than one registration on the same email address
    • A visitor changes their email address during the stripe process (not easy for them to do, but possible).

    However, it’s the best I’ve got so I’ll have to write some backup code to prevent two registrations on one email address (they’ll have to get in touch and pay another way) and raise an error if the email address that stripe got is different from the address in our records (the charity will have to match the records manually which isn’t difficult for such a small event).

    Here’s the part in my dev log that help me find the problem, along with this blog post on kalzumeus.com.

    Started POST "/registers/charge" for 127.0.0.1 at 2014-03-14 16:12:34 +0000
    Processing by RegistersController#charge as HTML
    Parameters: {"stripeToken"=>"tok_1234sometokendata", "stripeEmail"=>"asdf@asdf", "stripeBillingName"=>"CARDNAME", "stripeBillingAddressLine1"=>"asdf", "stripeBillingAddressZip"=>"ME13 9AB", "stripeBillingAddressCity"=>"Faversham", "stripeBillingAddressState"=>"Kent", "stripeBillingAddressCountry"=>"United Kingdom"}
    WARNING: Can't verify CSRF token authenticity


Search this site


Free apps

  • birthday.sroot.eu – Your birthday or other celebration date based on [years on other planets] / [how many seconds/days] / [how far you’ve travelled around the sun]
  • stampulator.sroot.eu – Calculates the combination and how many 1st, 2nd, large 1st and large 2nd class Royal Mail stamps you need on large envelopes and packets

Recent posts


Archives


Categories