Troubleshooting Kenai.com Ssh SCM
Monday Jun 29, 2009
See this tweet on debugging kenai.com ssh access to SCM (source code management) problems.
See this tweet on debugging kenai.com ssh access to SCM (source code management) problems.
Two weeks ago, before I left for vacation, Sun launched the new project collaboration site I am working on. You can learn more about Project Kenai and how it differs from similar project hosting sites like sourceforge.net and Google Code in Tim's interview with Nick, the lead developer.
I've been working on a new project for the past six months. It's a new web site built using Ruby on Rails that will be going public as a beta real soon now. Ruby on Rails is a webapp framework that's built on top of the Ruby scripting language so I've also been working in Ruby. It's a pretty cool language compared to others I've used. I'll write more once the project has been released to the public.
Yes, it is that time of the year again for 2008: JavaOne and the preceeding CommunityOne. I went to CommunityOne last year and thought it was definitely worth attending and was impressed by the variety of open source projects represented. Unlike its more well-known sibling, CommunityOne is completely free. Last year they had free food, t-shirts, and limited entry into JavaOne exhibits. This year some of the presentations I see are on OpenSolaris, MySQL, Ruby, Python, NetBeans, jMaki, Glassfish, OpenOffice, and even hardware. There's lots more I haven't mentioned too.
This is the second annual CommunityOne and I believe it developed as an expanded version of NetBeans Day which always occurred on the Monday of JavaOne week. It's a great idea because there are lots of open source projects useful for developers that Sun is involved in.
I'm signed up for CommunityOne, but so far I don't have a pass to JavaOne. That's because I no longer work on a project that's directly Java-related. For the last couple months, I've been working on Project Kenai. I'll write more about Kenai later. There is supposed to be a demo at the JavaOne Pavilion. I volunteered to help demo, but I might not be able to get an exhibit pass to get in. We'll see what happens.
The project I work on requires me to deploy to an OpenSolaris-based machine. However, the machine is going to be moved to another location which means it could be down for a week, so I thought I would take the time to set up a virtual machine (VM) using VMware Fusion on my Mac. It seemed like a good idea, particularly since I've worked with hypervisors like Fusion in my last project. Unfortunately, the app is quite large so it did not work out too well. I started with SXDE 1/08 and after provisioning it with all the needed software and deploying the apps into glassfish, the VM ended up slowing down and its size ended up approaching 18GB! Hopefully, the next iteration of the app will be consolidating several apps into a smaller number so it might eventually work.
I intend to write more about my experience. For example, I started writing some info on how to get the latest Java Desktop System (JDS) to run in the VNC server that comes pre-installed. See this link. Thanks go to the people in the OpenSolaris forums that helped me figure it out.
The source code management system we are using in my project is Mercurial. To learn more about using Mercurial, see the information in the "UnderstandingMercurial" and "Tutorial" guides in the "Getting Started" section on the main Mercurial page. There is also a more extensive manual available.
If you're using a Mac like I am, go to this page and look for the heading "For OS X 10.5". Download the latest Mercurial zip file, open it, and then run the installer in the new directory. Open a new Terminal window and make sure that "/usr/local/bin" is in your PATH and then verify that Mercurial runs by running "hg --version". Use the documentation mentioned above to become familiar with Mercurial. For other platforms, see other information on the Mercurial site.
When checking in code, it is useful to set your username in a ~/.hgrc file so the command does not complain. Mine is shown below. Other configuration options can also be placed in this file.
# This is a Mercurial configuration file. [ui] username = Edwin Goei <edwin.goei@sun.com>
A common setup is to use ssh to access a common repository. If you do not have a ~/.ssh directory, run the following command to create a key pair. Select the default location (~/.ssh/id_rsa) and use an empty passphrase.
% ssh-keygen -t rsa
Send the generated public key located in a file called ~/.ssh/id_rsa.pub or ~/id_dsa.pub to the repository administrator. They will add it to a authorized_keys file on the common repository host to grant you access.
The following shows some example commands that access a common repository.
% hg clone ssh://hgroot@santa.sfbay/hg/vapp destination directory: vapp no changes found 0 files updated, 0 files merged, 0 files removed, 0 files unresolved % cd vapp % echo "This is a test" >> README.txt % hg add README.txt % hg ci -m "Initial README" % hg push pushing to ssh://hgroot@santa.sfbay/hg/vapp searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 2 changesets with 2 changes to 1 files
Condition: Almost New. Same model currently sells for $2499 + tax from Apple. (You can check for yourself by going to the Apple Store.)
Shipping: local pickup preferred. I live in downtown Mountain View and work in Menlo Park, California.
Price: $1900 cash or check with valid ID. Credit card is $60 extra for transaction fee. Priced to sell so I can enjoy the rest of my break. :-)
Why am I selling it? There is nothing wrong with it. I purchased this in August 2007, before my company gave me with a new MacBook Pro to use instead. I've only used this one for a couple months and then it sat unused. I now have time to sell it because my company shuts down over the holidays. I've erased the hard disk and pre-installed Mac OS 10.5 Leopard on it so it will behave upon power up just like you bought it new from an Apple store with the "Welcome to Leopard" setup video.
I'm a software engineer living in Silicon Valley. This is an excellent development and home computing machine with a very nicely designed user interface. It is an x86-based CPU and so you can also use it to run other operating systems such as Windows, Linux, and Solaris simultaneously using virtualization software like Parallels or VMware Fusion, which is NOT included. I used to use a PC laptop running Windows XP before and I like this machine much better as do other engineers I know who have switched to MacBook Pros as their development machines.
I posted this on eBay originally, but then decided to try craigslist because I prefer a local pickup so I don't have to mail it. The pickup location is negotiable but I live in downtown Mountain View and work in Menlo Park in Silicon Valley. I checked comparable prices and set the price to be low so I could enjoy the rest of my break :-). If you are interested, leave me a comment and I will contact you. Thanks!
Sun has a Winter Break this week and so my goal is to complete some tasks that I've been meaning to do.
One of them is selling my MacBook Pro that I bought recently. I've wanted one for a long time but I was unsure when I would get one from work. I got tired of waiting and so I bought my own personal one last August from an Apple Store. Then soon after, the work laptop arrived and so I no longer need my personal one. If you're interested, feel free to leave me a comment and I'll get back to you.
The battery icon in the menubar of my MacBook Pro was showing a black "X" instead of the time remaining. It looks like it also prevented the battery from being charged correctly. I found this article on how to reset the System Management Controller (SMC) that fixed the problem.
As part of a demo, I wanted to deploy a Ruby on Rails application into a Rails Virtual Appliance using Capistrano. A Rails Virtual Appliance is a Virtual Machine that contains a complete stack of software from the Operating System up to Ruby on Rails itself. If you are using NetBeans 6 as your IDE, you can create a file such as $PROJECT/lib/tasks/demo.rake containing something like the following:
# Rake task to deploy to a production server for virtual appliance demo
# 2007-12-10eeg
# File that contains IP address of virtual appliance. If this file cannot
# be read, then the user will be prompted for the information.
TARGET_IP_FILE = '/ApplianceShare/ipfile.txt'
namespace :demo do
desc 'Print the target IP address'
task :print_target_ip do
puts "Target host IP: #{get_target_host}"
end
desc 'Show the coolstack page'
task :show_coolstack do
sh "open http://#{get_target_host}/"
end
desc 'Show the main depot web application page'
task :show_app do
sh "open http://#{get_target_host}:8000/store/"
end
desc 'Deploy to production'
task :deploy do
target_host = get_target_host
sh "cap -S target=#{target_host} deploy:setup"
sh "cap -S target=#{target_host} deploy:cold"
end
desc 'Deploy and run the application'
task :run => [:deploy, :show_app]
end
def get_target_host
if File.readable?(TARGET_IP_FILE)
f = File.new(TARGET_IP_FILE)
line = f.readline
host_ip = line.chomp
else
print "Target host: "
line = $stdin.gets
host_ip = line.chomp
end
host_ip
end
### Local Variables:
### mode: ruby
### End:
Note that the rake task uses sh to call Capistrano via the cap command to deploy the app into the production machine which in this case is a Virtual Appliance.
Then, within NetBeans, you can invoke the context menu on the project node in the Projects Window and select "Run Rake Task" and navigate to the task you want to invoke. See this blog entry or wiki page for more information on NetBeans and Rake.
I stopped by a Starbuck's on our way up to Oregon and did something cool. You know how they have songs playing in the background? Well now if you have an iPhone, you can go to the iTunes store and buy it using the onsite WiFi. In fact you can see what has recently played before too. I bought and downloaded a Sarah Vaughn song. It probably works with the ipod touch too. Definitely a good trend because I often want to get what's playing for instant gratification.
Update 2007-12-17: One thing I don't like about buying songs this way is that the songs currently have DRM (digital rights management) on them so you have to authorize them on a computer to play them :-(. I know the trend is toward DRM-free music. For example, Amazon now has DRM-free music downloads. The iTunes store is supposed to as well, but I haven't figured out how to search for that yet.
BTW, I'm blogging this entry from my iPhone.
From my recent entries, you may have noticed that I've been playing with Parallels and VMware Fusion recently. That's because I'm working on a new project that utilizes virtualization technology. I'm in the process of writing down some of the steps for creating a Rails Virtual Appliance for Solaris. See this page for a draft.
I use IRC (Internet Relay Chat) to work with other people on various projects. I also use IM (Instant Messaging) but unlike the common IM systems, IRC provides channels that users can join. So for example, there is a "#jmaki" channel on Freenode for people who are interested in the Jmaki Project. See a previous entry for more information about using Freenode.
I like using Chatzilla because it is cross platform and has features like "/stalk" that I use. However, it was originally a browser add-on. Well now there is a standalone version which I just installed. It's not the easiest install procedure and I also had to copy over my old preferences manually using a text editor. Look for the "prefs.js" file in your browser's profile directory and copy properties that start with "extensions.irc.". Then merge them into the new chatzilla "prefs.js" in its profile directory.
I serendipitously found a page that shows how to do the equivalent of Chatzilla's "/stalk" in various irc clients. I know other people who use X-Chat Aqua which like Chatzilla is cross platform. It might meet your needs, but I was already used to Chatzilla and didn't want to learn how to configuring it. I was also unsure if it was being maintained.
I've been meaning to update my old theme for a long time. So this morning I started to work on it. I started with an existing shared Sun roller blogger theme and am modifying it. It's still a work in progress.
Update: VMware Fusion 1.1 final release is out, resuming a virtual machine (VM) works but it still causes a kernel panic when I boot a VM. See this link for more info.
There are a couple bugs with VMware Fusion 1.1 Beta like flakey bridged networking and a caps lock remapping bug so I tried 1.1 RC1. However, it caused a kernel panic on my Mac :-(. Recently, someone posted a patch that fixes this bug. See these instructions on getting it to work.