Wednesday, November 05, 2008

Alternatives to Jinzora (Ampache and Subsonic)

UPDATE: The instructions below regarding Subsonic are for Hardy. For Intrepid, these instructions stay the same except for the following: Install tomcat6 instead of tomcat5.5. Then substitute tomcat6 wherever you see tomcat5.5 in the following instructions. Also substitute port 8080 anywhere you see port 8180.

I have found a couple alternatives to Jinzora that I think I actually like better. The reason is mostly the interface. The first is Ampache. This one is simple because you install it from the repositories (just type sudo apt-get install ampache). Then go to the site (http://yourserverip/ampache).

The second, and possibly my favorite, is Subsonic. There is a great howto here. But in case it ever gets lost, here it is again (instructions are for Hardy):
1. Download Subsonic (war version) from here and unzip the subsonic.war file.
2. Install tomcat5.5, java-jre, and java-jdk with the following:
sudo apt-get install tomcat5.5 sun-java-jre sun-java-jdk
3. Modify init for tomcat with the following:
sudo nano /etc/init.d/tomcat5.5
Find where it says TOMCAT_SECURITY=yes and change it to no.
4. Restart tomcat with:
sudo /etc/init.d/tomcat5.5 restart
5. Move that subsonic.war file that you previously unzipped to /var/lib/tomcat5.5/webapps with:
sudo mv /current/location/of/subsonic.war /var/lib/tomcat5.5/webapps/
6. Make a subsonic directory with:
sudo mkdir /var/subsonic
7. Then change the ownership of that folder with:
sudo chown tomcat55:nogroup /var/subsonic
8. Open up port 8180 if you have a firewall.
9. Reboot your computer
10. Try it out by going to:
http://yourcomputerip:8180/subsonic
11. You will initially login with "admin" as both your ID and password. Once at the site, you can change the password, add users, and add music.

Sources:
Subsonic
Subsonic Installation Howto

Tuesday, September 16, 2008

Remote Access to CUPS Web Interface

If you have a server(without gnome or kde running) and need to install a printer, the easiest way is to use the CUPS web interface. You can see it on your own ubuntu computer by going to http://localhost:631/admin. But to get to this page remotely for a server, you need to first make some edits to the cups conf file. So do the following:
1. Edit the cups configuration file by first running the following command on your server:
sudo nano /etc/cups/cupsd.conf
2. Your first edit to the file is to make the section that looks like:
# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock
look like this:
# Only listen for connections from the local machine.
Port 631
Listen /var/run/cups/cups.sock
3. You then want to change the sections that looks like this:
< Location / >
# Restrict access to the server...
Order allow,deny
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
< /Location >
so they look like this:
< Location / >
# Restrict access to the server...
Order allow,deny
Allow all
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow all
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
Allow all
< /Location >
4. Finally, restart cups with the following:
sudo /etc/init.d/cupsys restart
5. You should now be able to log into cups on your server with:
http://yourserverip:631
Note that when you change something, it may tell you that you need to add a certificate to firefox. Do so by clicking the add/get certificate button at the bottom of the firefox error message page. It will also tell you that to change stuff, you need to use the "https" version of the page instead of "http" so just go to:
https://yourserverip:631
You might also have to open/port forward port 631.

Sources:
Ubuntu forums post
Ubuntu Community Docs on Network Printing

Sunday, September 14, 2008

Watch any NFL game! (Sopcast on Ubuntu)

UPDATE (February 2009):
You can now ignore the rest of this post and simply download and install sopcast and sopcast-player. Both are listed on the sopcast page, but rather than manually installing and moving sopcast, just download both as deb files from Jason Scheunemann's google code page and double click to install. You will need to install the sp-auth deb first and then sopcast-player.

Sources:
Sopcast-player (install everything you need from here)
Sopcast (not really needed)


The old instructions:
Sopcast allows you to watch any NFL game (or other games for that matter). To get it working on linux and ubuntu, do the following:
1. Download and install VLC using synaptic.
2. Download sopcast for linux from their site. I only needed the sp-auth.tgz file. I did not need the stdc++5 library.
3. Unzip the file.
4. In the new unzipped folder, you will want to move the file named sp-sc-auth to /usr/bin. I think the easiest way to do this is to run the command:
sudo nautilus
This will open a new file browser and you can move anything anywhere. Just close the file browser and terminal when you are done.

At this point, you have two options. The easy option is to install a script, the second is to run everything from the command line.

As stated, the first way is to download and use Chickamade's script:
1. Download the newest version here. There are already good instructions under details on the site but I did have to change a couple of things.
2. So after you have downloaded the file, unzip it. Similar to above, run "sudo nautilus" and then move the "sopcast" file from the new unzipped folder to /usr/bin.
3. In firefox, type "about:config" (without quotes) in the address bar. Then right-click the screen and choose New-->String.
4. In the first field that comes up, type in:
network.protocol-handler.app.sop
In the next field that pops up, the value field, type:
/usr/bin/sopcast
5. Finally, the first time you click on a sop link somewhere, firefox should ask you how you want to open the link. Alternatively, you can go into Edit-->Preferences-->Applications and click on sop. Either way, ignore the default and tell firefox to open the sop link with sopcast by pointing firefox to /usr/bin/sopcast.
6. Now when you go to a site like MyP2P or Sopcast Channel List and click on a sop link, it will autmatically open VLC.

The second method is to ignore this script and simply open the streams through the command line. For this method, do the following:
1. Go to a site like MyP2P and find a sop stream you want to watch. Right-click on the link and copy the link location.
2. Now open a terminal and run the following:
sp-sc-auth linklocation 3908 8908 > /dev/null &
Replace "linklocation" with the sop link you copied from the site. Also, for information, the "> /dev/null" portion of this command gets rid of any output from the command and the "&" tells it to run the command in the background.
3. Next, open VLC. Go to File-->Open Network Stream. In the HTTP line, type:
http://localhost:8908/tv.asf
4. You should now see the stream. The only catch is that when you close VLC, it doesn't also stop the sp-sc-auth process. For this, you have to go to System-Administration-->System Monitor and stop the sp-sc-auth process.

There is also a third super easy method:
1. Download and untar/unzip the linux version of sopcast from their site as described in steps 2 and 3 in the first section.
2. Rename the sp-sc-auth file to sp-sc.
3. Move the sp-sc file to /usr/bin with the "sudo nautilus" command.
4. Download Sopcaster here. It is a very simple gui to run sopcast.
5. Untar/unzip the sopcaster download and move the sopcaster file inside to /usr/bin.
6. Now just make a launcher for the command "sopcaster."

Sources:
Sopcast download
Sopcast script
MyP2P
Sopcast Channel List
Sopcast Instructions
Sopcast script Ubuntu forum post instructions
Sopcaster gui

Friday, September 12, 2008

Cron & Crontab

As stated in an earlier post, there are cron folders within /etc appropriately named cron.hourly, cron.daily, and cron.monthly. Stick a script into the appropriate folder, and it will be run accordingly. For example, stick a script into the cron.hourly folder, and it will be run every hour.

The crontab file (/etc/crontab) is a way to have even more control. You can edit this file so that a command is run whenever you want. Open it and you will get a sense of how it works. The first five columns tell it when to run your command. The columns are minute, hour, date of month (dom), month, and day of week (dow). Note Sunday is 0 or 7. By filling these in, you can customise when you want your command to run. Use stars for any blanks. See the sources for better examples. In the next column, specify who the command is to be run as. For example, type root to run it as root. Finally, type in the command. Save the file and then exit.

A good example is to automate updates. If you wanted your system to automatically update everyday at 10:00 a.m., you would add a line to crontab like this:
00 10 * * * root apt-get update && apt-get -y upgrade
Note: the "-y" option with apt-get upgrade means to say yes to any prompts

A couple other notes. First, crontab will let you use steps. For example, if you wanted something to run every 15 minutes (and didn't want to specifically tell crontab to run the command at 15, 30, 45, and 60), you could just specify this with the notation "*/15" instead of "15, 30, 45." Second, crontab always sends output somewhere after it has completed its task. By default, it goes to the users mailbox on the system. To just get rid of this output, add "> /dev/null" to the end of the command line. However, you could specify any output file you like. The ">" means to overwrite the previous file. Alternatively, ">>" means to append the file. So, if we wanted the above example run every 15 minutes and the system to simply get rid of any output, we would add the following to crontab:
*/15 * * * * root apt-get update && apt-get -y upgrade > /dev/null

Personally, I like:
@reboot root apt-get update && apt-get -y upgrade && apt-get clean > /dev/null


Sources:
Schedule tasks on Linux (very good)
Automatically update your Ubuntu system
Newbie: Intro to Cron
Crontab man page

Friday, September 05, 2008

Installing Jinzora

Jinzora is a streaming jukebox similar to Squeezecenter. The web interface is not as intuitive as squeezecenter, but for me, worked much faster and without as many glitches. There are several nice guides on installing Jinzora which I have linked to below so I won't go through everything (like installing a LAMP server) since others have already covered it. These guides work equally well with Hardy. There are a few problems I ran into while installing that I will highlight here. The basics to installing are the following (again see the links for more details and screenshots):

1. Initially, we need to install a package and edit a file so that we don't get errors once jinzora is installed. So first use synaptic or apt-get to install the package "php5-gd." Next, edit the file /etc/php5/apache2/php.ini with the following command:
sudo nano /etc/php5/apache2/php.ini
You want to find the following lines and make sure the corresponding values match what I have listed below:
max_execution_time = 300
memory_limit = 32M
post_max_size = 32M
upload_max_filesize = 32M


2. Restart apache with the following command:
sudo /etc/init.d/apache restart

3. Download Jinzora from their website.

4. Unpack the downloaded file which will result in a folder called jinzora2. Move the jinzora2 folder to the /var/www directory. Do this with the following command:
sudo mv /current/path/to/jinzora2 /var/www/

5. Now change certain permissions in the jinzora2 folder. One way is to simply make everything in the folder read/write/exectue with the following command:
sudo chmod -R 777 /var/www/jinzora2
Or, we can use the included script to change only what is needed by running these two commands:
cd /var/www/jinzora2
sudo sh ./configure.sh

6. Now complete the installation by using the web based installer located at http://your-server's-IP/jinzora2/ (Note that jinzora needs port 80 open). The mac install guide, linked to below, has very nice explanations and screenshots. Also, on the backend setup, you can probably can leave the database user as root and use root's password unless you have something other than a typical setup. Jinzora2 is a good database name, localhost for database server, database type is mysql, and set create database to true.

7. When you are all finished and try to log in (again using the url noted in the previous step), you will get a message regarding the install folder. You probably don't want to delete the install folder in case you need it later, so simply rename it with the following command:
sudo mv /var/www/jinzora2/install /var/www/jinzora2/install.bak

8. It should now work. Again, refer to the links below for further explanations if needed.

Sources:
Jinzora
Mac Install Guide
Windows Install Guide
Linux Install Guide
php5-gd instructions
php.ini file alterations

Wednesday, September 03, 2008

VirtualBox & USB

To get USB support in VirtualBox, you first need the non-opensource version. Get this by adding the appropriate repository listed on the VirtualBox site noted below. The authentication key is also listed in my sources. After it is installed, do the following:

1. After installation, you must add yourself as a user to the "vboxusers" group (System-->Administration-->Users and Groups). Unlock and click Manage Groups. Then find vboxusers, click properties, and put a check next to your user name.

2. Edit the /etc/init.d/mountdevsubfs.sh file by uncommenting (i.e. deleting the # symbols) to four lines in the section labeled "# Magic to make /proc/bus/usb work." After editing the section, it should look like the following:
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb

Then save the file.

3. Next, edit the file called "/etc/udev/rules.d/40-basic-permissions.rules." For example, type:
sudo gedit /etc/udev/rules.d/40-basic-permissions.rules
In Hardy, you want the section called "# USB devices (usbfs replacement)" to look like this:
# USB devices (usbfs replacement)
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="vboxusers"
SUBSYSTEM=="usb_device", MODE="0664", GROUP="vboxusers"

You are basically adding the "GROUP" stuff. After the edit, save the file.

4. Finally, you will need to run the command "/etc/init.d/mountdevsubfs.sh start" before you start VirtualBox each time. To automate, this you can just add the command to rc.local. You want to add the stated command just before the line "exit 0." So do the following:
sudo gedit /etc/rc.local
Then, add the above stated command. After the edit, my file looks like this:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# VirtualBox USB tweak
/etc/init.d/mountdevsubfs.sh start

exit 0


5. Finally, reboot your computer.

Sources:
VirtualBox repositories
VirtualBox authentication key (Right Click and choose "Save link as..."
Ubuntu Community Documentation on VirtualBox
VirtualBox FAQs (text search for USB)

Friday, August 22, 2008

Squeezecenter & Ubuntu

After installing the .deb file from the Squeezecenter site, I had to delete a file and basically refresh a database to be able to connect through a browser. Here's how:
1. Stop apparmor and squeezecenter with the following commands-
sudo etc/init.d/apparmor stop
sudo etc/init.d/squeezecenter stop
2. Remove the problem file (/etc/apparmor.d/usr.sbin.mysqld.squeezecenter.orig). It is probably best to move this somewhere and not totally delete it. To move it to your home folder, type the following:
sudo mv /etc/apparmor.d/usr.sbin.mysqld.squeezecenter.orig ~/
3. Next delete the following database (this will be rebuilt when you restart squeezecenter):
sudo rm -fr /var/lib/squeezecenter/cache/MySQL/*
4. Now restart apparmor and squeezecenter with the following commands:
sudo etc/init.d/apparmor start
sudo etc/init.d/squeezecenter start
5. You may also have to reboot.
6. If all went well, you should be able to see your squeezecenter page by going to your server IP:9000 (Make sure you have used port forwarding, if needed, to open port 9000). For example, if your server is at 192.168.1.100, then point your browser to:
http://192.168.1.100:9000

Sources: flavor8's helpful post on the slimdevices forums

Wednesday, August 20, 2008

Apt-get Options

Here's a nice page with apt-get options and explanations.

Tuesday, August 19, 2008

Automatically Change Wallpapers

Lifehacker recently had a great article on ways to automatically rotate wallpapers including Gnome Wallchanger, Desktop Drapes, and Wallpaper Tray. As for the sunlight map mentioned in the article, I like the approach taken by areopa. The following will update the map as your wallpaper every hour:
1. First download the sunlight map here and change your background to use it as wallpaper (i.e. right click on your desktop and choose "change desktop background"). I will assume that you are downloading it to a folder called /home/user/wallpaper.
2. Then you need to write the following script:
wget -O /home/user/wallpaper/world_sunlight_map_rectangular.jpg http://www.opentopia.com/images/cams/world_sunlight_map_rectangular.jpg
Note: this is all on one line!
3. Next, move the script (I will assume you called it sunlight and saved it to your home directory) to cron.hourly with the following command:
sudo mv /home/user/sunlight /etc/cron.hourly

As a side note, to do this on a mac, follow the directions below:
1. Download the sunlight map from the link above and save it a folder of your liking. However, it must be the only file in that folder.
2. Set the file as your background and choose to have the wallpaper change. This should work because the file is the only one in the folder.
3. Download a program called Lingon and install it.
4. Run Lingon and add a new agent under "my agents."
5. Name it whatever you like such as "com.yourusername.sunlight"
6. In the what section, type the following command replacing "/path/to/world_sunlight_map_rectangular.jpg" to wherever you downloaded the file:
curl -o /path/to/world_sunlight_map_rectangular.jpg http://www.opentopia.com/images/cams/world_sunlight_map_rectangular.jpg
7. Finally, under the third section, "when," tell Lingon you want the command to run every 15 or 30 minutes.
8. Restart your computer and you should have an updating sunlight map as your wallpaper.

Sources:
Lifehacker article
World Sunlight Map
Lingon
cURL manual

Wget

Wget is basically a command line way to download things. I typically use it with the -O option which I have outlined below. See the sources for more options.

Using the "-O" option. This allows you to download a file to where you want on your system, rather than just in your home directory. With this option only, if you download a duplicate file, the older file will be overwritten.
Example: wget -O /path/to/file URL
(Note that URL is the full URL of the file on the web)

Using the "-r" option. With this option, a file will be downloaded on your system by duplicating its native folder structure. Try it out and you will see what I mean.
Example: wget -r URL

These options can, of course, be combined. A few rules I found confusing involved the following combinations listed below. These involve a situation where you are downloading a file that you had previously downloaded:

If no options are specified = Wget will not overwrite the previous file with the same name, but will simply download the new file adding a number to it. So if your original file is named cookie, if you download it again, it will be named cookie.1. If you download it a third time, it will be named cookie.2.


If you only use the "-nc" option = Wget will refuse to download newer copies of the file.

If you only use the "-r" option = re-downloading a file will result in the new copy simply overwriting the old. However, as noted, it will be downloaded in folders replicating its location on the web.

If you use both "-r" and "-nc" =
this causes the original version to be preserved and any newer copies on the server to be ignored (similar to only using the "-nc" option).

Therefore, I usually just use the "-O" option as described above so that a previous file of the same name can be overwritten and I avoid the extra folders.

Sources: Wget man page

Writing Scripts & Cron

Scripts are a way to simplify a list of commands or allow something else to execute commands. Here is an excellent summary of how they are written. Scripts must start by telling shell how to interpret them. Therefore, they often begin with:
#!/bin/bash
On the next lines, simply enter the commands you wish to be executed. Once you have made a script, you then usually want to then change the permissions so everything can execute it. For example, to give full read/write/execute permissions (which may not be appropriate in all situations), run the following command:
sudo chmod 777 /path/to/script

To have the script you have created executed at a regular interval, you can move it to one of the cron folders. These include /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly. For example, to have a script executed hourly, move it to cron.hourly with the following command:
sudo mv /path/to/script /etc/cron.hourly

Sources: Writing Shell Scripts

Aliases

Aliases are ways to simplify a command to one word. (Sometimes, moving a script to /usr/bin will accomplish the same thing). To setup an alias, you need to add it to ~/.bashrc (i.e. /home/user/.bashrc). It seems /etc/bash.bashrc might also work (see sources listed below). To add it to .bashrc, do the following:
1. Bring up .bashrc for editing with the following command:
sudo gedit /home/user/.bashrc
Note that user = your user name
2. Add an alias to the file and save. The syntax for an alias is the following:
Alias nickname='command'
For example, you might have something like this-
Alias songbird='/opt/Songbird/songbird'

Sources:
Lifehacker-Ten Handy Bash Aliases
Ubuntu-Environment Variables (explains why .bashrc is used)

Saturday, August 09, 2008

ipblock/java problems

ipblock (part of iplist and similar to moblock) wasn't working for me and the problem appears to have been with java. To fix it, I did the following:
1. First, make sure sun java, rather than openjdk, is your default. To do this, run the following command:
sudo update-alternatives --config java
Choose the sun version as your default by entering the appropriate number.
2. Then make sure your launcher command is correct. It should be:
sudo ipblock -g

Sources: iplist cli reference

Saturday, July 19, 2008

Create a symbolic link

First go to the directory where you want the link. Then use the following command:
sudo ln -s /path/to/file nameoflink
Note: "nameoflink" is whatever you want to call your link.

Friday, July 18, 2008

How to convert VOC files (and how to run a C program)

Update: There is a new website by Aria Stewart based on Dave Coffin's program to convert RCA-VOC files. Here is the link.

I have an RCA voice recorder and wanted to convert the VOC (specifically RCA-VOC) files to something I could use. I found the perfect program on Dave Coffin's page.
1. First install "sox" using synaptic.
2. Then, simply download Dave Coffin's free C program called "devoc.c."
3. You then have to make the devoc program into something you can use. Do this by running the following command:
gcc /path/to/devoc.c
This will spit out a file called "a.out" to the same directory where devoc.c is located.
4. Rename "a.out" to something else, such as "devoc" (no file extension is needed)
5. To run devoc from where it is, change to that directory in terminal and type ./devoc with an option. However, to make running devoc a little easier, move the new devoc file to /usr/bin by typing the following into the terminal:
sudo mv /current/path/to/devoc /usr/bin
6. Now to run devoc, simply open a terminal and type devoc with an option
7. To see a list of options, type the following into the terminal:
devoc
8. Finally, run the program with the option you desire, for example, to convert a VOC file to a WAV, type the following:
devoc -w /path/to/file.voc
This will convert the file and put the new WAV file in the same directory as the VOC file. I like soundconverter (available in synaptic) to then convert the WAV file to an MP3.

Sources: Dave Coffin AND Computing.net
Webpage Converter
Windows Conversion Program link

Sunday, July 06, 2008

The Command Line Way to Remove a Package's Unused Dependencies

When removing a package, if you want to also remove the unused dependencies associated with it, type the following:
sudo apt-get autoremove packagename


To also remove any configuration files with the dependencies, type:
sudo apt-get --purge autoremove packagename

Wednesday, June 25, 2008

Command line way to install a package

Use the following command to install a package:
sudo dpkg -i /path/to/filename.deb

PulseAudio, Flash, and Firefox

After installing Hardy, I was having a variety of problems with sound as well as Flash. Apparently there is some conflict between Flash and PulseAudio. For example, I was only getting sound from the first application I launched. So if I had firefox open, it would have sound. But then if I then opened a second application like rhythmbox, exaile, etc, no sound from that. This also worked the opposite way. In addition, I was having a problem with Firefox crashing everytime flash was running on sites like youtube.

The following has worked for me:
1. Uninstall the following packages using synaptic: libflashsupport and flashplugin-nonfree
2. Install the following packages using synaptic: pulseaudio-module-hal pulseaudio-module-x11 libasound2 libasound2-plugins padevchooser swh-plugins libao-pulse ladspa-sdk libsdl1.2debian libsdl1.2debian-pulseaudio
3. Run the following command to edit the /etc/libao.conf file:
sudo gedit /etc/libao.conf
Edit the file so that it looks like this:
default_driver=pulse
Then save and close the file
4. Run the following command to edit (or create if has not been) the asound.conf file:
sudo gedit /etc/asound.conf
Then add the following to the file:
pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}

Then save and close the file. This addition makes it so that all sound runs through pulse.
5. Go to System-->Preferences-->Sound and change the first four lines to "PulseAudio Sound Server"
6. To get flash working properly, we need to download the beta version of Flash 10. Download the deb package here. Then double click to install. To see other versions, check the site here.
7. Finally, reboot.

Sources: The (almost) Perfect Pulse Audio Setup and PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)

Friday, June 06, 2008

The command to use to search for installed packages in terminal

The following command will let you check to see if a package is installed:
aptitude search package-name

If you see an "i" next to the package name, it is installed.

Bluetooth Headsets with Hardy

I used the Bluez Wiki page to help get my bluetooth headset working with ubuntu. It basically uses the new default pulseaudio to divert the sound to your headset. I don't know if it matters, but it's a Samsung headset. Also, I know some people have had problems with skype which this post does not address.

To get it working, do the following:
1. Install the following package using synaptic: padevchooser
2. Type the following into a terminal to get your headset's mac address and then write it down:
sudo hcitool scan
3. Install Blueman using the instructions at the Blueman website. This is the only way I could bond / pair / connect my headset to my computer without getting an obex error. As long as Blueman shows a lock next to your headset, it should be good. I believe the problem occurs because the default ubuntu/gnome bluetooth app is trying to browse the headset for files.
4. Next use the following command to edit (or create if it doesn't already exist) the asound.conf file (note that "nano" can be replaced for "gedit" if you like):
sudo nano /etc/asound.conf
Add the following to the file as stated on the Bluez wiki page:
pcm.bluetooth {
type bluetooth
device 00:11:22:33:44:55
}
and save the new file
*Note that "xx.xx.xx.xx.xx.xx" should be replaced by the mac address you found in step 2.
6. Run the PulseAudio Device Chooser found in Sound & Video and will then show up in the tray.
7. Under preferences, choose to start on login. Also, check what you like under "configure local sound server."
8. Restart your computer.
9. In a terminal type:
pactl load-module module-alsa-sink device=bluetooth
This command has to be run each time you start your computer. I have not found a way to automate it without getting an error message somewhere. Therefore, I just made a launcher using the above command to speed things up.
Also, although I have not tested it, the following command should work to get a bluetooth microphone working:
pactl load-module module-alsa-source device=bluetooth

You should now be able to choose your bluetooth headset in the pulse device chooser under "default sink." If this doesn't work, try using the volume control option in the pulse device chooser, right click on the stream that is playing, and choose the bluetooth headset.

The Bluez wiki page also gives ways to send audo to the headset for only specific programs. (I found exaile can be set up using the rhythmbox instructions). Also, if this doesn't work for you, please check this thread at ubuntu forums for a slightly different approach.

Changing preferred actions or programs for media in Hardy

Hardy seems to have moved the preferred actions around for media. Some of it can still be configured in Systems-->Preferences-->Preferred Applications. However, to set the defaults for what happens when something like a CD is inserted, you must change it in nautilus. Therefore, pull up your home folder or any other folder and go to Edit-->Preferences-->Media Tab and make the changes you want.

Saturday, May 31, 2008

Problems with Hardy (Emerald, Java, & Samba Config)

Here are the solutions to a few problems I had with Hardy:

Emerald:
Emerald wasn't actually changing my windows even though a different theme was highlighted. So add the following (as a new startup program) to sessions (Systems-->Preferences-->Sessions):
emerald --replace

Java:
I was using sun's version of java but it wasn't working for me on firefox and I found this thread to help. First if you want to use sun's version, install the following packages: sun-java6-jre and sun-java6-plugin. To get it to work, first try uninstalling the package icedtea-gcjwebplugin. Then restart firefox and test again on the java webpage. If that doesn't work, try also uninstalling openjdk-6-jre. That did it for me.


System-Config-Samba:
For anyone that doesn't know, this package makes Samba configuration incredibly simple. (As a side point, I will show possible settings in a separate future post). However, the samba config utility wasn't working. Here's what I had to do. Run the following command:
sudo touch /etc/libuser.conf

Thanks to Ubuntu Forums for the answers.