Ubuntu Firefox 3.5 install: ubuntu-mozilla-security 22

Posted by bikethetam Fri, 03 Jul 2009 17:28:00 GMT

Important update: The official Firefox-3.5 is now available in the universe repositories. You don't need to do any of the following, just "apt-get install firefox-3.5". No need for any ubuntu-mozilla-* line in /etc/apt/sources.list.

To uninstall firefox-3.5 that was setup using ubuntu-mozilla-*, follow the removal instructions below.

 

After digging around a little bit more, I found that there was another, safer, repository for Jaunty with firefox 3.5: ubuntu-mozilla-security.

For those of you who don't want the daily updates of firefox, which will deliver experimental releases on occasions, you should use the security repository instead of ubuntu-mozilla-daily.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EBC211F

Add the following line at the bottom of /etc/apt/sources.list:
deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu jaunty main

sudo apt-get update
sudo apt-get install firefox-3.5 firefox-3.5-gnome-support

If had already installed firefox-3.5 from the daily repository and you want to switch to the security one, you first need to remove the ubuntu-mozilla-daily line from /etc/apt/sources.list and remove firefox-3.5 that came from that repository:

sudo apt-get remove firefox-3.5 xulrunner-1.9.1-gnome-support xulrunner-1.9.1

Only after that you should run "apt-get install firefox-3.5 firefox-3.5-gnome-support ".

 


Installing Firefox 3.5 the right way in Ubuntu Jaunty 56

Posted by bikethetam Thu, 02 Jul 2009 03:45:00 GMT

Important update: The official Firefox-3.5 is now available in the universe repositories. You don't need to do any of the following, just "apt-get install firefox-3.5". No need for any ubuntu-mozilla-* line in /etc/apt/sources.list.

To uninstall firefox-3.5 that was setup using ubuntu-mozilla-*, follow the instructions at ubuntu-mozilla-security.

Only follow the instructions below if you want to be on the bleeding edge.

 

Firefox 3.5 was officially released yesterday and it brings significant improvements in terms of speed, tab management and support of HTML5. Ubuntu does not automatically propose the upgrade so you need to help the system find the newer packages. Let's start by listing the least effective ways of getting those packages.

Installing from Canonical repositories

When searching inside of Synaptic Package Manager or using apt-cache, you are going to find firefox-3.5. Unfortunately, it's been there since the release of Jaunty and it has not been updated since then. At the moment, only the beta 4 for is available and believe me you don't want it.

$ apt-cache showpkg firefox-3.5
Package: firefox-3.5
Versions:
3.5~b4~hg20090330r24021+nobinonly-0ubuntu1 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_jaunty_universe_binary-i386_Packages)
 Description Language:
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_jaunty_universe_binary-i386_Packages
                  MD5: b670b07084b5a79b912d14c4307acda4

Installing from mozilla.org

That's a better option. The process is the following:

  1. download the .tar.bz2 file
  2. uncompress it under ~/firefox
  3. make sure no other instance is already running
  4. start firefox 3.5 by running "~/firefox/firefox"

It works fine but there are several problems with this approach:

  • It completely shortcircuits the package manager which means that you will have to install future updates independently of the rest of the system.
  • When Ubuntu gets upgraded, it's very likely this firefox installation will stop working as it depends on libraries that will have changed version.
  • This firefox installation will the same ~/.mozilla directory to store your personal settings as the Ubuntu version of Firefox (3.0.11 as of today). Confusion and pain will inevitably follow. Unfortunately the last installation option described below has that same disadvantage.

 

Now the better solution.

Setting up the ubuntu-mozilla-daily repository

You can add to your system a repository maintained by the mozilla developers.

Add the following line at the bottom of /etc/apt/sources.list:

deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu jaunty main

Let Ubuntu know the identification key of this repository:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247510BE

Refresh your system cache:

sudo apt-get update

Now, same as with the first option, the package that you want is firefox-3.5. The difference is that now, the version available is the right one.

$ apt-cache showpkg firefox-3.5
Package: firefox-3.5
Versions:
3.5.1~hg20090629r26036+nobinonly-0ubuntu2~umd1~jaunty (/var/lib/apt/lists/ppa.launchpad.net_ubuntu-mozilla-daily_ppa_ubuntu_dists_jaunty_main_binary-i386_Packages)
 Description Language:
                 File: /var/lib/apt/lists/ppa.launchpad.net_ubuntu-mozilla-daily_ppa_ubuntu_dists_jaunty_main_binary-i386_Packages
                  MD5: b670b07084b5a79b912d14c4307acda4

You need to setup this package, latex-xft-fonts and also firefox-3.5-gnome-support

$ apt-get install firefox-3.5 firefox-3.5-gnome-support latex-xft-fonts

At this point, there are 2 different versions of Firefox coexisting on the system, 3.0.11 and 3.5.1. When you run "firefox" from the command line or when you select it from the Applications menu, version 3.0.11 is fired up. It might be convenient to make the newer version the default:

$ sudo su
$ cd /usr/bin
$ ll firefox*
lrwxrwxrwx 1 root root 11 2009-06-22 16:45 firefox -> firefox-3.0
lrwxrwxrwx 1 root root 32 2009-06-22 16:45 firefox-3.0 -> ../lib/firefox-3.0.11/firefox.sh
lrwxrwxrwx 1 root root 34 2009-07-01 21:17 firefox-3.5 -> ../lib/firefox-3.5.1pre/firefox.sh
$ rm firefox
$ ln -s firefox-3.5 firefox

The newly installed version is branded "Shiretoko". That's the name used to identify 3.5 during development.

By using this technique, you're guaranteed that Firefox will get updated regularly through the Ubuntu package manager and that compatibility with system libraries will be preserved.

The downside of this is that you will get a little more updates than the average users: fixes to 3.5 will be dropped here first before they are made available to all. As a consequence, it's not impossible that you will be among the first to find regression bugs.

Reference: http://www.asoftsite.org/s9y/archives/160-FAQ-Where-can-I-get-firefox-3.5-for-Ubuntu.html

Update 7/3/2009: safer ubuntu-mozilla-security repository?

 


Fix for Firefox flashing when in full screen 2

Posted by bikethetam Tue, 12 May 2009 01:52:00 GMT

Since Jaunty, when Firefox is displayed in full screen (F11), any of the following actions will result in Firefox disappearing for a second and the background desktop image replacing it:

  • right click
  • alt-tab
  • hovering over a link with a tool tip

That happens if compiz is in use and I verified the problem both on machines using Intel and Nvidia video cards.

The fix is easy:

  • go to System -> Preferences -> CompizConfig Settings Manager -> General
  • uncheck "Unredirect Fullscreen Windows"

Why is Firefox so slow on the Acer Aspire One? 3

Posted by bikethetam Tue, 20 Jan 2009 02:46:00 GMT

Recently, I bought myself a nice little Acer Aspire One laptop. I swiftly got rid of the dull Fedora variant installed on it and replaced it with Ubuntu 8.04 and then 8.10. I had my share of troubles with the wireless card on the machine, especially with 8.10 and WPA2 networks, must as of now, it all works.

The AAO doesn't have a lot of system resources. 512MB memory and just 8GB of disk. This disk is actually an SSD drive, but it's the slow kind, really really slow especially when writing. As a result the laptop regularly comes to a standstill for a few seconds, with the disk light on solid, before reemerging. Annoying.

Here's what hdparm has to say about the disk:

me@aao # hdparm -i /dev/sda1
/dev/sda1:
Model=SSDPAMM0008G1EA                         , FwRev=Ver2.I0H, SerialNo=CVCP8236821U5
Config={ HardSect NotMFM Fixed DTR>10Mbs }
RawCHS=15636/16/63, TrkSize=32256, SectSize=512, ECCbytes=4
BuffType=DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=?0?
CurCHS=15636/16/63, CurSects=15761088, LBA=yes, LBAsects=15761088
IORDY=yes, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes:  pio0 pio1 pio2 pio3 pio4
DMA modes:  mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 *udma4
AdvancedPM=no
Drive conforms to: Unspecified:  ATA/ATAPI-4,5


Firefox is the application where it happens the most often. Firefox loads a page, it appears to be done, but it then freezes for a few seconds with that damn disk light on.

Why is that? Let's see. First let's make sure that it's Firefox using the disk. The great "pidstat" tool, part of the sysstat package is your friend. Start it up with the -d option to let it monitor disk activity and reports every X seconds which application is reading or writing to disk:

pidstat -d 5

There are always a few applications doing some IO at any point in time. Firefox, pdflush keep showing up in the list, but it's normally less than 4KB in or out per sec and that's fine.

Now load some web pages and keep an eye on the output of pidstat.

16:26:25          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
16:26:30         6026      0.80      6.40      2.40  firefox

16:26:30          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
16:26:35          181      0.00      2.40      0.00  pdflush
16:26:35         6026      5.60     41.60      0.80  firefox

16:26:35          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
16:26:40          181      0.00      5.60      0.00  pdflush
16:26:40         6026     51.20      8.80      0.00  firefox

16:26:40          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
16:26:45          181      0.80      1.60      0.00  pdflush
16:26:45         4540      0.00      2.40      0.00  syslogd
16:26:45         5441      0.00      0.80      0.00  wpa_supplicant
16:26:45         6026      3.20    107.20      1.60  firefox

Here you go, the page finishes loading and firefox starts writing to disk making the system unresponsive for a few seconds. It doesn't happen on every page and I noticed the high reading rates are not as bad as the lower write rates. 30KS/s write for 3 seconds is enough to make you feel the pain.

Now, let's find out what Firefox is writing. For that task, strace is what you need. First find the firefox pid. Once you have it, attacch to firefox using strace. strace will pring all the system calls the application makes including IO. What I want to know is what file is opened after a page finishes loading and how much data is written to it. Since there is a crazy amount of noise around the interesting data, I have to filter out of strace all the system calls I don't care about.

strace -p 6026 2>&1 | egrep -v "gettimeofday|poll|EAGAIN|itimer|sigaction|recvmsg|socket|bind|sendto|futex|select"

I try to start that command right when a page finishes loading and the disk light turns solid green and turn it off right after it goes black again.

What I see during those few seconds are a lot of writes to a couple of file descriptors (29 and 44):

write(44, "\r\r\374\0\t\t\244\0\16\302\16,\r\217\fy\v\304\v$\nu\n"..., 4096) = 4096
write(29, "\n\0\0\0\235\3o\0\0040\4E\4Z\4o\4\204\4\231\4\256\4\303"..., 4096) = 4096


Now to find what those file descriptors are:

me@aao # lsof -p 6026 | egrep " 29| 44"
firefox 6026 me   29uw  REG        8,1  1892352 467957 /home/me/.mozilla/firefox/kuz6twft.default/places.sqlite
firefox 6026 me   44u   REG        8,1    94904 467854 /home/me/.mozilla/firefox/kuz6twft.default/places.sqlite-journal

Firefox is writing to 2 sqlite database files. The places database is described at Mozilla Dev Center.
Places is the database where all of your history and bookmarks go. The history can grow very big thus getting the database to several MB or even several tens of MB. It seems every link you ever download, of any kind, text, js, images, everything goes in. That's a lot if inserts and as the database grows, each insert takes more time.

You can't turn off using that database AFAIK, nor limit the number of entries that goes in it. There are other databases that Firefox writes into and that also slow things down: the anti-phishing one and the cookies one. You can, although I don't recommend it, turn off the anti-phishing one: go to about:config, search for safebrowsing.enabled to change it to false.

That leaves you with few options to improve the situation. Here are the options sorted by order of effectiveness:

  • change history expiration setting: Go to about:config and reduce browser.history_expire_days
  • compact the database from times to times. When Firefox is off:
    sqlite3 "path to database" 'VACUUM;'
  • move the mozilla files including the databases to a memory partition. Create a tmpfs partition at /home/yourself/.mozilla. Make a copy of the directory you have on disk at the moment. Create a script to start firefox. This script will start by copying the on disk .mozilla to the on memory .mozilla. Then it starts firefox. When firefox shuts down, the script copies the daata from meemory to disk.


Note that I haven't tried that last option as I'm afraid it would need too much memory on a computer where this resource is already scarce.

 

But the first option that requires reducing "reduce browser.history_expire_days" is simple and works quite well. I set it to 7, that drastically reduces the size of the sqlite database and delays displaying web pages are now rarely above 2 seconds.

 


Make Blogger edit box bigger

Posted by bikethetam Mon, 17 Nov 2008 03:41:00 GMT

I've been using Blogger for a few days only but the one thing that annoyed me was the tiny size of the input box for writing a post. It's both too narrow and too short, forcing the writer to move the elevator constantly. blogger.com doesn't allow to change that size (as opposed to wordpress.com) Fortunately, users of Firefox can still trick their browser into resizing that box. This is done using the great Greasemonkey Firefox addon and an adequate Greasemonkey user script.

  1. First install the Greasemonkey addon to Firefox: download it here. You might also want Platypus but it's not necessary here.
  2. Restart Firefox.
  3. Now download the script for resizing the edit textarea: http://browservulsel.blogspot.com/2005/07/blogger-large-post-editor-user-script.html. Greasemonkey should automatically pick it up as you click on the Blogger Large Post Editor and from now on, any time you edit a post, the edit box will occupy the whole width of the page.

To my taste the edit is still too short, so I edited the script and increased the height of the box:

  1. Go to Tools/Greasemonkey/Manage User Scripts
  2. Select Blogger Large Post Editor and press the "Edit" button
  3. I chose to make the box height 500 pixels and to do that I just changed the ref.style.height and ta.style.height lines:
    var ref = document.getElementById('richeditorframe');
    ref.style.width = '100%';
    ref.style.height = '500px';
    
    var ta = document.getElementById('textarea');
    ta.style.height = '500px'; 

While I'm on the Greasemonkey subject, one other place where I find it very useful is for http://www.google.com/ig, the personalized home page of Google. The layout on that page changed in October 2008, mostly for the best, but it now includes a sidebar that is borderline useless and that leaves a good 15% of the width of the page on the left entirely black and sad. I decided to get rid of that sidebar, it's easy with Greasemonkey + Platypus. Platypus is another Firefox addon that can write Greasemonkey scripts based on the page element you select graphically and the action you decide to apply on that element using a contextual menu.

  1. Install the Platypus addon
  2. Go to http://www.google.com/ig
  3. If the platypus toolbar doesn't automatically show up, make it appear by selecting the Tools/Platypus! menu item
  4. Move your mouse over to the sidebar, it should entirely highlight itself (pink overlay), then right click, select remove, click the 'Save' button in the Platypus toolbar, and confirm.
  5. To make sure all variations of the http://www.google.com/ig URL get caught, append a * to it in the Greasemonkey User scripts manager.

The ig sidebar won't bother you anymore.