Of Native Americans, Elastic Clouds and Gutsy Gibbons
Posted by Tim Brys on Oct 19, 2007
Deploying
Some days ago, we deployed the docpublisher for the first time. After q uite a long session of installing and configuring, there still seemed to be someth ing amiss. We called it a day and decided to continue the next morning. Sadly, nex t morning, we found that our Apache had cra shed during the night. It was not a nice sight: blood, limbs and ruby-code everywh ere. We cleaned everything up and decided to test the deployed docpublisher on ano ther server…
EC2
This “other server�? is actually Amazon’s Elastic Compute Cloud. It’s quite an exciting concept: namely, you make an image on which you install whatever OS and software you want, you upload it to Amazon’s S3 Datastorage and from then on, you can create as many instances of that image on their servers as you want. Say you make a website and host it on EC2. Suddenly, your site becomes the new internet-hype and it’s daily hits are no longer counted in tens or hundreds, but tens and hundreds of thousands. With a regular hosting program, you would be in deep trouble, losing days of uptime while you acquire new servers or migrate to new hosts. With EC2 though, it only takes minutes to start new instances of your image which means you get some awesome scalability in no time at a very competitive price.
Ubuntu
On October 18, Ubuntu Gutsy Gibbon was released. From what I’ve seen of it, this linux distribution is really becoming a realistic Windows-alternative for the mainstream user.
New features include:
- Better hardware support
- Windows compatibility
- Enhanced User Interface
Get it here
Progress
Finalized first version of the Retrospectiva DocBook extension
As you can see above, there is a menu-tab called “Blog�?. In the extension, a new tab is created, called “Docbook�?. When Docbook files under subversion-control are added or changed, they are published under the Docbook tab and thus viewable to the user (that’s you). HTML is viewed directly on-site, other formats like pdf and rtf are available for download.
Wrote a logger for docpublisher
This was quite interesting to do. I decided to catch the standard output so I could write it to a logfile. To do this, I created an IO#pipe and a child process in which the stdout is cought and processed. Basically it’s this:
#clone old out
old_out = $stdout.clone
#make pipe
rd, wr = IO.pipe
#fork
pid = fork do
while true
#read from pipe
str = rd.readline
#log string
logger.info(str)
#print string on screen
old_out.puts str
end
end
#replace standard output with pipe
$stdout.reopen(wr)
Bye