I noticed there were no tutorials on the forums explaining how to do this, so I'll go through the steps I used to make this work here.
Microdc2 is an excellent command line based directconnect client, just like dc++ for windows, linuxdc++ for linux or shakespeer for mac. Now linuxdc++ is a very nice, fairly stable (later versions anyway) full featured client, so you might think why would you need something else.
Answer: Command line apps are great because
a) They take very little resources so you can run them as server daemons on older hardware
b) You can control them from anywhere in the world over an ssh connection
c) They are generally much much more stable and reliable than their graphical counterpart.
d) They're often (but not always) more configurable than their graphical alternatives.
This makes them excellent for things like running as daemons on unattended servers.
There are only two command line direct connect clients for linux. Microdc2 is one, and another one is nanodc. Nanodc appears to be under heavy development, whereas I think microdc2 may be stagnant now (correct me if I'm wrong here!). However, nanodc seems to be in pretty early beta from what I could see and although it uses a prettier ncurses interface that microdc2, its not actually as easy to use. Maybe in a little while nanodc will be a better choice, but for now, microdc2 is much better in my opinion.
First you need to download the source tarball. Go to the microdc2 website and download the latest version of the tarball. When I downloaded it, it was version 15.6, available here. So go into a command line, change to a suitable directory and download/unzip the tarball:
Ok, there's the source, but before we can compile it we need to download some libraries that the program needs:
tar xvfz microdc2-0.15.6.tar.gz
Now you can start making the program. I like to use checkinstall instead of make install because it installs the program as a normal debian package so you can easily remove it later.
sudo aptitude install build-essential libreadline5-dev checkinstall libxml2-dev libbz2-dev
Checkinstall will ask you some questions. You don't actually have to answer any of them, just say 'y' and press enter and it will automatically create a set of package docs for you.
Ok, now microdc2 is installed! If you used the default set of package docs in checkinstall, it will be called microdc2 in synaptic, and you can treat it like a normal package.
You can start microdc2 by just typing
at the command line. As with most command line applications, it looks a bit empty and threatening at first, but don't worry! It really is extremely easy to use:
You can type help and press enter to get a list of commands, or type help and then a command to get detailed information about what the command does.
Loading local FileList...done
Sharing 0 bytes (0B) totally
Microdc2 also supports tab completion so you press tab to finish commands or just press tab at an empty prompt to get help.
alias [NAME[=VALUE] ...] browse [USER]
cancel CONNECTION ... cd [DIRECTORY]
connect HOST[:PORT] disconnect
exit find [FILE ...]
get FILE ... grantslot [USER ...]
help [COMMAND ...] lookup HOST ...
ls [OPTION...] [FILE...] msg USER MESSAGE...
pwd queue [USER ...]
raw DATA... results [INDEX ...]
retry USER ... say MESSAGE...
search WORD... set [NAME [VALUE...]]
share DIR shell [COMMAND [ARGUMENTS...]]
unalias NAME ... unqueue USER [RANGE]
unsearch INDEX ... unshare DIR
who [USER ...]
microdc2> help set
set: set [NAME [VALUE...]]
Without arguments, display a list of variables and their current values. With only NAME argument, display the
value of that variable. With NAME and VALUE arguments, change the value of a variable.
Ok, microdc2 is pretty useless at the moment, so let's tell it to connect to a hub:
You should put in the ip address and port of the hub you would like to connect to. You can chat to people by doing:
microdc2> connect xxx.xxx.xxx.xxx:pppp
You can share files by doing this:
microdc2> say This is a message broadcast to everyone
Remember, microdc2 supports tab completion so it's very quick to use. These files will be instantly shared, but microdc2 will start hashing them in the background as a low priority task.
microdc2> share /home/user/sharedfiles/
Now here's something important:
Microdc2 ONLY remembers shared directories. All other settings are forgotten on shutdown.
This is why you have to create a ~/.microdc2/config file with all the commands you would like microdc2 to execute on startup. So create and open this file in your favourite editor. I will use gedit it here:
I have made an example config file here, you can change the settings to whatever you would like microdc2 to do:
Of course there a lot more options than these, but this should get you started. That's it if you want to leave it there and just run microdc2 normally!
# You should make sure that this listen port is forwarded properly if you are behind a router. If you can't forward ports, set active off and use passive mode. This can work behind firewalls but is crippled and slower than a properly forwarded one. NOTE: the port MUST be set before active mode is set on.
set listenport xxxx
set active on
# The following address should be set to your EXTERNAL ip address. This can be found by visiting www.whatismyip.com.
set listenaddr xxx.xxx.xxx.xxx
# I like to turn autoreconnect on in case I get disconnected from the server for whatever reason.
set auto_reconnect on
# The following enables logging. Replace the logfile with wherever you want it to log to. You can of course turn it off by leaving the following two lines blank
set log_charset UTF-8
set logfile /home/user/.microdc2/log
# These should all be pretty self-explanatory. Nick is your nickname. If the hub requires a password, specify one here.
set description I'm using microdc2!
set email email@example.com
set nick microdc2user
set password xxxx
set downloaddir /home/user/Microdc2_downloads/
# The set speed option doesn't actually change anything, it only changes your REPORTED speed that other users see. The slot is how many simultaneous downloads people can get from you.
set speed somerandomstring
set slots 2
#This is the hub connect command, it should be left until last
Running as a daemon
I don't know how to write init scripts so I can't help you there, sorry. I just use screen to run microdc2 as a daemon, and I reconnect to the screen every time I want to admin it. If you don't know what screen is, try typing man screen at the command prompt or do a google search.
That's it! Have fun with microdc2!