Linux: Setting File Permissions On Folders and Directories

To set all the files and folders in a directory to 755 use chmod:
chmod -R 755 /foo/bar

To set the directories to 755 and set the file to 644 for this you can use the find command e.g.
to change all the directories to 755:
find /foo/bar -type d -exec chmod 755 {} \;
to change all the files to 644:
find /foo/bar -type f -exec chmod 644 {} \;

Linux: apt-get install Error: “Media Change: Please insert the disc labelled ..”

So when we see the error in Ubuntu / Debian, basically the installer is looking for the cd as its first source of binaries:

Do you want to continue [Y/n]?
Media Change: Please insert the disc labelled
‘Debian GNU/Linux 5.0.4 _Lenny_ – Official i386 DVD Binary-1 20100131-19:16’
in the drive /cdrom/ and press enter

^C

We need to edit the /etc/apt/sources.list and comment out the line beginning with “deb cdrom …”

Using vi:

linux:~# vi /etc/apt/sources.list

Press i to insert a “#” char at the beginning of the line, then ESC, and “:wq” <RETURN> to write the file. Et voila 🙂

#############################################################
################### OFFICIAL DEBIAN CDROM ###################
#############################################################

#deb cdrom:[Debian GNU/Linux 5.0.4 _Lenny_ – Official i386 DVD Binary-1 20100131-19:16]/ lenny contrib main

#############################################################
################### OFFICIAL DEBIAN REPOS ###################
#############################################################

###### Debian Main Repos
deb http://ftp.uk.debian.org/debian/ lenny main contrib non-free

Linux: TwonkyMedia Server Licensing Problem Workaround

The system I use at home consists basically of my shuttle server sitting in the cupboard streaming to my XBox360 so that I get HD and upscaling. I’ve tried a few different UPnP media streaming apps and while I’m sure a lot of them are great, I just didn’t have the time to fiddle about constantly and the one which worked out of the box first was the TwonkyMedia trial so I was sold on the convenience.

The problems began after the trial had run out and I purchased the product – the license key didn’t seem to want to play ball. The result of this was a back-and-forth with support while the whole time there were no films or TV to be had so a workaround was needed.

After doing a little research, I found a file in the /bin directory called “.tv5”  and checked the content:

root@merlin:~# find / -name .tv*
/bin/.tv5
root@merlin:~# cat /bin/.tv5
upnp av.xml

Strangely enough, it was created on the very date I installed the trial! And indeed, stopping the twonkymedia daemon, removing this file and restarting the daemon allowed me to carry on in trial mode whilst the licensing was sorted with support. And very helpful they were too >:)

root@merlin:~# ps aux | grep -i twonky
root       957  0.0  0.0   1884   268 ?        S<   Sep01   0:00 /usr/local/twonky/twonkymedia
root       958  0.1  0.3   8068  2432 ?        S<l  Sep01  38:32 /usr/local/twonky/twonkymediaserver
root      3410  0.0  0.1   3340   884 pts/2    S<+  20:38   0:00 grep -i twonky
root@merlin:~# kill 958
root@merlin:~# rm /bin/.tv5
root@merlin:~# /usr/local/twonky/twonkymedia
twonkymedia        twonkymediaserver  twonkymedia.sh
root@merlin:~# /usr/local/twonky/twonkymedia
TwonkyMedia Version 5.0.61
using logfile /tmp/TwonkyMediaServer-log.txt