Getting line numbers to show up in CFeclipse on OSX

I found that when I installed eclipse and CF eclipse on my new Mac I did not have line numbers. I made sure the preference for show line number was turned on in the preferences, but the line number still would not show up. I put up with it for a while but, then I broke down and googled this issue. The fix was really simple.

Open the "org.cfeclipse.cfml.prefs" file found (your workspace folder\)".metadata\.plugins\org.eclipse.core.runtime\.settings\" add "lineNumberRuler=true" Save file, start cfeclipse.

Note these files are hidden, you will have to use Textwranger or Textmate's ability to view / edit hidden files. (or do the "defaults write com.apple.Finder AppleShowAllFiles YES" and "KillAll Finder" trick)

Using Conditional Comments to detect IE

I can never remember how this code goes, so I thought I would post it on my blog. I often use this to add a chunk of CSS to a page to fix a CSS bug in IE.

<!--[if gte IE 8]>
<p>You're using a recent version of Internet Explorer. You should upgrade your copy of Internet Explorer to Firefox or Chrome</p>
<![endif]-->


<!--[if lt IE 7]>
<p>Hm, You're using an older version of Internet Explorer. You should upgrade your copy of Internet Explorer by downloading Firefox or Chrome</p>
<![endif]-->
See the complete set of info and other methods: http://msdn.microsoft.com/en-us/library/ms537509.aspx#UsingCCs

PHP Get Data From MySQL Database

It seems that you can learn something new every day if you want to. I did not know that there was this many "standardish" ways to loop over a database query and output the results in php. I did know that two of them existed, and suspected that others existed.

http://www.php-mysql-tutorial.com/php-mysql-select.php

As always this is for my own reference, but feel free to use what you find.

Update one Table's data from another table in MYSQL

From time to time I need to update lots of records on a production MySQL server from a data on a development SQL server. There are some fairly impressive tools for doing this, BUT in this case all I have is phpMySQLAdmin on the production server. I have used this "Cross Table Update" before, but it still takes me about 20 mins to find the example query. So, I thought it would be handy to put it in my blog.

UPDATE TrainingCourse A
INNER JOIN trainingcourse_Updates B
ON A.ID = B.ID
SET A.CourseDescription = B.CourseDescription, A.AgendaDescriptionLink = B.AgendaDescriptionLink

Just a bit of explanation: CourseDescription and AgendaDescriptionLink are the two fields that need to be updated in the table TrainingCourse from the table trainingcourse_Updates. trainingcourse_Updates has 3 columns in this case, ID, CourseDescription and AgendaDescriptionLink.

Ever wonder about the XML config files in ColdFusion

As most of you know, every setting in the CF administrator is stored in XML files in the CF application folder. There are a few setting in these xml files that are not available in the CF admin.

Though, trying to find out what XML file contains what settings have often lead me to turn to google and blindly do search after search, until I found some blog entry talking about using the jrun-web.xml file to change the port number of the built in webserver not the web.xml file.

So, I thought... Someday when I have lots of time, I would map out what is stored in each xml file. Well Adobe beat me to doing it. Thank you Adobe!

Purpose and location of XML configuration files used in ColdFusion MX
http://kb.adobe.com/selfservice/viewContent.do?externalId=94a16ba6

Verity Spider set up notes

Here is the best how-to I can find for setting up Verity Spider:

http://www.leavethatthingalone.com/blog/index.cfm/2005/8/16/CF7spider
Notes:

  • The config file needs to be in one line.
  • Do not include the collection name as part of the path
  • Create the collection with the bat file first, then make / map to it from the CF admin
  • If collection has already existed, you may not be able to recreate it with out deleting workspace files. AKA "Path not found error"
  • If all else fails, recreate collection with a new name.
  • Select Englishx in the CF admin

    • Tech note: http://kb.adobe.com/selfservice/viewContent.do?externalId=cfe19ecb

Windows 2003 Server FTP and Firewall Passive port range tweak

On Windows 2003 Server with IIS6

  • To Enable Direct Metabase Edit
    1. Open the IIS Microsoft Management Console (MMC).
    2. Right-click on the Local Computer node.
    3. Select Properties.
    4. Make sure the Enable Direct Metabase Edit checkbox is checked.
  • Configure PassivePortRange via ADSUTIL script
    1. Click Start, click Run, type cmd, and then click OK.
    2. Type cd Inetpub\AdminScripts and then press ENTER.
    3. Type the following command where the range is specified in "..". cscript.exe adsutil.vbs set /MSFTPSVC/PassivePortRange "5001-5201"
    4. Restart the FTP Publishing Service.
  • You'll see the following output, when you configure via ADSUTIL script:

    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

    PassivePortRange : (STRING) "5001-5201"

  • Add each port to the Windows Firewall
    1. Click Start, click Control Panel, open Windows Firewall, and select the Exceptions tab.
    2. Click the Add Port button.
    3. Enter a Name for the Exception and the first number in the port range.
    4. Click TCP if not already selected and click OK.
    5. Repeat for each port in the range - for large ranges see the end of the document.
    6. Enable the Windows Firewall on the General Tab.


To add a range of ports to Windows Firewall from the Command Line
  1. Click Start, click Run, type cmd, and then click OK.
  2. Type in the following where the range is specified in ( ) and the name of the firewall entry is in " ".
    FOR /L %I IN (5001,1,5201) DO netsh firewall add portopening TCP %I "Passive FTP"%I
  3. Each port in the range will be added with an "OK" confirmation.

This info was taken directly from: http://www.newagedigital.com/cgi-bin/newagedigital/articles/ms-firewall-ftp.html I post this here on my blog as my personal reference.

Disable SSL2.0 on Windows webserver IIS

Open Regedit
Go to:
HKey_Local_Machine\System\CurrentControlSet\Control\SecurityProviders \SCHANNEL\Protocols\SSL 2.0\Server
Add new DWORD, In the Value Name box, type "Enabled", and then click OK.
Reboot or restart IIS. Not sure if only restarting IIS will do it.

Import PFX SSL Cert into IIS

If you just imported all of your IIS site via the export / import site method. You will have several sites that reference a SSL certs that do not exist on your system yet. To import the ssl certs you can get started by, simply importing the .PFX file into IIS by getting the site properties clicking on the directory security tab, click view cert (IIS Cert Wizard), then remove existing "dead" cert, then go back into the view cert / IIS Cert Wizard, select import a cert from a .pfx file, Enter password and you are done.

Here is a second way:

In order to view the Certificates store on the local computer, perform the following steps:

1. Click Start, and then click Run.
2. Type "MMC.EXE" (without the quotation marks) and click OK.
3. Click Console in the new MMC you created, and then click Add/Remove Snap-in.
4. In the new window, click Add.
5. Highlight the Certificates snap-in, and then click Add.
6. Choose the Computer option and click Next.
7. Select Local Computer on the next screen, and then click OK.
8. Click Close , and then click OK.
9. You have now added the Certificates snap-in, which will allow you to work with any certificates in your computer's certificate store. You may want to save this MMC for later use.

Now that you have access to the Certificates snap-in, you can import the server certificate into you computer's certificate store by following these steps:

1. Open the Certificates (Local Computer) snap-in and navigate to Personal, and then Certificates.

Note: Certificates may not be listed. If it is not, that is because there are no certificates installed.
2. Right-click Certificates (or Personal if that option does not exist.)
3. Choose All Tasks, and then click Import.
4. When the wizard starts, click Next. Browse to the PFX file you created containing your server certificate and private key. Click Next.
5. Enter the password you gave the PFX file when you created it. Be sure the Mark the key as exportable option is selected if you want to be able to export the key pair again from this computer. As an added security measure, you may want to leave this option unchecked to ensure that no one can make a backup of your private key.
6. Click Next, and then choose the Certificate Store you want to save the certificate to. You should select Personal because it is a Web server certificate. If you included the certificates in the certification hierarchy, it will also be added to this store.
7. Click Next. You should see a summary of screen showing what the wizard is about to do. If this information is correct, click Finish.
8. You will now see the server certificate for your Web server in the list of Personal Certificates. It will be denoted by the common name of the server (found in the subject section of the certificate).

Now that you have the certificate backup imported into the certificate store, you can enable Internet Information Services 5.0 to use that certificate (and the corresponding private key). To do this, perform the following steps:

Migrate IIS SSL Certs to a new server

Create an MMC Snap-in for Managing Certificates

In order to perform the backup, you must first create a new MMC and add the Certificates snap-in. You can also add the snap-in to another MMC as long as it is opened in Author mode.



Use the following steps to create a new MMC and add the Certificates snap-in:

1. Click Start , and then click Run.
2. Type in "MMC.EXE" (without the quotation marks) and click OK.
3. Click Console in the new MMC you created, and then click Add/Remove Snap-in.
4. In the new window that appears, click Add.
5. Highlight Certificates , and then click Add.
6. Choose the Computer account option and click Next.
7. Select Local Computer on the next screen, and then click OK.
8. Click Close , and then click OK.

You have now added the Certificates snap-in, which will allow you to work with any certificates in your computer's certificate store. You may want to save this MMC for later use.

Export a Certificate and Public Key

Now that you have added the Certificates snap-in, you can export the key pair that your Web server is using (the certificate and public key). To do this, perform the following steps:

1. Open the Certificates (Local Computer) snap-in you added in the last section, navigate to Personal, and then to Certificates.
2. You will see your Web server certificate denoted by the CN (Common Name) found in the Subject field of the certificate (using Internet Explorer 5.0, you can easily view the certificate to see the Common Name if you are unsure).
3. Right-click on the server certificate, select All Tasks, and then click Export.
4. When the wizard starts, click Next. Choose to export the private key, and then click Next. NOTE: If you export the certificate for use on an IIS Web server, do not select Require Strong Encryption. This option causes a password prompt every time an application attempts to access the private key, and causes IIS to fail.
 
5. The file format you will want to choose is the Personal Information Exchange MB Note: Select PFX and deselect all other options, go to next step...

(though you can select from several options). This will create a PFX file. Notice that you can export any certificates in the certification path by selecting the option on this screen. This is very handy if your certificate was issued by a non-trusted certificate authority (for example, Microsoft Certificate Server). Only choose delete the private key if the export is successful to be sure it is not left on the computer (for example if your migrating from one server to another).NOTE: If you do not select "Include all certificates in the certificate path if possible" and the issuer of the certificate is not trusted by your server, then you may notice that when the properties of the certificate are viewed, the "This certificate is issued to:" field may display "Windows does not have enough information about this certificate". This is by design and can be resolved by selecting "Include all certificates in the certificate path" while exporting the certificate.
 

6. Click Next, and then choose a password to protect the PFX file. You will need to enter the same password twice to ensure that the password is typed correctly. When you have completed this step, click Next.
7. Choose the file name you want to save this as. Do not include an extension in your file name; the wizard will automatically add the PFX extension for you.
8. Click Next, and then read the summary. Pay special attention to where the file is being saved to. If you are sure the information is correct, choose Finish.

You now have a PFX file containing you server certificate and its corresponding private key. Be sure to protect this file! You may want to move it to a floppy disk and store it somewhere safe from outside disturbance. Keep in mind, if you run a backup on the server, this file may be saved in that backup if it is still on the server.


This info was found here at MS's website. I am reproducing it here for my own notes.

Show hide sub form based on radio button with jquery

I wrote this chunk of code and ended up not using it. So, I thought I would just save it here for my reference, but if it helps anyone...

<script type="text/javascript" src="../js/jquery-1.2.6.pack.js"></script>
<script language="javascript">
function showHide(obj)
{
var showDiv = "#"+obj;
$("div").slideUp("slow");
$(showDiv).slideDown("slow");
}
</script>
<input type="radio" name="honormemory" onChange="showHide(this.value)" value="honor" id="input_radio_honor"> <label for="input_radio_honor">In Honor of:</label><br>
<div id= "honor" style="display:none">   
   Name: <input type="text" size="30" maxlength="36" name="" value=""><br>
   Pass: <input type="text" size="30" maxlength="36" name="" value=""><br>
   Foo: <input type="text" size="30" maxlength="36" name="" value="">
</div>
<input type="radio" name="honormemory" onChange="showHide(this.value)" value="memory" id="input_radio_memory"> <label for="input_radio_memory">In Memory of:</label>
<div id= "memory" style="display:none">
   Name: <input type="text" size="30" maxlength="36" name="" value=""><br>
   Pass: <input type="text" size="30" maxlength="36" name="" value=""><br>
   Foo: <input type="text" size="30" maxlength="36" name="" value="">
</div>

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.001. Contact Blog Owner