How-To: play DivX and Xvid on your Apple TV

-from engadget thanks guys for this awesome how to

The two biggest Apple TV limitations are the lack of codec support (like XviD, DivX, etc.) and not even having the ability to do basic surround sound like Dolby Digital 5.1. These issues were resolved almost immediately after the Apple TV was released, although the hacks were somewhat less than practical. Something as simple as getting your Apple TV to, say, sync and recognize your XviD movies as playable was no simple feat. Thankfully, that’s no longer the case, and we want to show you how to get the most out of your Apple TV. Who says you can’t have your cake and eat it, too?

Before we get started we would like to applaud the entire crew from AwkwardTV, if it wasn’t for their great Wiki, we may not have figured all this out.

Warning: you’re about to engage in some serious, potentially warranty-voiding hacking. Just the way you like it, right? Ready to get your hands dirty? We need to download a few files first.

Download – ATVFiles plugin.
Download – Perian, the swiss army knife of QuickTime codecs.
Download – A52Codec, an AC3 codec.
Download – Custom ssh.plist file to start sshd automatically.

Optional
Download – Fugu, a nice OS X GUI to transfer files to the Apple TV.
Download – WinSCP to a nice Windows GUI to transfer files to the Apple TV.
Download – If you don’t have an Intel Mac, you will need this Intel version of sshd.

Materials needed
A Mac of some sort – Sorry, you’ve got to be able to read the Apple TV’s drive to at least get sshd going.
other stuff here.

We are going to do this in two steps. For those who do and do not already have SSH enabled. So if you’ve got SSH running on your Apple TV, skip ahead to the next section.

Enable SSH on the Apple TV (requires a Mac)

Remove the drive the same way we did to expand the drive and plug it into a Mac, then launch Terminal. Our first command is going to copy the Intel version of ssh daemon from our Mac to the ATV drive. If you are on a Intel Mac copy it from your sbin directory to the ATV’s OSBoot/usr/sbin/ directory. If your browser causes the line to wrap be sure to enter it on one line in the Terminal.

sudo cp /usr/sbin/sshd /Volumes/OSBoot/usr/sbin/

You can also copy it from your downloads directory:

cp /Users/Engadget/Downloads/sshd /Volumes/OSBoot/usr/sbin/

Backup the original ssh.plist to our home directory:

cp /Volumes/OSBoot/System/Library/LaunchDaemons/ssh.plist ~

Now copy the new one from our downloads directory to the Apple TV drive:

cp /Users/Engadget/Downloads/ssh.plist /Volumes/OSBoot/System/Library/LaunchDaemons/

Before we dismount the drive to reinstall into the Apple TV, let us see if we need to clean up after Spotlight again.
Perform these command and check if the .Spotlight files are on the partitions by typing:

ls -a /Volumes/Media

and

ls -a /Volumes/OSBoot

Now, if you do see those .Spotlight files, use the following command to remove them. But be careful, this is the dreaded rm -rf command, which has the potential to ruin everything.

sudo rm -rf /Volumes/OSBoot/.Spotlight-V100

or

sudo rm -rf /Volumes/Media/.Spotlight-V100

Now dismount the drive and install it in your Apple TV. If you need to give your friend’s Mac back, feel free. From here on out you can fly PC on this op, if you so choose.

Test it by signing in via terminal. (The password is frontrow.)

ssh -1 frontrow@AppleTV.local

That should get you in. So let’s start installing the good stuff, shall we?

Adding additional QuickTime components.

Before we can start copying files we need to ssh into the Apple TV and mark the volume as read / write. A few times we will use sudo (as in sudo make me a sandwich) and a password will be requested; it’s also frontrow. From the terminal, ssh to the Apple TV:

ssh -1 frontrow@AppleTV.local

Now remount root as read / write. (Enter frontrow for the password.)

sudo mount -o remount,rw /dev/disk0s3 /


At this point you can use Fugu (our scp file transfer frontend) if you prefer. Otherwise, use the commandline scp to copy the following files to the Apple TV. But before you can preform this step you need to mount all the DMGs you downloaded and uncompress ATFiles so you can have the necessary files handy.

Now, copy the ATVFiles plugin, Perian and AC3 QuickTime components to the Apple TV. (As always, depending on the location of these files your command will differ.)

scp -1 -r /Users/Engadget/Downloads/ATVFiles-0.2.1/ATVFiles.frappliance/ frontrow@AppleTV.local:~
scp -1 -r /Volumes/Perian\ 0.5/Perian.component frontrow@AppleTV.local:~
scp -1 -r /Volumes/A52Codec\ 1.7.2/A52Codec.component frontrow@AppleTV.local:~

If you have the MPEG-2 QuickTime component then you can copy that too, but otherwise it’s probably not worth the $20.

scp -1 -r /System/Library/QuickTime/QuickTimeMPEG2.component/ frontrow@AppleTV.local:~

Now we need to use ssh to move the files to the proper directory so QuickTime can find them.

ssh -1 frontrow@AppleTV.local
sudo mv ATVFiles.frappliance/ /System/Library/CoreServices/Finder.app/Contents/PlugIns
sudo mv Perian.component/ /Library/QuickTime/
sudo mv A52Codec.component/ /Library/QuickTime/
sudo mv QuickTimeMPEG2.component/ /System/Library/QuickTime/

Now we need to restart Finder so it will load the plugin, you could pull the power (easy way) or you could run a couple commands (slightly less easy way). Here those are, if you’re paranoid about unplugging your unit; find the pid to kill:

ps ax | grep Finder

This will return a line with the pid for finder.

Finders Pid
Now kill Finder’s pid. (Ours was 512 when we wrote this.)

kill 512

After Finder restarts we will see a new menu item named Files, which allows us to play movies stored in /Users/frontrow/Movies on the Apple TV. So we’ll copy a movie there, shall we? (Again you can use scp, or Fugu if you prefer.)

scp -1 ~/Movies/Gothika_480p_XviD.avi frontrow@AppleTV.local:~/Movies/

All you have to do is select the clip to play from the files menu.

Voila! Your Apple TV just got a whole helluva lot more useful.

Of course there are many more codecs that work by using the same basic method of installing QuickTime plugins into the ATV’s directory structure. And don’t even get us started on all the other plugins being developed for this bad boy. Hell, you can even mount AFP or NFS shares and stream videos instead of copying them. The possibilities are kind of endless for this little Unix box, but hopefully this guide well get you on your way. Good luck!

Boot linux on the 360

-from MydediBox
Here is a crappy help to boot linux on the 360.

First, you need :

– 360 xbox with an exploitable kernel (4532 or 4548).
– Dvd drive flashed with xtreme firmware.
– Serial adapter (http://mydedibox.homelinux.com/1.jpg).
– King kong patched.
– Xell loader (thanks tmbinc).
– A powerpc toolchain (http://kegel.com/crosstool/)

– Install NFS server on your linux box, and make a share available for the 360 linux kernel to load the filesystem (eg. /tftpboot/x360). You also need portmap installed.
For help if needed :
http://tldp.org/HOWTO/NFS-HOWTO/server.html
http://www.google.fr/search?hl=fr&q=nfs+server+howto&btnG=Recherche+Google&meta=

– Now we need to make the filesystem, i choose ubuntu 6.10 powerpc64 livecd iso (ubuntu-6.10-desktop-powerpc.iso), mount it, install squashfs-tools then extract the compressed livecd content :

ninux$ sudo mount -t squashfs -o loop,ro ubuntu-livecd/casper/filesystem.squashfs mnt/
ninux$ cp -a mnt/. /tftpboot/x360

Note that there isnt enough device copied from the ubuntu compressed file system to our nfs root file system to boot correctly. Copy your current “/dev” folder to the nfs share :

ninux$ cp -a /dev/. /tftpboot/x360/dev”

– Edit the .config file from tmbinc (http://mydedibox.homelinux.com/downloads/x360/.config) so the kernel find the filesystem on your computer ip : “root=/dev/sdb1 ip=10.0.0.204 video=xenonfb console=tty0 nfsroot=10.0.0.1:/tftpboot/x360”

– Recompile the kernel (of course with the xenon patch applied) :

ninux$ alias smake=’make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu-‘
ninux$ smake

– Now upload the Xell loader via serial to boot your newly kernel (either by tftp or cdrom, i prefere tftp), it should load the filesystem from your NFS server. You can then chroot an usb disk from there so you dont need the NFS server anymore (a lot tricky).

– I had a probleme with the password from the livecd to pass the prompt so i added the option “single” to the kernel config line (“root=/dev/sdb1 ip=10.0.0.204 video=xenonfb console=tty0 nfsroot=10.0.0.1:/tftpboot/x360 single”) so i can change the root passwd then removed this option.

Now i should look to make an initrd so my usb disk will be available when the kernel is booting. It would prevent all this tricks.

Edit : You can also install linux on your 360 hard drive, so you dont need the nfs part anymore. Note that its not sure that you will be able to use it again after format it to a linux filesystem.
Anyway if you want so, mount the “filesystem.squashfs” file under your nfs share (“/tftpboot/x360/mnt/fs” for exemple) so it is available under your 360 linux box.
When logged on the 360, use cfdisk for exemple to make a partition on your 360 hdd (/dev/sda), format it with mkfs.ext3.
Mount it (mount /dev/sda1 /temp) then copy the filesystem on it (“cp -a /mnt/fs/. /temp).
Now recompile your kernel with this option : “root=/dev/sda1 video=xenonfb console=tty0”. You now have linux installed on your hdd !
Finnish the work .. (edit /etc/fstab, /etc/hosts, /etc/network/interfaces etc …).