2009年12月30日星期三

Hacking Western Digital MyBook World Edition

Hacking Western Digital MyBook World Edition: "Installing aMule on my MyBook

aMule homepage: http://www.amule.org/wiki/index.php/AMule_Project_FAQ:About

About

aMule: The all-platform Mule.
aMule is an eMule-like client for the eD2k and Kademlia networks, supporting multiple platforms.
Currently aMule (officially) supports a wide variety of platforms and operating systems, being compatible with more than 60 different hardware+OS configurations.
aMule is entirely free, it's sourcecode released under the GPL just like eMule, and includes no adware or spyware as is often found in proprietary P2P applications.

aMuleCMD
aMuleCMD is a command-line utility that allows you to control aMule or aMuled either locally or remotely.
The character-oriented interface offers a subset of aMule functionality, including searching for files, initializing downloads, and viewing your download queue.
It also displays status information and allows you to change certain options.

aMuleWeb
aMuleWeb is a utility that allows you to control aMule by means of a web browser from any location.
The web interface offers a subset of aMule functionality, including searching for files, initializing downloads, and viewing your download queue.
It also displays status information and allows you to change certain options.
2. Installation
2.1. libPNG

libPNG is an open source project to develop and maintain the reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files.

# wget http://downloads.sourceforge.net/libpng/libpng-1.2.24.tar.gz
# tar -xzvf libpng-1.2.24.tar.gz
# cd libpng-1.2.24
# ./configure
# make
# make install

2.2. libGD

libGD is an open source code library for the dynamic creation of images by programmers. GD creates PNG, JPEG and GIF images, among other formats.

# wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
# tar -xzvf gd-2.0.35.tar.gz
# cd gd-2.0.35
# ./configure
# make
# make install

2.3. wxWidgets

wxWidgets provides a single, easy-to-use API/Framework for writing applications (GUI applications supported) on multiple platforms and languages.

# wget http://prdownloads.sourceforge.net/wxwindows/wxWidgets-2.8.7.tar.gz
# tar -xzvf wxWidgets-2.8.7.tar.gz
# cd wxWidgets-2.8.7
# ./configure --disable-gui --disable-gtktest
# make
# make install

2.4. aMule

# wget http://download.berlios.de/amule/aMule-2.1.3.tar.bz2
# tar -jxvf aMule-2.1.3.tar.bz2
# cd aMule-2.1.3
# ./configure --enable-amulecmd --enable-webserver --disable-monolithic --enable-amule-daemon --disable-backtrace --disable-debug --enable-optimise
# make
# make install

Compile errors in /src/libs/common/MuleDebug.cpp :
Put include execinfo.h and functions backtrace and backtrace_symbols (line 291) in comment,
bad use of compile switches (disable-backtrace) !

// if ((num_entries = backtrace(bt_array, 100)) < 0) {
// fprintf(stderr, '* Could not generate backtrace\n');
// return wxEmptyString;
// }

// if ((bt_strings = backtrace_symbols(bt_array, num_entries)) == NULL) {
// fprintf(stderr, '* Could not get symbol names for backtrace\n');
// return wxEmptyString;
// }

/usr/lib/gcc/arm-linux-uclibc/3.4.2/../../../libbfd.a(cache.o): In function `bfd_open_file':
cache.c:(.text+0x314): undefined reference to `unlink_if_ordinary'
==> to solve install GCC 4.2.2 --> http://gcc.gnu.org/ --> seems to be binutils-2.9\bfd\cache.c: problem

# wget http://ftp.gnu.org/gnu/binutils/binutils-2.16.tar.gz
# tar -xzvf binutils-2.16.tar.gz
# ./configure --disable-nls
# make
# make install

3. Configuration

This information was found in: http://www.amule.org/wiki/index.php/HowTo_get_aMule_web_interface
3.1. aMule-daemon

Go to the path where aMule was installed, which in our case is /usr/local/bin and run ./amuled.
When this is done, the configuration file ~/.aMule/amule.conf is created.

# cd /usr/local/bin
# ./amuled

Quit the daemon again.
Create a password for amule-daemon.
Use the command md5sum to create a MD5-string of a password.
Find and replace the following lines in ~/.aMule/amule.conf.

# echo -n your-password | md5sum
56f491c56340a6fa5c158863c6bfb39f

~/.aMule/amule.conf

[webserver]
Enabled=1
Password=56f491c56340a6fa5c158863c6bfb39f <-- MD5 of the password you wish to use.

[ExternalConnect]
AcceptExternalConnections=1 <-- To let aMule listen to external connections.
ECPassword=56f491c56340a6fa5c158863c6bfb39f <-- MD5 of the password you wish to use.

3.2. aMuleWeb

The program amuleweb is used to get the web interface running.
To create a configuration file for this program, the following parameters are used, where
--password is the password used in the amule daemon configuration and
--admin-pass is the password to access the web interface itself.

# ./amuleweb --write-config --host=localhost --password=password --admin-pass=anotherpassword

Then you just have to start amuleweb, and you're done. Be aware that the amule daemon must be running.

# ./amuleweb

3.3. Configure aMuled and aMuleWeb as services

Although starting aMuleWeb by enabling it in aMule's preferences is the preferred method, you can also run aMuleWeb together with aMuled as as services by means of an init.d script.

Here is an example:
/etc/init.d/amule

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/amuled
WEB=/usr/local/bin/amuleweb
NAME=amuled
DESC=amuled
RUNAMULE=yes
USER=root

test -x $DAEMON || exit 0

# Include amule defaults if available
if [ -f /etc/default/amule ] ; then
. /etc/default/amule
fi
if [ '$RUNAMULE' != 'yes' ] ; then
echo 'Amule not to be started. Edit /etc/default/amule first.'
exit 1
fi

set -e

case '$1' in
start)
echo -n 'Starting $DESC: '
$DAEMON --full-daemon
echo '$NAME.'
;;
stop)
echo -n 'Stopping $DESC: '
killall amuleweb
killall amuled
echo '$NAME.'
;;
restart|force-reload)
echo -n 'Restarting $DESC: '
killall amuleweb
killall amuled
sleep 1
su $USER -c '$DAEMON -f'
while ! netstat -l -n -t | grep 4712 ; do sleep 1 ; done
su $USER -c '$WEB --quiet'
echo '$NAME.'
;;
*)
N=/etc/init.d/$NAME
echo 'Usage: $N {start|stop|restart|force-reload}' >&2
exit 1
;;
esac

exit 0

4. Starting aMuleWeb from your webbrowser

Go to the web address http://hostname:4711, where hostname is the name of the computer running amuleweb and 4711 is the port amuleweb is using.
In most cases this should be http://<MyBook-IP>:4711.



* http://www.mybookworldedition.co.nr
* Last modified on January 15, 2008


http://www.amule.org/wiki/index.php/HowTo_get_aMule_web_interface

./configure --disable-debug --enable-amuleweb --enable-amulecmd --enable-optimize

./configure --enable-amulecmd --enable-webserver --disable-monolithic --enable-amule-daemon --disable-backtrace --disable-debug --enable-optimise


[09:49:07] Erwin Rademakers zegt: je hebt ook nog mijn server.met file nodig
[09:49:17] Erwin Rademakers zegt: initieel staat er geen in
[09:49:21] Erwin Rademakers zegt: je moet er een downloaden
[09:49:27] Erwin Rademakers zegt: die is dan corrupt
[09:49:36] Erwin Rademakers zegt: en bijgevolg geraak je niet geconnect
[09:49:43] Erwin Rademakers zegt: dus moet je mijn server.met nemen
[09:49:51] Erwin Rademakers zegt: di eheb ik aangemaakt onder ubuntu - amule
[09:50:07] Erwin Rademakers zegt: GOOD LUCK"

没有评论:

发表评论