Chris Matchett Just another Wordpress blog running of the computer in my spare room

14Feb/101

Nomike custom speaker

As I have a Philips dab hifi with no speakers I decided to build one to get some use of the hifi. The 40w woofer and 25w tweeter cost £8 in Maplin and the cabinet cost £5 in Ikea. The value of building something that actually works and sounds good, priceless.

It's called the Nomike as this is one occassion when my mate Mike didn't do the soldering, fixings for me :-)

Nomike - Front View

Nomike - Rear view

Tagged as: 1 Comment
28Dec/090

PC Apple Green Tea

A friend and I often enjoy the mac versus pc debate over green tea and coffee. I am on the pc and coffee side but recently my argument seems to be weakening and I have also been persuaded to have a cup of green tea.

The main issue swinging me in Apple's direction is their take on the digital hub, the computer being at the heart of empowering technology around the home. When I decided to connect a camcorder to my pc I had to go out and buy a firewire card to get it physically connected and new software to edit my video footage. When I wanted to get my music and podcasts on to my mp3 player I used Apple's iTunes as Microsoft missed the podcast boat and didn't make it easy to buy new music. When I wanted to connect my guitar to my computer I had to go out once again and buy new hardware and software.

So there seems to be a pattern of me having to acquire new hardware and software that I wouldn't have needed with an Apple computer. People don't want a home server locked away under the stairs like Harry Potter magically providing home entertainment, they want a computer that doesn't look out of place in the living room that can join up their growing number of hand-held devices.

These days I am starting to think more of Apple computers in terms of value than cost and have also bought a box of green tea (with pineapple).

macbook

Filed under: apple, tea No Comments
5Nov/090

NameVirtualHost *:80 has no VirtualHosts

Here's some help if you are trying to run multiple sites of one ip address using Apache2 and are getting the following error;

[warn] NameVirtualHost *:80 has no VirtualHosts

I followed a tutorial on howto setup name based virtual hosts and this is where the problem started. The 'NameVirtualHosts *:80' directive may already be getting picked up in /etc/apache2/ports.conf so you don't need to add it. Getting the <virtualhost *:80></virtualhost> right is enough in your sites-available, that should be all you have to do. Too many NameVirtualHosts directives is what was causing this error for me.

apache_logo_medium

Filed under: Linux No Comments
17Oct/090

Windows 7 Ultimate, 64-bit

After attending the launch of Windows 7 in Belfast all the attendees were given a copy of Windows 7 Ultimate, 32-bit and 64-bit versions. I must say I am very impressed! I hated Vista and saw myself staying with XP for some time. Of course I may have done if it wasn’t for the free upgrade.

Notable features of Windows 7 are support for virtual machines and full system image backups. Add-ons I am also currently getting use of is the new Microsoft Security Essentials And Windows Live Movie Maker and Live Writer. Actually I am writing this wordpress article on Windows Live Writer.

Filed under: Windows No Comments
19Sep/090

Drupal 6 – Remove numbers from pager output

Having made many attempts at trying to the remove the pager numbers through a template.php file I found the easiest solution was to add the following to my custom theme style.css.

.pager-item{
display: none!Important;
}
.pager-current{
display: none!Important;
}

It means the fix will remain even if Drupal needs updated.

drupal-logo

Tagged as: No Comments
25Jul/092

Display Php Multidimensional array

foreach($output as $var =>$value )
{
echo "$var\n";
foreach( $value as $innervalue )
{
echo "$innervalue\n";
}

}

}

Tagged as: 2 Comments
17Jun/090

Embed twitter in webpage with links

My education board decided to block twitter so I got a hold of some code for our school website to allow students to see our school's tweets.

The code is standard pear-twitter stuff, the cleverness is converting the twitter text url string to a real url.

    <?php
    // include class
    require_once('Services/Twitter.php');
   
    try {
      // initialize service object
      $service = new Services_Twitter('user', 'password');
     
      // get status updates posted by logged-in user and friends
      $response = $service->statuses->friends_timeline(); 
      if (count($response->status) > 0) {
        echo '<h2>Recent status updates</h2>';
        foreach ($response->status as $status) {
            echo '<div><img src="' . $status->user->profile_image_url . '" />';
            $a=preg_replace("/(http:\/\/|www|[a-zA-Z0-9-]+\.|[a-zA-Z0-9\.-]+@)(([a-zA-Z0-9-][a-zA-Z0-9-]+\.)+[a-zA-Z0-9-\.\/\_\?\%\#\&\=\;\~\!\(\)]+)/","<a
href=\"\\1\\2\">\\1\\2</a>",$status->text);

   echo $a . '<br/>';
            echo 'By: <em>' . $status->user->screen_name . '</em> on ' . $status->created_at . '</div>';
        }
      }
     
      // get recent posts on public timeline
    //  $response = $service->statuses->public_timeline(); 
    //  if (count($response->status) > 0) {
    //    echo '<h2>Recent public timeline updates</h2>';
    //    foreach ($response->status as $status) {           
    //        echo '<div><img src="' . $status->user->profile_image_url . '" />';
    //        echo $status->text . '<br/>';
    //        echo 'By: <em>' . $status->user->screen_name . '</em> on ' . $status->created_at . '</div>';
    //    }
    //  }
           
      // perform logout
      $service->account->end_session();
    } catch (Exception $e) {
      die('ERROR: ' . $e->getMessage());
    }
    ?>

Filed under: Uncategorized No Comments
31May/092

Windows 7 free for one year!

I downloaded and installed the new version of Windows, Windows 7 RC, on May 5th when it was made available to the public. I was pleasantly surprised at their decision to give it away for free...well free for a year anyway.

I guess they are trying to hook people in after the disaster that was Vista. Vista was to XP what Windows ME was to Windows 98, one step forward and four steps back!

I am enjoying Windows 7 RC however! All my hardware is running as should be and the system seems very snappy. I was worried that some of my older (but much loved software) would cause some problems but it hasn't been the case. Dreamweaver 8 and Photoshop 7 are running well which is a big bonus. I guess we are all suckers for a shiny interface as well and Windows 7 has one, I like the transparent window look.

So if you are thinking of having a go backup your documents and have a go. It's only free for a year but a year is a long time in tech, we mightn't even have desktop computers in June 2010!

windows7

Tagged as: 2 Comments
31May/090

Downloading podcasts to the Blackberry 8820 using your home wifi

My original goal was to try and access my podcasts, stored on a network share, on my Blackberry 8820. It turns out accessing network shares isn't available on the current Blackberry 4.5 operating system but will be in version 5.0. So here's my solution to make life a little easier in the meantime.

the quick version

  • Setup a web server on one of your home computers
  • Use Juice to keep your podcasts up to date (I'm not an iTunes fan)
  • Make your music library accessible to the web server
  • Configure your Blackberry browser to use wifi
    (I have two browsers, Opera and the Blackberry browser. I have one configured for wifi and the other as part of my data plan)
  • Browse and play/download music and podcasts from your intranet server using it's ip address from your wifi browser

the not so quick version

I have an old pc running Windows Server 2003 sharing my podcasts and music. I know not many people have a copy of windows server running at home but the following steps could be carried out on any operating system able to run the IIS or Apache web servers. If you aren't familiar with running a web server your windows pc may already support IIS, if not Xampp is a good starting point. This is a good article for Ubuntu users on setting up a web server.

Once you have setup your webserver and have made sure your music library is visible through your new intranet site you can either simply enable directory browsing of your music folder or use some asp or php code to create a prettier interface. Currently IIS 6 doesn't allow you to apply style to directory browsing. I use some asp code from ASP101 to style and allow recursive directory browsing of my music library.

Make sure you are in wifi mode on your Blackberry and browse to the ip address of your intranet server hosting your podcasts and music. Simply click on a link to one of your mp3 files and you will be prompted to open it or save it. If you open the file the Blackberry media player will start playing it. I tend to save podcasts as you have more control over fast forward etc.

And that's it, one less wire to hookup and freedom to roam around your home listening to your podcasts!

blackberry-8820-lg

31May/090

Installing Windows 7 alongside XP and Ubuntu

I have just installed the beta version of Microsoft's new operating system, Windows 7 Ultimate, on the same hard drive as XP and Ubuntu (all three systems have their own partition). I don't think I will be rushing out to buy Windows 7 Ultimate...

The window's virus did of course wipe my master boot record during install but it was quite a simple process to restore my existing grub boot manager. Windows 7 will add XP to it's boot mananger but not Ubuntu (hardly surprising). So at the moment I have grub booting XP, Windows 7, Ubuntu and some other stuff.

I had hoped to setup grub to boot straight into Windows 7. It seems the Windows 7 boot loader has planted itself on my XP partition (the system's first partition). This means I can't boot directly into the Windows 7 partition which is something I will have to fix. If I had thought about it this should have seemed obvious as multi-booting details are held in the Window's boot loader files...I guess any master boot record points to a bootable partition and uses it boot loader. 

In conclusion, I won't be rushing out to buy Windows 7 Ultimate. It seemed to perform well on my system, much better than my experience with Vista, but will it be worth the likely £200 price tag? If it cost £80 I would probably buy it, that seems like a fair price to me. It won't though, so I will be sticking with XP.

windows7