Fix time machine after cloning your backup disk

Posted in Uncategorized with tags , , on 25/11/2009 by I

So I’d swapped out my time machine hard drive for a new one. I superdupered the old backup onto the new disk, but time machine wouldn’t work. You get an error in the logs like:

“Cookie file is not readable or does not exist at path: /Volumes/backup/.0017f2cec48d “

So what you need to do, is replace the cookie file. The bit to notice is that the number for the filename is your mac address:

“sudo cp /var/db/.TimeMachine.Cookie /Volumes/backup/. 0017f2cec48d”

in my case.

Live event tracking

Posted in N97 with tags , , on 06/11/2009 by I

Seeing the mobile webserver, and what it can do (give folk interactive access to content on your phone, the ability to take pictures using the camera etc.) gave me a cool idea about the potential of this mobile tech.

Say you’re doing a big event – e.g. a friend recently completed the LEL. It’s nice for friends and family to be able to keep updated – e.g. you could use twitter to text in updates on your progress.

But modern nokias tend to have GPS, net connections etc. So wouldn’t it be better if instead of you needing to update them, they could see where you are, live? And then wouldn’t it be better still, if they could also send you messages of encouragement? And the icing on the cake, wouldn’t it be great if they could be there with you – see what you’re seeing?

Well I think this is possible (within the constraints of battery life, but external batteries can sort that).

You need:

  • A modern S60 nokia with GPS or a camera and a data contract.
  • Sportstracker
  • Mobile Web Server, from the Ovi Store
  • Some sort of mount suitable for the activity – e.g. for cycling probably a bar mount, and a case to waterproof the phone.

Then from there it’s simple. Set up the web server so that users can send you messages and take pics on the camera (this is all built into it anyhow). Set that running, and put a link to the URL into your sportstracker profile, then set sportstracker running with the live tracking option.

Then next time you’re doing that big event, gathering your sponsorship etc, you can give folk the sportstracker link. Then they can see, live, how you’re getting on, send you messages of encouragement – and most impressively of all they can take pictures, and see for themselves your moment of success.

 

NOTE: This blog entry expands an idea for the nokia Innoviate competition.

readline on leopard

Posted in Uncategorized on 03/11/2009 by I

Trying to get gnu readline to work on leopard so you can compile stuff that needs it?

Download it, ./configure;make;sudo make install as normal.

Before you run configure on your app, you need to set:

export LDFLAGS=”-search_paths_first -L/usr/local/lib”

export CPPFLAGS=”-I/usr/local/include”

So your new version is picked up. This isn’t an issue on Snow Leopard, for some reason.

“bus error” on snow leopard?

Posted in Uncategorized on 02/11/2009 by I

That’s a memory access error. It happened to me because I had a makefile (that worked on leopard) that set: -DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4

But on my 32bit SL kernel it should be:

-DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DSIZEOF_INT=4

Anything with a configure script should test this, you can use that fact to get the correct values for your system (they might be different on a 64bit kernel, I’ve not checked).

P.S. Incase it affects anyone else, my issue was compiling CUDD with NuSMV.

Sync an N97 with a Mac over-the-air with Google

Posted in N97 with tags , , , , on 28/08/2009 by I

Right, buckle down, this is a fairly involved process to setup (although automated entirely once it’s going). And I’ve been quite wordy so it’s a long read. Get a cup of tea and a biscuit in. Oh, and I say N97, it should apply to any recent s60 phone.

IMPORTANT: First things first. You’re going to be screwing with your important contacts and calendar data. The nature of syncing means that often the fields used for data by Nokia/Google/Apple are different, so things may go wrong, and you may loose data. I am not responsible for this! And backup your data first!

Back up the Calendar and Contacts on your N97. You can do this with PC suite to a PC, or to the devices memory card. If anyone’s got a good link on backup/restore then post in the comments.

Backing up Addressbook

Backing up iCal

Backing up Google Calendar (I think that’s the right link, I didn’t need to do this)

Backing up Google Contacts

Finally, if you use google talk, make a list of your contacts. (I don’t know if there’s a way to automate this).

Overview

Right, first off it makes sense to explain my setting, what worked for me, and some limitations. I have an N97, a Macbook Pro, a Macbook and a Google account and want to keep them all in sync. In general, the “master copy” for me is the phone, and the rest are just backups, but it’s nice to be able to add data to the machines and have it sync to the others automatically.

I tend not to use gmail via the web interface, instead I connect (on my phone and laptops) via various mail programs over imap. Why is this important? Because if you use the web interface, gmail will add anyone you correspond with as a contact, which will then sync to your other locations. This may or may not be an issue for you.

Another issue is the different fields used by the different apps to store data – this is more of an issue with contacts. When I initially set it up I had problems with surname/firstnames being reversed, and other such things. But then I had a fairly odd contacts setup I won’t go into here. What I will say is, once it’s setup and everything’s in sync and the data’s ok, it seems to stay ok. With the calendar, the only issue I’ve come across is with alarms, see here for details. Also I seem to have a few issues with anniversary type events (birthdays) but that might be a hangover in my data from previous syncing with other devices.

I’ll briefly explain the process I went through, and my starting point:

I had all my data on 1 mac, cleared the contacts in Google, emptied the calendar. Empty contacts and calendar on the N97.

  1. Synced mac to google.
  2. Synced google to n97.
  3. Synced other mac to google.
  4. Deleted all contacts, calendar data on both macs, and google
  5. Cleaned up the data on the N97
  6. Resynced everything

Obviously step 4 onward was a bit extreme. I expect if you just clean up the data and resync it should be fine. And anyway, if it all goes tits up you made backups like I told you yes?

Getting started

First up, understand this. There are 2 parts to the operation:

  • Syncing your mac with Google.
  • Syncing you N97 with Google.

I’ll cover them in turn.

Software Setup

OK, two things to setup software wise.

On your mac: Start address book, go to preferences, general tab. Can you see a “Synchronise with Google” option? If the answer’s yes, well done, skip this part.

If not, then you need to make this option appear. Sadly Apple in their wisdom decided only the true believers with iPhones should sync with google, and the option only appears if you’ve attached an iPhone or iPod touch. So the easiest thing to do, if you have access to one, is to plug in an iPhone/iTouch, let iTunes start, then eject it, and restart address book – the option should be there.

If not, or you don’t have access to one, you can add the file for the menu option yourself. Here’s a good how-to. If you don’t have the plist at all, then I’ve exported an ASCII version of my file here so you can recreate it:

{
{
    Devices =     {
        43F9146D367EF1D1 =         {
            Connected = 2009-08-13 12:55:10 +0100;
            "Device Class" = iPod;
            "Family ID" = 10003;
            "Firmware Version" = 256;
            "Firmware Version String" = "3.0";
            ID = 43F9146D367EF1D1;
            "Serial Number" = 9C7270AQ301;
            "Updater Family ID" = 10003;
            "Use Count" = 1;
        };
    };
    "com.apple.PreferenceSync.ExcludeAllSyncKeys" = 1;
    "conn:128:Last Connect" = <c6a9bdae>;
}

Note that I've changed the serial number and ID, so that might not actually work. And you'll need to use plist editor to save that as the correct XML.

On your N97: Have a look in Applications->MfE, is mail for exchange already installed? If yes, you can skip this. If not, there are two ways to get it. First, the install .sisx is in c:\installation\MailForExchange_S60_5_0.sisx so you could try running that. Second, you can make it install by adding an email account with the wizard, make up an email address (NOT a gmail one), set the type as exchange, let it do it’s stuff, then you can delete this profile from MfE later, or edit it to the gmail one.

Part 1: Sync your Mac with Google

Two things to do here, contacts and calendar.

Calendar.

Addressbookthis link has most of the info, read it. But basically, you just go to preferences and enable the “Synchronise with Google” button. But read the link for all the Caveats.

Check your google talk at this point, as google say :

Due to an interdependence between Gmail and Google Talk, removing or replacing contacts in Gmail may require you to reauthorize some contacts for chatting in Google Talk. This can also happen if contacts are merged or deleted and then synced.”

This is why I told you to note them earlier.

Note that syncing will now happen whenever you load the various apps on your mac. However, changes you make to the info that is then pushed up to google can take 10-15 minutes to show in the gmail interface to your contacts. But the changes are there at the backend, if you sync something else – say your N97 – then the changes will propagate.

Part 2: Sync your N97 with Google

Right. This is gonna be done with Google’s support for exchange, and Mail for Exchange (MfE) on the N97. Have you got a backup before we begin?

nice video at the nokia blog.

And Google’s instructions.

Those instructions are basically right, the hurdle you might fall at is getting MfE on the phone in the first place, see my instructions above.

You can set the auto-syncing in MfE, but then you can also force a manual sync through the menu option. Don’t forget to set the access point/destination up, and remember this does use a little bit of data, so consider the costs on your data plan.

Finally…

We’re pretty much done. Assuming you set MfE to sync automatically, now everything will be kept up to date without you needing to remember to do anything. Great. However, I’d recommend at this stage just going through your info on the N97, checking it’s correct and editing as necessary and then force a manual sync. Then check your data everywhere else too (remembering google’s web interface can take 10 mins to catch up). And if it’s all gone wrong, at least you made backups like I told you, right?

If you ever want to check it’s been syncing correctly, just fire up the MfE app on the phone. It will then tell you when it last synced, and if you double tap that, it brings up a log telling you what was synced.

Any improvements you want to this article, want to see screenshots, or links to add, or just to thank me – fire away in the comments.

Sync iCal alarms with Google Calendar

Posted in N97 with tags , , , , on 25/08/2009 by I

If you create an event in ical with an alarm, “message with sound” then sync with google. the alarm will be stripped from it. If in gcal you’ve a default alarm set, this will be used instead.

However, if you choose just “message” for your alarm, then it will sync fine.

And then if you’re syncing to your n97 via exchange, it’ll show up there with an alarm.

Syncing back the other way, n97->gcal->ical, ends up with the alarm as a message in ical.

Get mythweb not to use mobile template

Posted in MythTV with tags , , on 16/08/2009 by I

“It’s an old post, but since I found it while looking for the answer (and it put me on the right track), I figured I should contribute.

In the file ‘includes/mobile.php’, force the function ‘isMobileUser’ to return a false value:

Code:

function isMobileUser() {

return false;

# return (getScreenSize() === false) ? false : true;

}

Note… this COMPLETELY disables WAP support. No, really. Your mythweb installation will never, ever, ever recognize a device as needing WAP.

Hope that helps someone…”

via Can I force Mythweb not to use WAP – Ubuntu Forums.

Stop apache going straight to mythweb in mythbuntu

Posted in MythTV with tags , , on 06/07/2009 by I

In a default mythbuntu install, going to http://mymachine will redirect to http://mymachine/mythweb. But maybe you want to stop this, to server other web pages too. To fix this, you need to edit /etc/apache2/sites-enabled/default-mythbuntu, and right near the top comment out the “DirectoryIndex mythweb” line. Job done.

A handy mythtv recording importer

Posted in MythTV with tags on 05/07/2009 by I

I wanted to export all my saved recordings from my old mythbox, and import them into my new mythbox. Now, with mytharchive, exporting (to a native archive) is easy, just select all the recordings you want to export, then set it going and it exports them all.

Problem is, to import to the new machine, if you use the menu interface you can only import one file at a time, which is a bit of a PITA. So I knocked up the following script, which imports all the programs saved in the current directory. How it works should be pretty obvious, the only slightly clever bit is that it extracts and uses the same channel ID as in the original recording.

#!/bin/bash

# Get all files in current directory
myXMLFiles=$(ls *.xml)
# Loop through all files
for loopFile in $myXMLFiles
do
  channel=$(cat $loopFile | grep "<chanid>" | sed 's:<chanid>::;s:</chanid>::')
  mytharchivehelper -f $loopFile $channel;
done

MythTV and XBMC integration

Posted in MythTV with tags , , , on 04/07/2009 by I

OK, my system works like this. MythTV for most purposes, video/TV etc. but then I also want iPlayer (HD) on my telly, and as my mythbox is hooked to the stereo, last.fm in my living room. It seems to me the best way to get these is with XBMC.  So I have XBMC installed as per previous posts, the iplayer source defined and it set to load straight to the video screen. But I want some better integration, so there are a few steps:

Make them looks the same. So project grayhem widescreen theme for Myth, project mayhem HD for XBMC.
Launch XBMC from myth. Tricky this one, as if I just launch XBMC infront of mythtv, due to the odd way XBMC handles remotes, signals will keep going to mythtv aswell, hilarity ensues… So the solution is to have an XBMC menu option in myth that does the below:

<type>MENU_MEDIA_LIBRARY</type>
 <text>XBMC</text>
 <action>EXEC /full-path-to-script/myth2xbmc.sh</action>
 </button>

And the myth2xbmc.sh script looks like this:

#!/bin/bash
killall mythfrontend.real;xbmc;mythfrontend &

And yes, it’s an awful hack. Any better suggestions, well the comment forms at the bottom of the page ;-)

Actually, I’ve customised more than just the above in my mythtv menus (no need for the optical disc menu on my revo for a start). I did this by creating my own menu theme in /usr/share/mythtv/themes , following the lead of the DVR menu theme but it’s more based on the default. I’ll put mine online if I can find somewhere good to upload the .tgz.

Getting back to myth from XBMC. Ok, so I mentioned XBMC handles remotes funny. Basically it used Lircmap.xml to map your remote’s keys, to XBMC keys (historically based on an XBOX controller), then it maps its standard keyset to actions in Keymap.xml. If you copy the default to your userdata folder, then you can edit what buttons do what. It’s a bit of an odd setup really, took me a while to work out what was going on there! Anyhow, so the above script means when we exit XBMC it’ll restart the frontend an boot us back to the main menu. So I just added the XBMC.Quit action to the power and home buttons on my remote. Job done.

XBMC with VDPAU and iPlayer

Posted in MythTV with tags , , , on 03/07/2009 by I

So I got XBMC working, cos I plan to use it to view iPlayer, and HD iPlayer on my mythbox. I”ve made a menu option to launch it from mythtv.

Of course, on an Ion powered Revo, I need VDPAU for the HD content. So to do that I need an SVN build of XBMC, which can be got from the PPA here and then the iplayer plugin.

A few things to note about setting it up:

  • You need to tell XBMC to use VDPAU in the video settings.
  • In the plugin settings for iPlayer (press ‘c’ for the context menu to get them) it’s worth setting the stream to h264(3200kbs) to make sure you get the HD goodness.

At the time of writing, non-SVN XBMC plays the video at half-speed or thereabouts for me and hammers the CPU – clearly no VDPAU in use.

VDPAU testing tool – nV News Forums

Posted in MythTV with tags , , on 02/07/2009 by I

VDPAU testing tool

Hi all,

for those interested, here is a little VDPAU benchmarking tool.

http://hftom.free.fr/qvdpautest-0.3.tar.gz

See README.

via VDPAU testing tool – nV News Forums.

Page 6 there’s some Ion results to compare against, possibly others too, I didn’t look.

LIRC Config

Posted in MythTV with tags , on 30/06/2009 by I

OK, getting it working in mythbuntu was easy – I just selected the appropriate remote from the control centre. But that’s only half of it. The lirc config files are to be found in ~/.lirc/. So for now, here’s my mythtv config file for a MCE version 1 remote.

LIRC CONFIG

And now here’s my mplayer one:

MPLAYER CONFIG

Update: so it turns out there’s a problem using a MCE remote for your mythbox when you also have a XBOX360, certain buttons turn the xbox on, d’oh! So I taped a bit of tinfoil over the IR reciever on my xbox.

Mythbuntu starting 2 instances of mythfrontend on login?

Posted in MythTV with tags , on 30/06/2009 by I

.. and other such startup weirdness? Such as mouse and remote not working after login too.

The problem’s in xfce caching the desktop session to resuming, and then also auto-starting etc.

The sessions are stored in ~/.cache/sessions just delete them all, or remove that directory (and make a new one in its place). And be careful about saving sessions when you logout.

Acer Aspire Revo

Posted in MythTV with tags , , , on 30/06/2009 by I

So, my revo arrived, £150 from play.com. Currently they don’t seem to have the linux version though. It was listed as having an 8Gb SSD, but as per various reports, it actually came with a 160Gb HD. Sweet.

Out the box, and it’s tiny. Here it is pictured beside the kb & mouse it comes with, and a more normal sized regular keyboard:

acer1The mouse is a notebook sized logitech optical number, seems decent enough, and the keyboards smaller than normal but also seems ok. I wouldn’t want to use it full time, but it’s better than I was expecting, and I prefer the short-throw laptop style keys.

How noisy is the acer? Not very, fans whoosh on startup, then settle down. More on that once it’s been tested more as a mythbox.

Update: Ok, I’ve tested it a bit more as a SD mythbox and it’s pretty encouragingthe fan’s not spun up yet :-) However, I noticed that if you use the analog audio connection on the front, heavy wifi traffic causes a bit of interference (probably not noticeable when actually watching something). However, that’s pretty much par for the course, and it’s unsurprising here where the wifi antenna is so close to the socket. I probably won’t run wifi anyhow, but if I do I might wire in a socket to use an external wifi antenna for better reception, and to alieviate this issue (and I have a spare antenna anyhow).

Upgrading the RAM

It came with 1Gb of ram (single stick of DDR2 667Mhz stuff), which means the 9400 IGP can only use up to 256Mb, I plan to decode HD with it, so the more the merrier. So time to drop in another 1Gb stick so I can give it a 512Mb framebuffer.

To get the case open you need to undo one screw, and it’s that one under the little “don’t break this sticker” sticker. So unscrew that, then jam a knife in the gap and work your way round releasing all the little snap clips. Top-tip: If you have the machine power-button side down, then the top side is the one that lifts off.

A point to note if you plan to upgrade the HDD – the screws holding it in place are in from the back of the board, so you’d need to take the whole thing out. I didn’t look into doing that, as the stock 160Gb is fine for me for now.

What’s it like inside? Have some pics:

acer2acer3