Created March 28, 2001. Updated April 8, 2001.
The nap software is copyrighted by Kevin Sullivan, under conditions set forth in the file COPYRIGHT.
XXX
stands for a version number.
Instructions: download the file nap-XXX.tar.gz
. The
following sequence of commands should compile and install nap.
tar -zxf nap-XXX.tar.gz cd nap-XXX ./configure make su (type root password) make install
nap-linux-XXX.tar.gz
.
Install nap as follows:
tar -zxf nap-linux-XXX.tar.gz cd nap-XXX su (type root password) cp nap /usr/local/bin/nap chmod 0755 /usr/local/bin/nap
nap-XXX.i386.rpm
.
As root, install nap with the single command
rpm -ivh nap-XXX.i386.rpm
nap-XXX.tgz
.
Install it with the single command
pkg_add nap-XXX.tgzNote: this file is an OpenBSD Package, not a regular tar archive. It should be installed with "pkg_add". If you unpack it with "tar", do it in an empty directory, as it will spill some files into the current working directory. If you do unpack this as a tar file, you will find an executable binary in the "bin" subdirectory.
/usr/local/bin
; you can install it anywhere you like.
All that is really necessary is that the nap
binary is
somewhere in your PATH
. The recommended steps are as
follows:
1. create a directory bin
in your home directory, and
move the file nap
there.
mkdir $HOME/bin mv nap $HOME/bin2. If the shell you are using is
sh
or bash
,
put the following lines in the file .bashrc
in your home
directory:
PATH=$PATH:$HOME/bin export PATHIf the shell you are using is
tcsh
, put the following
line in the file .tcshrc
in your home directory:
set path = ($path $HOME/bin)3. Restart the shell. You should now be able to invoke nap by typing
nap
.
.napconf
in your home
directory, whose content looks more or less like the following (of
course, you need to substitute your own data):
# the username, password, and email address of your Napster account user=username pass=? email=email@here.com # a list of directories with shared files, separated by semicolon ';' upload=music/;music2/ # a directory where to put downloaded files download=music/ # which port to use for incoming upload requests - probably the # default will do fine. It is advisable to specify a range in case the # given port is busy. dataport=6699-6799 # your type of internet connection, according to the following list: # # Connection | Number # ------------------- # Unknown | 0 # 14.4 | 1 # 28.8 | 2 # 33.6 | 3 # 56.7 | 4 # 64K ISDN | 5 # 128K ISDN | 6 # Cable | 7 # DSL | 8 # T1 | 9 # T3 or > | 10 connection=4 |
A file with the above sample contents came with your nap distribution,
and you may find it easy to copy it to your home directory and edit it
to your tastes. The sample file is called nap.conf.dist
. If you used RPM,
this file can be found in the directory /usr/doc/nap-XXX
,
otherwise it is in the tar ball that you unpacked.
Note that you may either enter your password, or you may leave the password entry blank (or use a single question mark), if you want nap to prompt you for your password each time.
That is all. You are now ready to use nap. In fact, even if you don't create this file, you can still use nap, and you will be prompted for the missing information. However, in this case, you will not be able to share any files.
All the options that you specify in your .napconf
file
can be overridden on the command line. In fact, it is even possible to
have more than one configuration file (for instance, if you have two
different napster accounts with different usernames and passwords),
and to specify on the command line which one to use.
nap -bYou will be prompted for any necessary information not included in your configuration file, and eventually you will see napster's main screen, which looks more or less like this:
[nap v1.4.4-ps-2] _.-------._ |\ /| /| \_.----._/ |\ __ .$: :$. _____ ____ _____ _____ / /__ ___ ____ |$$: ___ ___ :$$| / __ // _ `// _ // ___// __// _ \ / ___/ "$: \___\/___/ :$" / / / // /_/ // /_/ /(__ )/ /_ / __// / | __ | /_/ /_/ \__,_// ____//_____/ \___/ \___//_/mG! `. \/ .' /_/ `. .__, .' `----' * This is the main screen of nap. * * In this space, you will usually see some welcome messages from your * Napster server. * * In the upper right corner, you see the version number of nap. * The blue line below is called the status line. * It displays the user name, and some other information. In the right part * of the status line, you see the number of current uploads and downloads. [username] [474042 songs in 8066 libraries (1954 gigs)] [U/0 D/0] |
The very last line, after the status line, has a cursor. This is where you can enter commands. All commands start with a slash "/"; if you forget the slash, nap will complain that you are "not on a channel". But more about that later.
/search
command. For
instance, if you want to search for a song called "Yucky green goo",
you type
/search yuckyThis will cause nap to search for files that contain the word "Yucky". Napster queries are case insensitive, so it doesn't matter if you search for "yucky" or "Yucky". If fact, napster is generally very tolerant regarding search queries.
After a few moments, another screen will pop up with the search results. This is called the result screen. It might look as follows:
Filename (total = 14) | BRate | Length | Conn -----------------------------------------|-------------|--------------|--------- 1) Bobby Bones - Yucky.mp3 | 64 | 3:24 | T3 2) HOT 5- [07]Time Will Tell.mp3 | 128 | 2:12 | T3 3) WB theme songs - Jack and Jill .mp3 | 128 | 3:00 | Cable 4) Korean Rap-YG family - 1tym attack.mp | 128 | 3:35 | 56k 5) Felicity THEME season 3 (New version | 128 | 0:53 | 56k 6) Passions theme.mp3 | 128 | 2:24 | 33.6 7) Korean - Uptown(03)- Han Oh Baek Nyun | 128 | 4:25 | 28.8 8) BB Mack - Back Here.mp3 | 192 | 3:40 | 28.8 9) Cher_with_Peter_Cetera-After_All.mp3 | 128 | 4:04 | 28.8 10) Gob- Paint it Black.mp3 | 160 | 1:49 | 28.8 11) 3lw (Three Little Women) - NO MORE3. | 192 | 4:26 | 28.8 12) kpop-CLICK B-EXIT.mp3 | 128 | 4:21 | 14.4 13) Duets - Gwyneth Paltrow & Huey Le wi | 192 | 4:51 | 14.4 14) Dawson's Creek 2 Soundtrack - Shawn | 128 | 4:38 | Unknown | | | | | | | | | | | | | | | | | | | | | 1:\1\Mp3\Bobby Bones - Yucky.mp3 |
Note that not all files listed actually contain the word "yucky". For instance, some of them might be found in a directory named "yucky", but the directory name is not displayed in the results list.
The files are listed in decreasing order of connection speed. On the result screen, you can move up and down with the respective arrow keys, or you can move faster with the "PgUp" and "PgDn" keys. The red line at the bottom displays the full filename of the song currently selected; if it does not fit on the screen, you can scroll it from side to side with the right and left arrow keys.
By default, the result screen displays the bitrate and length of each song, as well as the connection speed and/or ping results. However, you have full control over what information is displayed: The following keys toggle each category of information on and off:
b - bitrate l - length m - megabytes f - frequency u - user name s - speed p - pingMoreover, if you type 'a', all categories of information will be turned on. Warning: this might not all fit on the screen, and will be cut off on the right.
You can hit "return" for any song you wish to download. Note: do not use nap to download or distribute any copyrighted material.
Type "q" to return to the main screen. From the main screen, enter
/results
to return to the result screen. You can also
switch back and forth between the main screen and the result screen
with the function keys "F1" and "F2".
Back on the main screen, nap will inform you about any downloads or uploads that have been started or stopped. If you want to see a detailed list of downloads that are currently going on, type
/pdownThis will tell you, among other things, how far each download has progressed.
If you want to delete a particular download, first find out what its
number is by using /pdown
. Suppose you want to delete
download number 3, then you type
/ddown 3
Files are downloaded into the directory which you specified during configuration or on the command line. If you did not specify a download directory, nap will use the current working directory.
Do not try to download two files with identical names. Nap currently does a very bad job in this situation. Wait until one download has finished, then rename the file manually.
/browseand that user's files will appear on the result screen.
/pdown
and
/ddown
for uploads are /pup
and
/dup
.
You can use to "up" and "down" keys to scroll through a history list
of previous commands. This will help you save time typing. You can
also use the "tab" key for completing partially typed commands. For
instance, /res[tab]
will yield /results
.
Type /results
to return to the results screen after a
previous search. Type "q" to leave the results screen.
You can type /help
to see a list of available
commands. (There are so many that you will probably have to use "PgUp"
and "PgDn" to see them all). You can get usage info for a particular
command by typing /help
followed by the command name
(without the leading slash).
/quit
. If there are any uploads or
downloads going on, nap will refuse to quit unless you type
/quit yes
.
nap -bThe "-b" tells nap to "build your library", which means to compile information about all the files you are sharing. This information goes into a file in your home directory called ".nap_shared". Once you have built your library, it is not necessary to type the "-b" the next time you invoke nap, provided that nothing has changed about your shared files. This might save you some time because nap starts faster if it doesn't have to build your library again.
On the other hand, if you added or deleted any shared files or directories, it is necessary to rebuild your library, or otherwise, nap will rely on out-of date information (and not share any new files you might have added). Thus, I recommend always invoking nap with the "-b" flag unless you are sure that it is unnecessary. In the future, this may become the default behavior of nap.
You can learn about other command line options in the section "Summary of command line options" below.
/msgIf you don't want to receive such messages from a particular user, you can ignore the user by typing
/ignore user messageYou will no longer see that user's messages or files. If you have regrets later, you can also
/unignore
a user.
/clist or /clist2to see a list of available channels.
/clist2
lists more
channels than /clist
. To join a channel, type
/join channelYou can be on several channels simultaneously. To switch between channels, type
/join
again. To leave a
channel, type
/part channelYou can omit the channel name if you want to leave the current channel.
While you're on a channel, you will see a special prompt telling you what channel is currently active. To say something on that channel, simply type the message. This is why all command names start with a slash "/": so that when you're on a channel, nap can distinguish between a command and a post to a channel.
A word of caution about double quotes ("). The napster protocol is extremely dumb when it comes to double quotes. It cannot tolerate any data which contains double quotes. This includes filenames, messages, and anything you say on a channel. This is not nap's fault; it is really a problem with the napster protocol. Thus, avoid using double quotes under any circumstances. Use single quotes instead.
To see a list of all channels you are currently on, type
/pchans
. To see a list of users on your active channels,
type /names
.
Just like for messages, you can /ignore
a user that is
bothering you. More severe punishments are also available for users
that behave truly inappropriately: you can request to kick a user from
a channel or all channels, or request that a user be muzzled, killed,
or banned. Such measures should of course be taken only under extreme
circumstances, and might be subject to review by the administrators of
your napster server. The corresponding commands are called
/kick
, /kickall
, /muzzle
,
/kill
, and /ban
. Try
/help commandfor more info.
/alias x get $1this will define "x" to be an alias, and you can henceforth type "/x arg" instead of "/get arg". But there's more to aliases than this simple example suggests. For instance it is possible to write aliases that contain "if" conditionals or "while" loops. Aliases can also be saved and loaded from a file. I know very little about the details of alias syntax, so additions to this section are very welcome.
Nap's daemon mode allows you to do exactly that. If you invoke nap as follows:
nap --daemon --autorestartit will connect to the napster server and then run silently. While connecting, it will still print the usual informational messages, and prompt you for any missing information. As soon as the connection succeeds, it will print something like
Connected to 208.184.216.40:8888and then fall silent. It will produce no further output, nor react to input. Moreover, if your config file is complete, and you are sure that nap will not prompt you for any information, you can even suppress the informational messages by redirecting its output:
nap --daemon --autorestart > /dev/null
By the way, the --autorestart
option is so that nap will
automatically reconnect whenever it detects that it has been
disconnected from the server. It tries to do this at most once a
minute, so that your computer will not overheat in case all servers go
down.
Using this method, I have been able to run nap unsupervised for days and even weeks at a time.
If you feel uncomfortable with nap's silence, and you would rather like to see whether it is actually working (and not just dozing off), you have the ability to write something to a log file. The option
--log logfilewill cause nap to log all uploads and downloads to the specified file. (But beware that log files might later be used against you in court). If you'd like even more information, you can specify
--logall logfile2and nap will log everything that would have normally been written to the main screen to that file. Note that these log files can take up a tremendous amount of disk space, so you might want to delete them and restart nap periodically, for instance once a week. If a log file already exists, nap will append its output to the end of the existing file.
nohup nap --daemon --autorestart -b --log logfile >/dev/null &Note that you have to put an explicit ampersand "&", or otherwise the process will not fork to the background. To stop such a process, you will have to kill it explicitly, by saying
kill -KILL pid or killall -KILL napwhere pid is the process id, as reported by the command
ps -e
. The second form kills all processes whose name is
nap.
On my system, I use a small shell script called server
, which automates these tasks. Here
is the script:
#! /bin/bash napservers="-s 63.196.54.15:8888" napservers="$napservers -s 63.196.54.248:8888" napservers="$napservers -s 63.196.54.4:8888" # etc if [ $# -gt 0 ]; then action=$1 shift else action=start fi if [ $# -gt 0 ]; then target=$1 shift else target=all fi do_action () { local action target action=$1 target=$2 case $action in start ) do_action stop $target if [ "$target" = all -o "$target" = gnut ]; then echo -n "Starting gnut " nohup gnut -d >/dev/null & echo $! > gnut.pid echo "(PID $!)" fi if [ "$target" = all -o "$target" = nap ]; then echo -n "Starting nap " nohup nap --daemon --autorestart -b $napservers --log nap.log >/dev/null & echo $! > nap.pid echo "(PID $!)" fi ;; stop ) if [ "$target" = all -o "$target" = gnut ] && [ -r gnut.pid ]; then pid=`cat gnut.pid` echo "Stopping gnut (PID $pid)" kill -KILL $pid rm gnut.pid fi if [ "$target" = all -o "$target" = nap ] && [ -r nap.pid ]; then pid=`cat nap.pid` echo "Stopping nap (PID $pid)" kill -KILL $pid rm nap.pid fi ;; esac } do_action $action $target |
This shell script illustrates a number of things: first, note the use of the "-s" option to pass an alternative list of server addresses to nap. Second, the script can be used to start and stop not only nap, but also gnut, another neat file sharing client for linux (gnut is a Gnutella client). Third, the script automatically saves the process id so that it knows how to stop the process later.
I invoke this script as follows:
./server start nap (to start or restart nap) ./server stop nap (to stop nap) ./server start gnut (ditto for gnut) ./server stop all (stop them both)
Usage: nap [options] Options: -h, --help - print this help message -v, --version - print version info and exit -b, --build - build library of your current mp3s to send to server -B, --build-only - build library and exit -m, --create - create new account from the information in config file -r, --reconnect - keep reconnecting until server connection established -a, --autorestart - automatically reconnect when connection to server lost -q, --daemon - run without user interface; file sharing only -t, --notitle - do not display the title bar (fixes messed-up displays) -l, --nxterm - try using a terminal which is compatible with most systems (fixes messed-up displays) -f fn, --config fn - specifies the config file to use (default $HOME/.napconf) -x fn, --log fn - log all transfers to a specific filename -g fn, --logall fn - log everything to a specific filename -s sv, --server sv - select a specific server (multiple -s opts possible) -d n, --debug n - set debug level -u str, --user str - specify Napster username -p str, --pass str - specify user's password -e str, --email str - specify user's email address -U dir, --upload dir - specify upload directory (multiple -U opts possible) -D dir, --download dir - specify download directory -P n, --dataport n - specify local data port to use -C n, --connection n - specify connection speed number (see README) -M n, --maxuploads n - specify maximum number of simultaneous uploads
/help
:
about alias aliaslist announce ban banlist block blocklist break browse cban cbanlist chupload clear clearalias clearhandler clist clist2 cloak conf cunban ddown dec debug disconnect dns done dup echo eval exec finger g get gusers handler handlerlist help hotlist hup if ignore ignoreclear ignorelist inc irc join kick kickall kill lastlog loadalias loadconfig loadhandler me msg muzzle names news noprint notify opsay part pchans pdown ping psocks pup query quit rebuild reconnect reload reloadm results savealias saveconfig savehandler say search serv server set setdataport setlevel setlinespeed setpassword setuserlevel sraw stop sver tell timer tlist topic tquit unalias unban unblock unhandler unignore unmuzzle unnotify unset while whois window wstats