Archive for the 'Linux' Category

Disable File System Access Timestamp

Jan 21 2010 Published by under Linux,Windows

Access time can slow down disk operations because it adds an extra write every time a file is accessed. This is most noticeable during boot when many files are read, and the access time located on another part of the disk is recorded. To turn off atime, just follow these steps
Windows: simply run “FSUTIL behavior set disablelastaccess 1” at the command line.
Linux: a few more steps are required, since the atime property is set per partition.

  1. vim /etc/fstab
  2. change defaults under mount options column to noatime

No responses yet

KDE Font Settings

Jan 16 2010 Published by under Linux

Besides editing the font configuration file, there is an easier way to adjust font settings on desktops like GNOME and KDE. This article will cover KDE, since I just read another article that tries to make Ubuntu look like Mac OS X.

  1. Menu > Computer > System Settings
  2. Under Look & Feel, Appearance
  3. Click Fonts > Configure
    snapshot2
  4. Make sure sub-pixel rendering is enabled if you have an LCD screen and Hinting style is set to the preferred level. Hinting affects the edge contrast of fonts.
    snapshot3
  5. Click Ok and Apply

No responses yet

Better Linux LCD Font Rendering

Jan 16 2010 Published by under Linux

After doing a font rendering comparison on Linux and Windows, I thought there was more that can be done in Linux. The script I wrote to display fonts at different pixel sizes helped to pin down the places where I noticed display artifacts. I notice font problems most often when browsing the web. A site like LifeHacker uses a font that’s not installed my Linux box. At other times, random colors appear on the edges of fonts at certain pixel sizes. However, the following font configuration file will make font on every page appear smooth if Firefox is configured to use system fonts. More on that in a later post.

/etc/fonts/local.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>

<!-- Use the Autohinter -->
<match target="pattern" >
    <edit mode="assign" name="autohint" >
        <bool>true</bool>
    </edit>
</match>

<!-- Disable Autohinting for bold fonts -->
    <match target="font">
        <test name="weight" compare="more"><const>medium</const></test>
        <edit name="autohint" mode="assign"><bool>false</bool></edit>
    </match>

<!-- Enable sub-pixel rendering -->
<!-- Uncomment this if you have an LCD screen -->
        <match target="font">
                <edit name="rgba" mode="assign"><const>rgb</const></edit>
        </match>

<!-- Font hinting to increase edge contrast -->
    <match target="font">
        <edit name="hinting" mode="assign"><bool>true</bool></edit>
        <edit name="hintstyle" mode="assign"><const>hintmedium</const></edit>
    </match>

<match target="font" >
    <edit mode="assign" name="antialias" >
        <bool>true</bool>
    </edit>
</match>

<!-- Exclude/Include a range of fonts for Anti Aliasing
    <match target="font">
        <test qual="any" name="size" compare="more"><double>8</double></test>
        <test qual="any" name="size" compare="less"><double>18</double></test>
        <edit name="antialias" mode="assign"><bool>true</bool></edit>
    </match>
-->

<!-- And/Or disable Anti Aliasing for a range on pixel-based size.
    Disabling this using both methods seems to fix Firefox.
    <match target="font">
        <test compare="less" name="pixelsize" qual="any"><double>20</double></test>
        <edit mode="assign" name="antialias"><bool>false</bool></edit>
    </match>
-->

<!-- Strong hinting for small fonts, increases sharpness.
    Enabling this seems to fix Firefox.-->
    <match target="font">
        <test compare="less" name="pixelsize" qual="any"><double>9</double></test>
        <edit mode="assign" name="hintstyle"><const>hintfull</const></edit>
    </match>


<!-- Light hinting for large fonts, reduces sharpness.
    Enabling this seems to fix Firefox.-->
    <match target="font">
        <test compare="more" name="pixelsize" qual="any"><double>13</double></test>
        <edit mode="assign" name="hintstyle"><const>hintslight</const></edit>
    </match>

<!-- Ignore any embedded bitmaps in TTF, etc (Microsoft's Calibri and others from Office 07/Vista have these) -->
        <match target="font" >
          <edit name="embeddedbitmap" mode="assign" >
            <bool>false</bool>
          </edit>
        </match>

</fontconfig>

After editing the file, a restart of your application is required for the settings to take effect (for me it was Firefox, since I was testing font configuration).

No responses yet

Font Rendering Comparison

Dec 31 2009 Published by under Linux,Windows

After changing some font display settings in Linux, I wanted to test the changes. The specific change I wanted to test was the hinting level adjusted by pixel size. Hinting affects how sharp the edges of displayed fonts are. (Note that this is different from print appearance.) The article that got me started adjusting font display is a post on Planet Gentoo that I read a while ago. I noticed that there was a suggestion to use medium hinting to reduce fuzziness on small fonts. That was interesting, so I turned on full hinting for small fonts, hint medium for medium fonts, and hint slight for large fonts. You can see the result on the screenshot.

Linux

snapshot1

Medium hinting is set for pixel sizes between 7 and 11. As the size becomes larger, there are  noticeable color fringes on the edge of the fonts. That’s where hint slight comes in.

Now, there’s nothing fancy going on in Linux as all the settings can be changed in an XML file. So after adjust font in Linux, I decided to write a webpage to test the different pixel sizes.

<html>
<head>
<title>Font Rendering Test</title>
<style type = "text/css">
        .col1 {
            float:left;
            width:33%;
            margin-left:1px;
        }
        .col2 {
            float:left;
            width:33%;
            margin-left:1px;
        }
        .col3 {
            float:right;
            width:33%;
            margin-right:1px;
        }
</style>
</head>

<body>
<center>

<?php
$s = "";
for($i=97;$i<123;$i++){
    $s = $s . chr($i);
}

$font_families = array("Serif", "Sans-serif", "Monospace");
$n = 1;

foreach ($font_families as $font){
    echo "<div class="col" . $n . ""style="font-family:" . $font . "">\n";
    for($i=5;$i<22;$i++){
        echo "<p style="font-size:" . $i . "px">" . $i . " px</p>\n";
        echo "<p style="font-size:" . $i . "px">" . $s . "</p>\n";
    }
    echo "</div>\n";
    $n++;
}
?>
</center>
</html>
</body>
</html>

I happened to be using a computer running XP while I wrote this, so I decided to run the test on that computer, too.

XP

screenshot.1

XP, like Linux, does have color fringes, but they are less noticeable and appear at all font sizes.

Today, I booted Windows 7 to fill out a PDF form and print it across the network. I also planned to do some PDF editing using PDF X-Change Viewer. One thing that makes Windows different from Linux is that applications don’t have system-wide configuration file. PDF viewers have their own font rendering settings. Anyways, here’s what the fonts look like in Windows 7:

7

screenshot.1

Fonts in 7 does not have any rendering artifacts. Which is a reason people do notice the difference when they switch to another OS.

No responses yet

LCD Brightness in KDE4

Dec 28 2009 Published by under Linux

The KDE4 control panel does not have a panel for setting the display brightness yet. However, changing the display brightness can be done at the shell, and the changes take effect immediately.

  1. find a path like “/proc/acpi/video/VGA/LCD/brightness” using ls and cd (the exact path varies)
  2. cat yourfile. The top line contains possible values. The bottom line is the current one.
  3. login as root using su
  4. echo -n new brightness > /proc/acpi/video/VGA/LCD/brightness

to make this permanent every time you login, add it to the KDE autostart directory

  1. cd ~/.kde/Autostart
  2. vim set-brightness.sh
  3. put the following lines in it:

#! /bin/sh

echo -n brightness > /proc/acpi/video/VGA/LCD/brightness

  1. chmod 775 set-brightness.sh

No responses yet

Increasing mouse scroll speed in firefox

Dec 25 2009 Published by under Linux,Windows

This is easy in windows:

  1. hit start orb
  2. type mouse wheel
  3. hit first option
  4. set the mouse scroll rate

However, settings in Linux desktops such as GNOME and KDE does not directly set the scroll speed in Firefox:

  1. type about:config in Firefox address bar and hit enter
  2. make the following changes
  • mousewheel.withnokey.sysnumlines->”false”
  • mousewheel.withnokey.numlines -> 6 (default:3)

Scroll to see the changes

No responses yet

Bad Karma and the Fox Chasing Its Tail

Dec 21 2009 Published by under Firefox,Linux

I’ve been using Windows 7 since May, when I started my first co-op term. It was definitely better than Vista and much better than XP in some ways. The only thing I don’t like about Windows 7 compared to XP is more hard drive grinding pre-loading programs before they are used into memory.

So this time I decided to install Kubuntu again, forgetting what caused me to abandon it last time. (I couldn’t recall the reason until I finished writing that last sentence) Just a quick overview of what whas karmic and the fox before I get into the root cause of this.

Karma is evolutionary garbage, literally. Some companies trying to make monkey dress it up and call it “good karma” or try to sell you “karma coins”. All garbage. I remember the story behind the game Alpha Centauri. There was only 1 in a million chance of the spaceship getting hit by a meteor, yet due to the karma carried by humans onboard, it was destined to be hit by a meteor. Same thing happens in real life. Things on an outer level never change without a change on an inner level.

So why is Kubuntu karmic? It still had the same problems from last time. When I loaded up my wireless card, I still had to apply the bug fix from Hardy, back 2 generations ago over a year. I expected it to be fixed by now. Second, the default firefox version from the repository was version 3.0.6. If Ubuntu updated its software every six months, then it should at least be 3.5 now. Karmic was released at the end of October. I go through several links on google to install 3.5. Unfortunately, this wasn’t the only bug I encountered installing firefox. There was a firefox installer included with Kubuntu. If I click on it, the installer exits saying firefox is already the latest version. As a result, I had to install it from the command line. After the installation finished, it gave an error message about kde. This should have been a clue about what would follow. Firefox ran smooth until I tried to restore a few things using Firefox Extension Backup Extension (FEBE). I was only able to restore 3 things until the dialog box just refused to show up (it was a GNOME dialog box). After that, I saw KDE desktop crash a few times, apt unable to resolve dependencies, wireless stop working, and several attempts to get wireless back (it’s a lot harder without an internet connection). NOW the Karma becomes obvious, though I still don’t know why.

So now we come to the fox chasing its tail. That’s what you get with a distribution that aims to be current built on top of Debian Linux. The fox will never escape its tail. Kubuntu is based on the KDE desktop, and many Ubuntu users won’t even care to try it for whatever reason (maybe for the same reson they’ve never tried other distributions). When I compare the Kubuntu/Ubuntu website with the Sabayon/Gentoo websites, I find that the Ubuntu side has far less activity and takes longer to solve problems. All because the distribution is based on Debian. In a source based distribution like Gentoo, there is a much greater flow of knowledge. Just look at Planet Gentoo, a Gentoo user blog. It’s not surprising that I remember the reason I abandoned Kubuntu last time, as my laptop is installing Sabayon and I’m writing this. Kubuntu didn’t have a community, it didn’t have people contributin knowledge. It’s just a buggy KDE desktop on top of Xorg and the rest of Ubuntu.

Update: I’ve come across another article mentioning the same problem with Ubuntu (I did get the Kubuntu broken Grub bug, forcing me to install another Linux distro). Also, there is a more technical article benchmarking Gentoo and Ubuntu. Gentoo won, of course. As far as speed goes, Gentoo is the fastest, followed by Fedora, Slackware, Mandriva, and almost last . . . Ubuntu (last goes to the outdated Debian stable).

No responses yet

Time for the Flood

Dec 19 2009 Published by under Linux,Windows

Just finished my last exam and now’s the time to update all my outdated software!

The plan is to leave my XP installation that came with the laptop and wipe out everything else. Does that mean Atlantis will be destroyed and civilization has to be rebuilt again? (Who just asked that!) Not that Windows 7 Release Candidate has gone stale, it expires sometime next year. In the past 3 life cycles, I have focused on heterogenous software configurations.

  1. XP should have Spore and custom theming
  2. Linux distributions should be either user-friendly or technology focused (Ubuntu and Sabayon)
  3. Vista with Google Chrome and Gadgets

The basic principle behind this new installation is to keep every system I use consistent. This implies keeping the user interface the same. Several things to achieve this effect:

  1. FEBE and CLEO Firefox extensions to mass install all extensions and profiles
  2. Firefox as the general purpose browser
  3. Font smoothing (yeah Linux and XP have them)
  4. KDE as Linux desktop (the destop effects in Vista can be duplicated, and it’s closer to Windows desktop than GNOME)
  5. Speed up the slowest part of my user experience (loading a web page in Ubuntu)

No responses yet

Setting Up Sabayon Linux Part II

Aug 03 2009 Published by under Linux

If you want to make your system rock solid it’s a long process, but you have to do it sooner or later.

  1. This step is optional if you know how to edit USE flags. http://www.gentoo-wiki.info/Euse
  2. add glibc-omitfp and nptonly to your USE flages in /etc/make.conf.                                        www.gentoo-wiki.info/HOWTO_Optimise_glibc#Enabling_further_optimizations
  3. if your are keen and want to save 90% of the space taken up by localization settings and some compile time, edit the locales. nano -w /etc/locale.gen http://www.gentoo.org/doc/en/guide-localization.xml
  4. delete unnecessary languages
  5. emerge glibc
  6. still staying very basic,  add -malign-double to your CFLAGS, and test it by emerging dillo. www.gentoo-wiki.info/CFLAGS_matrix

Type dillo at the console and press enter.

Tryout the powersave or “standby” in windows.
http://powersave.sourceforge.net/kpowersave/introduction.html#starting

If you still have time, you might like stable transparencies.
http://fluxbox-wiki.org/index.php/Transparency

No responses yet

Setting up Sabayon Linux Part I

Aug 03 2009 Published by under Linux

Do not use kuroo or emerge before completing the following steps :

Simply the console or terminal, type the commands, and hit enter.

su –

sabayon (sudo passwd to change)

emerge –sync

emerge portage

dispatch-conf

u (update)

layman -S

glsa-check -f all

dispatch-conf

u (update)

http://wiki.sabayonlinux.org/index.php?title=Tips

If you are bored with the above, start with detecting your hardware.

cat /proc/cpuinfo

http://www.gentoo-wiki.info/Detecting_your_Hardware

nano -w /etc/make.conf                NOTE: ^ is ctrl

http://gentoo-wiki.info/Safe_Cflags

No responses yet

« Prev - Next »