2010-10-11

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 :

2010-10-06

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.

2010-10-04

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 :

2010-10-01

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

2010-09-29

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".

2010-09-27

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 :

2010-09-25

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 !!!

2010-09-24

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.
e.g.
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 :

2010-09-22

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 !!!

2010-09-17

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?

2010-07-26

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 :

2010-07-23

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 :

2010-07-21

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 :

2010-07-19

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 :

2010-07-17

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 :

2010-07-15

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 :

2010-07-14

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 :

2010-07-13

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.

2010-07-11

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?

2010-07-05

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 :