Why do we say thank you to bus drivers?

I know this is a completely random thought but saying thank you to a bus driver when getting off the bus has just become an automatic thing for me and I never use to think about it. Well the other day I just thought to myself why do we say thank you?

Well the only answer I could come up with is that I say thank you for the comfortable journey and getting me to my destination safely and on time. I think if they do those things then its only fair to say thank you when alighting from the bus.

Well now whenever I leave the bus I take a moment to think does this bus driver deserve a thank you? Well sure enough I don’t say thank you as often as I use to.

Just a few nice words

Friends are like balloons; once you let them go, you might not get them back. Sometimes we get so busy with our own lives and problems that we may not even notice that we’ve let them fly away. Sometimes we are so caught up in who’s right and who’s wrong that we forget what’s right and wrong. Sometimes we just don’t realize what real friendship means until it is too late.

Javascript Same Height Div’s

Recently I had to make some divs the same height. Usually I would just pad the bottom of a div with page breaks but I couldn’t do that this time round as the page content is dynamic and the height of the divs could change.

First thing I did was look online for answers and sure enough there were solutions but looking at them they seemed over complicated so I decided to write my own solution.

Javascript Code:

function sameHeight(divs) // Bring in an array of your divs
{
  var highest = 0;
  for(i = 0; i < divs.length; i++) // Loop through the divs
  {
    document.getElementById(divs[i]).style.height = "auto";
    // Check to see if this div is the highest?
    if(document.getElementById(divs[i]).offsetHeight > highest)
    {
      // Yes its the highest so set the highest value to this div’s height
      highest = document.getElementById(divs[i]).offsetHeight;
    }
  }
  // Loop through all divs again
  for(i = 0; i < divs.length; i++)
  {
    // Set all divs height to the highest value
    document.getElementById(divs[i]).style.height = highest+"px";
  }
}

Then to run this code:

<script type="text/javascript">
window.onload=function(){
sameHeight(new Array(’block_01′,’block_02′,’block_03′));
}
</script>

Simply pass an array of your divs to the function. Easy peasy….

Just an extra word of warning… Be aware of using padding on the blocks you pass to this function. If the paddings are different in each block then they may not end up being the same height. Although you could modify the function to check for the use of padding and alter the heights accordingly.

Getting Windows HDD usage with PHP and SNMP

At work a couple of months back I was faced with a problem that many of our servers would run out of hard drive space without us knowing and that would cause the server to hang and/or stop responding. So I did a bit of research and came across. This little utilility would run on the server in command line and tell you what drives were available and some info of the drives like space used and available. Well with this I would echo out the data to a text file and send that across to a common holding ground. Then from there get my web server to constantly scan this folder for new logs. This method worked but it had its issues.

Well yesterday at work I was playing around with SNMP and after finding a site with W2K MIBS I found lots of info you can pull from the server. Now I was already familiar with SNMP in PHP thanks to their documentation on their site. So using their snmpwalk function I was able to pull the relevant data to get HDD usage info.

$names = snmpwalk($row['ip'], “public”, ‘.1.3.6.1.2.1.25.2.3.1.3′);
$used = snmpwalk($row['ip'], “public”, ‘.1.3.6.1.2.1.25.2.3.1.6′);
$total = snmpwalk($row['ip'], “public”, ‘.1.3.6.1.2.1.25.2.3.1.5′);
$alloc = snmpwalk($row['ip'], “public”, ‘.1.3.6.1.2.1.25.2.3.1.4′);

Now that would give me an array of drive names, space used on those drives, total space available on those drives and the allocation units. Now the allocation units I didn’t realize I needed as I thought the numbers given in used and total were just measured in bytes but they aren’t. The numbers in used and total are how many blocks of allocation size (if that makes sense). So to get the true byte value from used and total you need to multiply them by the allocation size number.

25599569 * 4096 = 104855834624B = 97.65GB

So there you have it. Now you know how to get HDD usage from your server using PHP and SNMP.

Healthy Living - Obviously Not

So I was in Tesco’s and just about to get to the cashier and my friend James notices that the cashier is wearing a healthy living T-Shirt. “Well isn’t that ironic” he says, well the picture speaks for its self.

Healthy Living - Yeah Right!

Just what are Tesco thinking to give this poor lady a top advertising healthy living when she clearly hasn’t being doing just that?

Cheating Wife put on Ebay

All I can say is LOL

Cheating Wife put on Ebay Cheating Wife put on Ebay Cheating Wife put on Ebay

Reason 89 to Shop at Morrisons

I don’ know if you remember those Morrison’s adverts where they gave a list of reasons why to shop at Morrison’s? Well firstly they would show a clip of something good about their store, for example fresh bread. Then after showing the clip they would say “Reason 32 to shop at Morrison’s” and this was just one of the adverts as each advert would have different reasons. Presumable they had lots of reasons why you should shop their but they only showed the best reasons on TV.

Well anyway I was out walking around York with my friend Dan and he shouts out “Reason 89 to shop at Morrison’s as we are opening a store near you”. I’m like “You what?”. Well as it goes a Morrison’s store was being built right near where we were walking.

Reason 89 to Shop at Morrisons

This photo is old and now the store has been open for awhile. So why have I posted this? Well I just found it witty what my friend said :)

Sainsbury’s Recommended Reads

Ok this is an old photo that I’ve had on my phone for some time now but I took it for a reason. I was stood in the queue at Sainsbury’s and noticed the recommended reads stand. Now what made me laugh that at one side was kids books and at the other end was just gardening magazines, but at the top “FHM 100 Sexiest Women”. Now obviously someone hasn’t really thought out what they put on that stand. Who picks what goes on there? I suppose at least they had some brains to put the magazine on the top shelf of the stand.

Sainsbury’s Recommended Reads

This post isn’t a complaint or anything but it’s just one of those things that made me laugh.

Didn’t get the Job

Oh well I didn’t get the job :( but I did get this responce:

Hi Scott,

Further to our telephone call today, I wanted to say that we were very
impressed with your attitude and your skills, and it wouldn’t be out of
the question for us to give you a call in the future for some part-time
work or freelance work. We thought you had an excellent CV, and came
across well in the interview.

If it’s OK with you, we’d like to keep your details on file, and
hopefully be in touch soon.

Many thanks,

Chris

Big Update Continued

So now you’re looking at the Managing Director of Alpha Ready LTD, got it all set up and also an account to deal with all expenses and sort out all taxes etc for end of year. I’m on my way to making a million pounds :P

Well not is all good, recently we have just been hit with some bad news at work. The IT director has been replaced. We were all in shock most of the day as we couldn’t believe what we were hearing. Straight away I’m like oh no the old IT director hasn’t finished sorting out making me a supplier so I contract to Ford Retail.

Ok big pause to reflect what has just happened……….

Ok well can’t just sit around and wait for things to happen. I don’t know much about the new IT director and I don’t know what he wants to do with the IT department, will he still require my type of work? Will he take on my limited company? So just in case I end up without a job I’ve been looking for other jobs.

I found a job offer for a web design company just starting out. They have rented out office space in York Science Park, a new complex purposely built for small companies starting out related to IT. Anyway I have been for an interview. Felt it went well but don’t know if I’m what they are looking for. We will find out in a week…. The job sounds really interesting and it would be nice to work with likeminded people. Where I work at the moment I’m the only one that deals with web related work and so forth can’t talk about my work or turn to other members of staff for help. There is no team work at Ford Retail and that’s why I would really like this job at the web developing firm as we will be working as a team to get the work done.

To be continued…

Next Page »