Thursday, January 19, 2012

Rebuild portupgrade to use Ruby 1.9

PC-BSD installs portupgrade as default, but, it uses Ruby 1.8 - not Ruby 1.9. In this article, I introduce the way to rebuild portupgrade to use Ruby 1.9.

Before rebuilding

  1. Prepare ports on /usr/ports
  2. Install ccache to build Ruby 1.9, on /usr/ports/devel/ccache
  3. Add RUBY_DEFAULT_VER=1.9and RUBY_VER=1.9 to /etc/make.conf
  4. Deinstall Ruby 1.8 on /usr/ports/lang/ruby18
  5. Install Ruby 1.9 on /usr/ports/lang/ruby19

Rebuild portupgrade

# cd /usr/ports/ports-mgmt/portupgrade
# make deinstall
# make install clean

After rebuilding (optional)

Fix the information about ports dependencies
$ sudo pkgdb -F

Monday, January 16, 2012

Dual Boot PC-BSD 9.0 and OS X Lion on Macmini

A few days ago, both FreeBSD 9.0 and PC-BSD 9.0 are officially released, and these handbooks are also upgraded.
IMO, the best advantage of PC-BSD 9.0 compared with FreeBSD 9.0 is that the installer can make easily dual boot with FreeBSD 9.0/PC-BSD 9.0 and Mac OS X 10.5 or later on Macmini, Macbook and any Mac machines. In this article, I introduce the way I make dual boot.

Friday, January 13, 2012

mini_magick 3.4

At the end of last year, both mini_magick 3.4 and subexec 0.2.1 are released. Before this release, we had to write different codes for POSIX and for Windows as mentioned in phosphorescence: mini_magick - A better RMagick alternative. Then now, since this release, we can write the same codes both for POSIX and for Windows.
require 'mini_magick'
image = MiniMagick::Image.open("http://www.google.com/images/logos/logo.png")
image.resize "50%"
image.format :gif
image.write "localcopy.gif"

Tuesday, January 10, 2012

I've finished reading "Regular Expressions Cookbook"

I've finished reading Regular Expressions Cookbook.

  • Between Chapter 1 and Chapter 3, This book makes us learn or re-learn the basis of Regular Expression. It is useful both for newbie and for others.
  • Between Chapter 4 and Chapter 8, This book is totally "the recipe book". We should re-read each corresponding chapters whenever we need any solutions.
  • Japanese edition contains how to deal Japanese encodings and characters in Regular Expression domain. This is also useful for Programmer dealing Japanese language.

Saturday, January 7, 2012

Enable G1GC

Since Java7 update 2, Java7 becomes stable, steadily. So that now is the time to try G1GC.
> java -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC Another args...

If you want to use G1GC commonly, set these VM args to environment variable JAVA_OPTS.
JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC"
> java $JAVA_OPTS Another args...
Another advantage to set JAVA_OPTS is that other Java programs often reads and uses this environment variable, e.g. tomcat, JRuby and so forth.