Apache2.2 with vhost_alias on Debian mini-HOWTO

By using Apache2.2 mod_userdir you may setup user-specific directory as http://example.com/~username/ syntax with document root as /home/users/username/public_html, but what if we hope to setup a dynamic mapping for http://some_other_dir.example.com/? mod_vhost_alias can do this for you.

This mini-HOWTO will guide you though the setup and configuration of Apache2.2 mod_vhost_alias module on Debian Lenny. Before start you should have some basic idea about how DNS and Apache is working.


A new life for Rebecca and Edison: we get married :D

After a 11 years relationship with Rebecca, we finally get married on 2010-01-15! It is a new start of both of us :D

We start our relationship since Secondary 3 when studying in Kiangsu-Chekiang College (KCC). Hmm... it should (!?) since 1998-06-29. I can't think for life without my wife: we keep on studying hard for HKCEE/HKAL, we have our university life in Chinese University of Hong Kong, and so on. We should thanks for a lot of people; but I would like to thanks Rebecca most. I am always not in a good manner, but she still love me so for the past 11 years. I will try my best for our coming future. My dear, I love you so much ;D

Will have the photo for wedding party soon. Should I upload it here and let's share the happiness?


白宮群英CMS篇: Drupal

Here is a Drupal related news from a Hong Kong magazine PC Market Vol.856 on 2009-12-22, BizIT, Let's Open section (p.156):
白宮群英CMS篇: Drupal: PC Market Vol.856, 2009-12-22白宮群英CMS篇: Drupal: PC Market Vol.856, 2009-12-22

作為開源軟件的Drupal,是一個採用PHP程式語言編寫、模組化框架架設的內容管理系統(Content Management System,CMS)。由於其功能及意義超過了一般的CMS,故有人稱它為內容管理框架。Drupal可以在Windows、Unix及Linux等作業系統上進行,背後需要MySQL或PostgreSQL等的數據庫系統作出支援,亦可以配合Apache及IIS的網頁伺服器運行。

剛剛推出版本6.0的Drupal,擁有多項方便內容管理的新功能。一)支援使用OpenID,讓用戶可以在互聯網上享用單一的識別身分,在使用一眾支援OpenID的網站下,用戶毋需再在不同的網頁內,輸入不同的登入姓名及密碼,提升使用的體驗;二)自動檢查功能,系統將會定時找尋模組軟件及其他安全更新,步驟自動化,令系統管理員省卻管理的時間。除此之外,Drupal 6亦作出大量的系統優化程序,包括國際化語言支援,除了全球最多人使用的英文及中文外,其他從右向左書的語言亦已步入支援之列,足令Drupal的世界用戶群數繼續增加。

Drupal的穩定性及功能強勁亦獲美國總統奧巴馬垂青,在今年10月起,白宮建立的whitehouse.gov網站討論區,就改用了Drupal作為系統架構的基礎。

As a people living in Hong Kong, I feel so happy about this news. Some website designer in Hong Kong still think that "Using CMS or some other website framework will simple remove their development flexibility; the learning curve of CMS is too high which may not really improve their project performance; etc." This is a good signal that more people are now searching for better website development solution, rather that just simple static page design :D


VirtualBox 3.1 + iSCSI on Debian Lenny mini-HOWTO

VirtualBox 3.1 coming with a new feature "Teleportation" (aka live migration). With live migration you can port a running client from one host to another, without any service down time. It is for sure a enterprise-ready killer function (well... even KVM and QEMU already support that for some days before...). Therefore the next question should be: any pre-requirement for using VirtualBox's live migration? According to official user manual:

The two virtual machines on the source and the target must share the same storage (hard disks as well as floppy and CD/DVD images). This means that they either use the same iSCSI targets or that the storage resides somewhere on the network and both hosts have access to it via NFS or SMB/CIFS.

IMHO, iSCSI should be the best choice in this case: it is simple in architecture and faster when compare with using NFS/SMB/CIFS, it is native and simply supported by some SOHO SAN/NAS, and you may even share an entire hard disk to your virtual client machine as like as normal physical disk without abstract with NFS/SMB/CIFS (personally, this is my original and main target for using iSCSI).

Any drawback? Yes, for sure: you will not able to work with snapshot. This is because snapshot only work with *.vdi or *.vmdk

This mini-HOWTO with guide you though the installation of iSCSI target on Debian Lenny, some demo setup for sharing your physical hard disk or a single raw file image with iSCSI, and howto setup an iSCSI hard disk within VirtualBox 3.1.

My darkness day, my new start

Thursday is my darkness day. I face a great change which is out of control. It is a special day that should be mark down within my life and never forget.

BTW, it is also a single for a new start. Something that I have planed for a long long ago can be start now. It is just 9 months earlier from my original schedule. On the other hand, after an indeed review of my current status, no else case would be better then current situation for my next start. From some point of view, I should thanks Jesus about his special planing which I have never think before.

It is not a suitable timing for detail the background. I need some time to refresh my brain. Someday later I will review this once again, but 2009-12-10 should never forget.


筆電分解清潔圖

8月幫表妹清潔Notebook時拍了一些照片,今天才有空記下來...
20090830.jpg20090830.jpg20090830(001).jpg20090830(001).jpg20090830(002).jpg20090830(002).jpg20090830(003).jpg20090830(003).jpg20090830(004).jpg20090830(004).jpg20090830(005).jpg20090830(005).jpg20090830(006).jpg20090830(006).jpg20090830(007).jpg20090830(007).jpg20090830(009).jpg20090830(009).jpg


Add CMYK support for GIMP on Win32 and Debian Lenny mini-HOWTO

By default GIMP only support sRGB color profile but lack of CMYK support. An additional plugin called as Separate can add this missing function. As an alternative another plugin called as Separate+ is presented with color profile management. This simple guideline will go though the installation of GIMP + Separate+ under Win32 and Debian Lenny.

Get and install Separate+ under Win32

Go to Separate+ homepage and download the zip version. Here we use the separate+-0.5.4.zip.

Just extract the zip file to elsewhere, and copy the 3 files (icc_colorspace.exe, separate.exe and separate_import.exe) from bin\win32_gimp2.4\ to %PROGRAMFILES%\gimp-2.0\lib\gimp\2.0\plug-ins\.

Go to Adobe home page, accept their EULA, and download the ICC profiles for CS4. Here we get the AdobeICCProfilesCS4Win_end-user.zip.

Extract the zip file. Copy all *.icc from CMYK and RGB to %SYSTEMROOT%\system32\spool\drivers\color\. That's it.

Get and install Separate+ under Debian Lenny with source code

Go to Separate+ homepage and download the zip version. Here we use the separate+-0.5.4.zip. Also go to Adobe home page, accept their EULA, and download the ICC profiles for CS4. Here we get the AdobeICCProfilesCS4Win_end-user.zip. Extract both file under your home directory, e.g. /root.

Next, install required dependence package for complie:

apt-get update
apt-get install libtiff4-dev libgimp2.0-dev icc-profiles

Compile Separate+:

cd ~
unzip separate+-0.5.4.zip
cd separate+-0.5.4
make
make install

Unzip and move all ICC profiles to /usr/share/color/icc/

cd ~
unzip AdobeICCProfilesCS4Win_end-user.zip
find . -name '*.icc' -exec mv {} /usr/share/color/icc/ \;
find . -name '*.icm' -exec mv {} /usr/share/color/icc/ \;

Now start your GIMP and you should find the Image -> Separate

Get and install Separate+ under Debian Lenny with APT

Separate+ (0.5.3) is already packaged as gimp-plugin-registry for Debian, therefore you may simply get it with:

apt-get update
apt-get install gimp-plugin-registry icc-profiles

So now start your GIMP and you should find the Image -> Separate

How to use Separate+

I will use Win32 version as demonstration, where Debian Lenny works fine as identical. Here are the original JPEG image and the CMYK TIFF final product (Ooops... I convert the TIFF as PNG for display... My Drupal setup dislike TIFF...). You may find a bit different in their color tones:

1116026365_63489.jpg1116026365_63489.jpg1116026365_63489-CMYK.tif1116026365_63489-CMYK.tif

Separate the image from menu Image -> Separate -> Separate:

seprate+_002.pngseprate+_002.png

Choose the color profile according to your target printing device:

seprate+_003.pngseprate+_003.png

The image should now look like below. Also check the layers and you will find it separated as CMYK:

seprate+_004.pngseprate+_004.pngseprate+_005.pngseprate+_005.png

To save the image as CMYK TIFF, go to Image -> Separate -> Save and save it:

seprate+_006.pngseprate+_006.pngseprate+_007.pngseprate+_007.png

How to keep the CMYK layers?

From the README file:

To save a CMYK TIFF for use in a DTP program, bring up the right-mouse-button menu, and select "Image->Separate->Save...". Please note that saving an image this way won't clear the image's modified flag, so when closing, you'll be warned that the image hasn't been saved. This won't be fixed until the plugin is capable of loading CMYK images. Until then, if you need to edit the CMYK image in the future, you need to save it off in XCF format, to preserve the layers.

IMHO, you may also save the file as *.psd so Photoshop may also open it :D


Bookmark for Windows Offline Files

http://blogs.msdn.com/jonathanh/archive/2004/12/02/274078.aspx

Remember to check:

These are the checks that are made on CSC startup:

  1. CSC is not enabled on Home Edition
  2. CSC is not enabled when terminal server is configured for multiple concurrent users
  3. CSC is not enabled when either the user’s (admin user) preference or Group Policy says it should be disabled
  4. CSC is not enabled when either of the following REG_DWORD registry values is set to zero:
    HKLM\Software\Microsoft\Windows\CurrentVersion\NetCache\Enabled
    HKLM\Software\Policies\Microsoft\Windows\NetCache\Enabled

A quick code for about registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetCache]
"Enabled"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NetCache]
"Enabled"=dword:00000001
"FormatDatabase"=dword:00000001

;Benfit: Force "Offline Files" enable with re-initialize


Drupal, Gallery2, FCKeditor and G2Image integration mini-HOWTO

This mini-HOWTO will guide you though the integration procedure for both Drupal and Gallery2, with assistance of FCKeditor and G2Image. If you hope to insert your photo album images into Drupal without a heavily embed style, this should be your cup of tea.

Why not integrate with Drupal's gallery.module?

The most simple answer should be: keep everything simple. I hope to keep my Drupal and Gallery2 installation isolated for a simpler management, as different system coming with different specific requirement. What I only hope to do is to reuse the existing resource coming from Gallery2, so user don't need to upload a single image twice.

Why not use Drupal's image.module + img_assist.module?

They are in different design so I use both solution. I use image.module + img_assist.module for tiny amount Drupal-only images, for fast layout design and so on, e.g. insert some image when writing a blog post as like as this mini-HOWTO. You won't hope to: 1. create a new album in Gallery2, 2. upload images and manage their title, 3. go back to Drupal and choice your image though FCKeditor, how fancy!

Demo Drupal and Gallery2 setup

In this HOWTO I will install Drupal and Gallery2 as path below:

www2:/# ls -la /var/www/
total 60
drwxr-xr-x 13 www-data www-data 4096 2009-11-07 12:49 .
drwxr-xr-x 18 root     root     4096 2009-05-29 09:13 ..
lrwxrwxrwx  1 www-data www-data   10 2009-11-07 12:49 content -> drupal-6.x
drwxr-xr-x  9 www-data www-data 4096 2009-07-02 04:55 drupal-6.13
drwxr-xr-x 10 www-data www-data 4096 2009-11-07 12:13 drupal-6.14
lrwxrwxrwx  1 www-data www-data   11 2009-10-27 14:40 drupal-6.x -> drupal-6.14
lrwxrwxrwx  1 www-data www-data   11 2009-11-07 12:49 gallery -> gallery-2.x
drwxr-xr-x 11 www-data www-data 4096 2009-11-06 16:01 gallery-2.3-developer
lrwxrwxrwx  1 www-data www-data   21 2009-10-30 09:14 gallery-2.x -> gallery-2.3-developer

Why a lot of symlink? Because whenever upgrade is required, I just need to download the new version and relocate the symlink target. No path or URL will be changed.

So if my server with URL http://example.com/ and Apache DocumentRoot on /var/www, Drupal and Gallery2 will be accessible though:

http://example.com/content/
http://example.com/gallery/

Moreover, Drupal's FCKeditor is already installed in:

/var/www/drupal-6.x/sites/all/modules/fckeditor

Where G2Image already installed in:

/var/www/drupal-6.x/sites/all/modules/fckeditor/plugins/g2image/

Download G2Image here, and also read its general installation guideline.

G2Image Drupal-specific configuration

Edit the /var/www/drupal-6.x/sites/all/modules/fckeditor/fckeditor.config.js, and add the following line:

FCKConfig.Plugins.Add( 'g2image' ) ;

I add the G2Image button to both DrupalFull and DrupalFiltered, so it should look like:

['Image','G2Image','Flash','Table','Rule','Smiley','SpecialChar','DrupalBreak'],

Now edit the /var/www/drupal-6.x/sites/all/modules/fckeditor/plugins/g2image/config.php as below:

$g2ic_gallery2_path = "/var/www/gallery-2.x/";
$g2ic_embedded_mode = TRUE;
$g2ic_use_full_path = TRUE;
$g2ic_gallery2_uri = '/gallery/main.php';

Ok that's all :D

Test the setup

Create a new node, activate the FCKeditor, and you should have something similar as below:
drupal_g2image-001.pngdrupal_g2image-001.png

When click on the G2Image button, you should able to browse your album, select and insert your images:
drupal_g2image-002.pngdrupal_g2image-002.png

Once insert your editor should look like:
drupal_g2image-003.pngdrupal_g2image-003.png

Ok so now save the node and review it. Enjoy :D


Syndicate content