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-26
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 :
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 :
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 :
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 :
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 :
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 :
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. :
Since BlackBerry is a Smart Phone, it has the usual PIM (Personal information management) applications. 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?
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 :
Playing around with it and the below is what found out :
2010-06-24
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 :
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 :
2010-06-17
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:
2010-06-16
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 :
Adios !!!
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 :
- N900 - How to ssh into N900 using OpenSSH
- Perl - A happy note, on N900
- N900 - How to overclock the processor speed of N900
- N900 - How to clear all the phone data & settings
- Stay tuned, this list will be update periodically.
Adios !!!
2010-06-14
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 !!!
2010-06-11
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 :
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 :
2010-04-03
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.
2010-03-27
Perl - How to list installed modules
A note for myself. This is how to list out what perl modules are installed.
Way 1 :
Way 2 :
*** these are all taken from http://perldoc.perl.org/perlmodlib.html
Das Vidanya !!!
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 !!!
2010-03-20
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.
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.
2010-03-12
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 :
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 :
2010-01-16
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 :
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 :
Subscribe to:
Posts (Atom)





