Archive for the ‘Linux’ Category

actiontec gt701-wg telnet modifications

I thought I might document some of the modifications I make to my Actiontec GT701-WG on a regular basis via Telnet. Sure these changes are not permanent, as they get reset every time you power-cycle the device. But I did not want to take the time to try and figure out how to recompile a whole new flash image, or chance bricking my only reliable Internet connection. Explanation follows semi-pastable.

echo "nameserver 208.67.222.222
nameserver 208.67.220.220" > /etc/resolv.conf

echo "127.0.0.1 localhost
192.168.0.1 gateway gateway.[yourdomain].com
192.168.0.# ntinstall [host] [host].[yourdomain].com" > /etc/hosts

echo "start 192.168.0.51
end 192.168.0.254
interface br0
opt router 192.168.0.1
opt dns 208.67.222.222 208.67.220.220
opt subnet 255.255.255.0
opt lease 86400
conflict_time 86400
lease_file /var/tmp/landhcps0.leases
siaddr 192.168.0.#
sname [hostname]
boot_file pxelinux.0" > /etc/udhcpd.conf

All of the code above assumes you are operating your network in the default 192.168.0.0/24 IPv4 local block. In addition, all of the changes happen nearly instantaneously in regards to reshaping network traffic.

The first chunk sets the default name servers that the gateway device uses to the fast OpenDNS servers. It also clears out the other crap that makes DNS queries time out trying to lookup domains in the actdsltmp local domain that is set by default. In the web interface I suggest setting the DNS servers to OpenDNS’s servers as well (those changes should be permanent).

The 2nd block is for those of you with your own domains that would like to set up the gateway so it refers to itself within your domain. The last line of the 2nd block – “192.168.0.# ntinstall [host] [host].[yourdomain].com” – overrides certain gateway DNS lookups and routes the particular name to an IPv4 address “192.168.0.#”. I use this line for my Unattended Windows installations, as it by default looks for a host by the name of “ntinstall” if you haven’t specified a hostname.

The 3rd pastie-grouping deals with the DHCP server that is built into the gateway. I enjoy the speed of OpenDNS queries on my LAN hosts as well, hence – “opt dns 208.67.222.222 208.67.220.220″. The last three lines of the 3rd block deal with my TFTP/PXE server. “siaddr 192.168.0.#” specifies a TFTP server at IPv4 address “192.168.0.#” (replace # with a number). “sname [hostname]” – replace “[hostname]” with the hostname of the server at address “192.168.0.#”. “boot_file pxelinux.0″ specifies that I wish to have my PXE client boot a file by the name of “pxelinux.0″ that is in the root of my TFTP server.

Did you know you can also run full websites off your gateway? Using a TFTP server on your network and built-in binaries on your gateway make it possible.

mkdir /var/www
chmod 755 /var/www
tftp -g -l /var/www/index.html -r public/gateway-site/index.html 192.168.0.#
chmod 644 /var/www/index.html
tftp -g -l /var/www/cgi.cgi -r public/gateway-site/cgi.cgi 192.168.0.#
chmod 755 /var/www/cgi.cgi
thttpd -d /var/www -u root -p 81 -c /var/www/**.cgi

To my knowledge, the /var directory on the Actiontec GT701-WG is the only directory one can write to. So first a directory is created for the website to reside in, and the necessary permissions (chmod) to make the site accessible. Then using the tftp client, “index.html” is grabbed from the “public/gateway-site/” directory on the tftp server at IPv4 address “192.168.0.#” (where # is a number), and this file is stuck in the “/var/www” directory. Then the “index.html” file is set to the proper permissions so it can be accessed – 644 for data/non-cgi files. A similar process happens for the cgi file, although this time it needs to be set to 755 so it can be executed when accessed.

I still can’t quite get cgi files compiled properly for the Actiontec GT701-WG, but I’m assuming one needs to do some cross-compiling to the MIPS 4KEc V4.8 32-bit chip that runs this. Article on compiling CGI stuffs: http://devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=301.

MediaTomb 12 on Debian 5 for DirecTV MediaShare/DLNA

I have been trying unsuccessfully for the past couple of months (on and off) to stream content from my home Linux servers to several DirecTV HR20-700’s. This latest attempt, actually worked and I wanted to document my exact setup as no other literature has done.

Stuff you need:

  1. Debian 5 installed on a computer with ~ 1GHZ CPU, 256MB RAM, hard drive with media content on it
  2. reliable Internet connection
  3. a DirecTV HR2x

 
 
Here are the exact commands you need to run, I’ll explain them later.

apt-get update
apt-get upgrade
apt-get -y install screen vlc vorbis-tools mpg123 ffmpeg unzip subversion build-essential autoconf automake curl libexpat-ocaml-dev libsqlite3-dev libcurl-ocaml-dev libid3-3.8.3-dev libtagc0-dev libavformat-dev libexif-dev
svn co https://svn.mediatomb.cc/svnroot/mediatomb/trunk/mediatomb mediatomb
cd mediatomb
autoreconf -i
./configure
make
make install
cd
wget http://vraidsys.com/article-includes/mediatomb.zip
mv mediatomb.zip /etc/
cd /etc/
unzip mediatomb.zip
rm mediatomb.zip
mkdir /var/lib/mediatomb
chmod -R 777 /var/lib/mediatomb/
cd
mv /etc/mediatomb/mediatomb /etc/init.d/
vi /etc/init.d/mediatomb < -- change line so ethX reads eth0, eth1, or whatever your LAN network interface card is assigned to
chmod +x /etc/init.d/mediatomb
update-rc.d mediatomb defaults

The idea is that the default MediaTomb install found in the repos (version 11) doesn’t support transcoding quite right for the DirecTV HR2x. So we do an install from the repos for a bunch of dependencies for the latest code (version 12) that we then checkout from the project SVN repo. A new configuration script that I built is downloaded and installed. It has support for transcoding ogg, mp3, flac, flv, avi, mkv, mov, and a few other formats (pretty easy to add support for other formats check out –> http://mediatomb.cc/dokuwiki/transcoding:transcoding#directv_hr2x_transcoding).

MediaTomb will be automatically started on boot. It can also be stopped and started manually by: /etc/init.d/mediatomb stop or /etc/init.d/mediatomb start.

You can then go to the webui of MediaTomb and update your media library. –> http://hostname:49152/

Your Ad Here

rtorrent 11 on Debian 5

For those of you looking for DHT support with the default rtorrent package that it is in the Debian 5 apt repos you are out of luck. Currently the only way to get DHT support for rtorrent is to use the 0.8.5-2 release for Debian “Squeeze” (testing).

So to get rtorrent working with DHT, go about the installation like you would usually:
apt-get update
apt-get upgrade
apt-get -y install rtorrent
apt-get remove rtorrent libtorrent10
(should leave dependencies installed)
wget http://ftp.us.debian.org/debian/pool/main/r/rtorrent/rtorrent_0.8.5-2_i386.deb (for i386)
wget http://ftp.us.debian.org/debian/pool/main/libt/libtorrent/libtorrent11_0.12.5-2_i386.deb (for i386)
dpkg -i libtorrent11_0.12.5-2_i386.deb
dpkg -i rtorrent_0.8.5-2_i386.deb

Your version of rtorrent, should now have DHT and PEX support.

For automatically starting rtorrent, you can download an init script from the libtorrent project, that works real great.
wget http://libtorrent.rakshasa.no/raw-attachment/wiki/RTorrentCommonTasks/rtorrentInit.sh
mv rtorrentInit.sh /etc/init.d/rtorrent
chmod +x /etc/init.d/rtorrent

vi /etc/init.d/rtorrent (change the user in the config file to a different user account, your own? that has a .rtorrent.rc in it’s home directory –> /home/[user]/.rtorrent.rc)
vi /etc/rc.local < — stick in the line “/etc/init.d/rtorrent start” before the “exit 0″

Make a .rtorrent.rc startup file, so that /etc/init.d/rtorrent works properly
wget http://vraidsys.com/tutorials/rtorrent.rc
mv rtorrent.rc /home/[user]/.rtorrent.rc
vi /home/[user]/.rtorrent.rc (change user to the user you want this to run as)
mkdir -p /home/[user]/torrents/session
chown [user] /home/[user]/.rtorrent.rc <-- run this if doing everything from the root user
chmod -R 777 /home/[user]/torrents <-- I do this so that I can access my torrents from several user accounts. see comments section. [Edit 1/1/2010]

Now restart the machine: shutdown -r now

When you log back in, torrents should be automatically downloaded to the /home/[user]/torrents/ directory, when you stick .torrent files in the /home/[user]/torrents/ directory. You can also access the screen thread by screen -r rtorrent in a terminal session.

Return top