Peter Bargh

Sights & Sounds

Archive for the ‘Helping Hand’ Category

September 4th, 2013 by Peter Bargh

 appearing in WordPress posts following mysql database import

If you experience the problem of an  appearing in seemingly random places throughout you WordPress posts following a database import you may be able to solved it like I did by commenting out the encoding line in your site’s wp-config file:

Search for

define(‘DB_CHARSET’, ‘utf8?);

and add // to the front:

// define(‘DB_CHARSET’, ‘utf8?);

This should make the Âs disappear.

December 20th, 2012 by Peter Bargh

Setting up a offline web environment

I’m currently setting up a home off  line web development environment and tried Xampp – I got stuck and the online help didn’t help…so I switched to WAMP and it’s going ok so far.

I’m going to use this post to add links that I find useful along the way

Creating multiple virtual hosts

This allows you to have several sites in the one location accessed from your WAMP server via Apache.  I read and followed several guides from blog posts that didn’t resolve the problem, before finding one that works.

 

 

May 31st, 2012 by Peter Bargh

Lightroom 4.1 wont install

If  you have a version of Lightroom and the alert comes to tell you that a new version is available, so you down load and then when trying to run the .exe file you get the error message you may find it a struggle to find the solution.

I had this issue and the Adobe solution is to download a fresh instal.

I was running a 4.1 Beta upgrade from the original 4.0 install. I tried a second download and it didn’t work. I couldn’t find the answer online so I decided to uninstall my 4.1 Beta install and delete my 4.1 download .exe.

I then reinstalled my 4.0 off the disc, re downloaded the 4.1 update and click the .exe and this time it worked.

Hope this helps a few who’re in the same situation

If it helps please link to this thread in the forums you use to help others. 🙂

December 14th, 2011 by Peter Bargh

Beware! Banner advert scam on WordPress with adv.php

If you receive an email like this what would you do?

Hi,
I am sorry I have to write you to e-mail from whois information of the domain. But I could not find contact e-mail or feedback form on your site.

We are looking for new advertisement platforms and we are interested in your site.
Is it possible to place banner on your site on a fee basis?

Best regards,
Lilian Marchand

I replied and asked what they had in mind. Here’s their reply back

I represent Lemma Agency. At the moment we are preparing an advertising campaign for Lacoste Company (it is a French company producing clothes, footwear, perfumery etc.) We already have designed banners for the campaign, they are the following sizes: 160×600, 240×400, 300×250, 336×280, 468×60, 728×90.
What can be your price for one banner (banner should appear at ALL pages of your site) of abovementioned sizes (please specify the place for the banner – top, bottom, left, right)? Please mention a normal link for banner, without javascript code and set prices in US dollars per month.

Best regards,
Lilian Marchand.

site: www.lemmaagency.com
e-mail: [email protected]
phone: + (0)9 78 62 24 83

I thought up a price and fired it off in another mail. This was accepted back in similar speed.
I was then given a link to some code to download that appeared as a non harmful zip file that opened as adv.php with instructions on how to make the site ready for banners and payment.

The adv.php code was to be added into the wordpress blog as a plug-in. Alarm bells rang. Why would an ad agency want to add a plug-in? Normally they just provide banners as graphics with tracking links. Something smelled fishy.

Could the code be harmful? I had a quick read through and it seemed ok, but php is not my strong point. I asked my IT colleague to check it over.

A bit of research later and he came across many other blog owners who’d had similar emails, from different ad agencies. All worded exactly the same and all warning of this new scam.

These buggers are becoming clever…no longer content with sending you viruses through email or server hacks, they’re now getting web owners to do the hacking for them.

So if you run a wordpress site and get a email with similar characteristics. Ignore…or come up with some form of wind up and string them along.

More in-depth details of the people who discovered it was a hack can be found here: @peaz and here SLee and Topher

 

If you read this and a similar thing has happened to you feel free to add a comment with your experiences.

October 11th, 2011 by Peter Bargh

Threat has been detected!

I’ve just had an incident that I’ll explain how to get out of if you ever have the same. If you’re using an anti virus software and you get the message “threat has been detected” when you try to access wp-admin it could be that someone has posted a trojan in the comments on the public part of your site. Avast, for example, picks up on this and suggests you don’t visit admin because of the threat. I went in through an “edit page” route and clicked on the activate comment area and got the same “threat has been detected” message. So I knew it must be the comment that had the virus.

Comments are stored in the database, so access your wordpress blog database, find the wp-comments table. Look for the comments and find one with suspicious message in the comment_content field and delete it.

August 24th, 2010 by Peter Bargh

Fatal error: Allowed memory size exhausted in WordPress 3.0 upgrade

Have you upgraded to WordPress 3.0 and got the following message when trying to automatically update to 3.01?

Fatal error: Allowed memory size of xxxxxxxx bytes exhausted (tried to allocate xxxxxxxxx bytes)

I used to get that error on older versions of WordPress from time to time and resolved it by editing the wp-settings.php file. There’s a line that says define(‘WP_MEMORY_LIMIT’, ’32M’); and a quick edit to define(‘WP_MEMORY_LIMIT’, ’64M’); used to sort the problem out.

But on a recent attempt to upgrade from 3.0 to 3.01 I got the error and found the memory allocation in the wp-settings.php file is split out as an include file on line 20

require( ABSPATH . WPINC . ‘/default-constants.php’ );

and the “default-constants.php” file, with its memory settings is in the wp-includes folder and appears to now be correctly specified at 64M. After some research I found a site that suggested increasing this to 128M, or 256M I tried both and neither worked.

Another site suggested changing the PHP.ini file’s memory from 32M to 64M, but I use Namecheap and I don’t have access to that file.

I finally found the answer that worked for me.

Locate the .htaccess file in the WordPress root folder and add this line:

php_value memory_limit 64M

That worked fine. I hope that helps you too.

January 11th, 2010 by Peter Bargh

Building an Igloo

I decided this year I will try to do as many new things as I can. I’ve made a list of places in the UK that I haven’t been as part of that resolution and I will also be on the look out for new activities.

My first challenge, to break me in gradually, was something I’ve never done with snow before..and that’s to build an igloo. I’ve done snow men and snow sculptures before but never attempted an igloo.

I also decided to record the building of the igloo photographically and then shoot the built igloo at night with an inner glow. I’ve uploaded the result in my portfolio and the rating is favourable, so I’m pleased with that.

I’ve also written how to do it on my foliopic site blog Building an Igloo so you can get an idea a) how to build an igloo, b) how to photograph one and c) view one of the strengths of a foliopic site’s article system.

August 10th, 2009 by Peter Bargh

Images don’t right align in WordPress

I recently added a new WordPress template to one of my sites and found that the right align option did not work. The Alignment was set correctly in the upload “Edit Image” settings and appeared correct in the “Advanced settings” but when you preview the image was still at the left hand side. I looked up various WordPress sites for the answer and it appears that the style sheets of many of the themes are old and need updating to work on more modern versions of WordPress. Several sites suggested adding the following code:

img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}

img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

.alignright {
float: right;
}

.alignleft {
float: left;
}

The replies from various happy forum readers suggested that the code fixes the problem, but it didn’t do so on my chosen theme GabLog 1.0

After some more research I finally found the answer one line of code

.alignright { float: right !important; margin:0 0 15px 15px !important; }

Simply place this in the css style sheet. You’ll find this in the wp-admin page under “Appearance” and sub menu “Editor” From there look at the Theme files on the right, select Stylesheet (style.css) from Styles and add the above line of code in to the centre edit box. Click on update File and you should then find your image aligns to the right when you refresh.

June 28th, 2009 by Peter Bargh

Open Office Tip – Changing To Title Case

I use Open Office and wanted to change some text to Title Case (Where Each First Letter Is A Capital Letter) In many programs you have a Change Case option in the Format menu. Here you would usually find Title Case, as well as UPPER CASE, lower case and sometimes Sentence case. But in OpenOffice there is no such option.
After a fair bit of trawling I found my answer and thought it would be useful to add them to my blog as a notebook entry for me and as a help for anyone else looking for a quick fix.

So if you use Open Office here are a couple of solutions:

Changing a field to Title Case in Open Office Calc (Excel Equivalent)

Click on the cell in the next empty column across from the field you want to change. key in =PROPER ( ) and insert the cell number that you want to change inside the brackets for example =PROPER(A1) You will now have the A1 cell repeated in B1 cell with the words in title case.

Changing a field to Title Case in Open Office Writer (Word Equivalent)
Select Format>Character and then click on the Font Effects tab and select Title from the Effects drop down list.

March 6th, 2009 by Peter Bargh

I never thought I’d consider my diet!

Following a heart attack you start looking at your life in new light. In my case excessive weight, lack of fitness or smoking could not be attributed to the cause…but one thing that I can change is my diet. Particularly my cholesterol level, which, at 6.6 (post heart attack), is too high for today’s standards. The guideline for UK today is around 3. I was put on statins which reduces this level but it’s time for a diet change as for years I’ve been doing it wrong – very wrong.

Two things I ate almost daily where cheese and chocolate…not together I might add.
I’d have cheese on toast, cheese in sandwiches, cheese on pizza, cheese in dishes.
And, in the evening I’d have a bar of chocolate with a pint. It became regular, and addictive. I’m told cheese can still be eaten, but not the hard variety which tends to have more fat. Basically, if the cheese tastes strong and lovely, like mature cheddar, it’s probably no good. If it tastes bland like Edam it’s better.
And milk chocolate is the one I’d reach for, but plain is the safer choice. I’ve had about two bars of chocolate in three months and miss it badly.

Things I ate weekly: curries, fish and chips, ready meals. I’ve had fish and chips once since and ready meals have been stopped completely.
I love curries…the ones I like are cooked in Ghee (Indian butter). It’s about as fatty as you can get. I enjoy a peshwari naan alongside and pilau rice. In curry terms these are three big bad items. We should be eating dry meals such as Tandori or Shashlik, but I like those runny dishes that soak into the fried rice and go well with the coconut naan.
The naan should be plain and the rice should be boiled. I’ve had two “proper” curries since, and the temptation to go back to what I really enjoy was too great, I can live without the peshwari naan and the pilau rice, but not the flavour rich jalfrezis or dopiazas. Once now and again won’t hurt, he mutters with fingers crossed.

Five a day!
If there’s one thing that’s been well and truly drilled into us it’s the message – five a day. We’ve all heard it, but do we take notice? I didn’t, I do now! So what is five a day? We know it’s fruit and veg but how much? Here are the requirements for an adult:

Something the size of an apple is classed as one portion
A plum or kiwi is half a portion so two would be needed to make a portion
A larger item such as a pineapple would require a thick slice
And a small item such as a grape would need a handful
Dried fruit counts (you need a tablespoon’s worth)
A 150ml glass of fruit juice
A dessert bowl of salad
2 tablespoons of any veg, raw or cooked

Have fruit with breakfast, as a snack and after a meal, include veg with a meal and a glass of juice at some point in the day and you’re sorted.

Something fishy
I regularly ate tinned tuna in sandwiches, and was eating it because I thought I was being healthy. I had no idea why, but thought, it was fish, so it was good. The reason you need fish is for the Omega 3 oils. In tuna it’s unfortunately removed in the canning process, so you need to switch to mackerel or pilchards if canned fish is your thing. Fresh Tuna’s fine.

Milk round
I’ve had semi skimmed milk for years and at least that’s one thing I don’t need to change. I’m told there are some new skimmed milks doing the rounds that have flavour, but that remains to be tested by the Bargh palate.

I also cook using Olive oil which is the best route but reduce the amount of oil you use.

I’ve used spreads as a butter replacement for years too, but there are some that are better than others. Make sure you choose a spread with less than 15g of saturated fat per 100g, and spread thinly.

Are you nuts about nuts?
Research suggests that nuts can reduce your chances of heart attack by up to 35%. This is because they are shown to reduce low-density lipoprotein cholesterol (the bad cholesterol)
My favourite nuts are cashews, but the best appear to be Walnuts (they contain Omega 3 fatty acids) and Almonds that are rich in protein, vitamin E, manganese, magnesium, copper, vitamin B2 (riboflavin), and phosphorus. Other healthy options include peanuts (not Bombay spiced!), pumpkin seeds and cashews.

As a disclaimer I must state that I’m not a dietician just following advice I’ve been given or read. It’s not conclusive; I’ve just scratched the surface, but it may give you a lead to research further. But be warned you will find lots of conflicting info.

btw my cholesterol level is now 3.5. So something’s worked.