Showing posts with label firefox. Show all posts
Showing posts with label firefox. Show all posts

Monday, October 27, 2008

Setting your default web browser in Openbox on Ubuntu

I just installed Openbox on my laptop running Ubuntu. When I clicked the web browser menu item, it opened Konqueror. Since this is not my preferred browser, I ran

sudo update-alternatives --config x-www-browser

It provides an interactive way to choose which browser opens when you run x-www-browser.

Tuesday, October 14, 2008

Using Gmail as the default mail client in Ubuntu

I finally got annoyed with Evolution opening up every time I clicked a mailto link in Firefox. So I did a little Googling and came up with this:
  1. Create a script in your home directory. I put it in ~/scripts and called it mailto.sh.
  2. As of today, this script works with Firefox 3.0.3:
    #!/bin/sh
    firefox "https://mail.google.com/mail?view=cm&tf=0&ui=1&to=`echo $1 | sed 's/mailto://'`"
  3. Make the script executable:
    chmod u+x ~/scripts/mailto.sh 
    (or a+x if you want to allow all other users to run it)
  4. Go to System → Preferences → Preferred Applications.
  5. Set Mail Reader to Custom, and enter the path to the script.
Shell scripting is a beautiful thing, folks.

Friday, September 14, 2007

Ubuntu Server on Pentium II


For a Pentium II machine I recently revitalized, I wanted to install only the most essential software, so I started from the Ubuntu Server 6.06.1 CD. I did an expert install, since this particular motherboard, an Elitegroup (ECS) P6BX-A+ with Award BIOS, doesn't play nice with GRUB. Plus I planned on some little tweaks, like setting a static IP from the get-go and making a more server-like partitioning scheme.

NOTE: Unless you specify otherwise via the expert installer, Ubuntu disables login as root.

After completing the base installation, during which I opted to use all available repositories, I updated the package indices and installed the necessary packages for X, plus a window manager and other conveniences.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install x-window-system-core xdm fluxbox xterm
Then I rebooted and was delighted to find the X server started without a single problem.

While installing additional packages, I discovered that it took an intolerably long time to connect to the repositories. Once I installed Firefox, I observed similar delays in loading pages. For some reason, disabling IPv6 (via about:config) got Firefox working, but apt-get remained sluggish. So I used traceroute in the hope of finding the cause.

Apart from the delay in passing through the gateway, which I also observed on my Debian box when I traced the same route for comparison, it wasn't resolving domain names. Instead of the expected output,
traceroute to us.archive.ubuntu.com (91.189.89.8), 30 hops max, 40 byte packets
1 192.168.1.1 (192.168.1.1) 1.931 ms 1.680 ms 1.782 ms
2 * * *
3 XX-N-N-XXNN.XXXXXXX.pa.panjde.comcast.net (NN.NN.NNN.NN) 8.599 ms 7.877 ms 9.530 ms
4 XX-NN-XXNN.XXXXXXX.pa.panjde.comcast.net (NN.NN.NNN.NNN) 9.573 ms 8.122 ms 9.572 ms
5 XX-NN-XXNN.XXXXXXXX.de.panjde.comcast.net (NN.NN.NNN.NNN) 10.248 ms 8.929 ms 9.522 ms
6 po-10-ur01.norristown.pa.panjde.comcast.net (68.86.209.98) 10.724 ms 9.759 ms 9.519 ms
7 po-10-ur02.norristown.pa.panjde.comcast.net (68.86.209.102) 9.838 ms 10.222 ms 9.526 ms
8 po-21-ar01.wallingford.pa.panjde.comcast.net (68.86.209.106) 12.028 ms 11.325 ms 11.952 ms
9 68.86.91.182 (68.86.91.182) 14.310 ms 14.387 ms 14.187 ms
10 68.86.85.2 (68.86.85.2) 13.551 ms 13.315 ms 14.142 ms
11 68.86.84.153 (68.86.84.153) 17.783 ms 16.573 ms 17.901 ms
12 te-1-3-pr01.ashburn.va.ibone.comcast.net (68.86.84.154) 18.032 ms 16.492 ms 16.894 ms
13 xe-3-1-0.was11.ip.tiscali.net (213.200.84.117) 16.672 ms 17.544 ms 16.504 ms
14 so-6-1-0.lon11.ip.tiscali.net (213.200.80.26) 94.043 ms 93.927 ms 93.544 ms
15 01502-004-01-gw.ip.tiscali.net (213.200.77.114) 93.777 ms 93.384 ms 93.506 ms
16 195.72.129.70 (195.72.129.70) 92.104 ms 90.699 ms 91.123 ms
17 byrd.canonical.com (91.189.88.11) 93.688 ms 93.222 ms 94.142 ms
18 * * *
every line looked like lines 9-11 above: no FQDN, only an IP. That pointed to a DNS problem. So I opened resolv.conf and found that the resolver had been using my router as its name server—a less than ideal configuration, since my router is an entry-level Linksys. I merely changed resolv.conf to read
search hsd1.pa.comcast.net.
nameserver 68.87.75.194
nameserver 68.87.64.146
and restarted networking services:
sudo /etc/init.d/networking restart
and it worked flawlessly.

The server install achieved exactly what I envisioned for this box: low resource usage. Here's the process tree right now, with one user active.
init─┬─atd
├─cron
├─cupsd
├─dd
├─events/0
├─6*[getty]
├─khelper
├─5*[kjournald]
├─klogd
├─ksoftirqd/0
├─kswapd0
├─kthread─┬─aio/0
│ ├─kacpid
│ ├─kblockd/0
│ ├─kgameportd
│ ├─khubd
│ ├─kseriod
│ └─2*[pdflush]
├─mdadm
├─migration/0
├─shpchpd_event
├─sshd───sshd───sshd───bash─┬─firefox-bin───2*[{firefox-bin}]
│ └─pstree
├─syslogd
├─udevd
├─watchdog/0
└─xdm─┬─Xorg
└─xdm
Yes, I'm writing this post in Firefox on the Ubuntu server with X forwarding to my laptop. Remember, this is a Pentium II at 450MHz, circa 1998. Legacy hardware has a place in modern computing—in the third bedroom, right beside my main Debian box.

Wednesday, November 09, 2005

Totem Mozilla Plugin Unplugged

Since upgrading to Ubuntu Breezy 5.10, I found that video was broken in Firefox. I initially installed the MediaPlayerConnectivity extension I had used with Hoary 5.04 and disabled the Totem plugins for all video file formats. This worked well enough for everything except the trailers on Apple's web site. I suspect they're using the most sophisticated/"fancy" features of QuickTime, which causes Totem Mozilla Plugin—despite being disabled—to totally flip out and crash the browser. The Firefox UI doesn't provide any obvious way to uninstall the plugin, but it can be done. Here's how.

cd /usr/lib/mozilla/plugins
sudo rm *totem*


or, alternately

sudo rm -rf *totem*

I'm always wary of using forced recursive removal. I wouldn't recommend the second method, especially since the first seems to work equally well.

This should delete all files associated with Totem Mozilla Plugin. If you really wanted it back, I suppose you could reinstall the Firefox package. (You might have to use the one included on the Ubuntu installation CD.) The next step is replacing the Totem plugin with something else. The MPlayer plugin has improved considerably since Hoary, so that's what I'm using. The package is called mozilla-mplayer.* I opted to remove mplayer-386, which Synaptic will install by default, and replaced it with mplayer-nogui. I didn't want MPlayer cluttering up my Applications menu. I already had the necessary codecs installed because of xine. If you get a missing codec(s) error, you might have to download them from the MPlayer web site. Now everything works beautifully. Embedded media is a sweet, sweet reality for me.

* If I remember correctly, it's part of the multiverse repository. I can provide detailed instructions on how to enable repositories upon request.

Thursday, August 04, 2005

X11: Xine United

Here's a puzzle for you. When I first tried to get embedded media working in Firefox, I installed the MediaPlayerConnectivity extension and had it open files in xine. I gave up on this plan because xine wouldn't play QuickTime (.mov) files, like the movie trailers at Apple's web site, forcing me to use MPlayer. So I used MPlayer for all embedded media until I predictably got tired of it, and then I switched to VLC for a while. When it became apparent that VLC wouldn't give me DVD playback without some serious reconfiguration, I returned to my original strategy in desperation. Except this time it was a flawless victory.



I wasn't sure whether to be overjoyed or furious. I mean, after all the time I spent trying to get embedded media to play correctly… Let's review the sequence of events.
  1. Installed MediaPlayerConnectivity and xine.
  2. Installed MPlayer (and XMMS).
  3. Removed MPlayer, xine and MediaPlayerConnectivity.
  4. Installed VLC.
  5. Removed VLC.
  6. Reinstalled MediaPlayerConnectivity and xine.
  7. Holy shit, it works!
What happened between events 1 and 6 to cause event 7? For a while, I couldn't account for it. Then I remembered that Synaptic gives you two ways to remove packages, removal and complete removal. The latter removes all files associated with the package. With the former, "configuration files and user created data" remain untouched.

Maybe files lingering from one of the other packages made it possible for xine to play embedded media it couldn't play before. I doubt they came from VLC; it had more problems than xine did. MediaPlayerConnectivity doesn't include any codecs, and XMMS had been on my system before I ever tried xine. That leaves MPlayer.

I decided to investigate the xine documentation. It contains a section that recommends downloading Dynamic Link Libraries (DLLs) from the MPlayer site in order to play QuickTime files. On the other hand, it recommends a similar solution to playing Windows Media Video (WMV). I still can't play WMV in xine—or any other media player, for that matter. Eat my shorts, Microsoft. You and your proprietary video format can suck my USB dongle. In any case, I'm not willing to discount the MPlayer theory yet. I'll look into this tomorrow if I have time.

By the way, xine has beautiful DVD playback. All I had to do was get the libdvdcss2 package. I've seen suggestions that the use of this decryption library is illegal in the U.S. So it's illegal to play a DVD I bought with my own money in a computer likewise purchased? That's ridiculous. Nonetheless I feel obliged to warn you. Now here's how to install the package.

sudo apt-get install libdvdcss2

It's that easy. Go enjoy your favorite movie. You are big winner.

Tuesday, August 02, 2005

Overextended

I've spent the last few hours searching for an elegant way to play embedded media in Firefox. I hoped to gain the capability to play multimedia within the browser but without using MPlayer, which was unreliable for me in the past. Sadly I met with only limited success.

MediaPlayerConnectivity

Initially I tried using an extension called MediaPlayerConnectivity. The interface was refreshingly clean, but I disliked the fact that it doesn't play embedded media in the browser window. Instead it opens another application. So I had to install xine for video playback. This combination worked well for most video formats but couldn't handle Quicktime movies and m3u playlists smoothly. I knew the MPlayer plug-in would give me Quicktime playback. I gave in and installed it. Incidentally the MPlayer package depends on XMMS, so I had to reinstall XMMS and try my hardest not to gouge out my eyes. At this point I was getting frustrated. I had intended to install one item and found myself forced to install several others I didn't want. I thought,

Fine, I'll just go back to using MPlayer for all embedded media. It worked well most of the time.

Easier said than done. I uninstalled MediaPlayerConnectivity using the Tools -> Extensions menu. I had been running Firefox from the Terminal to catch any error messages that might appear. When I restarted Firefox, the Terminal spewed out over a dozen lines of the following.

*** nsInstallLogReader::_parseLine - failed to deregister chrome

I'm guessing this means Firefox was unable to remove the extension's registry entry. Below that it printed another error twice. I've truncated it slightly.

*** getItemProperty failing for lack of an item. This means getResourceForItem failed to locate a resource for aItemID (item ID = http://ftp.mozilla.org/pub/…/mediaplayerconnectivity-0.3.9-fx+ns.xpi, property = internalName)

Nonetheless I resolved not to reinstall the extension. I began testing MPlayer to see what surprises it had in store for me.

MPlayer and VLC

It soon became clear that MPlayer was just as fickle as ever. I grew particularly annoyed with its tendency to stop playback in the middle of a streaming MP3. First it forced me to reinstall XMMS, and now this? Je refuse! I closed Firefox and removed MPlayer and XMMS. Then I decided to try VLC.

I installed the player and the Firefox plug-in and have been testing it with various different video formats. Unfortunately it doesn't seem to work much more reliably than MPlayer. More extensive tests will be necessary to determine my next course of action. Once I get the embedded media problem solved, I can move to other tasks.
  • Optimize NVIDIA performance.
  • Install necessary packages for DVD playback.
Of course, it's entirely possible I'll grow weary of fussing with the embedded media and save it for a time when I'm less irritable. Otherwise I'm liable to start removing the heads and spinal columns of innocent bystanders.



I'm serious as a heart attack.

Thursday, July 28, 2005

Flash News Flash

Thank you, Mozilla. It's finally possible install the Flash plug-in for Firefox for Linux i386 without leaving your browser. That's right. You no longer have to go to the Macromedia web site, download a gzipped tar file, unpackage it and run the installer. Now it's as easy as clicking "Next" and "Finish."