Speeding Chromium start up

Posted in Linux Development on January 14th, 2011 by OneOfOne

If you have been using Chromium like me, you know it can get pretty slow on the first start up after a couple of months of usage.
It’s mainly because of all the SQLite 3.x databases it uses for history and other settings.
So here’s a simple script to defrag and reindex all the databases chromium uses.

1. Install SQLite3 :

# install sqlite3
emerge sqlite:3 #gentoo
aptitude install sqlite3 #ubuntu/debian based

2. Close Chromium.

3. Execute this in bash :

cd ~/.config/chromium/Default #where recent chromium store its settings

find -type f -exec file '{}' \; | perl -ne 'print "$1\n" if /(.*?): SQLite/' | while read fname; do 
    sqlite3 "${fname}" VACUUM; 
    sqlite3 "${fname}" REINDEX; 
done

VACUUM : The VACUUM command rebuilds the entire database.
REINDEX : The REINDEX command is used to delete and recreate indices from scratch.

4. Results (I ran this a couple of weeks ago so the result isn’t as good as it would be the first time. :

-rw-r--r-- 1 oneofone oneofone 37M Jan 14 17:27 History
-rw-r--r-- 1 oneofone oneofone 34M Jan 14 18:01 History
.................
-rw-r--r-- 1 oneofone oneofone 39K Nov 23 10:11 History Index 2010-08
-rw-r--r-- 1 oneofone oneofone 9.0K Jan 14 18:03 History Index 2010-08

-rw-r--r-- 1 oneofone oneofone 32M Jan  2 14:12 History Index 2010-09
-rw-r--r-- 1 oneofone oneofone 12M Jan 14 18:03 History Index 2010-09

-rw-r--r-- 1 oneofone oneofone 93M Jan 14 17:29 History Index 2010-10
-rw-r--r-- 1 oneofone oneofone 71M Jan 14 18:08 History Index 2010-10

-rw-r--r-- 1 oneofone oneofone 169M Jan 14 16:06 History Index 2010-11
-rw-r--r-- 1 oneofone oneofone 161M Jan 14 18:20 History Index 2010-11

-rw-r--r-- 1 oneofone oneofone 152M Jan 14 01:43 History Index 2010-12
-rw-r--r-- 1 oneofone oneofone 137M Jan 14 18:22 History Index 2010-12

-rw-r--r-- 1 oneofone oneofone 93M Jan 14 16:16 History Index 2011-01
-rw-r--r-- 1 oneofone oneofone 92M Jan 14 18:24 History Index 2011-01
.................
Tags: , , , , ,

Mingw + OpenSSL + Qt4 for Windows on Linux

Posted in Linux Development on November 17th, 2009 by OneOfOne

This is slightly outdated, will upload a new version with OpenSSL v1.0.0, also fixed the link to the mingw-openssl.sh script.
For the longest time I used Mingw + cmake on top of wine to cross compile my Qt4 apps for windows, then I was bored one day, tired of how slow it is to recompile qt4 on wine and decided to try to get it to work with a native gcc instead of the overhead with wine.
So here goes.

This was done on Gentoo Linux, please don’t ask me how to do it on other distros.

Assumptions :

1. You know your way around the linux shell and have portage privileges.
2. You’re not scared from compiling things by hand.
3. You already have Qt4 installed and it is the same version as the windows source we gonna build.
4. Your working path will be ~/win32.
5. You have a working wine setup.

Part 1 – Meet the Toolchain :

# Change 32 to 64 if you're trying to build for Win64, of course you'd need a 64bit Linux toolchain as well.
export cross=i686-pc-mingw32
emerge -av crossdev
# I decided to use the latest gcc version, however there's nothing stopping you from using 3.x.
# Start building the tool chain, go make some coffee, watch tv, or play a game until it's done.
crossdev --gcc 4.4.2 ${cross}
# Fix a bug in Qt4's corelib, also make sure to change 4.4.2 to whichever version of gcc you decided to use.
ln -s /usr/${cross}/usr/include/float.h /usr/lib/gcc/${cross}/4.4.2/include/g++-v4

*Important* due to the way the gentoo build works, you have to use -static-libgcc while compiling with mingw’s g++ to elemenate the dependacy on libgcc_s_sjlj-1.dll.

You don’t need root access anymore.
Read more »

Tags: , , , , , , , ,