Entries tagged with “windows”.


This is a guide to setting up Windows 7 Media Center, and configuring it to use 3rd party codecs such as CoreAVC and AC3Filter.

I’ve been using an old Vista machine as a media center for a long time. It’s not great spec, so I use CoreAVC to playback HD content. Firstly, here’s a little background on the setup:

AMD Athlon FX57 processor (2.8ghz)
2GB RAM
ATI Radeon x850
1TB external drive with all my content

I plug it into my TV using a VGA cable and stereo audio (my TV is a Samsung LCD) as the graphics card doesn’t support HDMI sound bridging. I decided that I’d upgrade to Windows 7 to hopefully get a bit more performance and get the latest version of windows media center. I know that as this is a ‘linux’ blog, I should probably go for MythTV or XBMC on linux, but as the pc is used to play back things for my wife and 2 year old daughter, I wanted it to be as easy as possible.

So, I’d expected the windows 7 set up to be easy – I know a bit about codecs etc.. and usually just install the K-Lite pack (say what you want about codec packs, I’ve heard it all before and know what I’m doing – it works!) and then CoreAVC, and set ffdshow to not decode HD streams and leave it to coreavc. This works fine in Vista, so I expected it to work just as easily in Win7 – I was wrong!

Installing windows 7 was easy, it was a clean install. I then made sure I had drivers for everything, and installed all my usual ‘media oriented’ apps.

I know that Windows 7 includes decoders for h264 ,xvid, divx etc.. so decided firstly to give it a try and see if it would work without any extra codecs. Normal avi’s (xvid) worked flawlessley and I was happy to see that Win7 media center is capable of rewinding and fastforwarding them! I went to play an HD file to be told that the file type isn’t supported!

It seems that whilst h264 does natively work, a splitter is needed to play mkv files. I installed haali for this purpose and tried again. HD playback dropped frames and was choppy, even on 720p.

Now, I know that Windows 7 likes to lock playback down to the native decoders and doesn’t play nicely with CoreAVC. I found a brilliant guide to tweak the registry to force CoreAVC to be the preferred decoder here. This is a direct cut and paste of the steps to get CoreAVC to be set as the preferred decoder:

1. Open REGEDIT as an Administrator
2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\Preferred
3. Right click on ‘Preferred’ and select ‘Permissions’.
4. Click on ‘Advanced’ -> ‘Owner’ tab. ‘Administrators’ , check ‘Replace Owner on subcontainers and objects’ checkbox, OK.
5. Now back to the first window – click ‘Administrators’ and check ‘Full Control’. Press OK.
6. In the left pane look for {e06d8026-db46-11cf-b4d1-00805f6cbbea}
{31435641-0000-0010-8000-00AA00389B71}.
7. Edit these entries with a double click and replace the value data entry with that for CoreAVC – {09571A4B-F1FE-4C60-9760-DE6D310C7C31}.
8. Reboot. This is important.

That’s it, now windows media player and media center will use CoreAVC as the decoder for mkv’s. Everything worked fine until I noticed that some of my media didn’t have any sound. I tested it in media player and had no sound so realised it was obviously a codec issue. I opened the file with GSpot and found that the audio codec on the silent files was DTS. As I hadn’t installed K-Lite on this install, I decided to install AC3Filter and as soon as it was installed, everything worked fine. Windows 7 also had ‘real’ support for my TV (automatically setting the desktop to the native resolution and in device manager it shows as a Samsung LCD), and has noticably better picture quality, especially on HD. I’d always found VGA to be a bit washed out on Vista and just assumed it was because I was using VGA instead of a digital connection. On Windows 7, the quality is comparable to Sky+HD over HDMI.

Now that it’s all working, I’ll recommend a few useful addons for media center:

Media Center Studio – Allows you to customise the interface, including the ability to add/remove icons.
BBC iPlayer addon – Lets you watch iPlayer content, and it looks like a native media center app.
Heatwave - I haven’t actually used this, but I’ve been recommended it, and it looks like a great weather app.
My Movies – The best movie catalogue app for media center, bar none!

One thing I found slightly irritating about the way iTunes backs up iPhones is the fact that it only keeps the most recent backup. This means that if you accidently delete a text, photo, or something else that’s backed up and only realise after you’ve backed up again, it’s too late.

Also, the fact that iTunes backs up as soon as you plug the phone in is annoying. If you plug in to restore something you’ve removed and aren’t quick enough to ‘slide to cancel’, a new backup will be created and overwrite your old one.

It’s actually fairly easy to keep old backups – it’s not something you can do automatically, but is worth knowing. All you need to do is make a copy of your current back up, and rename it to something else in the filesystem. You can also change the description of it so that it shows a more friendly name when you attempt a restore.

First, browse to the folder containing the most recent backup:

Windows XP:
C:\Documents and Settings\USERNAME\Application Data\Apple Computer\MobileSync\Backup

Windows 7 and Vista:
C:\Users\YOURUSERNAME\AppData\Roaming\Apple Computer\MobileSync\Backup

Mac OSX:
~/Library/Application Support/MobileSync/Backup/

Inside this folder, you will see another folder with a long string of numbers and letters, something like…

To keep this backup, all you need to do is make a copy of the folder, and rename it to something like ’20100311 – 8deabb43……’.

Next, enter this folder, and open the file ‘Info.plist’ in your favourite text editor. To give the backup a meaningful name, you need to find the key ‘Display Name’ and change the <string> tag to anything you want.

Once this is done, open up iTunes and plug your phone in. Now, in the future when you want to restore one of your previously saved backups, just right click the iPhone in iTunes and click ‘Restore from Backup’.
Now you will notice that you have multiple backups to choose from, and can restore back to any of the backups which you’ve saved. Note that the display name I edited above is the one which shows in the drop down list.

Apologies for this last one being a photo rather than a screenshot, but I’m writing this on a macbook pro (running windows 7!) and there’s no print screen key, and when trying to use snipping tool, the drop down box closes when it loses focus.

There you go, that’s all you need to be able to manage multiple backups on an iPhone. I assume this will work for iPods as well but I don’t have one to test it on.

I recently changed from Windows Mobile to an iPhone, after getting tired of Windows Mobiles sluggishness and general lack of innovation.

I don’t like iTunes, and generally prefer to manage my music manually in explorer, and use winamp to play songs/albums. I know of alternatives like SharePod which allow you to manage music on your iPhone or iPod, but you still need to use iTunes for things like backing up etc..

The way I get around this is fairly simple, I still do everything in iTunes but manage my music manually. Firstly, I use a great free app called mp3tag to make sure that the music has the correct id3 tags, album art etc..

Then it’s just a case of putting the music I want on my iPhone into iTunes, and nothing else. First, set iTunes to sync all music with the iPhone, and then simply drag and drop folders or individual songs from explorer into iTunes and sync with the iPhone. To remove music, just delete it from iTunes and sync again.

I find this an easy way to make sure that I don’t have to use iTunes to actually listen to music or manage my collection, but I can keep my phone happy by using iTunes to sync music to it. It’s much easier than having all your music in iTunes and telling it to only sync certain artists/playlists.

I have some friends who either use the ‘selective sync’ option, or just use alternatives like SharePod or Media Monkey to copy music, but after I show them the simplicity of this method, they make the switch. Hopefully a couple of others will find this useful.

Having been bitten a few times by not backing data up, I’m now pretty anal about making sure my servers are backed up.

First, a little bit of background. My network consists of a large number of linux boxes (mostly debian and ubuntu), and various windows servers running anything from XP, to 2000 and 2003. I have one dedicated linux machine which is a backup server running debian. Some backups are ‘put’ onto the backup server at predefined intervals over samba, nfs, and ftp, and others are ‘retrieved’ by scripts on the backup server. Every day these backups are copied to 2 usb drives (both encrypted with truecrypt) and taken off site.

As rebuilding a server is a fairly quick task (especially ubuntu, which can be installed and configured from scratch in under 20 minutes), I only back up the necessary configuration files and data, as doing full images of every server would need a huge amount of storage.

Firstly, the backup server itself needs to be configured to run samba, nfs, and ftpd. Setting these up is fairly trivial and won’t be covered here but I will write guides to setting these up in the very near future. As a side note, we have recently switched from a backup ‘server’ to a QNAS network storage device. As this runs linux it’s more than capable of running the necessary cron jobs for the ‘get’ server backups. Plus it also comes preconfigured with samba, nfs, timecapsule, and ftp.

So, on to the backing up. All of my windows machines are part of the ‘get’ backups, where the backup server itself connects to the client and fetches the backup. To achieve this, I simply create network shares on the client machines, then do something similar to the following:

mount -t smbfs //svr2/share /mnt/backup
tar -zcvf /home/backups/svr2.tgz /mnt/backup/* -R
umount /mnt/backup

I have this saved as a shell script which runs every night to fetch a backup of the necessary data from the windows machine. Note that this method can be used for any windows server where the necessary data is shared on the network, or any linux server where the data is shared over samba. I have a number of these shell scripts, all of which connect to different servers and save their vital data.

Second, onto backing up our client machines which are all running windows XP. We’ve ‘trained’ all our users to store their important documents inside the ‘My Documents’ folder. I then have samba shares on the backup server for each user, and re-map their ‘My Documents’ folder to the network drive. To achieve this, I map the drive on their machine, and then right click on ‘My Documents’, and change the location it points to.

To backup these folders, all I need to do is create a tar archive of each of the samba shares.

Finally, backing up the linux servers. As I said above, some of these are backed up by just making a tar archive of their samba shares. For servers which don’t have samba shares, I run cron jobs on each machine which creates a local backup and then copies it to the backup server through ftp.

An example of how to back up a standard debian/ubuntu apache install:

tar -zcvf /home/backups/apache_configs.tgz /etc/apache2/* -R
tar -zcvf /home/backups/website_data.tgz /var/www/* -R

An example of how to back up a MySQL server. There are 2 ways to do this. The simple way to back up all data is to make a tar archive of the entire MySQL data directory. This is fine for many small sites but may not be suitable for sites where the data is constantly changing, or the tables are using innodb (innodb doesn’t always backup 100% successfully by simply copying the data files). For a standard debian/ubuntu install, this can be achieved by:

tar -zcvf /home/backups/mysql_data.tgz /var/lib/mysql/* -R

Another method of backing up mysql is to use the ‘mysqldump’ command line utility, which will create a dump of the database as a .sql file, and can be re imported at a later date. This is seen as a more secure backup because the sql files can usually be imported across mysql versions easily, but has the downside of a slower backup, slower restore, and occasionally you will need to manually edit the dump files to get them to reimport properly. A mysqldump can be created by running a command similar to the following:

mysqldump -uUSER -pPASSWORD -hHOST DB_NAME > /home/backups/file.sql
mysqldump -uUSER -pPASSWORD -hHOST ANOTHER_DB_NAME > /home/backups/file2.sql
tar -zcvf /home/backups/databases.tgz /home/backups/*.sql

Backing up a DNS server is also very simple, and can be done in much the same way as the apache backup above, making sure that the directory including the configs, and zonefiles are included in the archive.

Mail servers can be a bit more tricky since they rely on configs for different services which are usually found in different locations. Also, all user email must be backed up. The way I achieve this is to have the shell script create a tar file for all user email, and then manually copy the important configs into a directory before creating a tar file containing them all.

Once you’ve backed up the data for the servers, you will need to move it to the backup server for safe keeping. I usually do this over FTP, by adding something similar to the following to the bottom of the backup shell script:

# FTP to backup server

HOST=’backup_ip’
USER=’backup’
PASS=’password’
cd /home/backups/

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASS
binary
quote CWD backup/SERVER_NAME/
put backup_file.tgz
quit
END_SCRIPT

That’s about all there is to know. It’s all fairly simple to do, but ensures that you have backups of all your important data. If you wish to perform incremental backups then it’s advisable to look into rsync.

Once all of the servers have been backed up, I have a script on the ‘backup server’, which does some tidying up, and copies all of the daily backups to a directory with todays date. This means I can store backups for as long as I wish without accidently overwriting them.