Blog

Blog Archives - 7 Record(s)

Remove Filter Year: '2005' - Month: '11'

How to install the new MySQL JDBC driver on Coldfusion MX7

Posted by Luis Majano
29 Nov 2005 12:00 AM
I needed to upgrade my coldfusion JDBC drivers for MySQL since I upgraded my release to 5.0 and here is the little how to.

1) Donwload the JDBC drivers from here:

http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-3.1.11.zip/from/pick

2) Extract the archive and copy the following file:

mysql-connector-java-3.1.11-bin.jar

to the following destination:

J2EE

{j2ee path}/servers/lib

If you want it available to all servers or just for the Coldfusion app then:

{cfmx instance path}/cfusion-ear/cfusion-war/WEB-INF/lib

Standalone

{cfmx path}/wwwroot/WEB-INF/lib

3) Restart your CFMX instance or server.

4) Go to your Datasources in your coldfusion administrator to register a new datasource:

Name: {Your datasource name}

JDBC URL: jdbc:mysql://{your host}:3306/{your database}

Driver Class: com.mysql.jdbc.Driver

Driver Name: MySQL 5.0

User Name: {Username}

Password: {Your Password}

And that is it.

How to mount a remote ssh filesystem on ubuntu

Posted by Luis Majano
22 Nov 2005 12:00 AM
I have been fooling around with CFEclipse for a while, and one of the things it still lacks is full FTP support. For some reason my VSFTP at home on my Ubuntu box was throwing a out of index error on Eclipse. So I decided to mount my filesystem via ssh, for more security, on my Ubuntu distro on a laptop.

The following is a guide of how to mount an SSH filesystem using sshfs on Ubuntu (Breezy 5.10).

Please note that SSH is a more secure protocol than ftp or Samba.

The first thing you need to do is install sshfs via the apt-get utility. Below is a description of sshfs:

sshfs is a filesystem client based on the SSH File Transfer Protocol.

Since most SSH servers already support this protocol it is very easy to

set up: i.e. on the server side there?s nothing to do. On the client

side mounting the filesystem is as easy as logging into the server with

ssh.

Install sshfs by doing a:

$sudo apt-get install sshfs

This will install fuse-utils and libfuse2 which are required. After the install is successfull then you will need to change the permissions on the following file in order to run an sshfs command.

$sudo chmod +x /usr/bin/fusermount

This will allow your user to run the fusermount command, which is used by sshfs to mount ssh filesystems.

After this you are ready to use the command. However, you will need to create the mount point of where you want the ssh directory to be mounted. Let's say that you want to connect to the following directory in your server via ssh: "/MyDocuments" and you want to mount this directory in the following local directory: "/home/luis/Mounts/MyDocuments"

If this is the case then I would run the following command to mount the ssh filesystem:

$sshfs [email protected]:/MyDocuments /home/luis/Mounts/MyDocuments/

After you run this command you will be prompted for your account password. Once you successfully enter your password, your filesystem will be mounted.

Please remember that if you want to mount an ssh filesystem, you need to have an active SSH account on the system you are trying to connect to.

Now if you need to unmount the filesystem, then run the following command:

$sudo umount /home/luis/Mounts/MyDocuments/

And you will unmount the ssh filesystem.

You can find much more information about ssh and ubuntu in the following location:

http://fuse.sourceforge.net/sshfs.html

And there you go.

ASP vs CFMX!! CFMX by far beats ASP in functionality

Posted by Luis Majano
10 Nov 2005 12:00 AM
I have just finished installing a custom DHTML editor for a friend on his ASP website. However, I had to actually make the javascript work with his ASP backend. And phew!!! Let me tell you, WHAT A PAIN ASP IS!!!

I had completely forgotten how incredibly painful ASP is. Coldfusion is by far a more robust and simpler web application framework than ASP.

I practically had to build my own JSStringFormat function, already available in Coldfusion, for ASP. Basically, breaks and carriage returns in ASP were completely throwing Javascript off. So I had to build a small function to string replace these characters into "escaped" Javascript friendly items.

For those ASP users, which I believe are in the dark ages, here is the little snippet.

Private Function Strip(byVal string)

Strip = Trim( Replace( Replace( Replace( string, vbCrLf, "\n" ), chr(10), "\n" ), chr(13), "\n" ) )

End Function

I had to also try to remember how simple recordsets worked in ASP, OHH MY GOD, the dreaded ADODB.recordset.

Anyways, this post is to enlighted the ASP community to please see the light, COLDFUSION!!

My del.icio.us Account

Posted by Luis Majano
10 Nov 2005 12:00 AM
I just created my del.iciou.us account. You can find it here:

http://del.icio.us/lmajano

Please post any url's you find interesting and enjoy my links. I will start posting and transfering them shortly.

Ray Camden's New Blog CFC 4.0

Posted by Luis Majano
10 Nov 2005 12:00 AM
Ray Camden has just released his new BlogCFC 4.0. I will be shortly implementing his software and updating my blog.

I truly recommend this blog software. It is incredibly easy to install and customize to your own needs.

Keep up the great work Ray!!

Java's gettickcount(), How to get the current time in milliseconds

Posted by Luis Majano
07 Nov 2005 12:00 AM
Coldfusion has a great function called "gettickcount()" which basically gives you the current time in milliseconds. This is a great function to time code. Look at the example below:

<cfset stime = getTickCount()>

<!--- All my code to time here --->

<cfloop from="1" to="100" index="i">

<cfoutput>testing #i#</cfoutput>

<!--- Make a call here --->

</cfloop>

<cfset totalTime = getTickCount() - stime>

<cfoutput>The total time of execution for the code was: #totalTime#</cfoutput>

This utility is great. The question is, how do I do this in Java?? Well very simple, we use the System class. The following is a simple snippet of how to time in java.

double stime = System.currentTimeMillis();

//My Code Here


for(int i=0;i< 1000; i++){

System.out.println(i);

}

double TotalTime = System.currentTimeMillis() - stime;

//Display Total Time


System.out.println("Total Time of Execution: " + TotalTime + "ms.");

There you go!! Now you can time your java code.

Upgrade MySQL 5.0.13 to 5.0.15 Guide

Posted by Luis Majano
07 Nov 2005 12:00 AM
I just finished upgrading my MySQL Release Candidate installation to the Final MySQL 5.0 Release and found and interesting tip. My OS is Ubuntu 5.10 and I had MySql 5.0.13 RC installed. The following is my setup:

MySQL Install Dir:

/opt/mysql-standard-5.0.13

MySQL Link

/usr/local/mysql ==> /opt/mysql-standard-5.0.13

To upgrade to the new release, I downloaded the Linux (x86, glibc-2.3, dynamic, gcc) Standard Binary

I then extracted the archive to the following location:

/opt/mysql-standard-5.0.15

I continued to copy all of my data folder from my previous install to the new install. Now I fired up a terminal to fix the permission, groups and ownerships following the readme. Below is what you need to do:

shell> cd to /usr/local/mysql

shell> chown -R root .

shell> chown -R mysql data

shell> chgrp -R mysql .

The first command changes the owner attribute of the files to the `root' user. The second changes the owner attribute of the data directory to the `mysql' user. The third changes the group attribute to the `mysql' group.

I then proceed to startup my database. I use webmin, if not just type in the following command:

shell> bin/mysqld_safe --user=mysql &

Everything should be working great now. However, my InnoDB structure databases are somehow "FLOPPED." For some reason, which I still have not been able to figure out, the tables are not working. So a simple workaround, is just to do a simple backup of your InnoDB databases using the MySQL Administrator and then importing them back to the new install. This actually is the approach that the MySQL manual advices.

So there it is, simple, yea right!! MySQL Upgrade.

Site Updates

Entries Search