apt-get install checkinstall subversion build-essential make autoconf autotools-dev automake libtool libcurl4-openssl-dev libsigc++-2.0-dev pkg-config libncurses5-dev
apt-get remove rtorrent libtorrent11 libxmlrpc-c3 libxmlrpc-c3-dev libxmlrpc-core-c3 libxmlrpc-core-c3-dev
svn co xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/advanced xmlrpc-c
cd xmlrpc-c
./configure --prefix=/usr && make && checkinstall -D
cd ..
wget libtorrent.rakshasa.no/downloads/libtorrent-0.12.6.tar.gz
tar zxfv libtorrent-0.12.6.tar.gz
cd libtorrent-0.12.6
rm -f scripts/{libtool,lt*}.m4 # Debian
./autogen.sh && ./configure --prefix=/usr && make && checkinstall -D
cd ..
wget libtorrent.rakshasa.no/downloads/rtorrent-0.8.6.tar.gz
tar zxfv rtorrent-0.8.6.tar.gz
cd rtorrent-0.8.6
rm -f scripts/{libtool,lt*}.m4 # Debian
./autogen.sh && ./configure --with-xmlrpc-c --prefix=/usr && make && checkinstall -D
apt-get install screen -y
wget libtorrent.rakshasa.no/raw-attachment/wiki/RTorrentCommonTasks/rtorrentInit.sh --output-document=/etc/init.d/rtorrent
chmod +x /etc/init.d/rtorrent
sed -i 's/"user"/"torrents"/' /etc/init.d/rtorrent
update-rc.d rtorrent defaults
useradd -d /torrents -m torrents
mkdir /torrents/.rtorrent_session
cat >> /torrents/.rtorrent.rc <<EOF
port_range = 32001-32049
dht = auto
dht_port = 32000
peer_exchange = yes
use_udp_trackers = yes
directory = /torrents/
upload_rate = 10
download_rate = 100
session = /torrents/.rtorrent_session
scgi_port = 127.0.0.1:5000
EOF
chown -R torrents:torrents /torrents
/etc/init.d/rtorrent start
apt-get install lighttpd php5-cgi php5-cli php5-curl curl -y
lighty-enable-mod fastcgi
echo 'server.modules += ( "mod_scgi" )' >> /etc/lighttpd/lighttpd.conf
cat >> /etc/lighttpd/lighttpd.conf <<EOF
scgi.server = (
"/RPC2" =>
( "127.0.0.1" =>
(
"host" => "127.0.0.1",
"port" => 5000,
"check-local" => "disable"
)
)
)
EOF
/etc/init.d/lighttpd force-reload
cd /var/www/
svn checkout rutorrent.googlecode.com/svn/trunk/rutorrent
cd /var/www/rutorrent/plugins/
svn checkout rutorrent.googlecode.com/svn/trunk/plugins/tracklabels
svn checkout rutorrent.googlecode.com/svn/trunk/plugins/cookies
svn checkout rutorrent.googlecode.com/svn/trunk/plugins/autotools
svn checkout rutorrent.googlecode.com/svn/trunk/plugins/erasedata
chown -R www-data:www-data /var/www/
aptitude install dhcp3-server
cat >> /etc/dhcp3/dhcpd.conf <<EOF
ddns-update-style interim;
not authoritative;
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
option ntp-servers 192.43.244.18;
option option-150 code 150 = ip-address;
option option-150 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
authoritative;
range 192.168.1.110 192.168.1.254;
option routers 192.168.1.1;
allow unknown-clients;
allow booting;
allow bootp;
next-server 192.168.1.1;
filename "pxelinux.0";
host shakirov-home {
option host-name "shakirov-home";
hardware ethernet 00:1B:FC:33:F0:25;
fixed-address 192.168.1.100; }
}
EOF
/etc/init.d/dhcp3-server restart
aptitude install xinetd atftpd atftp
mkdir /tftpboot
cat >> /etc/xinetd.d/tftp <<EOF
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
EOF
/etc/init.d/xinetd restart
root@dvr:~# echo bla > /tftpboot/123
root@dvr:~# atftp 127.0.0.1
tftp> get 123
tftp>
root@dvr:~# cat 123
bla
apt-get install lftp -y
wget itblog.su/tftpboot_installs.sh
bash tftpboot_installs.sh
wget "http://downloads.sourceforge.net/project/systemrescuecd/sysresccd-x86/1.6.3/systemrescuecd-x86-1.6.3.iso?use_mirror=citylan"
mount -o loop systemrescuecd-x86-1.6.1.iso /mnt/
cp /mnt/sysrcd.* /var/www/
cp /mnt/isolinux/initram.igz /tftpboot/
cp /mnt/isolinux/rescuecd /tftpboot/
cat >> /tftpboot/pxelinux.cfg/default <<EOF
label linux
menu label SystemRescue-CD x86-1.6.1
kernel rescuecd
append initrd=initram.igz showopts vga=normal video=ofonly setkmap=us rootpass=123321 netboot=http://192.168.1.1/sysrcd.dat #eth0=192.168.1.213/24
EOF
Source: https://habr.com/ru/post/95898/
All Articles