Routinely, I did a "netstat -an" on a FreeBSD box, a DNS server. The screen then shower with hundreds of "TIME_WAIT" connections. Seems like some malware infected clients are querying the server and causes the terminated TCP socket waiting to be shutdown, but not fast enough, to be efficient. Fortunately, the numbers of TIME_WAIT sockets accumulated are insignificant.
In order to reduce the number of socket waiting, tune the system value :
2011-01-31
2011-01-28
FreeBSD - How to make changes to sendmail, FreeBSD styled
Sendmail is the default MTA in FreeBSD. FreeBSD has its own way in managing sendmail's configuration files. Instead of making changes to sendmail.mc, changes should be made to $(hostname).mc. Similarly for submit.mc, changes should be $(hostname).submit.mc.
Here's how :
Here's how :
2011-01-24
FreeBSD - How to test newsyslog for systax error
Platform :
FreeBSD
Purpose :
Syntax checking after creating a new logrotate in "newsyslog"
Command :
newsyslog
Installation :
The "newsyslog" log rotation program comes with the base installation.
Useful switches :
-n == DO NOT actually do the logrotate. Instead, show what will be perform
-vv == verbose on what newsyslog is doing
Example :
FreeBSD
Purpose :
Syntax checking after creating a new logrotate in "newsyslog"
Command :
newsyslog
Installation :
The "newsyslog" log rotation program comes with the base installation.
Useful switches :
-n == DO NOT actually do the logrotate. Instead, show what will be perform
-vv == verbose on what newsyslog is doing
Example :
2011-01-21
BIND - Error "loading from master file managed-keys.bind failed: file not found"
Platform :
FreeBSD
Error message :
Every time restarting the BIND DNS server, the log file will have this entry :
Solution :
Create a empty file in /var/named/etc/namedb, name "managed-keys.bind":
Why :
The file "managed-keys.bind" is used for managing keys in DNSSEC. By default, BIND is looking for it. Even though you might not be using this feature, creating the file in empty will make the error message go away.
Sayonara !!!
FreeBSD
Error message :
Every time restarting the BIND DNS server, the log file will have this entry :
general: error: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not foundBIND DNS continue to work though.
Solution :
Create a empty file in /var/named/etc/namedb, name "managed-keys.bind":
touch /var/named/etc/namedb/managed-keys.bind
Why :
The file "managed-keys.bind" is used for managing keys in DNSSEC. By default, BIND is looking for it. Even though you might not be using this feature, creating the file in empty will make the error message go away.
Sayonara !!!
2011-01-17
FreeBSD - How to get information on hardware details
Platform :
FreeBSD
Purpose :
Print out information about hardware, e.g. CPU, memory, network card & etc
FreeBSD
Purpose :
Print out information about hardware, e.g. CPU, memory, network card & etc
2011-01-14
OSX - How to maximize window using keyboard shortcut
By default, OSX does not comes with a shortcut, though there's a function for it. To make use of it, we'll need to assign a keyboard shortcut key to maximize or un-maximize window.
Here's how to do it :
Now, open an application and try the new keyboard shortcut key. Press the first time for maximized and the second time to return the previous size.
Nemaste !!!
Here's how to do it :
- Open the "System Preferences"
- Under the "Hardware" section, click on "Keyboard"
- Next, click on "Keyboard Shortcuts" then "Application Shortcuts" (on the left hand box)
- Add a shortcut key by clicking on "+" symbol, on the bottom of the right hand box
- At the next dialog box, choose "All Applications" for "Application:"
- In the "Menu Title :" column, type in "Zoom"
- Click on the next column, "Keyboard Shortcut:", then press your preferred keyboard shortcut.
E.g. Control + Option + Command + m (you didn't read wrongly, is 4 keys there :p)
*** Avoid popular shortcut key, e.g. Command + v
Now, open an application and try the new keyboard shortcut key. Press the first time for maximized and the second time to return the previous size.
Nemaste !!!
2011-01-10
FreeBSD - portupgrade php5 got hiccups with security/php5-filter
During the routing upgrading of ports, caught a hiccups while upgrading php5 related packages.
One of the port failed to upgrade after issuing "portupgrade -vr php5*".
The errors :
Checking out /usr/ports/UPDATING and /usr/ports/MOVED doesn't seems to give a hint. Next try on Forum.FreeBSD.org shed light on this :
One of the port failed to upgrade after issuing "portupgrade -vr php5*".
The errors :
===> Building for php5-filter-5.3.4 /bin/sh /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/libtool --mode=compile cc -I. -I/usr/ports/security/php5-filter/work/php-5.3.4/ext/filter -DPHP_ATOM_INC -I/usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/include -I/usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/main -I/usr/ports/security/php5-filter/work/php-5.3.4/ext/filter -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -fno-strict-aliasing -pipe -c /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c -o logical_filters.lo cc -I. -I/usr/ports/security/php5-filter/work/php-5.3.4/ext/filter -DPHP_ATOM_INC -I/usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/include -I/usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/main -I/usr/ports/security/php5-filter/work/php-5.3.4/ext/filter -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -fno-strict-aliasing -pipe -c /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c -fPIC -DPIC -o .libs/logical_filters.o In file included from /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:25: /usr/local/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory In file included from /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:25: /usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token /usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token /usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre' /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c: In function 'php_filter_validate_regexp': /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:411: error: 'pcre' undeclared (first use in this function) /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:411: error: (Each undeclared identifier is reported only once /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:411: error: for each function it appears in.) /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:411: error: 're' undeclared (first use in this function) /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:412: error: 'pcre_extra' undeclared (first use in this function) /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c: In function 'php_filter_validate_email': /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:527: error: 'pcre' undeclared (first use in this function) /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:527: error: 're' undeclared (first use in this function) /usr/ports/security/php5-filter/work/php-5.3.4/ext/filter/logical_filters.c:528: error: 'pcre_extra' undeclared (first use in this function) *** Error code 1 1 error *** Error code 1 Stop in /usr/ports/security/php5-filter. ** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20101224-47314-9ktu04-0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=php5-filter-5.2.11_1 UPGRADE_PORT_VER=5.2.11_1 make ** Fix the problem and try again. ---> Build of security/php5-filter ended at: Fri, 24 Dec 2010 09:36:27 +0800 (consumed 00:00:43) ---> Upgrade of security/php5-filter ended at: Fri, 24 Dec 2010 09:36:27 +0800 (consumed 00:00:43) ---> ** Upgrade tasks 1: 0 done, 0 ignored, 0
Checking out /usr/ports/UPDATING and /usr/ports/MOVED doesn't seems to give a hint. Next try on Forum.FreeBSD.org shed light on this :
2011-01-07
Bash - How to check the exit status of pipe command
Piping in bash commands are common.
Checking exit status of a command in bash scripting is essential.
How about checking exit status of the commands in a pipe?
Example:
2011-01-03
FreeBSD - Port p5-Encode-Detect error
While patching one of the FreeBSD box, a perl module port, converters/p5-Encode-Detect-1.01, failed to compile. This is the abstract of the error message :
It seems like the port devel/p5-ExtUtils-CBuilder didn't quite compile it's option and installed properly. Reinstalling devel/p5-ExtUtils-CBuilder didn't help. Re-compile all of the dependency of converters/p5-Encode-Detect & devel/p5-ExtUtils-CBuilder also didn't work as well.
The error message does strongly suggest that there's problem with devel/p5-ExtUtils-CBuilder. It's time to get my hands dirty, by manually compiling the port devel/p5-ExtUtils-CBuilder :
===> Extracting for p5-Encode-Detect-1.01 => SHA256 Checksum OK for Encode-Detect-1.01.tar.gz. ===> p5-Encode-Detect-1.01 depends on file: /usr/local/bin/perl5.8.9 - found ===> Patching for p5-Encode-Detect-1.01 ===> p5-Encode-Detect-1.01 depends on file: /usr/local/bin/perl5.8.9 - found ===> p5-Encode-Detect-1.01 depends on file: /usr/local/lib/perl5/site_perl/5.8.9/ExtUtils/CBuilder.pm - found ===> p5-Encode-Detect-1.01 depends on file: /usr/local/lib/perl5/site_perl/5.8.9/Module/Build.pm - found ===> p5-Encode-Detect-1.01 depends on file: /usr/local/bin/perl5.8.9 - found ===> Configuring for p5-Encode-Detect-1.01 Warning: ExtUtils::CBuilder not installed or no compiler detected Proceeding with configuration, but compilation may fail during Build Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for 'Encode-Detect' version '1.01' ===> Building for p5-Encode-Detect-1.01 Building Encode-Detect Error: no compiler detected to compile 'src/LangBulgarianModel.cpp'. Aborting *** Error code 2 Stop in /usr/ports/converters/p5-Encode-Detect.
It seems like the port devel/p5-ExtUtils-CBuilder didn't quite compile it's option and installed properly. Reinstalling devel/p5-ExtUtils-CBuilder didn't help. Re-compile all of the dependency of converters/p5-Encode-Detect & devel/p5-ExtUtils-CBuilder also didn't work as well.
The error message does strongly suggest that there's problem with devel/p5-ExtUtils-CBuilder. It's time to get my hands dirty, by manually compiling the port devel/p5-ExtUtils-CBuilder :
2010-12-29
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 :
What are you waiting for?
Click here to donate ...
and a Happy New Year 2011 !!!
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:
http://www.freebsdfoundation.org/donate/
To find out more about The FreeBSD Foundation, please visit:
http://www.freebsdfoundation.org
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 !!!
2010-12-24
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 !!!
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 !!!
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 :
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 :
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 :
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".
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 :
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 !!!
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 :
After the installation, time to try git. When issue the command "git", it return an error message :
In fact, all my other programs that installed through macports are having problem.
e.g.
Executing "svn" also return the same error :
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 :
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 :
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 :
- List of FreeBSD Core Team members
- List of FreeBSD Developers
- An article on Contributors to FreeBSD
- FreeBSD mirror servers
Subscribe to:
Posts (Atom)







