Ruby on Rails in 5min

Using an unbelievable RoR environment for PCs called InstantRails I had created my first RoR app in just a few minutes.

As the majority of posts on this blog will tell you, I’m a .Net guy, but some recent experiences working on web sites I created a while back in PHP have left me with some second thoughts about the universaility of ASP.Net as a web development tool. Couple that with the recent Hanselminutes podcast on RoR, and the fact that my PHP hosting company just started fully supporting RoR, I decided to write my very own RoR “Hello World”.

Turns out I didn’t even need to wait for my hosting company to come around, since there is an unbelievable environment for PCs called InstantRails, which installs not only Rails and Ruby, but MySQL and Apache! With the help of Matt Griffith’s screencast on how to install the environment I had created my first RoR app in just a few minutes. The only glitch I ran into was not having Ruby’s bin folder location in my PATH variable – do that before walking through the screencast and it should work like a charm.

Next you’ll want to check out these screencasts from 37Signals. They illustrate how to take advantage of RoR’s built-in features like ActiveRecords, scaffolding, and migrations – the reason for using RoR in the first place. They even have a screen cast on how to consume the Flikr API w/ Ajax.

All in all, I can’t believe how quickly I was able to get something up and running, especially considering how daunting the installation instructions from my hosting company were.

Automate FTP with Command Line Switches and Parameters

I have been assisiting my client in troubleshooting an application problem that occurs daily. Technical support has required us to send them an updated log file each day. I wanted to set up a batch program that I could schedule to run daily that would execute the necessary FTP commands to send the file to them automatically.

I found the solution in this article onMS-DOS FTP command line arguments and commands. FTP has a -s switch which can be used like the > redirect to specify a command file to automate a series of FTP tasks. You can then use Windows Scheduler to execute FTP with the command line switch to read the series of commands from your command file.

  1. Save the series of FTP commands (one on each line) as a text file:
    open [hostname]
    [username]
    [password]
    ascii
    put [filename]
    disconnect
    bye
    
  2. Create a batch file that executes FTP from the command line with the -s switch:
    ftp -s:commands.txt
  3. Use Windows Task Scheduler to execute the above batch file at whatever interval is necesary

Ways to Run Multiple Web Sites on XP Professional

This article lists more than one way to run multiple web sites in IIS on a non-Server edtition of XP (i.e. Professional or Home). Previously I thought that this was not possible, but it turns out the limtation is in the IIS Admin Console GUI – not Windows – although Windows still will not let you run more than one site siultaneously. I downloaded and installed IIS Admin, and it is working great.

Why would you want to do this anyway? Well, in my case, I am completely re-architecting a site for my client, but I need to maintain the current version and we only have one development server and it is running XP Professional. IIS Admin allows me to set up and work on both sites on the development server. Since I can only have one running at I time and most of my time is spent creating the rearchited site, I keep it running by default. Whenever I need to make a change to the existing site, I just start it in IIS Admin, make and test the changes, and then upload them to the production server, and then switch back.