Archive

Posts Tagged ‘linux’

Virtualhost for Couchpotato, Sickbeard, Transmission and SABnzbd

July 24th, 2011 6 comments

I wanted to be able to get to my applications without having to enter the port numbers e.g.

http://mydomain.com/couchpotato

instead of

http://mydomain.com:5000

First off is to add the information to enable the Apache Proxy Module. This information came from linode.com

sudo gedit /etc/apache2/mods-available/proxy.conf

File excerpt: /etc/apache2/mods-available/proxy.conf

<IfModule mod_proxy.c>
        #turning ProxyRequests on and allowing proxying from all may allow
        #spammers to use your proxy to send email.
 
        ProxyRequests Off
 
        <Proxy *>
                AddDefaultCharset off
                Order deny,allow
                Allow from all
        </Proxy>
 
        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
        # Set to one of: Off | On | Full | Block
 
        ProxyVia On
</IfModule>

Then you need to make sure that the modules are enabled

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo /etc/init.d/apache2 restart

Then you need to add the locations to the defaults sites

sudo gedit /etc/apache2/sites-available/default

File excerpt: /etc/apache2/sites-available/default

    <Location /couchpotato>
        ProxyPass http://localhost:5000
        ProxyPassReverse http://localhost:5000
    </Location>
 
    <Location /sabnzbd>
        ProxyPass http://localhost:8080/sabnzbd
        ProxyPassReverse http://localhost:8080/sabnzbd
    </Location>
 
    <Location /sickbeard>
        ProxyPass http://localhost:8081/sickbeard
        ProxyPassReverse http://localhost:8081/sickbeard
    </Location>
 
    <Location /transmission>
        ProxyPass http://localhost:9091/transmission
        ProxyPassReverse http://localhost:9091/transmission
    </Location>

Restart apache by running

sudo /etc/init.d/apache2 restart

You will have to edit the config.ini files for both Couchpotato, and SickBeard to use a webroot. Here’s are the lines in the config.ini files that had to change, and what they were changed to.

SickBeard config.ini
web_root = /sickbeard

Couchpotato config.ini
urlbase = couchpotato

Categories: Software Tags: , , ,

Connecting to MySQL on remote machine

May 31st, 2011 No comments

I just installed Ubuntu 11.04 on a machine that I was using as a shared XBMC database server.  It was the same machine that I was using before.  I backed up the database and restored it on the new machine, but when I went to use XBMC it wouldn’t connect to my shared database.  I tried doing the following from a XBMC machine:

ERROR 2003 (HY000): Can't connect to MySQL server on '###.###.###.###' (111)

After a bit of time on Google I found the solution.  It appears that they changed the security in the latest version of MySQL.  It used to be a setting called skip_networking which had to be set to off, they have since added the bind-address setting in the MySQL my.cnf file.

sudo nano /etc/mysql/my.cnf

You will need to find the bind-address setting and comment it out. Save and exit the file, and then restart MySQL.

sudo /etc/init.d/mysql restart

After that I could connect to the remote database, which was on my LAN. Please note that should take care to make sure that your server isn’t accessible from the outside, e.g. stay behind a firewall.

Categories: Software Tags: , , ,

Automount samba drives

May 30th, 2011 No comments

I have a network share that gets backups sent to it automatically, so I want to have the network drive automatically mounted on bootup, so the backups will work. You’ll need to make sure you have smbfs installed and then open fstab and edit it.

sudo apt-get install smbfs
sudo gedit /etc/fstab

Add the following to the fstab

# My Network Drives
//192.168.0.11/media /media/media cifs credentials=/home/michael/.mediaserverCredentials,rw,iocharset=utf8,_netdev,uid=1000,gid=1000 0 0
  • _netdev is supposed to make it not try to mount the drive until the network is up and going.
  • credentials is where your access credentials are stored
  • cifs is the samba file system type
  • uid is the user id, exclude for root
  • guid is the group id

You will need to create your .mediaserverCredentials

sudo gedit /home/michael/.mediaserverCredentials

and add the following to it.

username=michael
password=PASSWORD

obviously you will need to put your username and password, and change the paths to something for you. You may want to use /etc/samba/ as a location to store the credentials file. You need to make sure that the file is owned by root, and only readable to root.

sudo chown root:root /home/michael/.mediaserverCredentials
sudo chmod 400 /home/michael/.mediaserverCredentials

I’ve seen it mentioned places to update the unmount order to prevent hanging during shutdown. I’m not sure if this is necessary or not.

sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh stop 15 0 6 .
Categories: Operating Systems Tags: , ,

Automount drives based on UUID

May 29th, 2011 No comments

I wanted to be able to automatically mount my drives by adding them to fstab. I have done it before, but I have used the /dev/sdb1 syntax. I have noticed a problem when I unplug the drives, and plug them back into a different SATA controller. When I do that it changes the /dev/sd## to something else. I have learned that if you use the UUID in the fstab, then this issue doesn’t really arise.

First off is to determine the UUID of the drives that you have mounted. Enter the following in the command line.

sudo blkid

It will return something like

/dev/sda1: UUID="6413b21e-ec40-4d80-8103-da8ea5fbbd30" TYPE="ext4" 
/dev/sdd1: UUID="08ae0157-7718-4e3d-be15-11a3b2802148" TYPE="ext3" 
/dev/sdd5: UUID="e580e4fe-4aed-4ea9-bcac-8ab9220414db" TYPE="swap" 
/dev/sdb1: LABEL="Seagate320" UUID="ce09b320-c7b3-4d7c-a192-a2d55208473c" TYPE="ext3"

You can also run “sudo fdisk -l” if you want more information about the different /dev/sd## drives. Otherwise if you can tell from the results which UUID you want then theres no need for “sudo fdisk -l”. The drive I am going to add to fstab is the “Seagate320” drive.

sudo gedit /etc/fstab

Add the following to the fstab file

# My Local Drives
UUID=ce09b320-c7b3-4d7c-a192-a2d55208473c /media/Seagate320/ ext3    defaults,errors=remount-ro 0       1

Next time you reboot the drive will automatically be mounted.

Categories: Operating Systems Tags: , ,

LAMP with Ubuntu

April 21st, 2011 1 comment

I have a new install of Ubuntu 11.04 beta installed on a machine, and I wanted to use it to do some web development, so I needed to install Apache2 with PHP5 and MySQL. All I needed to do was run a simple command.

sudo apt-get install mysql-server mysql-client apache2 php5 libapache2-mod-php5

You’ll then need to restart apache to get php working.

sudo /etc/init.d/apache2 restart

You may view you phpinfo by editing a file in /var/www/

sudo gedit /var/www/info.php

add the following to the info.php.

<?php phpinfo(); ?>

Now visit http://localhost/info.php to view your php info. You may also want to add additional things to php5. You may search the repository using

sudo aptitude search php5

Then once you found what other things you’d like to have installed you may do so by entering something like

sudo aptitude install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json

Usually I need to have mod_rewrite enabled for my applications to work.

sudo a2enmod rewrite

Finally you may want to install phpmyadmin for working with your MySQL databases

sudo apt-get install phpmyadmin
Categories: Operating Systems Tags: , , , ,

CONKY-colors

March 12th, 2011 1 comment
Conky Desktop

Conky Desktop

Conky is a free, light-weight system monitor for X, that displays any information on your desktop. Conky is licensed under the GPL and runs on Linux and BSD. The biggest issue that I have had with conky is setting it up.

It’s kind of a pain to get everything up and running just right.  Recently I ran across CONKY-colors. It is a nice little program to help you set up conky. To get CONKY-colors to work properly you will have to do several things.

Read more…

Find words in files in linux

March 7th, 2011 No comments

After wanting to find text inside of files in Ubuntu I ran across a nice little post. They way it was described to do it works great.  It uses the grep command.

Say you want to find some text called “my_function” in your scripts folder located at the /home/michael/scripts/ directory. Simply run the following command:

grep -i -n -r 'my_function' /home/michael/scripts/

Here is what is happening:
grep is function name to search a pattern in files
-i means ignore case
-n means output line number
-r search recursively

This makes it easy to edit the files with vim, and then jump straight to the line that you needed to edit.

Categories: Scripts Tags: , , ,

XBMC Live – AVS Gear HA-IR01SV Remote

February 24th, 2011 8 comments

I purchased a second AVS HA-IR01SV Remote from newegg for my new Zotac Zbox. I plugged this into my freshly installed XBMC Live 10.0 Zbox setup, and the thing wouldn’t work. The light in the receiver would light up red, and just stay lit up. I sent the first remote back because it didn’t work, and the original one that I had bought worked fine. They sent me a new one, and it didn’t work either.

This time I happened to plug it into my laptop and ran XBMC. The remote worked fine. After looking into the problem I noticed that my Laptop was running version 0.8.7-pre3 of lircd and irw. It showed it was running version 0.8.6 on my  Zotac Zbox when the following commands were run.

lircd -v
irw -v

FYI: you can switch from the XBMC interface to a terminal by pressing alt+ctrl+f2. You can switch back by pressing alt+ctrl+f7. Obviously there are more terminals for f3, f4, f5 and f6.

Apparently the problem is that the new remote is a little bit different, and registers itself a little bit differently. When ‘lsusb’ was run it returned the following:

...
Bus 003 Device 003: ID 1784:0008 TopSeed Technology Corp. #original remote
...
Bus 005 Device 004: ID 1784:0011 TopSeed Technology Corp. #new remote
...

The new remote apparently is not set up by default in the 0.8.6 LIRC. I ran found a post in the xbmc forum that showed a way to do this.

To get the new receiver to work I had to run through the following.

sudo apt-get install dialog
sudo apt-get install lirc-modules-source
sudo nano /usr/src/lirc-0.8.6/drivers/lirc_mceusb/lirc_mceusb.c

This opens an editor where you’ll need to scroll down and add the following in the area with similar looking items.

/* Topseed eHome Infrared Transceiver */
        { USB_DEVICE(VENDOR_TOPSEED, 0x0011) },

You need to exit and save the file. Then you’ll stop LIRC and reconfigure it.

sudo /etc/init.d/lirc stop
sudo dpkg-reconfigure lirc-modules-source

After that you can restart LIRC and test it out with irw.

sudo /etc/init.d/lirc restart
irw

When you run irw you should be able to push the buttons on the remote, and it should give you some feedback on the screen about which button you pushed. Hopefully that’s all that you really need.

If that doesn’t work then you may want to read through this other post that shows a different way to do the same thing. I actually went through both of these, because I tried one and then the other, but I had both IR receivers plugged in but I was only pointing the remote into the new receiver, but it wasn’t working because LIRC was trying to use the original receiver. So it may have really been the second way that got it tor work.  Please let me know if this work for you or not.  If you run across any steps that are missing please post a comment to help others out.

Categories: Media Player Tags: , , , , ,

XBMC Live – Sound over hdmi

February 6th, 2011 No comments

When I installed XBMC 9.11 on my Acer Revo AR-1600 I had a problem with getting the audio working over the HMDI. It appears that the fix is to a a new file .asoundrc in the xbmc users home directory. SSH into the machine and type the following:

touch ~/.asoundrc
nano ~/.asoundrc

When the nano editor open up the .asoundrc file enter the following into the file:

pcm.!default {
type plug
slave {
pcm "hdmi"
}
}

Press ctrl+x to exit, followed by y to save the changes. Then the only thing remaining is to fix the settings in xbmc itself. Load xbmc and go into the audio settings and set the following.

Audio output (digital) => Digital
Audio output device => hdmi
Passthrough output device => hdmi
Downmix multichannel audio to stereo => ON

My revo is currently hooked directly to a tv, so there were no options about a receiver selected. I haven’t been able to see if the DTS or Dolby Digital options work.

Categories: Media Player Tags: , , ,

XBMC Live – Mount of filesystem failed

February 6th, 2011 No comments

I’ve been running a version of XBMC live on my Acer Revo AR-1600 for a while now, and today I tried to start it up, and got the following message.

Mount of filesystem failed.
A maintenance shell will now be started.
CONTROL-D will terminate this shell and re-try.
 * Starting init crypto disks...                                   [ OK ]

After a quick google, I ran across an xbmc forum post. It suggested it would start after fsck was run.

sudo fsck
sudo shutdown -r now

When I did this it started fine on the reboot. Now I’m curious if I’m going to be having problems on the next reboot. If I do, I’ll probably upgrade to XBMC 10.0 (Dharma). I have a Zotac ZBOXHD-ID11-U showing up tomorrow for another room. I’d actually like to get those running off the same database, and it’d make sense to get them running off the same XBMC version as well.

Categories: Media Player Tags: , , ,