Download API Tools from http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&categoryID=88

Extract the zip file to C:\ folder (to avoid paths with quotes issues in windows). I also renamed the folder to “ec2-api-tools”

Set Java Home Environment Variable. Usually this looks like “C:\Program Files\Java\jrexxx”. Find out exact path on your computer

From Command Prompt

> cd C:\ec2-api-tools
> set JAVA_HOME=”C:\Program Files\Java\jre6″

Set EC2_HOME variable

> set EC2_HOME=C:\ec2-api-tools

Now Get Private key and Certificate Files and keep in C:\ec2-api-tools\keys\ folder for convenience.

Now you can test api-tools

> C:\ec2-api-tools\bin>ec2-describe-availability-zones -K C:\ec2-api-tools\keys\pk-xxx.pem -C C:\ec2-api-tools\keys\cert-xxx.pem

In text:

1. Download “mysql-connector-net-6.2.2-src.zip”  from http://dev.mysql.com/downloads/connector/net/ and extract the zip file.  Note that we need ‘src’ version of library if we want to debug in visual studio.

2. Open your Visual Studio Solution and add  “Mysql.data.csproj”  located at  “MySql.Data\Provider\” inside the extracted archive.

3. Add this project’s reference to your project (mysql.data).

4. Now you can debug into mysql.data methods.

Once you connected using psql,

# \o  /tmp/myrecord.txt

Then run any SQL queries you want.  They wont be visible on screen But will be recored to /tmp/myrecord.txt

#  SELECT * FROM my_super_dummy_table;

#\q

Most common database used with Rails is mySQL but if you ever need to use SQL Server, here is a quick how to.

I am using  Windows Vista, SQL Server 2008, Rails 2.2.

1)  Install  activerecord-sqlserver-adapter gem

 > gem install activerecord-sqlserver-adapter

 Capture1

2) Create a new Login for this new database (say testuser) using SQL Server Management Studio

Capture3

3) Create a new database in SQL Server 2008 for your project (say testproject) and choose testuser as Owner

Capture3

4) Create a new ODBC DNS

Control Panel -> Administrative Tools -> Data Sources (ODBC)

Capture5

Add a new ‘User DSN’,  choose SQL Server,  give a name for DSN (say testprojectconn) then configure SQL Server authentication.

5) Now create your rails application as usual.  Configure db connection using database.yml as follows

  adapter: sqlserver
  mode: odbc
  dsn: testprojectconn
  host: localhost
  username: testuser
  password: testpass
  encoding: utf8

Thats it!

This blog post deals with VPNC (http://www.unix-ag.uni-kl.de/~massar/vpnc/) : an alternative to Cisco’s linux version client.  If you happy with cisco’s client and were able to install it successfully then you can skip the rest of the blog. 

Most of the information can be found at original sources http://wiki.centos.org/AdditionalResources/Repositories/RPMForge  and http://wiki.centos.org/HowTos/vpnc 

Only issue you might face is installing yum prorities using yum. That is broken in CentOS 5.3 (atleast til I tried). So here are the steps involved. 

1) Install Yum Prorities

Install prorities using rpm instead of yum.

wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/yum-priorities-1.1.16-13.el5.centos.noarch.rpm    
rpm -ivh yum-priorities-1.1.16-13.el5.centos.noarch.rpm
                     
2) Check if plugin is enabled (see http://wiki.centos.org/AdditionalResources/Repositories/RPMForge for details)

nano /etc/yum/pluginconf.d/priorities.conf

3) Update Proirities for repo files

nano /etc/yum.repos.d/CentOS-Base.repo

4) Install rpm forge

wget http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -i rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

5) Update prority for rpmforge repo file

nano /etc/yum.repos.d/rpmforge.repo

6) Update yum to start using priorirites and rpmforge as source.

yum check-update

7) install VPNC

yum -y install vpnc

Now vpnc is installed.  Follow http://wiki.centos.org/HowTos/vpnc to know how to use it.

Once in a while we been in situations where you need to quickly understand/analyze a database given to you by others.  We can go through each table and try to understand but it is usually lot simpler if you can visualize all the tables involved and relationships between those.  Enter SchemaSpy: a free tool to do that.    For sake of specifics, say the database given is MySQL and your pc is running some version of Windows.

A. Download and Install Pre-requsites (if you dont have already)

B. Download latest SchemaSpy Jar File  from http://sourceforge.net/projects/schemaspy/files/   (In my case it is schemaSpy_4.1.1.jar)  to a known location (using same C:\mydblayout)

Now run the schemaspy to generate report (html format) for database “mytestdb”  which is sitting at a local mySQL server.

C:\mydblayout>java -jar schemaSpy_4.1.1.jar -t mysql
 -dp mysql-connector-java-5.1.10\mysql-connector-java-5.1.10\mysql-connector-java-5.1.10-bin.jar
-db mysql -host localhost -u root -p mysecretpass -o mytestdb_report

See how -dp flag is used to point to jdbc driver.  The above command creates a folder called “mytestdb_report”  with all the nice html files.  Just open the “index.html” file.

For example output see http://schemaspy.sourceforge.net/unifieddb/characters/index.html

For more details, look at web page of  this wonderful SchemaSpy (http://schemaspy.sourceforge.net/) written by John Currier.

Close all IE8 windows…
if you have any IE window open, then VS cant start debugger….
Its not a problem with VS2008

Close all IE8 windows…

if you have any IE window open, then VS cant start debugger….

Its not a problem with VS2008 onwards.

Follow

Get every new post delivered to your Inbox.