Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux Timesaving Techniques For Dummies.pdf
Скачиваний:
59
Добавлен:
15.03.2015
Размер:
15.98 Mб
Скачать

14

Downloading and

 

 

Uploading Files

Technique

in a Snap

 

Save Time By

Building software from downloaded tarballs

Mirroring Web sites with

wget

Verifying your bookmarks with a wget spider

Setting $http_proxy to increase download speed

Using curl for unmanned uploads

The Internet is pervasive. Few days go by when we aren’t researching something on the Web. When you use the Internet, you’re constantly moving data. Using the right tools to upload and download

files can make a huge difference in the time it takes you to get the job done.

In this technique, we walk you through downloading and compiling a software tarball. You can find tarballs all over the Web, with great, timesaving software just waiting to be downloaded. The example we show you is for another timesaver — SuperKaramba — that just happens to be fun, too.

When it comes to moving data around, don’t overlook the command line. Using wget to create mirrors of Web sites you visit frequently is a great way to save time — you don’t have to wait for page downloads, and you can take the entire site with you when you travel. You can even schedule wget to perform mirror updates at night, when the network traffic is low. Now that’s a timesaver.

wget also has a few other tricks up its sleeve for downloading. It can play spider, cruising the Web sites in your bookmarks or links files checking to see if all the links still work. wget doesn’t give up on downloads if a connection drops. It’s a persistent agent and will try again to complete a download.

We also show you how to use curl to manage file uploads. Unlike ftp, curl manages uploads with just one entry at the command line. You can schedule your uploads, just like your downloads, to happen without your help.

Building Software from Downloaded tarballs

Free software packages are all over the Web. Many packages are available in RPM format, but some of the really good stuff only comes wrapped up in a tarball that you have to compile yourself.

Building Software from Downloaded tarballs

89

No problem — you can deal with tarballs. First, we give you the basic steps and then we explain how to use those steps for SuperKaramba.

Compiling a tarball: The basic steps

The basic steps don’t vary much for most software you find on the Web:

1. Download the tarball.

2. Unpack the tarball (see Technique 13 for more information).

3. Use configure to determine the software needs.

4. Use the make command to run the compiler.

5. Run make install to run the install script for the package.

If there are any variations in the procedure or any software prerequisites, the download page should include instructions specific to the package.

Downloading and compiling SuperKaramba

SuperKaramba is a tool that builds custom desktop features. In this section, we present the basic steps for downloading and compiling SuperKaramba as a fun and useful example of how you apply the basic steps to an actual program.

With SuperKaramba, anyone (not just the propeller-heads) can create desktop accessories fast. Use SuperKaramba to display information you’ve read over the Internet, create custom toolbars, or create virtual pets (ChiaPenguins perhaps?). You can download some pretty cool, ready-to-run SuperKaramba resources, too!

If you’re running SuSE, you’re in luck — SuperKaramba is already included with the KDE desktop in a standard installation. If you’re running SuSE, just open the main menu and choose System Desktop Applet karamba.

If you’re running Mandrake, you’ll find SuperKaramba is included with the standard distribution, but you need to install it. You may want to download and compile your own version anyway, to check out the most recent features as they develop.

To build SuperKaramba, follow these steps:

1. Open your browser and surf to

netdragon.sourceforge.net

2. Click the Download SuperKaramba link at the bottom of the page.

3. Scroll down to the Official Releases and click the link for SuperKaramba source code.

Why use a tarball when an RPM package is available? Well, if the RPM package that you find isn’t from an official source, the integrity of the software may be questionable.

Although it is possible for someone to introduce a Trojan horse into source code (just like a prebuilt version), it doesn’t happen often. RPM packages are platform specific, and the platform you need may not be available.

4. Click the link for the most recent release:

$superkaramba-0.33.tar.gz

5.The download page instructs you to choose a mirror site near you. Click the link for the site nearest you and then save the file to your desktop.

6.Open a terminal window and move to your Desktop directory:

$cd ~/Desktop

7.Unpack the tarball with the following command:

$tar -zxvf superkaramba-0.33.tar.gz

8.Move into the superkaramba-0.33 directory:

$cd superkaramba-0.33

90 Technique 14: Downloading and Uploading Files in a Snap

9. Enter the following command:

$./configure --prefix=$(kde-config -prefix)

configure determines the correct set of tools and compiler options to customize the software for your computer.

The --prefix=$(kde-config -prefix) portion of the command is unique to KDE. Use configure --help to get more configuration options for KDE and non-KDE programs.

If configure complains about any problems, now is the time to correct them. configure does remarkably well at describing the cause of any problem it encounters. If you see an error message that just doesn’t seem to make sense, type the text of the message in to Google and you’re likely to find a solution waiting for you somewhere out there on the Web.

10. Enter this command:

$ make

make runs the compiler for you. The compiler is translating the source code into a program one bit at a time. The make program coordinates the build — think of it as the job site foreman.

11. Give yourself superuser privileges:

$ su

Enter the superuser password when prompted.

12. Enter this command:

# make install

make install runs the install script for the package. Depending on the package you’re installing, the install script includes activities like copying documentation into place, setting up user accounts, and so on.

13. Turn in your superuser privileges with the exit command.

After SuperKaramba is installed, you can use it to decorate your desktop. See the sidebar, “Installing a SuperKaramba theme” for details.

Installing a SuperKaramba theme

After you install SuperKaramba, we suggest grabbing a theme or two to see how easy this program makes changing your desktop. SuperKaramba themes are different from other desktop themes. They’re active desktop decorations — little accessories for your desktop that actually function.

One desktop applet that we really like is Liquid Weather++. You could go to KDE-look.org and spend hours looking through the pages of Karamba themes — do that later. To find Liquid Weather++ quickly, go to www.google.com and search for Liquid Weather Karamba, and follow the link.

To download and unpack Liquid Weather++, follow these steps:

1.Open your favorite browser and surf to the download site for Liquid Weather++.

2.Click the download link and save the tarball to your desktop.

Notice that this tarball is different; it ends with the

.bz2 file extension. Different flavors of tarballs exist — gzips and bzips. Gzips and bzips are basically the same, but bzips generally offer better compression and download speed. You can unzip either kind with Linux.

3.Open your terminal window and move to the Desktop directory.

$ cd Desktop

4.Create a themes directory with this command: $ mkdir themes

5.Move to the themes directory: $ cd themes

6.Unpack the tarball with this command: $ tar -jxvf ../tarball

This extracts the tarball into the themes directory.

To start SuperKaramba, open the Main Menu and choose Run Command. Enter superkaramba in the Command field and click Run. The SuperKaramba window opens, as shown in the following figure.

Соседние файлы в предмете Операционные системы