FreeBSD : SMP suspend / resume finally?

I have not verified this on my own laptop (HP Compaq Presario V3417AU). But it really a good news.

To: freebsd-acpi@freebsd.org
From: takawata@xxxxxxxxxxx
Date: Tue, 13 May 2008 20:25:56 +0900
Subject: SMP suspend/resume.

Hi, I managed to make suspend and resume work on SMP system.
The patch following is a bit crude patch, but it begin
to work on my ThinkPad X61 (core2duo system).

TODO:
1. Suspend/resume path it self is simular to AP boot path.
Some of code may be integrated.
2. More context, like MTRR or npx context should be saved on
suspend.
3. Make acpi suspend resume path more ABI aware: needless
register recoverly or special register context saving
(the value itself is usually constant) should be removed.
4. Make same binary module work on both UP or SMP case.
(Or is it time to give up using acpi module on also on i386?)

Click attachment for the patch.

May 14th, 2008, posted by Kevin Foo (chfl4gs_)

Deluge: ‘boost::bad_lexical_cast’ abort

%deluge
no existing Deluge session
Starting new Deluge session…
deluge_core; using libtorrent 0.13.0.0. Compiled with NDEBUG.
Applying preferences
terminate called after throwing an instance of ‘boost::bad_lexical_cast’
what(): bad lexical cast: source type value could not be interpreted as target
Abort
%

Deluge refused to restart after my computer was not properly shut down. Simple workaround is to remove deluge config directory (don’t be too worried about your previous torrent download) and fire up deluge.

%rm -r ~/.config/deluge && deluge

Add your previous torrent seeds and select the previous directory where you saved them. Deluge will check your previous downloads and resume them. :)

April 30th, 2008, posted by Kevin Foo (chfl4gs_)

FreeBSD : mod_security2 broken?

I walked through routine maintenance of one of FreeBSD boxes, which was running as reverse proxy (Apache httpd + mod_security2 + mod_proxy) for OWA in my office. Everything went smoothly. But when it came to restarting of services, apache started to complain of unresolved symbol!

Cannot load /usr/local/libexec/apache22/mod_security2.so into server: /usr/local/libexec/apache22/mod_security2.so: undefined symbol: xmlFree

I reinstalled apache22, libxml2 and mod_security2 from ports. Nothing unusual was sighted. Asking our friend, google didn’t provide much of information. The latest that I managed to dig out was in 2005 and 2006. Some dudes had the same issue as me.

Anyhow I’m pretty convinced it is a bug from mod_security2-2.1.7_1 in FreeBSD’s ports. Here a quick workaround, just add the lines below to your Apache httpd.conf and the error message will go away!

LoadFile /usr/local/lib/libxml2.so
LoadModule security2_module libexec/apache22/mod_security2.so

April 29th, 2008, posted by Kevin Foo (chfl4gs_)

FreeBSD : alfresco + jdk1.5.0 + mysql = no joy


I was playing with Alfresco on FreeBSD 6.3 with no success. With mysql 5 and jdk1.5 installed from the FreeBSD ports, I downloaded alfresco community version 2.1.0 which bundled with tomcat and mysql-java-connector 5.0.3. Alfresco ran fine with default setup with minimum configuration for data, index and logging paths.

If I changed db to MySQL and restarted the alfresco tomcat, it failed to start alfresco web client. It complains of missing modules. Too bad I don’t speak much of Java. Seymores, the Java guy, advised me to give it a try on Linux and I managed to get it running within 20 minutes. Everything works like charm.

Anyone has had experience with Alfresco on FreeBSD? Please share some light.

April 24th, 2008, posted by Kevin Foo (chfl4gs_)

April Fool : UN against Open Source

This is funny. :D UN against Open Source

April 1st, 2008, posted by Kevin Foo (chfl4gs_)

Tun M’s Confession : a distortion?

“Tun Dr Mahathir Mohamad has expressed regret at the use of a video clip that purportedly showed he admitted that he had framed Datuk Seri Anwar Ibrahim.

Dr Mahathir said those who attended the talk understood the context of his speech but the Opposition took one part and distorted it.”

Source thestar

Seriously, I don’t know how true this is. Judge it yourself.

March 5th, 2008, posted by Kevin Foo (chfl4gs_)

Pound SSL with CA certificate

Here’s the note with easy steps to get pound running with SSL signed by CA.

Generating Certificate Signing Request
# cd /etc/ssl
# openssl req -new -nodes -subj '/C=MY/ST=Wilayah Persekutuan/L=Kuala Lumpur/CN=myshinny.webserver.com/O=My office./OU=IT department.' -key host.key -out host.csr

After generating certificate signing request, you need to copy and paste the contain of host.csr to Verisign for signing. Once you have got your certificate signed, save it as host.crt. Note: the naming convention here is for the demonstration below.

Obtaining Verisign intermediate CA certificate
Depending on which type of certificate that you have purchased, you could obtain Verisign CA certificate from this page. Copy the certificate content and save it as verisign.pem.

Now you have 4 files: host.key, host.csr, host.crt and verisign.pem. Only 3 of them are needed for pound ssl. Prepare the certificate to use with pound. Note: In server.pem that will be created, it is important that you follow the sequence as such.

1 Your key
2 Your certificate
3 CA certificate

# cat host.key host.crt verisign.pem > server.pem

Example pound configuration, pound.cfg:-

---snip---
ListenHTTPS
        Address x.x.x.x
        Port    443
        HeadRemove "X-SSL-.*"
        HeadRemove "X-Client-Verify.*"
        Cert    "/etc/ssl/server.pem"
        CAlist "/etc/ssl/verisign.pem"
        Ciphers "ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL"
---snip---

End

Replace x.x.x.x with your server IP address. Restart pound and you are done!

March 5th, 2008, posted by Kevin Foo (chfl4gs_)

转贴 : 造句(笑话)

友人把这笑话转发。觉得它完完全全的反映当今的大马。

小明的作业要用国家、社会、党、人民来造句。他不理解,就去问爸爸。
爸爸:国家就象你奶奶,地位最高,但是实际上管不了什么事。党就象我,咱家里我说了算,社会就象你妈,为你奶奶、我、你,我们大家服务。人民就象你,我们谁的话你都得听。
晚上小明还是不太明白,就再去爸爸的房间问爸爸,爸爸正和妈妈两人XX,一脚就把他给踢了出来,他哭着去找奶奶,可是奶奶已经睡下了。小明没办法,随便造了句就去睡觉了。
转天爸爸接到学校老师的电话。

老师:小明的造句是谁给造的?
爸爸:他造得不好吗?
老师:是造的太好了,让我们以为不是他造的。
爸爸:他怎么造的?

老师:”国家在沉睡,党在玩社会,社会在呻吟,人民在哭泣。“

February 21st, 2008, posted by Kevin Foo (chfl4gs_)

Debian : ssl-cert 1.0.15 chroot issue (ugly workaround)

On my previous post, I encountered problem with ssl-cert in chrooted environment. By installing ssl-cert via apt-get, these processes were triggered.

root 27799 0.0 0.4 4676 2256 pts/2 Ss+ 04:33 0:00 /usr/bin/dpkg --status-fd 13 --configure ssl-cert
root 27800 0.4 1.3 10016 7132 pts/2 S+ 04:33 0:00 /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/ssl-cert.postinst configure
root 27806 0.0 0.2 3804 1192 pts/2 S+ 04:33 0:00 /bin/sh -e /var/lib/dpkg/info/ssl-cert.postinst configure
root 27808 0.0 0.2 3820 1280 pts/2 S+ 04:33 0:00 /bin/bash -e /usr/sbin/make-ssl-cert generate-default-snakeoil
root 27812 0.0 0.2 3780 1448 pts/2 S+ 04:33 0:00 openssl req -config /tmp/tmp.OXerK27810 -new -x509 -days 3650 -nodes -out /etc/ssl/certs/ssl-cert-snakeoil.pem -keyout /etc/ssl/private/ssl-cert-snakeoil.key

Further investigation showed that process 27812 stuck. Running the openssl command manually brings up:

27830:error:0E065068:configuration file routines:STR_COPY:variable has no value:conf_def.c:629:line 5

The error message is exactly same as what Michael Prokop has found out.

The content of /tmp/tmp.OXerK27810 is:

#
# SSLeay example configuration file.
#

RANDFILE = $ENV::RANDFILE

[ req ]
default_bits = 1024
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
prompt = no
policy = policy_anything

[ req_distinguished_name ]
commonName = myshinnybox

DIRTY SOLUTION
As I’m only interested to get packages such as Postfix, Postgresql Apache mod SSL to install, killed the “apt-get install ssl-cert” process and fired up vi and removed the line RANDFILE = $ENV::RANDFILE from /tmp/tmp.OXerK27810.


# openssl req -config /tmp/tmp.OXerK27810 -new -x509 -days 3650 -nodes -out /etc/ssl/certs/ssl-cert-snakeoil.pem -keyout /etc/ssl/private/ssl-cert-snakeoil.key
Generating a 1024 bit RSA private key
................................................++++++
.......++++++
writing new private key to '/etc/ssl/private/ssl-cert-snakeoil.key'
-----
# apt-get install ssl-cert
Reading package lists... Done
Building dependency tree
Reading state information... Done
ssl-cert is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up ssl-cert (1.0.15) ...
#

I don’t understand why the package ssl-cert exist in the first place when user can just use “openssl” command to generate ssl certificate. Yet making the situation worst, ssl-cert was added as dependency to many packages. Duh! In additional, chroot seems to be buggy under Linux.

February 20th, 2008, posted by Kevin Foo (chfl4gs_)

Debian : ssl-cert 1.0.15 chroot issue

Ran into some issues with ssl-cert 1.0.15 installation on Debian chroot environment. But looks like I’m not alone. The issue was reported by Michael Prokop.


molecule:/# apt-get install ssl-cert
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
ssl-cert
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/7938B of archives.
After this operation, 90.1kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package ssl-cert.
(Reading database ... 27065 files and directories currently installed.)
Unpacking ssl-cert (from .../ssl-cert_1.0.15_all.deb) ...
Setting up ssl-cert (1.0.15) ...

……took forever……

make-ssl-cert generate-default-snakeoil took forever. So it looks like no fun with ssl-cert in chroot’ed environment. Any solution out there? Buzz me. Thanks.

February 18th, 2008, posted by Kevin Foo (chfl4gs_)