Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3149995
  • 博文数量: 117
  • 博客积分: 10003
  • 博客等级: 上将
  • 技术积分: 5405
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-23 09:34
文章分类

全部博文(117)

文章存档

2011年(1)

2010年(10)

2009年(69)

2008年(37)

分类: LINUX

2009-09-18 11:27:04

my friend of mine found out that Firefox can run faster if it's database is purged of empty entries. Firefox database is using SQLite to manage its database

you'll need:
1)SQLite >=3.0
you can check your version by typing in CLI
Code:
sqlite3
(exit typing .exit)
if you don't have it you can obtain it here: or with
Code:
sudo apt-get install sqlite3
2)you'll need this script:
Code:
#!/bin/bash

username=$(whoami)
proc="$(ps aux | grep $username | grep -v $0 | grep firefox | grep -v grep)"
if [ "$proc" != "" ]
then
        echo "shutdown firefox first!"
        exit 1
fi

curdir=$(pwd)

for dir in $(cat ~/.mozilla/firefox/profiles.ini | grep Path= | sed -e 's/Path=//')
do
        cd ~/.mozilla/firefox/$dir 2>/dev/null
        if [ $? == 0 ]
        then
                echo "i'm in $(pwd)"
                echo -e "    running...\n"

                for F in $(find . -type f -name '*.sqlite' -print)
                do
                        sqlite3 $F "VACUUM;"
                done

                echo -e "done in  $(pwd) ...\n"
        else
                echo -e "\n    !!!! Nisam uspio uci u direktorij $dir, preskacem ga !!!!\n"
        fi
done
echo "Job finished";

cd $curdir
use gedit (or any other text editor) to paste text in it,then save it in your home folder. Open your home folder, right-click on it, select properties. Then select Permissions tab and check the "Allow executing file as program" click Close.

Then close Firefox and run your script from terminal using ./name_of_script

when script done it's work start Firefox and you should feel the difference!
阅读(2053) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~