In this world of an endless quest for information (I’m speaking of the great Internet), it is common to stumble upon old websites or websites that have been generated by an old software. A perfect example of this would be howtos, which, while they are very useful, really look like someone shitted on my monitor. Since I’m using one the Best Browser(tm), that is Firefox, I’ve been trying to tackle this problem. The angle of attack will be userContent.css. Many Firefox hacks are based on this file. To have more information on this file and on how to create it (and where), please read the Customizing Mozilla page.

In this file, we will be adding a new set of rules which will give a default behavior to old web pages. Some things to note about these changes. First, I did not include !important so that newer websites can still define their styles. Secondly, I’ve spent some times in adding/removing tags so that the very vast majority of websites are unaffected by theses changes, while the old websites are much better (in my opinion). Here are the content of the file:

body { font-family: Calibri, Verdana, Arial, Helvetica, sans-serif; }
h1 { font-size: 175% }
h2 { font-size: 145% }
h3 { font-size: 120% }
h4 { font-size: 105% }
h5 { font-size: 80% }
h6 { font-size: 65% }
a[href] {color: #1133ff;}
a[href]:hover{text-decoration:underline;}
a[href]:visited{color: #1133ff;}
code,kbd,pre,samp,tt { font-family: Consolas, "Courier New", Courier, monospace; }
hr {
color: #999999;
background: transparent;
height: 1px; /* Required for IE/Win */
padding: 0;
border-color: #999999;
border-width: 1px;
border-style: none none solid none;
}
ol { list-style: decimal outside; }
ul { list-style: round outside; }
ol ul,
ol ol ul,
ol ul ul,
ul ul,
ul ol ul,
ul ul ul {
list-style: square outside;
}
table{
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
}
fieldset { border: none; }

You can download the file directly, if you prefer so. After that, restart Firefox, and browse to an old website.

Here is a comparison of the two rendering (before/after).

Before:

After:

Certains la connaisse peut-être déjà, voici une liste qui traine dans le cyberespace sur les vérités que les gens âgés ont comprises. C’est en anglais et traduisible, mais je suis feignant et vous êtes bon en anglais.

  1. Never, under any circumstances, take a sleeping pill and a laxative on the same night.
  2. Don’t worry about what people think; they don’t do it very often.
  3. Going to church doesn’t make you a Christian anymore than standing in a garage makes you a car.
  4. Artificial intelligence is no match for natural stupidity.
  5. If you must choose between two evils, pick the one you’ve never tried before.
  6. A person, who is nice to you but rude to the waiter, is not a nice person.
  7. For every action, there is an equal and opposite government program.
  8. If you look like your passport picture, you probably need the trip.
  9. Bills travel through the mail at twice the speed of checks.
  10. A conscience is what hurts when all of your other parts feel so good.
  11. Eat well, stay fit, die anyway.
  12. Men are from earth. Women are from earth. Deal with it.
  13. A balanced diet is a muffin in each hand.
  14. Junk is something you’ve kept for years and throw away three weeks before you need it.
  15. Experience is a wonderful thing. It enables you to recognize a mistake when you make it again.
  16. Thou shalt not weigh more than thy refrigerator.
  17. People who want to share their religious views with you almost never want you to share yours with them.
  18. You will never find anybody who can give you a clear and compelling reason why we observe daylight savings time.
  19. Never lick a steak knife.
  20. You should never say anything to a woman that even remotely suggests that you think she’s pregnant unless you can see an actual baby emerging from her at that moment.
  21. The one thing that unites all human beings, regardless of age, gender, religion, economic status or ethnic background, is that deep down inside we ALL believe we are above average drivers.

Voilà, certaines sont plus drôles que d’autres, mais globalement c’est pas mal 🙂

The other day, while doing my habitual surf & googling, I found something interesting : you can find the questions everybody is asking google. For example, type « differences between » and google suggest will give you a bunch of questions which are apparently the questions everybody wants the answer for. Don’t fear, my fellow humans ! Here are the answers to your really profound questions.

  1. differences between men and women
    Quite simple yet often asked. Don’t believe the lies about something prominent, the true answer is delicate and subtle : men don’t understand women, and women don’t understand why men don’t understand them (notice the subtle difference).
  2. differences between mitosis and meiosis
    Mitosis is pure and platonic. You get a lot of yourself to talk with. Meiosis is dirty and you need another one. Forget meiosis. Go mitosis, this is for the better (please note: you may have difficulty doing this as a human).
  3. differences between plant and animal cells
    This one is simple if you are not colour blind ! Plant cells are green and are good for transit, animal cells are red and smells not that good when put a long time under the sun.
  4. differences between dna and rna
    One letter. We can see the question is ill formulated, since obviously there is only one difference.
  5. differences between c and c++
    With c++, you get two ++ for the same price tag. Quite a deal, he ? With c++ you can also do more complex stuff, such as add one to a number, which requires a number of operations in c.
  6. differences between previous versions
    May I beg your pardon ? What kind of sick question is that ? In 6th position in addition ! Hum… let me answer… Differences between previous versions are the same as the next in paraphralogy.
  7. differences between them that
    He ! Two letters this time! No, just kidding. With them, you can insult a lot of people in one sentence. With that, you can insult objects.
  8. differences between democrats and republicans
    Democrats want democracy, republicans want republic (which is not the same as democracy, hence the fight between them). Otherwise the same, wanting more power than they can manage for their own good.
  9. differences between Islam and Christianity
    Both are wrong in their restrictions, otherwise the same. The true religion and the true god forbid drinking wine while multiplicating bred and fishes.
  10. differences between males and females
    Not convinced by the answer to #1, are you ? Ok, here is the real answer : males can stand up in levitation touching the ground with only one member under sexual excitation. Females can also, but in this case this is called a leg.

Ahh ! Feeling better ! Now that we all have the insightful answers to theses questions, we can move on in this difficult world of ours (however I am little bit worried by the IQ of my fellow googlers).

compass.pngRecently, I tried (as many) the recent beta of Safari on Windows. While the experience was far from nice (crashes, problem with rendering…) I noticed something very interesting : Apple is including the latest version of their Lucida Grande font in the package. This is quite nice, because the only version you can usually find on the Internet are old one with some characters missing (most notably the €). This package comes with the 5.0 version which is, I believe, the latest. These fonts are very readable at small font size, so they are a (among some others) perfect choice for a system font. It’s no surprise that the MacOS X desktop looks slick with these fonts. But now you can also have them in you Linux box ! Here are the instructions for Ubuntu, you can adapt them for Debian or your other distro of choice. If you don’t want to extract the font yourself, skip the first part.

Part 1 : Download and install Safari in Wine, then extract the fonts

First of all, install Wine. You can do this with tutorials, synaptic, or terminal and:
sudo apt-get install wine
Then download the Safari for Windows package at the Apple download site. Execute it with wine either by double clicking on it (if your system is configured for that) or with:
wine SafariSetup.exe
Once safari is installed, go to the install folder (« C:\Program Files\Safari\ » by default, on Linux with wine this is « ~/.wine/drive_c/Program Files/Safari/ ») and browse the Safari resources directory called « Safari.resources ». Here are your precious fonts ! You also have a nice Safari picture for your blog ;-). Copy them to your home directory or any other location and remove Safari (useless).

Then you have two nice files. Lucida Grande.ttf and Lucida Grande Bold.ttf.

Part 2 : Install the fonts

First, you will have to copy the fonts to your ttf font directory. Create it if it doesn’t exist yet:
sudo mkdir -p /usr/share/fonts/truetype/ttf
Copy the fonts:
sudo cp Lucida\ Grande\ Bold.ttf /usr/share/fonts/truetype/ttf/
sudo cp Lucida\ Grande.ttf /usr/share/fonts/truetype/ttf/

And reconfigure the fonts:
sudo dpkg-reconfigure fontconfig
You may also have to restart X with Ctrl+Alt+Backspace (save your work before that !). Go to your favourite font preferences (on Ubuntu this in System->Preferences->Font) and select Lucida Grande as the default font for everything with non-fixed font (ie Terminal/Code). Size 10 is very readable but a little big, and you can use the bold variant for the window title. If you are running also KDE apps or running the KDE desktop, you can select the same fonts and improve coherency among your system.

Update :

Osman shares with us this great tip ! If you want to install it as user font, just copy it to your font directory in your user profile.
mkdir -p ~/.fonts
cp Lucida\ Grande\ Bold.ttf ~/.fonts
cp Lucida\ Grande.ttf ~/.fonts

No more needs for a sudo !

Notes :

  • You can also extract the fonts from a Windows box. The rest is the same.
  • If your font doesn’t appear or has problem, check the files permissions in /usr/share/fonts/truetype/ttf/
  • On my flat panel, I have the following in use in my font preferences
    • Full hinting
    • Subpixel smoothing on (RVB order)

Firefox logoWith Firefox 2.0, many good things came. Among them are spell checker, anti phising, better tabs and so on (insert your favorite here)… Alas, it also broke two of my favorites extensions: OpenDownload and Tab Mix Plus (well, tab mix plus is now compatible). I used Tab Mix Plus for only one thing: open a tab for every search, bookmark or address I type in. So I searched for a easier method to do that. First, let’s fix the searchbar. Fireup configuration by typing about:config in the address bar, then search for « browser.search.openintab » in the list. If it does exists (it should), change it for « true » instead of false. Now every search opens up a new tab. Ahh, much better !

Unfortunately, people at Mozilla did not include the same option for bookmarks and address bar (I wonder why ? That’s not that hard). So we will have to use another option: userChrome.js extension. It’s the same type of customizing than userChrome.css, but with javascript instead of css. Cool ! Ok, install it (from the link above) and create a new file named userChrome.js (in your profile chrome directory, usually in C:\Documents and Settings\yourusername\Application Data\Mozilla\Firefox\Profiles\xxxx.default\chrome – you can get more information on your profile directory at the mozilla website.) with the following content:

/*======= Open urlbar's/bookmarks in new fg tab or in current tab if it's blank =======*/
eval("BrowserLoadURL = " + BrowserLoadURL.toString().replace("e;", "$& if ((gBrowser.currentURI.spec != 'about:blank' || gBrowser.webProgress.isLoadingDocument) && (!aTriggeringEvent.altKey)) { var tab = gBrowser.addTab(); gBrowser.selectedTab = tab; }"));
eval("BookmarksCommand.openOneBookmark = " + BookmarksCommand.openOneBookmark.toString().replace("open", "if ((gBrowser.currentURI.spec != 'about:blank' || gBrowser.webProgress.isLoadingDocument) && (aTargetBrowser != 'window' && aTargetBrowser != 'tab' && aTargetBrowser != 'tabshifted')) { var tab = gBrowser.addTab(); gBrowser.selectedTab = tab; } $&"));

Or you can download mine here.

Moreover, there are more little customization that allows you to create your firefox without tons of extensions. Vote for this extension to be included in the browser ! For example, you can open your tab to the right of the current tab. Oh, and you can probably uninstall Tab Mix Plus too :-).
Now, let’s start the hard part : OpenDownload. First, the OpenDownload extension is not compatible with Firefox 2.0, so grab the compatible-made one here. Do a tight-click->Save As… and then drag and drop from the saved location onto Firefox 2.0. Ok, installed ! Now, we only need a little modification in one of the Firefox files. This file is located in your Firefox install folder, not your profile folder. Usually this is « C:\Program Files\Mozilla Firefox\ ».
Find this block of code :

if (shouldntRememberChoice && noDefaultApp) {
https://www.x2b4.com/ hide featured choice
this.mDialog.document.getElementById("normalBox").collapsed = true;

And change the last true to false. Here is the already modified version. Do not forget to do a backup before modifying ! If it does not work and you’ve broke your firefox, reinstall it. Voilà ! Now you can finally open executables directly (having 100+ temporary executables on my desktop is not one of my biggest dream).

Happy hacking !