douglasmcgregor.co.uk

Archive for July, 2009

Windows Home Networking

by Douglas McGregor on Jul.27, 2009, under Geeky Stuff

After achieving geeky things today, I thought this would be very appropriate to talk about.

Home networks can be very useful things if you have more than one computer in the house.  You can conveniently share printers and transfer files without having to run between rooms all the time.  Windows provides a Network Setup Wizard, which is what I recommend for the layman.  But sometimes Windows can be tempermental and not do the job properly, so if you are confident in administrating Windows, you should find it pretty straight forward to set up manually. 

For this, I am assuming that you have the hardware set up i.e. modem and router connected and turned on.  Turn on any printers you have in the network as well.  Now, follow the instructions below.

  1. Go to Control Panel and Network Connections.
  2. Double click Local Area Connection and click on Properties.
  3. Check the "File and Printer Sharing for Microsoft Networks" box.
  4. Click "Internet Protocol (TCP/IP)", click on Properties and click Advanced.
  5. Click on the "WINS" tab and check the "Enable NetBIOS over TCP/IP" box.
  6. Click Ok and Ok all the other open boxes.

You will have to disable the built in Windows firewall if it's not disabled already.  It says it's not recommended to turn it of, but just ignore this.  You will also have to alter some settings in your Antivirus / Firewall software.  We use McAfee, so that will be the basis for this example. 

  1. Go to the Advanced menu and Configure and select Internet and Network.
  2. Where it says "Firewall protection is enabled", click Advanced.
  3. Select Windows Services and check "Windows File Sharing (NETBIOS) Ports 137 – 139".
  4. Click Ok and cross off McAfee.

This should now set it up so it can see the computers and printers on the network.  The real test is adding a printer to your computer.  If it works, then you're all set to go and use the network.  If not, you'll have to spend a bit of time troubleshooting.  To add a printer, do the following.

  1. Go to Control Panel and Printers and Faxes.
  2. Click Add Printer.  Follow the wizard, and select "A network printer, or a printer attached to another computer". 
  3. Select "Browse for printer" and select the name of the computer you wish to connect to (for example, mine is "\\FAMILY\Espon Stylus Photo 520"). 
  4. Click Ok.

You need to make sure that the firewall for the Local Area Connection on the computer that the printer is connected to is disabled as well.  Make sure McAfee has Firewall permissions on that computer by following the steps above.  This was the trap I fell into when I first did it.  Try printing something – if it works, it will be magic! 

My printer has reached the end of its life, so it's good that we've got two printers in the house, so I can now print directly to the printer downstairs from up here. 

Happy networking!

Leave a Comment more...

My YouTube Favourites

by Douglas McGregor on Jul.27, 2009, under Geeky Stuff

Morning all,

I've been writing this plugin for WordPress that gets a users YouTube favourite videos.  Or rather I was, but I've decided for the time being it's simply easier to put it in as actual code.

You have to be PHP literate in order to do this.  It seems logical, since WordPress is written in PHP.  First of all, create a new folder in the root folder of your WordPress installation, called "wp-library".  This library will contain the Zend Framework, as well as any other libraries you may wish to install in the future.  Download the Zend Framework here

The downloaded folder should be called "ZendFramework-1.8.4PL1".  Fire up your FTP software (I use WS_FTP) and go to the downloaded folder, go to "library" and select "Zend".  Hit the upload button.  This should take a wee while to upload, so feel free to do other things while you're waiting.

Once that is uploaded, in your WordPress theme, open "sidebar.php".  Look for the following code:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar_full') ) : ?>

 <li>
 <div class="sidebarbox">
 <h2>Recent Posts</h2>
 <ul>
  <?php wp_get_archives('type=postbypost&limit=10'); ?>
 </ul>
 </div>
 </li>

 <li>
 <div class="sidebarbox">
 <h2>Browse by tags</h2>
 <?php wp_tag_cloud('smallest=8&largest=17&number=30'); ?>
 </div>
 </li>

<?php endif; ?>

Directly after this, add the following code:

<li>
<div class="sidebarbox">
<h2>My YouTube Favourites</h2>

<?php
        set_include_path('.' . PATH_SEPARATOR . 'wp-library' . PATH_SEPARATOR . get_include_path());
        require_once 'Zend/Loader.php';
        Zend_Loader::loadClass('Zend_Gdata_YouTube');
       
        $yt = new Zend_Gdata_YouTube();
        $videoFeed = $yt->getUserFavorites('Shuggy23');
       
         $a = -5;
       

            echo "<table cellpadding='5' cellspacing='5'>";
                foreach ($videoFeed as $yt) {
               
                    $videoId = $yt->getVideoId();
                   
                    $YouTube_Link = "<a href='http://www.youtube.com/watch?v=" . $videoId . "' target='_blank'><img src='" . $yt->mediaGroup->thumbnail[0]->url . "' width='50' height='35' title='" . $yt->getVideoTitle() . "' /></a>";
       
       

        if ($a == '0') {echo "<tr>";}
        if ($a == '5') {echo "<tr>";}
        if ($a == '10') {echo "<tr>";}
        if ($a == '15') {echo "<tr>";}
       
        echo "<td>";
        echo $YouTube_Link;
        echo "</td>";
   
        $a = $a + 1;
               
        } // closes for each

        echo "</table>";
    ?>

</li>
</div>

This adds a new section to the sidebar, like a widget would do.  The idea is that it displays an image gallery of your recent YouTube favourites, and when you click on an image it links directly to the video on YouTube.  I think it's pretty funky.  There have been similar ideas in the past, but they provide a video player for WordPress, but in my opinion, this seems like a much neater approach.

There are still vast improvements I could make to this, but needless to say, the basics are working.  You can see a working demo here on this site.  I'm not a PHP programmer, I come from an ASP background, I find it easier to understand.  I hope someone finds this useful. 

As Aleksandr Orlov – founder of CompareTheMeerkat.com would say, "Simples!".

Leave a Comment more...

Lights, Camera, Action!

by Douglas McGregor on Jul.26, 2009, under General

Hello all,

Well it's the end of yet another weekend.  I find that Sunday nights usually drag on forever, so I'll probably stick on a video.  Where would we be without YouTube?!  It has almost every single episode of Star Trek on it.  Joy.

I was at the pub last night for a few quiet drinks with my friend David.  He actually said I have muscles, which I didn't expect.  I haven't been working out at all.  Muscles are probably a good thing for a man.  We went to Weatherspoons up in Anniesland, for a change of scene.  The pub is the best place to be on a Saturday night. 

I'm fed up of being by myself all the time.  I need to improve my lifestyle.  The best way to do that is to get a job, any job.  Ideally I'd like an Admin or Web Design position, but with the way the economy is heading, that may not happen in the near future.  Having said that, I have very good IT skills, so I'd probably be valuable in an Admin position.  As I said, I just want to improve my lifestyle, like get out every day and meet people.  Even if it's just a job in a shop. 

I'm going to take some action tomorrow and try and pull some strings to persuade someone to employ me.  I obviously won't put it like that when I'm talking to them.  I've not been away from Glasgow for over 2 years now.  I'd love to just even go down to Hull for a break, or hook up with some of my pals from University, wherever they may be.  I just can't afford it.  This is probably what is causing a bit of depression. 

I guess the first thing to do is get a long sleep tonight and I'll feel so much better in the morning.  Hope everyone has a good week!

Leave a Comment more...

A Tribute to Ronnie Walker

by Douglas McGregor on Jul.04, 2009, under General

Ronnie Walker is practically a legend in the world of classical musicians and teachers in Scotland. Tonight I learned that he has unfortunately passed away at the age of 63. Read this link: Ronnie Walker.

He conducted the first ever musical performance I was in, complete with orchestra – Ocean World. It inspired me to study a career in music. I since got the vocal score and tape recording of Ocean World. Unknown to me, I'd go on to perform in one of Ronnie's productions, African Jigsaw, which was absolutely amazing – first I sang in the choir, then I played the clarinet in the wind-band.

Scottish composer James MacMillian, who you've probably heard of if you're into your classical music, composed this piece called "The Company of Heaven", and probably because of our success with African Jigsaw, Ronnie chose our school wind-band to perform the piece, as well as the usual suspects. I managed to have a chat with Ronnie during the rehearsal breaks, and also on the phone a few times, and he's a really nice guy. Hence why I'm sad about his passing.

Ronnie, may your spirit find happiness in the light. Rest in peace. If you have any questions, don't hesitate to ask. I'll drink to Ronnie this week!

Douglas

Leave a Comment more...