Phine Solutions web work notes

Amazon AWS web service

Filed under: programming in general — 1.618 @ 1:08 pm

Amazon’s AWS webservice has been around for a while now and recently I implemented one of my web site to use the Simple Storage Service (A3). The idea is to utilize the storage space in Amazon’s computing cloud to ease the actual loads on my own web server. In this case, I store the user uploaded images into Amazon A3 storage as backup; and when the images are loaded on a page, they are pulled directly from Amazon A3. By using A3 the web site uses the distributed computing/storage resources and save the bandwidth.

Some of the good reasons to use A3:

  • The service is cheap. We are talking about GBs on the pennies here.
  • The service is quite reliable. I know earlier this year when A3 went down and a bunch of sites that were built using A3 as part of core infrastructure went down with it. But overall the down time is very rare. And A3 load time has also been pretty fast based on my experience.
  • Easy development. The A3 development community is a great place to find resources. For example, this standalone S3 php class pretty much has everything you need to start using the A3 storage.

Although we have a lot of good reasons to use AWS, I still wouldn’t embed too much of it into the infrastructure. The A3 storage in my case is used as a backup source and the actual data can be retrieved from local server by simply flipping a property value in the configuration file. The data update is also initialized by the scheduled cron jobs instead of building into the code. The benefit of this is that A3 is never something that my site has to reply on to stay up. And A3’s performance will not heavily influence the web site’s performance.

I have to say AWS is a brilliant idea and the fact that it came out from an online retail site makes it even more interesting. Here is a brief interview on Jeff Bezos who talked about Amazon’s cloud computing service during the D6 conference in May 2008.

Use cygwin on winxp, be careful about using xwidow/xterm

Filed under: programming in general — 1.618 @ 10:08 pm

Normally I use eclipse for as the development IDE for my web projects. But sometimes I also enjoy using just VI (or Vim) and consoles for coding. The biggest difference from using a GUI IDE is that I would do a lot of typing and not much file looking up from a GUI directory tree. This is especially helpful If I know my files and I can find it by simply typing some commands on the console screen, versus go to the file navigation tree (usually in a small font) in a IDE, scroll up and down and try to locate a file.

Since I use winxp, Cygwin becomes the tool to get some Unix like consoles and commands.

With the base installation I get a simple command prompt. It looks just like a windows cmd prompt so it is a functional tool but doesn’t satisfy my Unix style crave. Luckily I have a couple of other options.

Run Cygwin-X

It is an X window system on a windows machine. Basically I can run an X server in windows OS and run other X tools and toys such as xterm and xclock. xterm is the main thing I was looking for since it comes with all the bells and whistles and I can customize the fonts and colors to the way I like.

The installation is pretty simple. Using the Cygwin setup program and simply choose the X11 package and you should be good to go

But I didn’t run into the “file permission” problem until I actually start heavily using it.  The problem starts with the new files I created in xterm. My web apps (in php) could not read them because “the permission was denied”. Using chmod command seemed to fixed the problem. But soon I has CVS issue for some reason all the CVS folders becomes invisible to windows and Tortoise the CVS client started to complain.

After researching on the web and not being able to find anything that can get me out of this easily so I decided to give it up. Can’t afford losing my time since there are other alternatives.

Falling back to Eclipse is not painful. It is still a good IDE. However,  Cygwin has another nice bach console tool called rxvt.exe and the good thing about it is not needing a X server.

My rxvt.exe batch file (rcvt.bat):

@echo off
c:\cygwin\bin\rxvt.exe -sl 500 -fn ‘Courier New-16′ -sr -title “My bash” -e c:\cygwin\bin\bash.exe –login -i

This will give me a nice bash console with a nice font and so far I am pretty happy with it. I guess it needs a little time to find out if it also gives me file permission problems.

If you had the similar experience and know how to fix this, please let me know.

Sun Tech days in Atlanta

Filed under: programming in general — 1.618 @ 11:48 am

Last week I attended the Sun Tech Days in Atlanta. The event lasted for 3 days but I only went to the one day developer's session.

As I am a Java developer in the corporate world I'd like to keep updated with the newest Java Technology. Since Sun is the inventor of Java, Sun Tech Days should be a good event to go to and it turned out to be a very informative and interesting event.

Here are some highlights I gathered from the event:

Open Source

Sun is opening the source of its operating system and Java. 

NetBeans

Sun is definitely pushing its NetBeans IDE to the developer's desktop. During the event, the speakers from Sun demonstrated how easy it is to use NetBeans to create Java apps with Ajax and other plug ins. I am not sure if I will switch from Eclipse to NetBeans, but definitely want to give it try.

Web 2.0 & Ajax

These are two probably most repeated words in the speaker sessions. An interesting development is that Java 6 also includes a script engine so a Java program can include scripting language like Javascript or Ruby. I am not sure if PHP is on the future list. I guess since JVM itself is a platform it is natural to adopt scripting language, one of the fast growing development tools, into JVM.

In my opinion "Web 2.0" is really a natural path for the improvement of the web technology and the community concept is nothing new since the "web" literally represents a community. Ajax is a probably the single word to resonate the Javascript technology. It is good to know that Sun is keeping the pace with the latest technology trend.

Jame Gosling

There was a Q&A session with Jame Gosling, the inventor of the Java programming language. He really knew what he was talking about.

Things I will definitely check out

Project jMaki - jMaki is an Ajax framework that provides a lightweight model for creating JavaScript centric Ajax-enabled web applications using Java, PHP, and Phobos.

Mr. Sang Shin was one of the speakers on web 2.0 framework and Ajax technology. There are some great info on his website.

Free Sun Tech bag! 

 dscn1585.JPG

©phinesolutions.com