Asus Wl-500gp V2

13.11.2008 | 21:12 | Ostatné | miso
Asus WL_500gp V2 / Asus WL-500gpV2 / Asus wl-500gp v2 setup s transmission a torrentflux a rtorrent


stiahnite si olegov firmware, skusal som aj dd-wrt aj open-wrt.
Zatial co ma DD-Wrt oslovilo viac, ale nepodarilo sa mi prehodit jffs na externu particiu, s Olegovim FW je to jednoduchsie a rychlejsie. Open-Wrt sa mi nepodarilo nahodit (rozumej, flashoval som to raz, a ked to nenabehlo tak som to flashol spat na Olega, alebo to bolo DD potom? kazdopadne, urcite to tam pojde, ale nesnazil som sa moc)
Ja som si k nemu pripajal rovno disk, rozdelit odporucam predom,vsetko PRIMARNE particie
ja mam:
1.particia 300M ext3
2.part 50M swap
3.part zvysok

1.Stiahnut olega TU 2.pripojit sa TP kablom na router, port LAN 1-4 (ja som bezal na 4 vzdy)
3.otvorit ako ROOT rescue.exe utilitku cez wine (moja verzia 1.01)
4.odpojit router z elektriky
5.v rescue utilite vybrat firmware na flashovanie (trx alebo bin, v pripade DD-WRT) a stlacit UPLOAD
6. stlacit cierny cudlik v zadu na routri a drzat stlaceny a pripojit elektriku
7. zacne blikat POWER kontrolka asi po 10s a sucasne zacne nabiehat upload v rescue utilite, vtedy to uz mozete pustit.
8. pockat kym utilita napise ze vsetko ok a wait for reboot
9. ako kedy, oleg wacsinou rebootol, ale dd-wrt nie
10, ak to do 2 minut nerebootne samo a nezacne blikat kontrolka AIR tak to treba vytiahnut z elektriky a rebootnut to tak.
11. snad to tentokrat nabehlo
12. konzola:
telnet 192.168.1.1
13.admin/admin
14.a sme tam :) 1. uspech
15. cez web interface si nastavte vsetko co potrebujete pre pripojenie na net. vlastne vsetko co sa tam da OKREM USB/samby/NFS
16. po reboote telnet router
17. df
vypluje asi taketo daco:
/dev/discs/disc0/part1  201716748    191912 191278180   1% /tmp/mnt/disc0_1
(a pre kazdu part. to iste)
18.
umount /tmp/mnt/disc0_1
19. detto pre ostatne particie
20.
 fdisk -l
18. pravdepodnobne dostanete nieco taketo:
Disk /dev/scsi/host0/bus0/target0/lun0/disc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                                 Device Boot    Start       End    Blocks   Id  System
/dev/scsi/host0/bus0/target0/lun0/part1               1          25      200781   83  Linux
/dev/scsi/host0/bus0/target0/lun0/part2              26          57      257040   82  Linux swap
/dev/scsi/host0/bus0/target0/lun0/part3              58       35288   282993007+  83  Linux

19.
mount -t ext3 -o noatime,rw /dev/scsi/host0/bus0/target0/lun0/part1 /opt
mkdir /opt/harddisk
mount -t ext3 -o noatime,rw /dev/scsi/host0/bus0/target0/lun0/part2 /opt/harddisk
swapon /dev/scsi/host0/bus0/target0/lun0/part2
21. kontrola:
df
free
22.
ipkg.sh install
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-13_mipsel.ipk 
ipkg.sh install uclibc-opt_0.9.28-13_mipsel.ipk
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-10_mipsel.ipk 
ipkg.sh install ipkg-opt_0.99.163-10_mipsel.ipk 
ipkg update 
ipkg install nano cron screen mc diffutils hdparm less transmission
23. vsetko to bude koncit: terminated succesfuly, co znamena ze OK
24.
mkdir -p /usr/local/sbin/
touch /usr/local/sbin/post-firewall 
touch /usr/local/sbin/post-mount
touch /usr/local/sbin/pre-shutdown
touch /usr/local/sbin/pre-mount
touch /opt/etc/init.d/rc.unslung
touch /opt/etc/init.d/S99trans
chmod +x /opt/etc/init.d/S99trans
chmod +x /opt/etc/init.d/
chmod +x /usr/local/sbin/*
25.
nano /usr/local/sbin/pre-mount
ja tam mam toto:
#!/bin/sh
swapon /dev/discs/disc0/part2
e2fsck -p /dev/discs/disc0/part1
mount -t ext3 -o noatime,rw /dev/discs/disc0/part1 /opt
e2fsck -p /dev/discs/disc0/part3
mount -t ext3 -o noatime,rw /dev/discs/disc0/part3 /opt/harddisk
26.
nano /usr/local/sbin/pre-shutdown
toto:
#!/bin/sh

/opt/etc/init.d/rc.unslung stop

sleep 10s

for i in `cat /proc/mounts | awk '/ext3/{print($1)}'` ; do
  mount -o remount,ro $i
done

swapoff /dev/scsi/host0/bus0/target0/lun0/part2

sleep 1s
27.
nano /usr/local/sbin/post-mount
toto:
#!/bin/sh

/opt/etc/init.d/rc.unslung start

killall syslogd &&/sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7
28.
nano /opt/etc/init.d/rc.unslung
tot:
#! /bin/sh

# Start/stop all init scripts in /opt/etc/init.d
# starting them in numerical order and
# stopping them in reverse numerical order
#
if [ $# -ne 1 ]; then
printf "Usage: $0 {start|stop}\n" >&2
exit 1
fi

daemons=`echo $(/usr/bin/dirname $0)/S??*`
[ $1 = "stop" ] && daemons=`echo $daemons | /usr/bin/tr " " "\n" | /usr/bin/sort -r`

for i in $daemons; do

# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue

# Write to syslog
logger -t rc.unslung "$1 service $i"

case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set $1
. $i
)
;;

29. a to je asi vsetko, myslim, aspon pre zatial
30.!!!!!!!!!!!!!!!!!!!!!!!!!!toto nezabudnut!!!!!!!!
flashfs save && flashfs commit && flashfs enable && reboot
31.telnet router
32. skontrolovat df a free ci je vsetko tak ako ma
34. nakonfigurovat NFS export a SMB a ftp
35. ako ftp som si dal /opt (aby som mohol konfigurovat napr. transmission)
36. na NFS odporucam http://www.root.cz/clanky/nfs-a-autofs/
37.nakonfigurovat transmission
38.
nano /opt/etc/init.d/S99trans
do toho:
#! /bin/sh

case $1 in
        start)
                /opt/bin/transmission-daemon  -w /opt/harddisk/torrent/target -g /opt/harddisk/torrent/config
                ;;
        stop)
                if [ -n "`pidof transmission-daemon`" ] ; then
                        echo "stopping transmission-daemon"
                        killall transmission-daemon
                fi
                ;;
        restart)
                $0 stop
                sleep 5
                $0 start
                ;;
        *)
                echo "usage: $0 (start|stop)"
                exit 1
esac
39.
mkdir -p /opt/harddisk/torrent/target
/opt/harddisk/torrent/config
40. /opt/etc/init.d/S99trans start
41. http://routerIP:9091/transmission/web/

vysvetlivky k transmission peratorom:
Daemon has a few nice switches
Options:
-h --help Display this help page and exit
-a --acl <list> Access Control List. (Default: +127.0.0.1)
-b --blocklist Enable peer blocklists
-B --no-blocklist Disable peer blocklists
-f --foreground Run in the foreground instead of daemonizing
-g --config-dir <path> Where to look for configuration files
-p --port <port> RPC port (Default: 9091)
-t --auth Require authentication
-T --no-auth Don't require authentication
-u --username <username> Set username for authentication
-v --password <password> Set password for authentication
-w --download-dir <path> Where to save downloaded data

42. no a asi ficime.... kazdopadne, vsetko nastavit a nazaver este raz:
43. flashfs save && flashfs commit && flashfs enable && reboot


vela stastia.
upravy prosim dopisat ;) resp. zlepsenia


pridanie torrentflux
ipkg install torrentflux lighttpd perl
zmenit/opt/etc/php.ini
dopisat do prilahlej kolonky:
extension=pdo.so
extension=sqlite.so
extension=pdo_sqlite.so

a uistite sa ze nasledovne plati:
safe_mode = Off
allow_url_fopen = On
cgi.fix_pathinfo = 1
zmenit/opt/etc/lighttpd/lighttpd.conf
odkomentovat mod_fastcgi a mod_cgi
doplnit
url.access-deny = ( "~", ".inc", ".sqlite" )


zmenit /opt/etc/lighttpd/conf.d/10-php-fcgi.conf na
fastcgi.server = ( ".php" =>
                   ( "localhost" =>
                     ( "socket" => "/tmp/php-fcgi.sock",
                       "bin-path" => "/opt/bin/php-fcgi",
                       "max-procs" => 1,
                       "min-procs" => 1,
                       "max-load-per-proc" => 4,
                     )
                   )
                 )

no a potom uz len:
/opt/etc/init.d/S80lighttpd stop
/opt/etc/init.d/S80lighttpd start

http://nas_address:8081/torrentflux

bud vam nabehne setup na nastavenie user/hesla, alebo je prihlasovasie meno take iste ako ma user na routeri.


na rozchodenie Mc
export TERMINFO="/opt/share/terminfo"
export TERM="xterm"
/opt/bin/mc
rTorrent

-torrentflux aj transmission neunosne zatazuju krabicu
-rtorrent ponuka ovela viac moznosti, napr. konfigurovanie stahovania len niektorych suborov s orrentu (toto umoznuje aj torrentflux no transmission nie)
-len pre info, 8 torrentov zerie asi 10% !!! naozaj, 10% cpu (z 240Mhz...) zatialco transmission by potrebovalo 70, torrentflux zase robi narazove zatazenie pri nacitavani interfacu a cely interface je velmi pomaly

takze ako na rtorrent:
ipkg update
ipkg install screen rtorrent dropbear

najpr si nastavime ssh daemona (dropbear) ak ste tak este neurobili
mkdir -p /opt/etc/dropbear
dropbearkey -t dss -f /opt/etc/dropbear/dropbear_dss_host_key
dropbearkey -t rsa -f /opt/etc/dropbear/dropbear_rsa_host_key
echo "dropbear  -d /opt/etc/dropbear/dropbear_dss_host_key -r /opt/etc/dropbear/dropbear_rsa_host_key" >> /usr/local/sbin/post-boot
flashfs save && flashfs commit && flashfs enable
a pustime si ho (mohli by sme aj rebootovat, ale naco ...)
dropbear -d /opt/etc/dropbear/dropbear_dss_host_key -r /opt/etc/dropbear/dropbear_rsa_host_key
a dalej
rm /opt/etc/rtorrent.conf
nano /opt/etc/rtorrent.conf
vlozit
scgi_port = localhost:5005
min_peers = 20
max_peers = 40
max_uploads = 5
download_rate = 0
upload_rate = 30
check_hash = no
directory = /opt/harddisk/torrent/work
schedule = watch_directory,5,5,load_start=/opt/harddisk/torrent/dl/*.torrent
schedule = untied_directory,5,5,stop_untied=
schedule = low_diskspace,5,60,close_low_diskspace=10M
session = /opt/harddisk/torrent/session
port_range = 51777-51780
use_udp_trackers = yes
schedule = ratio,30,60,stop_on_ratio=150
safe_sync = yes
dht = auto
dht_port = 6881
peer_exchange = yes


nasledne:
mkdir -p /opt/harddisk/torrent/work
mkdir /opt/harddisk/torrent/dl
mkdir /opt/harddisk/torrent/session
nano /opt/etc/init.d/S99rtorrent
odkomentovat dirlayout=RTORRENT_DEFAULT a zmente to na: dirlayout=RTORRENT_ANOTHER
zmenit user="user" na user="vas_login" (pravdepodobne root alebo admin)
zmenit ps -A na: pstreba si dat vyhladat ten posledny, je to tam len raz a nie som si isty ze je to nutne, ja som to zmenil a ide, ale neskusal som bez zmeny.

spustime si rtorrent:
/opt/etc/init.d/S99rtorrent start

potom nam uz zostava si len stiahnut nejaky interface, nTorrent je celkom OK

treba v nom nastavit socket 5005 (lebo taky bol pouzity v tomto navode a malo by vsetko fungovat)

História úprav

AutorDátum
miso 13.11.2008 | 21:12
miso 09.11.2008 | 00:00
miso 09.11.2008 | 13:04
miso 09.11.2008 | 13:32