I have two systems setup with Ubuntu and Windows XP with a KVM switch; I have also tried dual boot in the past. These configurations definitely gave me the advantage of both worlds, but I wanted to run Linux and Windows on the same system without any KVM or dual boot. Recently, Parallels was giving out a free license for Parallels Workstation 2.2 so I thought of giving it a try. The irony was that I ended up using Vmware. Here is a short summary of what happened.

I installed Parallels Workstation 2.2 and started to create a VM. The process of creating a VM is very intuitive and I decided to use a typical install.(See this in case you need an idea of the process) I used an empty partition from my XP. When I tried to install Ubuntu on it, it asked me if I wanted to install it on the 31 GB drive. As far as I remembered I had the partition for 13 GB. Fearing that I would screw up my MBR (I have done that before), I quit. Later I realized that the typical install of Parallels created a 32000 MB expanding hard disk and thats the reason it showed me a partition of ~31GB. I created a new VM with higher RAM and lower hard drive space. Now when I tried to install Ubuntu 8.04 it showed me an error in the installation (an odd image with 1’s). When I tried to install Ubuntu 7.04 it froze after sometime during the installation. Surfing through the net I found that other users have come across the same problem and it seems that allocation of higher RAM creates a problem. So, the third time I created a typical install again but changed the hard drive space after the VM was created. So far so good. I had a CD for Ubuntu and 7.04 and I went for the install. Parallels install notes mentions that they support 7.04 and 7.10; I was hoping to upgrade to higher versions once I got 7.04 installed. The installation was smooth. Upgrade was where the problem came. The 7.04 has reached the End Of Life and so I kept getting “could not find the release notes” when I tried to upgrade. I changed the sources.list file (see here) and upgraded to 7.10. Upgrading to 8.10 was another problem. Each time I upgraded, the network would get disabled. This writeup helped me solve the problem. After upgrading to 8.10 I hit a major roadblock. Network failed; could not upgrade anymore; I gave up. This was enough for me with Parallels.

Having spent so much time to try out getting a VM, I decided to give VmWare a try too. I downloaded the VmWare server and installed it. Much to my dissapointment, it installed VmWare webacess and server on my machine and I couldn’t access the webaccess anyways. I was expecting a shortcut that would fire a tool that would help me create a VM. I looked at the website and saw at the range of their products. Now I wasn’t sure if it was VmWare Server that I needed or was it the Workstation and the Player. Finally, I figured it out. The server was not started on my box. I used Administrative Services to fire the service and access the VmWare Server Webacees. The webaccess provides the dashboard to create and manage VMs. Having spent time on Parallels, the process was quite simple. The problem was that Ubuntu wouldn’t start up from the live cd. I realized that I had to add remote tools on the VmWare server in order to proceed. Rest was easy. I now have Ubuntu 8.10 on my Windows XP. To get the network connection working, put the network type as NAT instead of ‘Bridged Network’ in the Network Adapter configuration of your VM. Here is a summary of how to get the sound working. Important: To make things work, you will need to add a password to the account on your host (Windows) that has the guest(Ubuntu). Somehow, an account with no password gives problems in getting to the VmWare webaccess.
What next? Will try to upgrade Ubuntu to Jaunty.

References:
http://www.sourceslist.eu/
https://help.ubuntu.com/community/EOLUpgrades
http://ubuntuforums.org/archive/index.php/t-1078737.html
https://help.ubuntu.com/community/Repositories/Ubuntu
http://svenand.blogdrive.com/archive/50.html
http://www.simplehelp.net/2007/04/27/how-to-install-ubuntu-feisty-fawn-in-os-x-using-parallels-a-complete-walkthrough/
http://download.parallels.com/doc/Parallels_Workstation_2_2_User_Guide.pdf
http://ubuntuforums.org/showthread.php?t=604052
http://forum.parallels.com/showthread.php?t=20921
http://mazimi.wordpress.com/2007/06/26/enabling-audio-in-vmware-server/

Technorati Tags: , , , , ,

Advertisements

Its been a while that I have been trying to set up a development environment on my box at home. One of the challenges was using MySQL. (Its not that there is anything wrong with MySQL; its more of a procrastination problem with me. 🙂 to move to something other than Oracle. I have been working on Oracle for sometime and I was keen on getting the same environment for my development at home.)

I tried Oracle Express Edition today and was amazed at its simplicity. I was up and running with some sample code in a couple of hours. I downloaded the deb package on my Ubuntu and the installation was as easy as clicking the package and running this command sudo /etc/init.d/oracle-xe configure
Here is a good article that spells out some details. But it was way easier for me. Once all the ports were configured and the database server installed , the management was easy. I used http://127.0.0.1:8080/apex url to get to the admin screen.(use the same ports that you specify when configuring the server) Creating users, configuration was all intuitive.

There is a tasks menu on the right side of the page that shows a link “Manage Http Access”. If you enable remote access by going to that page, the admin panel can be accessed from any other system remotely.

I couldn’t get the PL/SQL developer to work on the client machine to talk to the server, but SQL Developer did not give me any problems. PL/SQL Developer had problems with the tnsname but SQL Developer worked. Not sure why. Here is the tns configuration I used: (Got it from here)

XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
hostname)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

And this is the connection url that I used from my application code:
jdbc: oracle:thin:@hostname:1521:XE

Now that I have a new playground, I hope to add more to my blog soon.

Other Links:
JDBC Driver
Oracle XE download for Linux

An https/SSL connection to a website requires you to accept/trust a certificate in order to proceed. When trying to make an https connection from an application/program you need to install the certificate and build a keystore in the process.

Here is the outline of the process:

1. Get the certificate :

Firefox: Add this extension to the browser
Now try accessing the address that you need the certificate from and use the extension from above to export the certificate as a *.pem file.
Internet Explorer: Try to access the address and once you get the Security Alert box click on “View Certificate” and then the “Details” tab in the new window that appears. Use the “Copy to file..” button to export the certificate.

2. If not present, create a directory named “security” in the location “%JAVA_HOME%\lib”

3. Java has a keytool utility in its bin folder. Use the following command to install/create the keystore using the file from Step 1 above.

keytool –import -alias salesforce -keystore %JAVA_HOME%\lib\security\cacerts -file “path-of-file\filename” -trustcacerts

4. The default password for the keystore is “changeit”. When prompted “Enter keystore password: “, provide the password.

5. There will now be a confirmation to to trust the certificate along with other information like the certificate fingerprints. Proceed with “yes”.

6. The confirmation message “Certificate was added to keystore” will be displayed.

7. Add the following to the run.bat file (This is for the Jboss application server in Windows)

set JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.trustStore=%JAVA_HOME%\lib\security\cacerts -Djavax.net.ssl.trustStorePassword=changeit

References:
http://www.informit.com/articles/article.aspx?p=407886
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/keytool.html

Technorati Tags: , , , , , , ,

I was working on a Rails application recently that required the logs to be sent to remote log server. This blog is just a summary of the steps to get it working. I used Rails 2.0 and the development was done on Ubuntu.

The first thing was to get syslog-ng. Its more advanced than syslogd.

sudo apt-get install syslog-ng

The next step was to get the SysLogLogger tool to send the logs to syslog instead of a file. Go to the vendor directory of your application and get SysLogLogger using the following command.

curl http://rubyforge.org/frs/download.php/20520/SyslogLogger-1.4.0.tgz
-L | tar -zxvv

Assuming that you are working in the development environment , add this to the start of the development.rb file in the configuration directory

$:.unshift File.join(RAILS_ROOT, "vendor", "SyslogLogger-1.4.0", "lib")
require 'syslog_logger'
RAILS_DEFAULT_LOGGER = SyslogLogger.new(program_name = 'my-application')
config.logger = RAILS_DEFAULT_LOGGER

Locate the syslog.conf file in the etc directory and add these lines.

!my-rails-application
user.* /var/log/development.log


What this does is gets the logs that are sent to syslog from the rails application and writes it to the development.log file in /var/log/ dir

To get the changes working, restart the syslog service on Ubuntu by running the following command
sudo /etc/init.d/sysklogd restart

To send the logs to a remote log server instead of the log file use this in the syslog.conf file instead
user.* @address of remote log server

The log server should be configured to accept logs from remote systems. The syslogd file in the remote log server needs to be changed to show the following for this purpose

SYSLOGD="-r"

The syslogd file is located in the etc/default dir in Ubuntu. Since I had the log server configured already, I did not need to change the configuration. Please add comments on this post in case something is missing.

The log files can be rotated on a periodic basis (or depending on size) by configuring the logrotate.conf file in the etc dir.
See man logrotate for details.

It has been three days that I have been at JavaOne 2008. I had been waiting to attend this conference for a long time and here is a small review of what I have experienced so far.

The Good
* Looking at the huge crowd , I believe that the people at JavaOne have done a good job at the arrangements.(except at some places…read on).
* Directions, guidance, maps really helped.
* Arrangements on the General Sessions were excellent.

The Bad
* Too many choices. Pavilion, Technical Sessions, Hands on labs, Birds of a feather and more. I wanted to attend all of them, but most of them overlapped and I had to pick the best. Reminds me of The Paradox of Choice.
* Sitting area for lunch was not adequate and the special choice(Vegetarian) food ran out on Tuesday.

The Ugly
* Wireless service was next to none. Every time I tried to get online I got a ‘page not found’ error.
* Some of the presentations were completely unprofessional. The organizers could do a much better job in filtering out the speakers. I felt that the quality of presentations at No Fluff Just Stuff is much better that at JavaOne.

Here are some of the presentations that I liked:

More “Effective Java” by Joshua Bloch
MySQL cluster and Java Technology by Monty Taylor
Practical Applications of Static Java Technology-Based bytecode analysis and transformation by Misko Hevery and Eugene Kuleshov
Improving Application Performance with Monitoring and Profiling Tools by Jaroslav Bachorik and Gregg Sporar
Java Management Extensions(JMX) technology update by Jean-Francois Denise; Eamonn McManus

Things I liked on the Pavilion:

Sentilla
Amazon‘s brain teasers.
Validy

I am at San Francisco right now attending the JavaOne conference. Yesterday I was at the Pavilion and the guys from Amazon had put a brain teaser for everybody. I was the 11th person who answered the teaser correctly. Got a ‘Ninja Coder’ tag and a gift.

ninja

Here is the question for you to try.

unsigned int fib(unsigned int n){
if n == 0 return 0
if n == 1 return 1
if n == 2 return 1 // NINJA LINE

return fib(n-1)+fib(n-2)
}

What would be the difference in the number of times that the fib function is called if the ‘NINJA LINE’ is commented out?
Give the answer as an expression of n.

Its been sometime I have been working with Ruby and Rails. It was more of Ruby and less of Rails until now. We are building a restful service in rails that would be called by Java. It was this opportunity that made me look at The Rails Way by Obie Fernandez. I must admit I got caught right from the beginning. I am in the second chapter now and the author knows what he is talking about. I would not recommend this book for a person who is starting on Rails but this is a keeper for any Rails reference. (thats what I think so far). I took a glance at the part where he talks about nginx. Not much on that either. I think it would be best to use “Agile Web Development with Rails” to begin with, this book as a reference and Ezra’s book for deployment. (my two cents).

The part that I like most in the introduction is where Obie mentions the problems being faced in enterprise software development (Legacy Systems, Business Analysts, resistant managers, politics). There are two solutions to these problems. The first is to play safe and the second is an alternative to the first one. Here is what he says —

That alternative is being exceptional ! It starts with productivity. I am talking about being so obviously effective at your job that nobody will ever be able to scapegoat you, to the extent that it would be political suicide to try.

The first two chapters talk about configuration and controllers. Each part in that chapter has some information that is new to me. Not being an expert in Ruby and Rails has made me jump back and forth between this book and the ones from Pragmatic Programmers. But, so far I have enjoyed reading it.