Category Archives: Personal

Octopus Energy Referral Code for £50 Credit & Charity Donation

Octopus Energy offer a £50 referral discount with this code here

https://share.octopus.energy/peach-hawk-73

Using the code will give £50 credit to both of our accounts, or £100 each if you have a business account.

However, if you use the code, rather than keeping the £50, I will either:

  • Send you £25 and donate the other £25 to charity.
  • Donate the full £50 to charity.

After using the code, drop me an email with your full name, bank details, and preferred charity. I will transfer you £25 once the referral is confirmed. If you don’t email, the full £50 will be donated to a charity of my choice.

Please note, Octopus Energy takes a few months to process the payment, so donations will be made once everything is confirmed.

Either way, you will be contributing to a charitable cause. Use the code now and email me to make a difference!

Remembrance Sunday – Poppies at Conisbrough Castle

In remembrance for 100 years of the Battle of the Somme, local people and businesses donated towards lighting up Conisbrough Castle.

The castle was lit up for 3 days, and raised well over £1500 for British Legion and the renovation of the local cenotaph/park.

It is estimated over 5000 people came to visit and view the display. The display even appeared on BBC News!

I took lots of pictures, here’s a selection of mine:

Magento Order Status Flow

With Magento, the order status flow can be quite confusing.

The following diagram from MBS is useful in understanding the status flow:

It’s worth noting the following too:

  • An order can be “held” from any state/status in Magento
  • When “Unholded”, it goes back to the previous state/status
  • Once an order is “Cancelled” or “Closed”, it’s impossible to change state or status (except “Hold”)
  • An order cannot go to “Complete”, until everything is invoiced and shipped
  • An order cannot go to “Closed”, until all it’s items are refunded

Magento Order Status Flow

URL Encode String in SQL

URL Encoding is the transformation of special characters into a form which can be passed over the internet. A good example being ” ” (space) which should be replaced by “%20%”.

The following SQL function can be used to URL Encode a string in SQL:

CREATE FUNCTION dbo.UrlEncode(@url NVARCHAR(1024))
RETURNS NVARCHAR(3072)
AS
BEGIN
    DECLARE @count INT, @c NCHAR(1), @i INT, @urlReturn NVARCHAR(3072)
    SET @count = LEN(@url)
    SET @i = 1
    SET @urlReturn = ''    
    WHILE (@i < = @count)
     BEGIN
        SET @c = SUBSTRING(@url, @i, 1)
        IF @c LIKE N'[A-Za-z0-9()''*\-._!~]' COLLATE Latin1_General_BIN ESCAPE N'\' COLLATE Latin1_General_BIN
         BEGIN
            SET @urlReturn = @urlReturn + @c
         END
        ELSE
         BEGIN
            SET @urlReturn = 
                   @urlReturn + '%'
                   + SUBSTRING(sys.fn_varbintohexstr(CAST(@c AS VARBINARY(MAX))),3,2)
                   + ISNULL(NULLIF(SUBSTRING(sys.fn_varbintohexstr(CAST(@c AS VARBINARY(MAX))),5,2), '00'), '')
         END
        SET @i = @i +1
     END
    RETURN @urlReturn
END

In order to use the function, call it as follows:

SELECT dbo.UrlEncode('This is a test, *&%"£$')

This gives the following result:

This%20is%20a%20test%2c%20*%26%25%22%a3%24

Thanks to Peter DeBetta for the SQL.

Magento Web Service Calls Maintenance Mode – SOAP-ERROR: Parsing WSDL

I’ve had an ongoing issue with a Magento installation. When the maintenance mode is turned on (with access restricted to a few ip’s), web service calls using v2 SOAP API throws the following error:

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://**URL**/index.php/api/v2_soap/index/?wsdl=1' : failed to load external entity "http://**URL**/index.php/api/v2_soap/index/?wsdl=1"

The web service worked correctly when the site was not in maintenance mode.

After lots of research, managed to find the solution. Basically Magento itself was throwing the error as it uses the PHP SoapServer to create the API. This object needs access to Magento in order to function correctly. As maintenance mode was enabled, the SoapServer didnt have correct permission, so was getting the holding page and throwing the error.

In order to fix the issue, the IP address of the server needed adding to the exceptions for the maintenance mode. Full details on how to do this here – Magento Maintenance Mode

Once the IP was added to the white list, the web service calls started working again correctly.

Fitbit One Not Syncing Android

I’ve recently been having an issue with the Fitbit One. The fitbit is an electronic pedometer/sleep tracker, with nice graphical display and syncs to your mobile device /computer, showing your stats online.

All of a sudden the fitbit stopped syncing with my HTC One M8.

Fitbit’s website has several instructions for fixing the issue, ranging from force closing and uninstalling the app, to resetting the device.

Unfortunately none worked for me. I’ve even emailed their support team with no reply.

image

However I did find a solution, going into the Bluetooth settings and renaming the device.

My guess is that changing the name forced the devices to resync.

Official steps resolving Syncing issues with Android

Raspberry PI 2

Just seen the release of Rapberry PI v2. All I have to say is.. wow…

I love the Raspberry Pi, with its ability to solder on wires which can do funky things such as turn on a light, detect motion or even spin motors.
image

The new version 2 comes with 1GB of RAM, Quad core 900mhz processor. That’s double the memory and six times the processing power compared to previous B+… Plus can even run Windows 10!

More Information on Raspberry Pi 2

Tesco Christmas Gifts

Following on from yesterday’s blog post which covered Party Food, in this post I’m going to cover Christmas Gifts.

As noted in my previous post, I’m a member of Tesco’s Orchard Program. This program rewards me with money off vouchers in order for me to sample goods and review them either online, via Facebook, Twitter etc.

Buying online was a breeze, shopping via Tesco Direct‘s website and getting delivered to my local store (less than 10 minutes away). No hanging about waiting at home to have a parcel delivered!

I ordered some presents for family for Christmas and these where available next day for collection. The range was quite large and was pretty comparable to the large competitors such as ARGOS etc. Although it’s worth noting that Tesco has gone down the Amazon route and let other sellers list on their site. Therefore you need to filter on “Sold By Tesco” if you want to have it delivered to store.

Through TopCashBack (see my blog post Get paid to shop), I also received a 0.5% cashback on top of my spend. (I know it’s not much, but as they say, every little helps!)