FreeBSD Foundation - Still short of 1 quarter

Another few more days and it'll be the end of this year.

FreeBSD have done much for you. Is time to show you've done something for FreeBSD (both the great community & OS).

A quote from the FreeBSD Foundation Announcements :

End-of-Year Fundraising Campaign

Dear FreeBSD Community,

As the year is winding down I'm writing this note to remind you of the motivation behind the FreeBSD Foundation's work, its benefits to you, and to ask for your financial assistance in making our work possible.

Ten years ago, I created the FreeBSD Foundation to repay a debt I owe to the FreeBSD project. While working on FreeBSD I learned the fundamentals of sound software design, how to successfully manage a large code base, and experienced the challenges of release engineering. Beyond the benefits of this education, FreeBSD has provided a robust platform that has allowed me to build several successful commercial products while being well paid to work on an operating system I love. Today, through my volunteer work with the FreeBSD Foundation, I'm still paying down this debt.

This year, despite the slow pace of the economic recovery, the FreeBSD Foundation has an impressive list of accomplishments:

* Provided $100,000 in grants for projects that improve FreeBSD in the areas of:
o DTrace support
o High availability storage
o Enhanced SNMP reporting
o Virtualization and resource partitioning
o Embedded device support
o Networking stack improvements
* Allocated $50,000 for equipment to enhance FreeBSD project infrastrutture.
* Sponsored 8 FreeBSD related conferences.
* Funded 16 travel grants giving increased community and developer access to conferences.
* Provided legal support to the FreeBSD project.

How do our activities benefit you? If you are a company using FreeBSD, our work to strengthen the FreeBSD community ensures the continued viability of FreeBSD and a large pool of developers to tap into. If you are an end user, our work brings you new features and access to conferences. And if you are a FreeBSD developer, the FreeBSD Foundation is providing the resources needed to make your next innovation possible.

The FreeBSD project thrives through the hard work of our community, but it also requires financial backing. This year we set a fund-raising goal of $350,000. We are pleased to report that we are half way there, but we need your help to reach our goal. Every donation, no matter its size, helps to make our work possible. As a non-profit with very low overhead, your donation is the best way to invest in FreeBSD. Please make that investment today.

You can make a donation (including recurring subscriptions) by going to:


To find out more about The FreeBSD Foundation, please visit:


Thank You,

Justin T. Gibbs Founder and President The FreeBSD Foundation

What are you waiting for?

Click here to donate ...

and a Happy New Year 2011 !!!


FreeBSD Foundation - Is the seasons of giving

Is Christmas time !!!

Everyone gets to enjoy a feast with present, one or two.

Why not give some to the FreeBSD Foundation at this happy season as well? After all, the FreeBSD community did help you to get a job and probably earn a bonus.

It won't have to be a hefty sum that tip your budget off for the season. A minor few tens of bucks is good enough. Of cause, if anyone can spend a few hundred bucks on FreeBSD Foundation is definitely a merit.

What's more, you get to own the right to brag; brag about "I got my name on FreeBSD Foundation donor list" !!! :)

Merry Christmas & A Happy New Year !!!


Subversion - How to use svn to manage source files

The "svn" command stands for Subversion. Subversion is commonly use to manage revisions of source files, e.g. configuration files & program source code. Subversion keeps revision what of have been change or committed into the repository. This is good when we accidentally change the source code and needs to roll back to the previous changes. It is also good for managing configuration files (e.g. /etc, /usr/local/etc) on servers as it provides revision control. We can roll back to the last working condition if we screw something up. :p

Here's how to start using svn to manage source files, for the first time :


FreeBSD - Quick setup of SAMBA file sharing server

Samba is a service that provides file sharing across BSD & Linux, that includes FreeBSD. Implementing Samba at the server allows maximum compatibility on file sharing across mac OSX, linux, BSD & other operating system. This post shows a quick & dirty way of installing & setting up Samba file server on FreeBSD.


PC-BSD - How to stop KDE to load during startup

I just screwed up my PC-BSD desktop. :(

In order to fix it, the desktop needs to go into console mode every time it boots because X11 and other stuff doesn't work anymore. This is how to stop KDE from loading during start up :


FreeBSD - How to watermark image or picture using command line

Watermark is a technique to impose image or words using light shades. Digital watermark on image is use for the purpose of copyrights, comments or notices. Watermark image can be accomplish using tools from Image Magick suite of programs.

Firstly, install the ImageMagick port using portmanager :
portmanager graphics/ImageMagick -l


FreeBSD - The ps command output is truncated from the terminal width

There are a few commands that can list current process activity, "top" & "ps" are the most common one in use. The command "top" give an interactive view of the list of process running currently. But the command "ps" gives a more friendly output for scripting or text parsing. It also gives a lot of parameters to filter the output. One of the common parameters that I've always use is "ps aux". It list all the current process running with headers and information. By the way, "ps" stands for process status.

Usually, the process status output is pass to "less", a pager for ease of reading. Often, the "COMMAND" column of "ps aux" output, is truncated at the end of the terminal width. This behavior prevents the full process name from displaying. One thing good about this is, the output are not wrap so it won't mess up the output display. But most of the time, we'll want to view the full output.

There are 2 things to try in order to get the full output. First, try telling the pager (in this case, "less") don't chop the long lines after the terminal width, using parameter "-S".


Blackberry - Really Simple Syndication (RSS) reader

Having RSS (Really Simple Syndication) on the blackberry is a good way to kill time while waiting, especially during traffic jam or on the train. RSS reader applications generally needs to purchase. A good one might cost a extra few bucks.

But luckily there's Viigo, a RSS content delivery application that runs on blackberry. Viigo has all the feature I need, being a RSS reader that is light & free. It also comes with some other features that can get you more addictive to blackberry.

To name a few :


FreeBSD - A great way to track changes of FreeBSD

Before every FreeBSD port upgrade, checking the /usr/ports/UPDATING is a must. It list out known problems with solutions when upgrading ports. Cutting down less hiccups during upgrade of system. Skimming the changes using bare eyes can be quite tiring some times.

This is another fun way of monitoring the changes is, reading the changes in /usr/ports/UPDATING like a web feed, using RSS. Thanks to Alex of versia.com, he created a RSS feed that keep track changes of /usr/ports/UPDATING and publish it through RSS feeds. This is the post that he talks about it and the RSS feed is over here.

By the way, this RSS feed is created using Perl and hosted on github over here. Perl rocks !!!


Macports - After installing git-core, all packages depends on libssl breaks

Git is popular. Is like LinkedIn to working professionals and GitHub to programmers.

Before I'm able to play around git on my mac, "git-core" need to be installed first, through macports. As usual, installing port from macports is as easy as :
port -v selfupdate
port -v install git-core

After the installation, time to try git. When issue the command "git", it return an error message :
dyld: Library not loaded: /opt/local/lib/libssl.0.9.8.dylib
Referenced from: /opt/local/bin/git
Reason: image not found
Trace/BPT trap

In fact, all my other programs that installed through macports are having problem.
Executing "svn" also return the same error :
dyld: Library not loaded: /opt/local/lib/libssl.0.9.8.dylib
Referenced from: /opt/local/bin/svn
Reason: image not found
Trace/BPT trap

Looking at the error message, my guts tells me that libssl has problem working with these programs. After messing around with the OpenSSL port, here's the solution :


FreeBSD - Committers around the world

I've stumble (can't remember which blog or post lead me to it) on this map that shows the FreeBSD ftp servers & committers around the world using google map service. A very nice presentation indeed.

Another note on a similar subject, Murray Stokely of FreeBSD Release Engineering Team has a script that generates heat map base on FreeBSD committers around the world. The post is over here.

Some links :
Farvel !!!


FreeBSD Foundation - It doesn't cost as much as you think

I haven't been updating this blog for a while. Have been busy with some stuff in perl, time management & my job. Even so, I refuse to forget about donating to FreeBSD Foundation. The FreeBSD OS is part of my daily activities, from desktop to server. Even my future job is going to deal with FreeBSD, daily & heavily (happily).

Donations to the FreeBSD Foundation ensures that the foundation can have more resource to fund projects around FreeBSD. With funding, features & upgrades can be speed up. One of the project that the foundation have funded, "Resource Containers Project", is to enable FreeBSD Jail to implement resource containers and a simple per-jail resource limits mechanism.

The foundation also give out grants to hold BSD Conferences (BSDCan, AsiaBSD, MeetBSD, EuroBSD & others). These conferences gathers FreeBSD developers & users around the world to meet & discuss the current & future of BSD. IMHO, this cultures the community to continue develop & invites more participation into the FreeBSD project.

The FreeBSD Foundation also holds & acts on behave of any legal issue regarding FreeBSD, making FreeBSD out of the reach from evil hands. Though the mascot is Beastie :p

The foundation also make sure that proper infrastructure are in place to facilitate development & distribution of FreeBSD. Servers hardware & internet bandwidth aren't free and certainly, they aren't cheap.

If you think donation is expensive or a large sum of money, try visiting the donors list. The donation starts from $1, very minimal. Anyone can donate. By skipping something (food, gadgets, cloths or anything) in your life, you can easily contribute to FreeBSD. This minor skipping in your life can be significant in FreeBSD development, your favorite OS. I've not even started the "good feeling" after the donation.

This forum post shows how important to donate to the FreeBSD Foundation. Donation doesn't only emphasize on the amount but also the participation. This is another way to save some money if you're thinking of donating.

In short, FreeBSD is a great OS. If you want to see this great OS grow healthily & happily, donate. It doesn't cost as much as you think.

I've donated(this year), have you?


FreeBSD - How to allow normal user to mount USB drive

Recently, I've got a few external hard disk and one of them is formatted into file system FAT32 (msdosfs or vfat), because the files are to be interchange between Linux, OSX & FreeBSD. After the files are save from OSX, the external hard disk cannot be mounted onto FreeBSD or PC-BSD as a normal user. Since these are just some media files and frequently need to be interchange between these 2 OS, I'm quite reluctant to mount it using root or sudo. After all, root or sudo are suppose to be used for system administration.

On the FreeBSD box, some system value & devfs needed to be change in order for the external USB hard disk can be mounted. As for PC-BSD, the "hald" failed to mount the USB external hard disk because this USB external hard disk FAT32 partition is too big. Some changes needs to be done on "hald" but being a command line geek, I'd rather meddle these in command line. By the way, the error message pops out on the "Dolpine" (KDE) file manager is :
"An error occurred while accessing '160gb', the system responded:
org.freedesktop.Hal.Device.Volume.UnknownFailure: mount_msdosfs:
/dev/msdosfs/160gb: Disk too big, try '-o large' mount option : Invalid argument"

Again, "If doubt, refer de FreeBSD Handbook" shed light. These steps are to be executed as root or equivalent privilege. Also, the normal user that is intended to mount the external hard disk, need to be part of the group "wheel". Below are the steps that I've taken to allow normal user to mount a external USB drive :


N900 - How to clear all the phone data & settings

N900 is a great phone with a lot of drooling features (refer to this post "N900 - A phone running open source OS & programs"). Particularly, because it is running Maemo which have a active & generous community. But I've to give it up because I've found a phone that fits more into my lifestyle. Nonetheless, it is still great mobile phone to have.

The N900 is different from other mobile phone. The usual way of resetting the phone from the phone settings menu will only clear the mobile phone settings, but the OS & data (eMMC) are still intact. Before selling off this phone to the next person, I've gotta clear all the stuff in it, especially the data.

Below are the steps on how to flush the phone & clears all the data and settings :


Blackberry - How to reboot the phone using keyboard shortcut key

After an update of the blackberry OS or some software installation, it might prompt to reboot the blackberry phone in order to finish the installation. But some times, we need to use it so we'll choose "Reboot Later" but after finishing using it, how do we initiate the reboot sequence?

Once in a blue moon, the phone is acting up a bit weird, application not responding, some apps is taking too long to respond or the phone performance is lagging. A reboot might be a good try to ditch those weird acts.

This is how to reboot the phone using keyboard shortcut key :


FreeBSD - How to compile custom kernel

Normally, the generic kernel that comes with default FreeBSD installations are good enough for most installations. But some machines that I worked on are having more then 4gb of memory. Be default, the i386 processor architecture only recognizes 4gb or less memory. Any random access memory larger then 4gb, the kernel will need to enable the feature PAE (Physical Address Extension) in order to make use of the processor's extended physical address space, from 32-bin to 36-bit. After compiling PAE kernel feature, the 4gb limit will increase to 64gb.

Most of the time, I re-compile the kernel because of the server hardware comes with more then 4gb of memory. But recently I'm setting up a firewall that need to do traffic shaping, through QoS (Quality of Service). PF's ALTQ feature will do the traffic shaping, but by default, it is not included in the default kernel.

This post will show how to compile custom kernel in FreeBSD so that it includes the ALTQ feature :


FreeBSD - How to reset root account password

After the initial installation, the root password should be changed to a complicated enough password, then forget it. We're not suppose to use the root login & password as it might exposed to unnecessary risk. My preferred way of system administration should use sudo. It's more secure, controllable, and flexible.

But things happen. Today, I've totally forgotten root password. The box is lock out to the extend that only console access is allow. Worse of all, the regular password for the user name that I used to login for sysadmin stuff, have been "forgotten" as well too. Too Bad...

Anyway, as long as the physical box can be access, no security measures is good enough to stop the box being compromise. :P

This box is running the superior FreeBSD OS. The root password can be reset by :


N900 - How to overclock the processor speed of N900

The N900 is a flexible mobile phone that runs Maemo operating system. It should not be compare as a mobile phone but rather as a mobile tablet with an extra function, phone. As my previous post introduction, it comes with a large display, keyboard & a snappy processor. Because of Maemo, now it even allows processor overclocking.

By overclocking to 850mhz, I've noticed that the average battery usage life have increase up to 30%. From an average of 3 days per charge to less then 5 days per charge. And of cause, because the processor is running faster then the default 600mhz, it boosts the response of application execution. To anyone that is interested in overclocking this phone, this post will show how to overclock the N900 to 850mhz which I find this speed is a balanced between speed & battery life. Anything higher then this might spoil the phone. You've been warned.

Here's how to overclock the processor of N900 :


BlackBerry - Multi alarm clock application on BlackBerry

Like most of the mobile users, I use my blackberry phone as an alarm clock. But the alarm clock application that comes with it only allow to have one alarm entry at a time. Which is not enough for my lifestyle.

I did thought of using the calendar reminder as alarm clock but that would disrupt my daily todo stuff & meeting reminder ringtone. Multiple alarm clock entry is a simple and yet important function, how can RIM (Research In Motion) forget it?

After some meddling with the phone, I concluded RIM did not overlook this function. But rather, it "hides" it in a app that I've all the while never think of.

This is how to set multiple entry alarm clock on a blackberry phone :


BlackBerry - Quite a smart phone

BlackBerry is a smartphone that aims not only business user, but also casual user that wanna connect to people. The rich social application that comes with BlackBerry encourages frequent communication between people, through various channels. e.g. :
  • BBM (BlackBerry Messenger) is another kind of messenger that is capable of transmitting picture, sound, file or even GPS location to contact list.
  • twitter client
  • push email (with gmail, is more addictive then sms)
  • GPS map with integration into the above mentioned services

Since BlackBerry is a Smart Phone, it has the usual PIM (Personal information management) applications. e.g.


OSX - How to retrieve files on external hdd with HFS+ file system

HFS+ => Hierarchical File System Plus

Apple's OS X uses HFS+ (HFS plus) file system. It is the default file system since OS X Tiger (10.4). 255 characters can be used in file name. It can support up to 8 million terabytes and yes, that's huge!

I've just got a external hard disk and decided to format it using HFS+ file system as it is more efficient when mounted on the mac, which I used it most of my time. One concern though, should the mac die suddenly, how can I retrieve the files while getting a new mac?

Here's how to retrieve the files on the external hard disk on Linux?


OS X - Screen appear blur and only center part seems clear

One fine day, when I turn on my mac, suddenly everything on the display seems blur. Only the center part of the screen display is clear & sharp (like normal). It almost seems like it is a display card problem. But reluctant to make this an excuse to change my mac (:p), I check out the system preferences. And I noticed that there's a zoom function at "Universal Access". Just trying my luck to turn off using "apple key + alt + 8", the display looks fine again!

Playing around with it and the below is what found out :


FreeBSD - How to format & partition additional hard disk

While housekeeping the external hard disk laying around, I managed to squeeze out one spare hard disk out of this cleaning practice. The size is big enough to act as a backup media for my FreeBSD server & desktop workstations. The external hard disk partition layout preferred would be 3 partitions. The 1st (backup of OS & data) & 2nd partition (data backup) will be FreeBSD UFS & the 3rd will be FAT32 (for media transfer).

Since my workstation doesn't support FreeBSD UFS file system, I'll partition & format it using the FreeBSD server. All tools involve are command line utilities and can be done through remote secure shell. This post can also be serve as a guide for adding new/used additional hard disk to FreeBSD server.

Here goes :


FreeBSD - How to setup & configure jail with ezjail

OS virtualization is a technology that enable multiple copies of guest OS to run on top of a host OS. Why do we wanna do this?
- partition resources to share across multiple guest OS (current hardware to run multiple light guest OS. e.g. FreeBSD & Linux)
- enhance security (guest OS are isolated and thus hacking into a guest OS leaves other OS safe)
- saves power & money (hosting rack space & power are minimize)
- creating environments (application or OS testing, backup, legacy apps, admin delegation)
- improves server management (guest OS within virtualization are easier to move, copy, backup & remove)

FreeBSD Jail first appear in FreeBSD 4.x, introduced by Poul-Henning Kamp. Jail is a powerful OS virtualization that achieves security, cost, management & flexibility. Because of all these advantages, jail can some time be quite complex to setup & configure. Ezjail offers the simplicity to configure & maintain jails, without the complexity of getting our hands dirty. :p

Ezjail is a framework that controls jail. Ezjail takes care of the complicated part and makes setting up & maintenance of jail fun. Ezjail is develop by Dirk Engling, thanks Dirk. :)

FreeBSD jail does have its limitation. Here are the ones I've bump :
- resource control, e.g. ram & processor cannot be partition, they are all equally being shared. But hard disk space can be separate and control by implementing hard disk partition (or slice).
- all guest OS have to use the same kernel version as the host OS

Okay, enough of talking. Here's a simple step-by-step guide on how to setup Ezjail. Firstly, install Ezjail from sysutils/ezjail using Portmanager then proceed the below steps:


N900 - A phone running open source OS & programs

N900 is the latest offering from Nokia that answers the open source crave for software freedom, it runs Maemo, an OS based on linux, specifically Debian. Maemo also uses "apt" as package manager. Its GUI is fantastic, with accurate touch screen experience. Command line comes with it by default, to access the very core of the OS. And not like some other OS that hides hard to NOT let user touch it (even that, users managed to "jailbreak" it so to access the command line :p).

The N900 hardware runs a fast ARM cortex A8 processor (overclockable), 32GB internal storage with expandable micro MMC external storage card, touch screen with 800 × 480 pixel resolution, QWERTY slide hardware keyboard, 3.5 mm audio jack, A-GPS, WiFi, bluetooth, 3G internet connectivity and the long list goes on.

A big note here, the Maemo community is active & generous to its user that wants to have software freedom. Freedom to choose software from a community that offers alternatives, community that patches and write software just so that we all can use freely and not bow our heads to companies that charges software, even minor function. The Maemo community is active in providing patches both to the OS & 3rd party programs.

We all know that Debian is a hacker friendly linux distribution that seems more and more linux distribution derived from. e.g. Ubuntu family, Knoppix, Damn Small Linux, here & here. Maemo is based on Debian.

The price is unbeatable consider that it comes with such fast & furious hardware, OS and most importantly, the active & friendly open source community.

This post will list out my other blog post that's written based on N900. Here are some of it :
  1. N900 - How to ssh into N900 using OpenSSH
  2. Perl - A happy note, on N900 
  3. N900 - How to overclock the processor speed of N900
  4. N900 - How to clear all the phone data & settings
  5. Stay tuned, this list will be update periodically.

Adios !!!


Perl - A happy note, on N900

The Nokia N900 runs perl :

~ $ perl -v

This is perl, v5.8.3 built for arm-linux-gnueabi-thread-multi

Copyright 1987-2003, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Cheers !!!


N900 - How to ssh into N900 using OpenSSH

Since the Nokia N900 runs on Maemo, Debian based Linux, it also offers open source programs. The secure shell is one of open source gems. Maemo offers the OpenSSH variety of secure shell.

OpenSSH on Maemo not only offers encrypted secure remote shell, it also comes with functions that runs like the desktop version. Such as ssh socks 5 tunneling, that can be used to encrypt traffic transmit of the programs that supports socks 5 proxy.

Here's how to do it :


Perl - How to change @INC to include non-standard path

Have been playing around with local::lib and bootstrap a few directories. After switching a few local::lib directories, I tend to forget which cpan module is installed in which local::lib directory and this make perl don't know where to find the cpan module. This is how to set the environment variable @INC so that perl can quickly locate the cpan module.


Perl - How to list installed modules

A note for myself. This is how to list out what perl modules are installed.
Way 1 :
perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'

Way 2 :
perldoc perllocal

*** these are all taken from http://perldoc.perl.org/perlmodlib.html

Das Vidanya !!!


Perl - How to install perl module without root or super user

By default, perl modules installed through cpanX (cpanm, cpanp & cpan) utilities are install into system wide perl directory. Although this will make the module available through out all users on this box, it also means if there's a problem with particular module, it affects all users. Some other problem hit me as well :

Problem 1 - bloated with perl modules :
Some modules installed because it was needed to fulfill some dependencies (not necessary useful though), testing purpose or other reasons. This resulted the system wide perl directory is bloated with modules that aren't used as often as it should & should be removed. Removing modules in perl aren't easy as removing packages through a package manager. Because a typical package manager will check for dependencies to make sure that removing 1 package won't break another package.

Removing perl modules typically means manually remove the .pm files (or directory) in perl system wide directory. And this means there is a risk that removing a module might break some program or modules that depends on it.

Problem 2 - no root privileges :
In a hosting environment, normally one doesn't have root or sudo account, which installing CPAN modules needs it to add or change files in perl system wide directory. How nice if a normal users can have their own perl module directory.

Problem 3 - development environment :
Developers likes to setup individual perl projects to test & work on different environment. Naturally sets of modules that can be install into few different directories to serve as environment, switching between these directories are ideal for this situation. In this case, messing up an environment doesn't means messing up the entire perl modules.

Given the above situation, local::lib fits into the picture by solving the problems. Local::lib creates a directory resides in ~/ and cpan modules are install into here afterwards. Local::lib does that by changing the environment parameters @INC & system's $PATH variable.

The below instruction uses the "bootstrap" method of local::lib installation. This is useful on hosting environment where no access for root or sudo execution to install local::lib perl module.


Perl - How to install CPAN module, the easier way

Following IronMan Challenge posts not only for the sake of seeing What Color of Hair & Shirt ends up with Matt but the posts have been much enlightening. Recently in IronMan Challenge, there's been much talk about one of Miyagawa's project, App::cpanminus. Basically, cpanminus is a tool to install perl module from CPAN, without the verbosity of cpan|cpanplus, which also means, more newbie friendly. :)

The beauty of cpanminus is, it does not ask dozens of question before it installs. Instead, cpanminus will use the most suitable defaults & start downloading dependencies and install it. By default, cpanminus will not tell every action and result on the screen, which "scare" less.

In short, cpanminus improves or makes perfect the experience of installing modules from CPAN. Since the first time trying cpanminus, love it and loving it more seems inescapable :p

*** Some assumptions, perl 5.8 at least exist.

Enough talking, here's how to install cpanminus :


FreeBSD - Make ports not to include X11 or GUI related library

FreeBSD is an excellent operating system, be it on a Desktop (PC-BSD) or Server. Its stability and flexibility was never an issue, nor even software availability (21135 ports currently available to deploy).

Most of the time, ports will install the necessary dependencies to fulfill its requirement. But certain ports installs the X11 (X window system) libraries. Which we don't need it if the installation is meant to run on a server environment.

In this case, we will need to tell ports not to include the X11 libraries. This will certainly save some hard disk space, compilation time and avoid unnecessary security vulnerabilities.

Here is how to specify NOT to include X11 related libraries during ports installation :


FreeBSD - How to manage ports in FreeBSD using portmanager

There are various way of managing ports, using utilities. The usual "cd /usr/ports/<ports directory>; make; make install; make clean", portmaster, portupgrade and others. Today, this post will brief on how to use portmanager to install, upgrade and delete ports.

Using portmanager to manage ports have a few advantage :
  1. portmanager scans for what dependencies are needed and then determine what needed to be upgrade or install in order to fulfill the dependencies. At this stage, the dependencies are identified install/upgrade which is good as other utilities tends to fail in the mid of the installation just because some ports are too old or cannot install.
  2. portmanager supports output its messages to a log file. This is especially useful for trouble shooting what port / dependencies are giving problem.
  3. portmanager is also able to backup the current port/dependency before installing the new port. This useful when the new port cannot be install or interrupted during the installation, resulted a state where new port fail to install and new port have been deleted.
  4. portmanager collects its data by scanning the ports tree rather then building an index for the installed ports and depend on it. This is very less likely to cause problem as indexes are tend to be corrupted when abruptly (Ctrl-C) stopping installation in the halfway.
  5. portmanager gives a summary when installing dependencies/port. This gives an idea how many ports needs to be install or upgrade. This also means how much caffeine needed :p


OSX - How to arrange Menu Bar icons

When too many icon clogging on the Menu Bar, re-arrange them might look better. The shortcut key to arrange the icons is :
Cmd + mouse left click
on an icon then start arranging them.

Adios !!!


FreeBSD - How to setup ports using wget to download

The default download program for ports is using fetch. fetch is fine but my personal preference is wget. wget uses 1 connection to download, unlike my previous post that mentioned "Download ports simultaneously with multiple connections".

But wget gives extra bell and whistle like date/time of the download, log to file, continue from a partially downloaded file, rate limit of the download & others.

The below is how to setup ports to use wget to download :


FreeBSD - Tips to prepare large ports installation

Ports gets it's sources from internet. If the sources is big or there are multiple tens of sources, the tendency to fail in the mid of the ports installation increases.

Scenario 1:
Bumpy internet broadband internet connection, like mine, will disconnect halfway when downloading big files (> 10 MB)

Scenario 2:
Large ports that depends on tens if not hundreds of other ports. e.g. KDE4 or other window manager.

Scenario 3:
Limited online time frame and will need to take the machine off line after a period of internet usage.

Scenario 4:
Need to download the sources so that it can be moved to another box for compilation. A box that does not have reasonable or slow internet bandwidth to download.

Often, the above scenario are stuck with me, unfortunately. But the fortunate part is, while meddling with ports, a few steps can be taken to reduce the chances of these hiccups.

For illustration purpose, we'll use installation of KDE4 (the excellent Desktop environment) as an example. KDE4 depends on hundreds of other ports. The download of the sources alone will take some time and this serve as a good example. Here are the steps :


FreeBSD - Ports is fetching from slow servers

Ports randomly gets it's source server list from /usr/ports/Mk/bsd.sites.mk, as defined by the port maintainer. But the top 1st choice of the list may not be the one physically near to us and thus the download speed is much desirable. Most of the time compiling ports doesn't necessary takes a long time (like my 3 years AMD athlon 1.8Ghz perform fairly good). In fact, downloading of the sources is the one that takes a long time.

In this case, we'll need to tune the ports so that it fetches the sources from the nearest (physically) server. A nearer server normally means less latency and less latency means faster connection (this may not be the whole truth but truth is in it. :p)

The port "fastest_sites" will test the latency of the server listed in /usr/ports/Mk/bsd.sites.mk and output to a file. The file is suitable to be included in /etc/make.conf which tell ports where to fetch the sources from.

Here it is how to:


Gimp - How to convert background of logo or picture into transparency

Gimp stands for "GNU Image Manipulation Program", which is an open source image editing problem. It's capability often compare to professional software but fortunately, Gimp acceptance as Pro image editing software is getting better. Even so, Gimp is still popular among beginner up to hobbyist user.

Gimp's available on multiple platform and since it is open source, you can bet it's available on BSDs.

This post will brief through how to transform a logo or picture to transparent background, suitable for dark or colored web page background.


FreeBSD - Compilation errors on port KDE4 in FreeBSD 8.0

While adding GUI Desktop environment into my development box, an error encountered when compiling KDE4, the stable and nice looking Desktop environment. Compiling KDE4 can take quite some time as it depends on few hundred other ports. Alternatively, you can install KDE4 from the packages by using the command :
pkg_add -r kde4

But installing programs using ports is always my preference. Although ports takes additional time to compile but the flexibility to configure what options to enable or disable is preferred. By using ports, it also allows us to search (make quicksearch name=port-name) the local repository (/usr/ports) on what other related programs we can have.

Back to the topic. Halfway ports compiling KDE4, it halted with an error compiling the port "kdebase-runtime-4.3.4". Instead of searching the errors in a one big whole of logs, manually compile /usr/ports/x11/kdebase4-runtime to zoom in the error. Below is what the ports complained about while installing /usr/ports/x11/kdebase4-runtime (which is part of the dependencies of KDE4) :
[  2%] Built target kcm_mailtransport_automoc
[  2%] Built target mailtransport_automoc
[  2%] Built target microblog_automoc
[  2%] Built target kpimtextedit_automoc
[  2%] Built target syndication_automoc
Scanning dependencies of target gpgmepp
[  2%] Building CXX object gpgme++/CMakeFiles/gpgmepp.dir/gpgmepp_automoc.o
Linking CXX shared library ../lib/libgpgme++.so
[  7%] Built target gpgmepp
Scanning dependencies of target gpgmepp-pthread
[  7%] Building CXX object gpgme++/CMakeFiles/gpgmepp-pthread.dir/gpgmepp-pthread_automoc.o
Linking CXX shared library ../lib/libgpgme++-pthread.so
[ 11%] Built target gpgmepp-pthread
[ 11%] Building CXX object akonadi/CMakeFiles/akonadi-kde.dir/itemserializer.o
In file included from /usr/local/include/boost/parameter/aux_/arg_list.hpp:14,
from /usr/local/include/boost/parameter/aux_/tagged_argument.hpp:10,
from /usr/local/include/boost/parameter/aux_/tag.hpp:8,
from /usr/local/include/boost/parameter/keyword.hpp:10,
from /usr/local/include/boost/parameter/name.hpp:8,
from /usr/local/include/boost/graph/named_function_params.hpp:15,
from /usr/local/include/boost/graph/depth_first_search.hpp:21,
from /usr/local/include/boost/graph/topological_sort.hpp:16,
from /usr/ports/deskutils/kdepimlibs4/work/kdepimlibs-4.3.4/akonadi/itemserializer.cpp:40:
/usr/local/include/boost/parameter/aux_/maybe.hpp:13:53: error: boost/python/detail/referent_storage.hpp: No such file or directory
In file included from /usr/local/include/boost/parameter/aux_/arg_list.hpp:14,
from /usr/local/include/boost/parameter/aux_/tagged_argument.hpp:10,
from /usr/local/include/boost/parameter/aux_/tag.hpp:8,
from /usr/local/include/boost/parameter/keyword.hpp:10,
from /usr/local/include/boost/parameter/name.hpp:8,
from /usr/local/include/boost/graph/named_function_params.hpp:15,
from /usr/local/include/boost/graph/depth_first_search.hpp:21,
from /usr/local/include/boost/graph/topological_sort.hpp:16,
from /usr/ports/deskutils/kdepimlibs4/work/kdepimlibs-4.3.4/akonadi/itemserializer.cpp:40:
/usr/local/include/boost/parameter/aux_/maybe.hpp:90: error: 'boost::python' has not been declared
/usr/local/include/boost/parameter/aux_/maybe.hpp:90: error: expected unqualified-id before '<' token
/usr/local/include/boost/parameter/aux_/maybe.hpp: In member function 'typename boost::add_reference::type>::type boost::parameter::aux::maybe::construct2(const U&) const':
/usr/local/include/boost/parameter/aux_/maybe.hpp:59: error: 'm_storage' was not declared in this scope
/usr/local/include/boost/parameter/aux_/maybe.hpp: In member function 'void boost::parameter::aux::maybe::destroy()':
/usr/local/include/boost/parameter/aux_/maybe.hpp:72: error: 'm_storage' was not declared in this scope
*** Error code 1
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 1

Stop in /usr/ports/deskutils/kdepimlibs4.

From the errors, it seems kdepimlibs4 is missing of a dependencies related to "boost::python".


FreeBSD - How to check swap space or partition info

Use the command :

Specified the parameter "-h" to convert the bytes to "h"uman readable form :
swapinfo -h

Sayonara !!!


FreeBSD - ports install Exim email server with patch error

Learned another thing today. The ports tree is just a repository of available software, it can be deleted & regenerated. Why would some one wants to delete the ports tree? It needed to be delete and regenerated because some patch was downloaded incorrectly and the problem stubbornly persists.

Sample of the error :
===>  Applying FreeBSD patches for exim-4.71

Ignoring previously applied (or reversed) patch.
2 out of 2 hunks ignored--saving rejects to src/daemon.c.rej
=> Patch patch-src-daemon.c failed to apply cleanly.
=> Patch(es) patch-OS::Makefile-FreeBSD patch-scripts::exim_install applied cleanly.
*** Error code 1

Stop in /usr/ports/mail/exim.
*** Error code 1

Stop in /usr/ports/mail/exim.

The error complained about a patch file which the patch file did exists.

What have been tried :
  • portsnap fetch update;make
    NO, it didn't work
  • make clean;make rmconfig;make
    NO, it didn't work
  • make config, deselect all options, make
    NO, it didn't work
  • rm -rf /usr/ports/distfiles/exim then make
    NO, it didn't work

After meddling around for a few minutes, still no clue. Is time to check out :
IRC server : irc.freenode.net
IRC channel : #freebsd


FreeBSD - Backup and restore FreeBSD using Fixit CD

Since FreeSBIE have not been updated since year 2007, its kernel recognizing new hardware starts to worry me as it is based on FreeBSD 6.2 and it is going to reach EoL (end of life) by end of this year, 2010. Is time to experiment on new way restoring backup.

The FreeBSD installation process does mentioned about "Fixit" CD booting. After meddling around with it, it's actually referring to another bootable CD which its label name consits of "livefs" (Live File System). It's also known as "disk 2" prior to FreeBSD 7.
Installation disc -- > 8.0-RELEASE-i386-disc1.iso
Live File systems disc --> 8.0-RELEASE-i386-livefs.iso

Do take note that the dump/restore instruction from the previous post "Freebsd – Backup & restore for disaster recovery" is still valid. This post is served as a "update" as it won't be using FreeSBIE, rather, it will using the livefs to start the restoration of the partition(s).

Without further ado, here's the instruction :

FreeBSD - Ports complain about Checksum Mismatch error

File integrity checking has been built in for ports, checksum of file. Comparing checksum of a file is automatically done when ports is going to extract the compress file. It's a important process to make sure that the file downloaded are not altered in anyway, be it missing bits during download or some one maliciously change the contents of the original compress file. Imaging, what would happen if some one insert a trojan house or some spyware into the installation file and happen to be download and installed by users on the internet. The consequences is un-imaginably scary.

But this may not always be the case as ports takes its source from well known web sites and the ports are written by the author of the program which happen to be a commiter port maintainer which (please correct me if this is not the case) gone through a thorough process of checks & verification.

Warning of checksum error may most of the time caused by bumpy download connection that break the downloaded file. e.g. missing bits, halfway terminated file download process.

During installation of the ports, it will complain an error :