• Aucun résultat trouvé

Let's assume you have an NFS server running on a PC named nfs.homenetwork.net, which shares a /for_tivo directory to be mounted by your TiVo. Create a /var/mnt directory under which to keep NFS-mounted directories.

Create a subdirectory named appropriately for the machine and directory you are going to mount:

bash-2.02# mkdir /var/mnt

bash-2.02# mkdir /var/mnt/homenetwork

bash-2.02# mount nfs.homenetwork.net:/for_tivo /var/mnt/homenetwork

That's all there is to it. Now, whatever files you place into the /var/mnt/homenetwork directory on your TiVo or the for_tivo directory on your PC will be accessible to the other.

Top

Hack 57 Reading Email on Your TiVo

What's the point of a network connection if you can't read your email?

For many people these days, reading email is like breathing itself. The first thing they do with a network connection is grab their email. Why should your networked TiVo [Hack #49] be any different?

It shouldn't, or so answers Douglas Mayle with TPOP (http://www.networkhackers.com/tpop/), his POP3 email client for TiVo. TPOP queries a standard POP3 email server over your network connection, slurping new mail messages into TiVo's built-in message queue (Messages & Setup Read New Messages), which is reasonably well-suited to repurposing in this way.

As the name suggests, TPOP doesn't do IMAP. That's a pity, given that IMAP seems better suited for the task, keeping its message store on the mail server rather than locally on your TiVo.

Grab a copy of TPOP (http://www.networkhackers.com/tpop/tpop.tar.gz), transfer it to your TiVo [Hack #36], expand it, and put it into place under your /var/hack directory:

bash-2.02# cd /var/hack

bash-2.02# gzip -d tpop.tar.gz

bash-2.02# cpio -i -H tar < tpop.tar bash-2.02# rm tpop.tar

bash-2.02# chmod 755 tpopd.tcl bash-2.02# mv tpopd.tcl bin bash-2.02# mv tpopd.conf etc

All that remains is to configure TPOP to know where and how to retrieve your email. Thankfully, Mayle has built all this in, allowing you to build a new configuration file from the command-line, like so:

bash-2.02# tpopd.tcl -c /var/hack/etc/tpopd.conf -S -s 192.168.0.1 -P 110 -u raffi -p my_password

You should replace 192.168.0.1 with the IP address of your POP3 email server (sorry, TiVo doesn't do DNS resolution), 110 with the appropriate port specification (it's usually 110), and raffi and my_password with your email account's username and password. The script will overwrite the configuration file (/var/hack/etc/tpopd.conf) with the specified values.

Once configured, launch TPOP:

bash-2.02# tpopd.tcl -c /var/hack/etc/tpopd.conf

The script will start running in the background, checking your email every 10 minutes. Send yourself an email message from your usual email application, come back in a few minutes (Messages & Setup Read New Messages), and read email right on your very own television screen (see Figure 4-17).

Figure 4-17. Personal email incorporated into TiVo's message queue

The TiVo interface doesn't provide any real way to respond to that email, and TPOP keeps itself to downloading new messages and injecting them into the queue. This means that email on the TiVo is relegated to read-only. Still, it's a rather nice trick at that!

Top

Hack 58 Using the TiVo Control Station

Control the various hacks you have installed on your TiVo and populate your TV screen with sports scores, weather forecasts, stock quotes, Closed Captioning, and more.

For some, TiVo—not the computer—is the central repository of all knowledge in the universe. You waste . . . uh, spend . . . many an hour seated in front of it, soaking up its bounty like a sponge. Television programming is simply not enough—you want more?

You can already browse your email [Hack #57] onscreen. If you have a DirecTivo, you have caller ID information [Hack #43] at your heads-up disposal. How much more do you want?

Much more.

The TiVo Control Station (TCS), available at http://www.zirakzigil.net/tivo, is a metahack, encompassing various other hacks applied to the Series 1 TiVo. Think of it as a backdoor hack [Hack #8], only a lot more powerful. In fact, the TCS has access to those backdoor hacks.

The TCS runs as a service on your TiVo, listening for special remote control sequences. One sequence turns on tivovbi [Hack #42], while others display sports scores on the screen, check the weather forecast—as if you have any intention of going outdoors any time soon ;-)—or look up stock quotes.

Setting up the TCS is a little involved, so let's go through it carefully. First, you'll need newtext2osd [Hack #41] and JPEGwriter [Hack #40] installed on your TiVo. Once you have those set up, grab a copy of the TCS at

http://www.zirakzigil.net/download/TCS_1.0.0.tar.gz, and drop it into your /var/hack directory [Hack #52], and install as follows:

bash-2.02# gzip -d TCS_1.0.0.tar.gz

bash-2.02# cpio -i -H tar --make-directories < TCS_1.0.0.tar bash-2.02# rm TCS_1.0.0.tar

This leaves you with a new /var/hack/tcs directory, containing all the bits of the TCS you'll need. Perfect. Now, let's make sure that everything is configured properly.

Fire up your favorite text editor Section 3.11 on TiVo and edit /var/hack/tcs/config/IPAddresses. The first three lines provide the IP addresses of three DNS name servers for the TCS to use for domain name resolution; replace the xxx.xxx.xxx.xxx , yyy.yyy.yyy.yyy, and zzz.zzz.zzz.zzz with the DNS server addresses used by your home network and computers. Save the modified file when you're done.

If you're not sure where to find your local DNS servers, contact your local Internet provider and ask them for the IP addresses of their domain name servers.

Next, open the /var/hack/tcs/config/prefs file. This is a really long file that contains every configuration option the TCS needs. Somewhere in the file you'll notice a block of lines that look something like this:

telnet TelnetCommand /sbin/tnlited 23 /bin/bash -login

These lines tell the TCS where to find all the programs it's going to control for you. All but one of these lines point to the places we've suggested you put the support programs; alter the ftp line to read:

ftp FtpCommand /var/hack/bin/tivoftpd

Hold your breath and run the TCS:

bash-2.02# /var/hack/tcs/startcs

This command should return you to the prompt immediately and—despite no confirmation at all—the TCS should be running in the background, awaiting remote control sequences.

To shut down the TCS at any time, issue the following sequence on your TiVo remote control:

9 9 Clear

Do not simply kill the TCS processes. The TiVo Control Station is built on top of tivosh, the underlying shell that controls most interapplication messaging in the TiVo. tivosh does not take well to being interrupted, so simply killing the TCS on the command line will force your TiVo to reboot itself.

So, what can the TCS do for you? The list (http://www.zirakzigil.net/tivo/TCSreadme.html) is about as long as your arm—as long as mine at least. In addition to being able to stop and restart your TiVo's FTP, telnet, tivovbi, and tivoweb daemons, activate/deactivate other hacks, and sort the Now Playing list, you can check the weather forecast, display the latest sports scores, and look up stock quotes.