What's brewing
Friday
Apr272007

How to connect to a printer shared as a MS Windows print queue

To connect to this printer, all you need to do is similar to adding a local printer. The tricks in getting this done is step no. 3. So, watch out!


  1. Open the System Preference -> Print & Fax
  2. Click the "+" sign to add printer,
  3. Press the "option" key and mouse click on the "More Printers ..." button
    You can then find a menu item called "Advance" from the drop down list, which you can then specify the URI in reaching the SAMBA share.

    Follow the rules below to define the print que, userid and password.


    smb://<username>:<password>@<server>/<queue name>



    e.g. smb://paperdrip:xxx@printer.paperdrip.net/hp_printer

Friday
Apr272007

Installing NXServer to Ubuntu Feisty Fawn

Just installed the Ubuntu Feisty Server to a new machine and remote access is one of the first few things that I need. Below are the steps I have taken. I am by no means the original author that figure out the installation process but I am providing a summary and solution on the different issues that you may encounter.


  1. Download the NXClient, NXNode and NXServer from the website of Nomachine, you can use the DEB version provided. The sequence DOES matter, so, please follow accordingly.

    • Install nxclient
    • Install nxnode
    • Install nxserver

  2. Load up your /etc/ssh/sshd_config file into an editor:


    sudo nano /etc/ssh/sshd_config



    Add the following line & save the file


    AuthorizedKeysFile /usr/NX/home/nx/.ssh/authorized_keys2



    Restart sshd by typing:


    sudo /etc/init.d/ssh restart



  3. Done! Now verify NXServer is running properly by typing:


    sudo /usr/NX/bin/nxserver --status



    This should return:


    NX> 900 Connecting to server ..
    NX> 110 NX Server is running.
    NX> 999 Bye.



  4. Now comes to the part that ppl start having problem, configure the NXClient on your client machine, start the connection and after the point of "Authentication", the whole client apps disappear. The fix is sort of funny, it is done by adding a hostname "unix" to the host file, example as follows,


    127.0.0.1 localhost unix



    The reason for the change is NXServer tries to look for the display from unix:xxxx and the system cannot resolve the host name "unix" which results in failed connection.

  5. It works OK already in the local network but I find myself failed to get back to the office from home. I get an error message like


    "Could not yet establish the connection to the remote proxy"



    By digging around the web, I noticed an article from Nomachine.

    The error is due to a firewall was set in between my home and office machine. By turning on the SSL flag on my OS X client and the connection can be established right away.


By following these, you should have the NXServer installed properly. But you may want to join the discussion if you still encounter problems upon following the procedures. Below are the 2 that I locate all the information above, kudos to the contributer over there.

Step by step guide and also discussion on the installation process

This thread discuss the issue of the client that cannot connect to the server
Monday
Apr022007

A Web Service Client in PEAR SOAP

In the preparation of my next episode on Hermes 2, I have been struggling on how to develop a web service client in technology other than Java. My primary candidate is definitely ruby, but I have to give up on it after playing it for a while. I just don't know how to construct a MIME message in Soap4r.

So, I headed to my second lover, PHP. From there, I have a couple of choices, NuSOAP, Pear SOAP and PHP Extension. I have decided to use Pear SOAP cause NuSOAP seems to be stopped from developing and PHP Extension is not something I am familiar with. With that said, let's move forward and see how it works.

Installation, embrace beta packages


I am not drilling into the details on how to compile PHP with Pear support, google on this topic and you should get loads of responses. There are 2 things that I feel worth mentioning.


  1. Change the preferred_state to beta so that you can install the latest version of PEAR::SOAP.


  2. pear config-set preferred_state beta



  3. After that, install all the dependency for SOAP, including Mail_MIME and Mail_DIME, if NOT, you will not be able to send multipart message.

    pear install -alldeps SOAP





Hurray! Now show me some code ...


OK ok ... First of all, create a new soap client and define the endpoint that it will be connecting to.


$url='http://images.vsmile.com:8080/corvus/httpd/ebms/sender';
$soapclient = new SOAP_Client($url);



After that, prepare the parameter which you will be sending over in the SOAP message, this parameter should be those required by the web service server for program execution. You should encapsulate all the value in the class SOAP::Value and put them into an array. Notice on the last value that I am packaging, I am using the SOAP_Attachment object which is a child of the SOAP_VALUE.


$params =
array (
new SOAP_VALUE('cpaId', 'nonEmptyToken', 'cecid'),
......
new SOAP_Attachment('SWA','text/xml','./dbhelper.xml')
)
;



Along with the program parameter, you will also need to define on how the SOAP message should be delivered. This include the document type of the message, how the file should be sent over as, etc. All these settings will again be encapsulated in an array.

From the code below, notice that I am defining the attachment will be sent over as a MIME message, i.e. a multipart message.


$options=array(
'namespace' => "http://service.ebms.edi.cecid.hku.hk/",
'soapaction' => '',
'style' => 'document',
'use' => 'literal',
'trace' => 1,
'timeout' => 30000,
'Attachments'=>'Mime'
);



With these, we can initiate the call!


$resp = $soapclient->call('query', $params, $options);



Damn it! It doesn't work!


Yes, it doesn't work to me either, until I read this.

I modified my SOAP_Base::_makeMimeMessage as instructed. Notice about the double quote surrounding "text/xml"? Axis reject the SOAP request if it is un-quoted.


$params = array('content_type' => 'multipart/related;
type=text/xml');


to


$params = array('content_type' => 'multipart/related;
type="text/xml"');


Ta-da, it works ok now!
Thursday
Feb222007

The quest for a VPS provider

In the preparation of an internet performance test of our latest product, I figure that all the server I own has one thing or two missing. I need to look for additional server environment in order to test throughly.

I could bring one up at home by using Parallels but I still need another one that is hosting elsewhere.

My first thought is to leverage my account at JaguarPC, but my shared web hosting plan didn't provide Java support, so this isn't an option to me. But I noticed that they have a service which brings the flexibility of a dedicated server and the price similarity to shared web hosting, i.e. the VPS (Virtual Private Server). They were having a promotion at that time and I can do what I want by migrating my shared hosting plan to a VPS plan.

This begins my numerous email with the support in learning more abou this service. I have to give the support team an applause since I could always get a reply in a very short time. Besides, they have the patience in explaining the plan to me and offer an account migration. BUT, my migration cannot turn to be fruitful as the promotion period has just been over by the time when I am ready to place the order.

I have to look elsewhere (cause it's not as cheap without the discount) but turns out it's a good opportunity for me to learn more about this service. I want to share the experience in my quest and hope someone might find this useful.

... When I thought Virtuozzo is the only option for VPS ...



I first learnt about VPS from my existing web hosting company and they are using Virtuozzo as the engine for all VPS plan. Cause I haven't spent the time to look around and I thought Virtuozzo is everything for VPS.

But upon looking further, I know that Xen is becoming popular in the VPS world, too. The 2 technologies differs quite differently, Virtuozzo is emulating in OS level while Xen is emulating in the hardware level. Also, for the server having Virtuozzo in place, all the VM (Virtual Machine) has to be run in the same OS as the host. While for Xen, VM running in different OS are running in parallel. One thing to note though, the OS running in each VM has to be modified in a way to support the host. But a good news is on the horizon, the upcoming CPU will have the virtualization taken care so that patch is no longer required.

Also, Virtuozzo is a commercial product, support is provided directly from the company and a nice control panel is also included. For Xen, it's an opensource project, support level might not be as complete as Virtuozzo but the developing process is rolling out very quickly. Also, since Virtuozzo is developed with the ISP in mind, so there are a lot of little tools for administration process.

Another consideration is performance, there are fans for each of this technique. Virtuozzo is claimed to be light in footstep, also, they have a "memory burst" which allows anyone of the VM to leverage the memory of the other VM if they are idel at that moment. For Xen, since it is emulating down to the hardware level so the overhead is comparatively smaller than other solution.

I can select the OS as desired?
Yeah, but you have to bite your bullet, too.


JaguarPC offers 4 different kind of OS to be run in the VM but I find that there could be even more offering in the other provider. Cause I am more familar with Gentoo so it would be a bonus if this is available as an option.

A big difference from a shared hosting is, you need to take care of all the software installation and patching. Software installation is OK but the difficult (or tedious?) part is the security administration. Some service provider can help to install the security patch if you select a particular OS (Centos Linux most of the time).

So, what about administration, you might ask? If you have ever used a shared hosting, you should have seen a web based administration page. There are several big names which provides an interface on top of the OS which aims to ease the administration task, e.g. setting up of DNS, email account, etc. Cpanel, Direct Admin, Plesk and Interworx are some of the "big name" and Cpanel is one of the hottest name that you will come across. Again, there are fans for each of these products while some of the comment I hear the most is, Cpanel require some more system resources when compared with the others but it also provide extensive amount of features, too.

For me, I have installed neither of them, firstly is because it isn't provided and secondly, I think I am feeling right at home with Gentoo. Also, plans without using these control panel can come cheaper in price.

So, what's your pick finally?



Below is a list of service provider that I have considered and maybe I can share some of my personal encountering that leads to my decision.


  1. JaguarPC
    They are the service provider where I put this blog to. Their plans are generous and the support shines. I can usually get a reply shortly from them and they are patience with my numerous questions sending back and forth. I should have signed up with them if I didn't missed the window for their promotion.

    Their VPS runs on Virtouzzo and the pricing is competitive but you might be able to get more resources for your VDS from the other service provider.
  2. eApps
    I first encounter eApps from Google, when I try to search for Java hosting. They have plans specialized for Java Servlet hosting (which is what I want to do), their pricing is OK and the review I read has a mixed reaction but I can't quite get the "resources" I would get for my VDS so I ended up headed to somewhere else.

  3. Xelhosting.com*
    I heard of some rave review for Xelhosting and I begin to study the plan to offer. But I am surprised to find that their web site is so clean and simple, i.e. I got little information apart from the hosting plan details. I usualy get my feeling towards the company from the reaction of existing user but they provided no user forum, and only a short FAQ.

    Their offering is quite good, with a wide selection of host OS including something rare like Suse and Slackware.

    I put them on my "waiting list", might consider them if I cannot find any closer match.

  4. ServerAxis*
    ServerAxis is another service provider that I heard a lot, and upon checking out what they have to offer, all I can say is "WOW"! They are the most genrous provider that I have seen. 512M RAM, 20G HDD space and 200G bandwidth for a mere US$30 is quite a bargain. I am so tempted to place my order BUT the thing that draw me back is the ordering procedures.

    I am no strangers to online shopping but what they are asking is sort of weird to me. They require the customer to send an "image" of their credit card for any ordering. I can understand they want to prevent fraud ordering but I am reluctant to do so, so I emailed their sales and check if there are alternaive solution. They responsed and tell me I can mask out the signature on the card in an email that I got after a day or so. Too bad I am on the hurrying side so I signed up a plan elsewhere.

  5. SliceHost*
    I found SliceHost from some other recommendation, their web site is designed towards a Web 2.0 style and I can find quite a bit of information through their user forum, blog and FAQ. Their offering is quite attractive, too, although not as powerful as those in ServerAxis but very good enough to me. 256M RAM, 10G HDD and 100G bandwidth for US$20. Also, they offer Gentoo linux as the VDS, which is a big plus to me since I have been a long time Gentoo Linux user.

    I head up to sign up mine and the process is a breeze. I have my newly opened VDS in a matters of minutes, installed my application and I can start my testing right away!

    The machine is very snappy and it feels even more powerful than the other dedicated server I own (a dual pentinum III server with 1G RAM). Remote access is very acceptable, too (I am accessing it from Hong Kong to the macine located in the USA).

  6. RimuHosting
    I have came across some very positive comment regarding to the level of support they provide. They even offer server colocated in different location for you to choose from but the pricing is on the more expensive side. I need to cough up almost US$40 for something similar to what I got in SliceHost but seems they are limiting only a small amount of VDS running on each of server to ensure a reliable operation, maybe that's the higher price you are paying for.


I am now a happy user of SliceHost and I would recommend anyone who want to get a shot on VPS with them.

I will soon try to setup my own Xen boxes for fun. Happy VDSing, everyone.
Saturday
Dec232006

Have a Cocoa Christmas

In this holiday season, there are several charity event in the Mac community and one of them is the A Holiday Cocoa Duel!.

It is in a hope of raising donation from the community to the charity by offering a number of holiday-themed applications.

Below is a summary on what each of the application do.


Operation X -> A game having santa to deposit gift through the chimney of each house but there's a F-16 to get into your way.

SantaSnaps -> My personal favorite, loaded up something like Photo booth but you can put up all the xmas decoration on yourself.

Snow Tracker -> Screen saver, for astrologist I think.

Snowy -> Snow, snowman and penguin everywhere.

Snowplane -> Dim the screen and snow falling on the background.

Photocard -> Forget to send out xmas card to your friend? No worry, create an e-card with ease!

Snow Wars -> Mr. Snowman is boring, they said let's have a snowball fight, the catapult style.

MacGiftWrap -> Want some decoration on your folder but don't want to change it one bye one? This app will replace the finder folder with ribbon wrapping around.

Mac Lights -> Decorate your desktop with Christmas light.

Holiday Lights -> Allow you to assign lights to Cocoa application.

Santa's Gizmo -> Let's hear what the developer said - "We embarked on a quest - a quest to obtain the ultimate machine. Struggling through the perils of the icy northern hemisphere, we flew over Kybar's Teeth, fought polar bears, and battled the vicious Elven Mages."

iSled -> Having the sled rider running accorss your screen.


Enjoy the offering but don't forget to donate.

Have a Merry Cocoa Christmas!