- Projects -     - Mouldy Soups -     - Mouldy Bread -     - Contact -     - Links -     - Cheap Plastic Stuff -     - Photo Gallery -

Mr Mist’s Blog

It’s very sensible

Archive for the ‘Web and Tech’ Category

Installing TwonkyMedia 5 on TS101

Sunday, February 7th, 2010

So here we have a Qnap TS101 NAS device. It’s quite a neat little thing, does a number of different sharing tasks from one hard-drive sized case. It shipped with TwonkyMedia 4, and as we’re getting more involved with media sharing in our household and our TV came with 3 TwonkyMedia 5 licences, I wanted to see how open it was to being upgraded. So this is that story.

The first thing you’ll need to do is to upgrade your TS101 to the latest firmware. This should give you access to the NAS via telnet. Some older versions of the firmware do not have Telnet access enabled.

Next you need to telnet to the NAS using your preferred telnet client on port 13131. Log in using the administrator username and whatever password you have assigned to that user.

You should get a standard shell prompt. You can use this to have a look around. The usual unix-type commands are available – ls, df, that sort of thing. (Note that you are dropped in to /root/ on login so you won’t see anything there. cd elsewhere to see stuff.)

The normally mounted areas are /share/HDA_DATA and /mnt/HDA_ROOT/ I have a second drive attached which appears as /share/external/sdb. The TM4 stuff is located in /mnt/HDA_ROOT/twonkymedia/ I guess you could – if you wished – directly overwrite this with your TM5 stuff, but this would give you no way back, I chose to create a new directory to house the TM5 binaries and associated database files.

The next thing is to download the correct TM5 install. The one you need for this is twonkymedia-powerpc-uclibc-0.9.28-5.1.2 and at the time of writing this was available from the TM site on the alternate builds download page.

The easiest way to upload that is to unpack the archive and then copy the resultant directory across to your NAS on one of its many shares. You can then use mv or cp from the shell login to move the directory to wherever you want it to be.

So now you have the software in place, you need to make some changes to the default ini so that you can start it up without issue. By default, the TM5 software puts a lot of its content (the database, etc.) into /var/. This is doubly useless on the NAS, firstly because /var/ is small, and secondly because it is a volitile area. So you need to change some ini lines. Copy the default twonkymedia-server-default.ini from the install directory to another file. This will be your working ini file. To edit the file, there is a built in vi on the shell, but I found that there were issues with my client sending double-returns, so for me it was easier to copy the file back to my host and edit it there. Just make sure that you use an editing tool that repects the unix EOL characters.

Once you have the file for editing, you need to set up the following bits of information -

# cachedir
cachedir=/mnt/HDA_ROOT/tm5/db/cache
# dbdir
dbdir=/var/twonkymedia
# HTTP Server Port
httpport=9001

# bgtransdir
bgtransdir=/var/twonkymedia/twonkymedia-server-transcoding-data

# uploadmusicdir
uploadmusicdir=/mnt/HDA_ROOT/tm5/twonkymedia-server-uploaded-music
# uploadpicturedir
uploadpicturedir=/mnt/HDA_ROOT/tm5/twonkymedia-server-uploaded-pictures
# uploadvideodir
uploadvideodir=/mnt/HDA_ROOT/tm5/twonkymedia-server-uploaded-videos

You should set these values to whatever locally created directories you have set up for Twonky to hold stuff in. (This probably means you’ll need to create a few directories.) I set the HTTP Port also so that it does not conflict with the TM4 server on 9000 should they both happen to be running at the same time.

Note that the paths are representative, you can stick stuff wherever you want. The upload paths are only important if you want to make use of that facility.

If you choose to put anything in /var/something then you’ll need to do a bit more work. My path in /var/twonkymedia is actually a symlink to a real directory. However, the normal startup will trash the symlink, so you have to ensure it is recreated on boot. Normally on a Linux system this means editing a startup file in /etc/ but in this case, even those are overwritten!

The startup scripts for the TS101 are in /etc/rcS.d (which links to /etc/init.d). There’s no runlevel support on the NAS, everything gets started in order. The twonkymedia script is in there and can be easily modified to start TM5 instead of 4. Copy the file from init.d to your chosen permanent directory. Call it whatever you like. Make a backup for easy reference to the TM4 file if needed.

You need to make only a few changes -

WORKDIR1=”/share/external/sdb/t5″
PIDFILE=/var/run/mediaserver.pid
INIFILE=”${WORKDIR}/twonkyvision-server-default.ini”

WORKDIR1 should be wherever you put the binaries. PIDFILE should be as above.
INIFILE is whatever your modified default ini file is called. Note these lines are spread out in the file itself.

I also commented out a few lines that overwrite the ini file when it starts.

Now, the fun bit is to get all that to auto-start. This requires modification of the autostart.sh file which is maintained in the on-board ram. You can mount that up to get access to the file -

mkdir /mnt/flash
mount /dev/mtdblock4 /mnt/flash
vi /mnt/flash/autorun.sh

Add something like this to the autorun file

ln -s /share/external/sdb/t5/var/ /var/twonkymedia
/etc/rcS.d/S90twonkymedia stop
cp /share/external/sdb/twonkymedia5.sh /etc/init.d/twonkymedia.sh
/etc/rcS.d/S90twonkymedia start

This creates your symlink in /var/ stops the TM4 server if it’s runing, overwrites the rc.d for TM4 (until the next reboot) with your tm5 startup scripts, and starts TM5. You’ll need to provide the full paths to all your files. Also, this method assumes that TM4 is enabled in the NAS config, or that you have commented out those checks in your TM5 startup script.

Reboot your NAS and enjoy TM5.

Patrick Stewart new year honour

Saturday, December 19th, 2009

It’s reported that Captain Pickard, or, in real life, Patrick Stewart, is to be knighted in the New Year honours list. I can only agree, and say “make it so”. A very varied and talented actor, he is.

In other news, we are hearing more confirmation that Schumacher is close to an F1 return with the Mercedes team – though nothing yet from the man himself, or the team. I’m in two minds about this return. I wouldn’t want it to be a damp squib, because he left on a high, but nor would I relish the return to his utter dominance. A good scrap would be interesting.

Loads of peeps were trapped in the Channel Tunnel last night, after freezing temperatures on both sides of the tunnel contributed to a mass break-down of the trains. It appears that on-board staff had not been properly trained in what to do, which is not great. Think everyone is out now, but they were stuck for some time. Not great at all.

Lastly, WordPress 2.9 is out, with bucket loads of new functionality. If you run WordPress on your blog site, you should upgrade now. Make sure your host meets the new requirements first, though – the MySQL and PHP version requirements have increased to 4.1.2 and 4.3 respectively.

WordPress 2.8.3 released

Monday, August 3rd, 2009

WordPress 2.8.3 has been released as a security-related recommended upgrade. The changes fix some loopholes that allowed direct access to a few WordPress include files. Everyone is advised to upgrade their copies as soon as. (Remember with newer versions you can generally use the auto-upgrade functionality especially if your host uses PHP5.)

Upgrade your copy now…

Friday, July 31st, 2009

There seems to be growing evidence that the XSS vunerability in versions of WordPress before 2.8.2 is now being exploited for real in the wild. The manifestation seems to be that, after recieving a maliciously-crafted comment, affected blogs display a login panel

Title: Authentication Required
Text: The server (yourserver) at Magic requires a username and password

It would appear at the moment as though the malicious content can be removed by replacing wp-includes with a fresh copy from the WordPress source for your version. But if I were you I wouldn’t take that chance. I’d upgrade to 2.8.2 now. Otherwise you can’t really be sure that the hack hasn’t stolen any credentials, or caused other changes.

The old and the new

Tuesday, May 19th, 2009

The old – the supposed find of “the missing link” in the shape of a perfectly preserved human-dinosaur hybrid fossil. This must be a fake if ever I heard of one. Already there is a book and TV show around it. Hmm. Impressive media machine, though.

The new – WordPress 2.8 beta 1 is available for testing. If you have a dev platform for your blog, you should get it now and check it out. The more people who test the fewer bugs will hit the release version.


Google