NSLU2-Linux
view · edit · print · history

Other Optware Plug Packages: (omit Pogoplug specific steps for other platforms) (Pogoplug specific refers to Pogoplug V1, Pogoplug V2 (gray and pink), Pogoplug Pro, Pogoplug Biz, Seagate devices such as Dockstar and GoFlex)

(Please be aware that you are responsible for any damage to your hardware, software, or files, so use extreme caution when following guides/instructons on this site. NO warranty is explicitly or implicitly provided. It is assumed that you know what you are doing and if not, get assistance from somebody that does, or do not perform the installation.)

BitTorrent

There are numerous BitTorrent packages available in Optware such as Transmission, Btg, Btpd, ctorrent, enhanced-ctorrent, rtorrent, torrentflux, py25-bittorrent, and py26-bittorrent. To get a list, just type "ipkg list|grep torrent" at a shell prompt.

Transmission for Plug Computers (Old Transmission Page):

1. Type "mount -o rw,remount /" to make root file system writeable.

2. Install Transmission with "ipkg install transmission".

3. Now a hack to generate a configuration file for Transmission:

  "mkdir -p /opt/etc/transmission"
  "/opt/bin/transmission-daemon --config-dir /opt/etc/transmission"
  "killall transmission-daemon"

4. Edit "/opt/etc/transmission/settings.json" and change "rpc-whitelist-enabled" from true to false, "rpc-authentication-required" to true, "encryption" to 1, "blocklist-enabled" to true, "rpc-username" to a username you want, and "rpc-password" to a password you want.

5. Restart Transmission "/opt/bin/transmission-daemon --config-dir /opt/etc/transmission"

6. With your web browser, enter the address "http://your.plug.ipaddress:9091/", where your.plug.ipaddress is actually the ip address of your plug (like http://192.168.x.xxx:9091) - (if you don't get this by now, forget about it).

7. Click on preferences, and change the "Download to" directory to a writeable section of your drive.

8. Create a start script in "/opt/etc/init.d" called "S90transmission" with the contents:

#!/bin/sh

# Update blocklist on start up, be patient, list can be big.
# You can put whatever blocklist provider you want below.
wget -q "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz" -O /opt/etc/transmission/blocklists/level1.gz
cd /opt/etc/transmission/blocklists/
if test -f level1.gz; then
   rm -f level1
   rm -f level1.bin
   gunzip level1.gz
   chmod go+r level1
fi

if [ -n "`pidof transmission-daemon`" ] ; then 
    killall transmission-daemon 
fi 
/opt/bin/transmission-daemon --config-dir /opt/etc/transmission/

Make this file executable with "chmod 755 S90transmission".

9. You can add "/opt/etc/init.d/S90transmission" to your rcS or mount_optextX file to run at start up or just manually start it up.

10. Make the root file system read only again with "mount -o ro,remount /".

If you want to omit the blocklist portion, omit the sections in settings.json and the S90transmission file.

Tor Server

1. Type "mount -o rw,remount /" to make root file system writeable.

2. Install Tor server with "ipkg install tor"

3. Go to the Tor setup with "cd /opt/etc/tor". Create a setup file by copying the sample with "cp torrc.sample torrc"

4. Edit the torrc file to your specifications. Here is a sample:

## This is required, but you can choose the port
ORPort 9001
DirPort 9030

## Required: A unique handle for this server. Choose one.
Nickname MyNameHere # Substitute your own nickname for MyNameHere.

## Uncomment the next line to run as a daemon
## You may want to comment this for debugging purposes.
RunAsDaemon 1

## The IP or fqdn for this server. Leave commented out and Tor will guess.
## This may be required, if tor cannot guess your public IP.
Address 192.168.x.xxx # Use your Plug IP.
OutboundBindAddress 192.168.x.xxx # Use your Plug IP again.

SocksListenAddress 0.0.0.0:9100

## To limit your bandwidth usage, define this. Note that BandwidthRate
## must be at least 20 KB.
BandwidthRate 20 KB # Throttle traffic to 20KB/s (160Kbps)
BandwidthBurst 50 KB # Allow bursts up to 50KB/s (400Kbps)
# To run Exit Mode, add # in front of the following:
ExitPolicy reject *:* # middleman only -- no exits allowed

5. Time to test by running "tor" at the shell prompt.

6. Set up your browser to use your plugs ip address as a proxy. Test your system.

7. If everything works to your satisfaction, add tor to your rcS or mount_optextX.

8. Make the root files system read only "mount -o ro,remount /".

mt-daapd-svn iTunes Server or Firefly Media Server

1. Type "mount -o rw,remount /" to make root file system writeable.

2. Install mt-daapd-svn with "ipkg install mt-daapd-svn".

3. Check to make sure that you have a /var/run directory by typing "ls -l /var/run". If this does not exist, you have to create it with "mkdir /var/run"

4. Change to the mt-daapd setup directory by typing "cd /opt/etc/mt-daapd/" and edit the configuration file "mt-daapd.conf". You might also want to set permissions with "chmod 667 mt-daapd.conf" to let the Web Interface modify this file.

5. Find the entry "admin_pw" and change the default password "mt-daapd" to something of your choosing.

6. Change the entry "mp3_dir" to the directory on your drive that you will use to hold your mp3 music.

7. Change "servername" to your preference.

8. Change "runas" to "root".

9. Test your configuration by running the server "/opt/etc/init.d/S60mt-daapd"

10. Connect to the admin web pages on port 3689 by entering the address of your plug on your browser "http://192.168.x.xxx:3689".

11. Login with your user name and the admin password from above. You can click "Start Scan" to add the files to your library. You can also enable the automated rescanning of the music directory.

12. Customize the setup to your preferences and verify that your set up functions correctly.

13. You can add "/opt/etc/init.d/S60mt-daapd" to your rcS or mount_optextX file to run at start up.

14. Make the root file system read only with "mount -o ro,remount /".

Kismet (For the Pogoplug Pro)

The Pogoplug Pro has both WiFi and ethernet capabilities. This makes it a natural candidate to run Kismet on. Use this program at your own risk!

1. Type "mount -o rw,remount /" to make root file system writeable.

2. Install Kismet with "ipkg install kismet"

3. Go to the Kismet setup with "cd /opt/etc/kismet".

4. Edit the kismet.conf file to your specifications. Here are some suggestions:

# User to setid to (should be your normal user)
suiduser=root

# YOU MUST CHANGE THIS TO BE THE SOURCE YOU WANT TO USE
source=rt8180,ra0,ra0

# Where state info, etc, is stored.  You shouldnt ever need to change this.
# This is a directory.
#configdir=%h/.kismet/
configdir=/opt/etc/kismet/.kismet/

5. Time to test by running "kismet" at the shell prompt. Probably a good idea to run kismet in the "/opt/etc/kismet" directory. Once in kismet, type "h" for help, "Q" to quit.

6. Make the root files system read only "mount -o ro,remount /".

7. Documentation is at "http://www.kismetwireless.net/documentation.shtml#old".

Rsync Server

1. Type "mount -o rw,remount /" to make root file system writeable.

2. Install Tor server with "ipkg install rsync".

3. Make sure that /opt/var/run exists. If not, create it with "mkdir /opt/var/run".

4. Change to the /opt/etc directory with "cd /opt/etc" and edit the rsyncd.conf to suit your specifications. Here is an example (feel free to modify users and shares information):

# rsyncd.conf
# 
# configure according to your needs

uid = root
gid = root
use chroot = yes
max connections = 5
syslog facility = local3
pid file = /opt/var/run/rsyncd.pid
secrets file = /opt/etc/rsyncd.secrets

[ShareA]
        path = /tmp/.cemnt/mnt_sda1
        comment = Backup ShareA
        read only = no
        uid = root     
        gid = root     
        auth users = root
        secrets file = /opt/etc/rsyncd.secrets
        hosts allow = *

[ShareB]
        path = /tmp/.cemnt/mnt_sdb1
        comment = Backup ShareB
        read only = no
        uid = root     
        gid = root     
        auth users = root
        secrets file = /opt/etc/rsyncd.secrets
        hosts allow = *    

[ShareC]
        path = /tmp/.cemnt/mnt_sdc1
        comment = Backup ShareC
        read only = no
        uid = root     
        gid = root     
        auth users = root
        secrets file = /opt/etc/rsyncd.secrets
        hosts allow = *    

[ShareD]
        path = /tmp/.cemnt/mnt_sdd1
        comment = Backup ShareD
        read only = no
        uid = root     
        gid = root     
        auth users = root
        secrets file = /opt/etc/rsyncd.secrets
        hosts allow = *

5. Edit "/opt/etc/rsyncd.secrets" to add the entry "root:password", where password is root's actual password. If you need to add more users, then add them in the manner of "username:password" format, each on its own line:

root:password
someusername:somepassword

6. Edit "/opt/etc/default/rsync" and set RSYNC_ENABLE to true - "RSYNC_ENABLE=true". Here is an Example (Create it if it does not exist):

# defaults file for rsync daemon mode

# start rsync in daemon mode from init.d script?
#  only allowed values are "true" and "false"
RSYNC_ENABLE=true

# what extra options to give rsync --daemon?
#  that excludes the --daemon; that's always done in the init.d script
#  Possibilities are:
#   --address=123.45.67.89                (bind to a specific IP address)
#   --port=8730                                (bind to specified port; default 873)
RSYNC_OPTS=''

7. Verify that there is a start script file in "/opt/etc/init.d" named S57rsyncd, and it looks like:

#!/bin/sh

if [ -f /tmp/var/run/rsyncd.pid ] ; then
  kill `cat /tmp/var/run/rsyncd.pid`
else
  killall rsync 2>/dev/null
fi

rm -f /tmp/var/run/rsyncd.pid

[ -e /opt/etc/default/rsync ] && . /opt/etc/default/rsync

if ${RSYNC_ENABLE} ; then
  /opt/bin/rsync --daemon ${RSYNC_OPTS}
fi

8. Test rsyncd by running "/opt/etc/init.d/S57rsyncd". Some extra information is at How To Backup Your Linux Box.

9. If everything works, you can add "/opt/etc/init.d/S57rsyncd" to your rcS or mount_optextX file to run at start up.

10. Make the root files system read only "mount -o ro,remount /".

Samba2 to Samba3 conversion

If you are using Samba2 and encounter share size reporting errors, a conversion to Samba3 would be most helpful.

1. Backup your /opt/etc/samba/smb.conf, /opt/etc/samba/smbpasswd, and /opt/etc/secrets.tdb. You can create a /opt/etc/samba/backup directory for this if you desire. You can also backup /opt/etc/init.d/S80samba. If you use Swat, then you can backup /opt/etc/xinetd.conf and /opt/etc/xinetd.d/swat.

2. Type "mount -o rw,remount /" to make root file system writable.

3. After backing up your configuration files, Type "ipkg remove samba2".

4. Type "ipkg install samba35" (as of this edit. If there is a newer one, you can try that, but this setup is based on samba35). This can take a while since it is a big package. It also installs gconv-modules.

5. Now you need a /opt/etc/samba/smb.conf for Samba3. Here is a sample smb.conf for samba3 (please modify to fit your security needs and system requirements):

[global]
        netbios name = OptwarePlug
        workgroup = WORKGROUP
        server string = OptwarePlug Samba Server
        syslog = 10
        encrypt passwords = true
        passdb backend = smbpasswd
        obey pam restrictions = yes
        socket options = TCP_NODELAY
        unix charset = ISO-8859-1
        preferred master = yes
        os level = 20
        security = share
        guest account = root
        invalid users = guest
        smb passwd file = /opt/etc/samba/smbpasswd

[ShareA]
        comment = Share A drive
        available = yes
        browseable = yes
        public = yes
        writeable = yes
        create mask = 0777
        path = /tmp/.cemnt/mnt_sda1
        read only = no
        guest ok = yes

[ShareB]
        comment = Share B drive
        available = yes
        browseable = yes
        public = yes
        writeable = yes
        create mask = 0777
        path = /tmp/.cemnt/mnt_sdb1
        read only = no
        guest ok = yes

[ShareC]
        comment = Share C drive
        available = yes
        browseable = yes
        public = yes
        writeable = yes
        create mask = 0777
        path = /tmp/.cemnt/mnt_sdc1
        read only = no
        guest ok = yes

[ShareD]
        comment = Share D drive
        available = yes
        browseable = yes
        public = yes
        writeable = yes
        create mask = 0777
        path = /tmp/.cemnt/mnt_sdd1
        read only = no
        guest ok = yes

For systems that need it (Pre NT), you can add "lanman auth = yes" to global, if not, then "lanman auth = no". Use this at your own discretion. For reference, you can visit "http://www.samba.org/" and read through the documentation.

6. Go to /opt/etc/init.d by typing "cd /opt/etc/init.d" and type "mv S08samba S80samba". It seems that Samba2 uses S80samba, while Samba3 uses S08samba for their start file (run level). The contents of the file appear to be the same as of this edit.

7. Verify the contents of /opt/etc/xinetd.conf and /opt/etc/xinetd.d/swat. Compare their contents with the ones you backed up. If you do not have Swat and you want to install it, then type "ipkg install samba35-swat" and make the necessary modifications.

8. Reboot the system:

 "sync"
 "sync"
 "reboot"

9. Test your system.

10. Make any necessary modifications to the /opt/etc/samba/smb.conf either manually or using Swat. You can manually relaunch /opt/etc/init.d/S80samba to see if there are any errors. Verify the process with "ps", "ps -ax" or "ps -ef" depending if you are using the native Busybox or Optware version ("http://procps.sourceforge.net/"). You can also type "more /opt/var/samba/log.smbd" to debug.

view · edit · print · history · Last edited by BAflak.
Originally by OddballHero.
Page last modified on January 09, 2013, at 09:21 AM