pigfoot’s weblog

We should forget about small efficiencies — Donald Knuth

Archive for the ‘Unix’ Category

When you try to upgrade your system via portage system recently, you will find the error message as followings:

sojia portage # emerge -uvDNpt world

These are the packages that I would merge, in reverse order:

Calculating world dependencies
!!! Packages for the following atoms are either all
!!! masked or don’t exist:
sys-apps/fileutils

This is because sys-apps/sh-utils, sys-apps/fileutils, and sys-apps/textutils have been replaced by sys-apps/coreutils. If you want to get rid of this kind of warning, you must update your /var/lib/portage/world by your-self.

In other words, remove sys-apps/sh-utils, sys-apps/fileutils, and sys-apps/textutils these three lines in your /var/lib/portage/world, the warning will be gone.

Popularity: 8% [?]

  • 2 Comments
  • Filed under: Gentoo, IT, Linux, Unix
  • More astonishing KDE4 screen-shots

    More astonishing KDE4 screen-shots!, from digg.

    KDE4 太華麗了! 看起來和 Windows Vista 超像的~ 不過和 Windows 的 GUI framework 迥然不同的 Unix-like Operation System, 會跑的順嗎?

    一台剛裝完 Vista 的 1G RAM 的機器, 就會用掉八百多 MB 的記憶體, 不知道 KDE4 會是怎樣的 monster 呢? :p

    Popularity: 7% [?]

  • 0 Comments
  • Filed under: IT, Unix, What's New
  • Tune your ext2/3 filesystem

    Tune your ext2/3 filesystem, from Gentoo Weekly Newsletter (October 17th, 2005)

    ext2/3 are the main filesystems for a large amount of users but what a lot of people don’t know is that you can get almost Reiser4 speed out of it without any of the instability they’d associated with Reiser4. One of the great features of ext2/3 is the ability to tune it by adjusting various parameters. The one we are going to modify here is dir_index which essentially uses hashed b-trees to speed up lookups in large directories.

    Let’s take some precautions, first of all by finding out if some of those parameter are already enabled, by running

    # tune2fs -l /dev/hdXX

    (replacing XX with your drive and partition your ext2/3 filesystem resides in). If you don’t see dir_index in the list then we can enable it, and just in case you do see dir_index in ‘Filesystem features’ then you have either enabled it already or it was automatically enabled for you.

    You are going to need a Gentoo LiveCD because changing parameters on mounted filesystems can cause problems, so in the interest of safety we are booting off the CD. At the start phase the Gentoo install system is booted into what’s called a “ramdisk” which is where the files needed are put into RAM to be used. mke2fs, tune2fs and other parts of the e2fsprogs package will be present at this stage.

    Now let’s turn on the feature with

    # tune2fs -O dir_index /dev/hdXX

    Now run e2fsck with the -D option to have the directories optimized:

    # e2fsck -D /dev/hdXX

    Do that on any ext2 or ext3 partition and then reboot. You should notice the difference straight away.

    Popularity: 5% [?]

  • 0 Comments
  • Filed under: IT, Linux, Unix
  • OpenBSD: Improved Memory Allocation, Beta Testing 3.8, from KernelTrap.

    OpenBSD creator Theo de Raadt described a number of modifications to how OpenBSD allocates memory:

    • mmap system call return a random memory address, as well ensuring “that two objects are not mapped next to each other; in effect, this creates unallocated memory which we call a ‘guard page’”
    • malloc function was updated to use mmap to obtain memory
    • free function was updated to immediately return memory to the kernel and un-allocate it from the calling process

    Theo points out that these changes have a couple of significant impacts. He explains that for over a decade efforts have been made to find and fix buffer overflows, and more recently bugs have been found in which software is reading before the start of a buffer, or beyond the end of the buffer. With these recent memory allocation changes, such an attempt will cause the application to coredump with a SIGSEGV signal.

    Additionally, now that memory is unmapped as soon as it is freed, any attempt to access freed memory will also cause the application to coredump with a SIGSEGV signal.

    Popularity: 8% [?]

  • 0 Comments
  • Filed under: IT, OpenBSD, Unix
  • How not to load-balance connections with accept(), from Phil Harman’s blog.

    這裡還有一些利用 LD preload 的技巧.

    Popularity: 6% [?]

  • 0 Comments
  • Filed under: IT, Sun, Unix
  • Linux: Removing Older GCC Support, from kerneltrap.

    大意是說以後用 GCC 3.2 以前的版本不能再 compile Linux kernel 了. 剛剛找了一下, RHEL 2.1, Debian 3.0 (woody), SuSE 8.0, Gentoo 1.2, Slackware 8.1 都是小於 3.2 的. 不過 Redhat 8.x, 9.x 和 Fedora Core 所有版本都是有 support 的.

    Popularity: 5% [?]

  • 0 Comments
  • Filed under: IT, Linux, Unix
  • GDB to MDB Migration

    GDB to MDB Migration Part One, Part Two. from Eric Schrock’s Weblog.

    Solaris 的 corefiles 改良成可以包含 process 所有資訊 (library text 和 type information), 而 MDB (and KMDB) 被設計用來作 post-mortem analysis 和 live kernel analysis[1][2].

    Coredump debugging 可能是上班以後必備的技巧之一吧 :p

    [1] libumem & libutil in Solaris, from zmx.
    [2] libuutil and designing for debuggability, from me.

    Popularity: 7% [?]

  • 0 Comments
  • Filed under: IT, Sun, Unix