Press "Enter" to skip to content

Richy's Random Ramblings

Varnish: Unable to start: SHMFILE owned by running…

If, when trying to start the Varnish reverse proxy server, you receive an error message such as:
[root@internet634.fbi.gov ]#/usr/sbin/varnishd -d -f /etc/varnish/default.vcl
GeoIP plugin loaded successfully.
storage_file: filename: ./varnish.8QhQpI size 4208 MB.
SHMFILE owned by running varnishd master (pid=2451)
(Use unique -n arguments if you want multiple instances.)

but “ps auxwww | grep 2451” doesn’t show Varnish (in my case, it was dkim-milter on that pid) and “ps auxwww | grep varnish” shows nothing, then you need to manually reset Varnish’s SHMFILE settings.

This is easier done than said! Just go into /var/lib/varnish/[hostname] and delete all the files in there (such as varnish.8QhQPI and _.vsl). Restarting varnish should then be successful.

PHP: Magento – current stock value

If you run the Magento ecommerce shopping cart software and you want to find out how much your stock is worth, how many product lines you have stocked and how many individual items you have, you may find the following MySQL query handy.

I’m assuming that you’ve created an attribute with the attribute code “supplier_price” as a decimal, that you’ve kept this field up to date and your stock levels are accurate 😀 If it isn’t called “supplier_price” change the appropriate part in the query.

SELECT
COUNT(sku) AS 'products_stocked',
SUM(qty) AS 'items_in_stock',
SUM(stockvalue) AS 'stock_value'
FROM (

SELECT
catalog_product_entity.sku,
cataloginventory_stock_item.qty,
catalog_product_entity_decimal.value,
(cataloginventory_stock_item.qty * catalog_product_entity_decimal.value) AS stockvalue
FROM
cataloginventory_stock_item,
catalog_product_entity,
eav_attribute,
catalog_product_entity_decimal
WHERE
catalog_product_entity.type_id='simple' AND
cataloginventory_stock_item.product_id=catalog_product_entity.entity_id AND
catalog_product_entity_decimal.entity_id=catalog_product_entity.entity_id AND
eav_attribute.attribute_id=catalog_product_entity_decimal.attribute_id AND
eav_attribute.attribute_code='supplier_price' AND
cataloginventory_stock_item.qty > 0
ORDER BY sku ASC) AS b

UK Post code Lookup prices compared

Following on from my Voice Over IP Call Costs Compared post, I’m now looking at differing costs of looking up UK Postcodes.

Prices exclude VAT and are based on a single UK Premises address level lookup on a public facing website and buying the smallest credit pack possible for the number of lookups.

Company Price per lookup Minimum purchase Credit length
200 lookups 500 lookups 1,000 lookups 2,000 lookups 5,000 lookups

Postcode Software £0.0300 £0.0300 £0.0176 £0.0176 £0.0176 500 lookups
£15
12 months
Crafty Clicks
Pay as you go
£0.0300 £0.0300 £0.0300 £0.0300 £0.0200 300 lookups
£9
12 months
Crafty Clicks
Monthly plan
£0.0175 £0.0150 £0.0150 £0.0150 £0.0125 250 lookups
£4.38
1 month
Postcode Anywhere £0.0500 £0.0500 £0.0500 £0.0400 £0.3300 1000 lookups
£50
12 months

UK VoIP Call Costs Compared

As you might have seen from my recent tweets, I’m looking at changing my VoIP provider (I started off on Gradwell’s Multi User package, moved to VoipFone (which never really “worked right” with my setup) then moved to AAISP), as AAISP don’t currently offer all the facilities I would like (the most important one being sending the “number being called” as the CLI when forwarding VoIP calls to my mobile). But which one to go to? Well, after two long calls to o2 mobiles today, I started to look at call costs as well as the “monthly rates” – and here’s the details of the VoIP call costs and “line rentals” which may be of use to people:

Provider Monthly rate for 01/02 number Monthly rate for 03333 number Peak to o2 mobile Weekend to o2 mobile Peak to 01/02/03 numbers Weekend to 01/02/03 numbers
Gradwell Single User £4.00 £4.00 9.00ppm 6.00ppm 1.25ppm 1.00ppm
Gradwell Multi User £8.00 £8.00 9.00ppm 6.00ppm 1.25ppm 1.00ppm
AAISP £1.00 £1.00 18.33ppm 18.33ppm 1.25ppm 0.83ppm
VoipFone £2.00 £2.00 12.00ppm 12.00ppm 1.00ppm 1.00ppm
Soho66 £2.00 £2.00 10.00ppm 10.00ppm 1.00ppm 0.50ppm
VoIPTalk Standard Tariff £2.99 £2.99 11.90ppm 11.90pm 1.40ppm 1.40ppm
VoIPTalk Prepay Silver Package £6.98 £6.98 9.90ppm 7.90pm 1.00ppm 1.00ppm
DrayTEL Standard Tariff £2.99 £2.99 11.90ppm 11.90pm 1.40ppm 1.40ppm
Sipgate

None Not offered 9.90ppm 9.90ppm 1.19ppm 1.19ppm
AQL

£2.00 £2.00 7.10ppm 7.2ppm 1.00ppm 0.80ppm

All prices subject to VAT, prices may vary yadda yadda yadda. In otherwords, these are the prices I found when I looked – the prices you might be charged and might find may be different.

Correction: 14 Feb 2011 13:41: Previously AAISP’s prices were shown including VAT. This has now been fixed.

Royal Mail Fax Numbers

If anybody else needs these contact details:
Royal Mail Fax Number (to be honest, I’m not sure where this one goes): 020 7250 2030
Royal Mail Redirections Centre Fax Number: 01782 406 120 (however, faxes sent at 1pm on a Friday won’t get looked at “until Monday, possibly Tuesday and then will take 5 days to action”)
Royal Mail Redirections Telephone: 08457 740 740, option 2 2 4. However, extremely busy at 4.30pm on a Friday (20 minute hold times!) and reasonably busy at 2.40pm on a Friday (8 minute hold time).