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
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).

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.

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.

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.

Display Php Multidimensional array
foreach($output as $var =>$value )
{
echo "$var\n";
foreach( $value as $innervalue )
{
echo "$innervalue\n";
}
}
}
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());
}
?>
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!



