Archive

Archive for the ‘For Geeks Only’ Category

Installing ColdFusion 8 on Ubuntu

June 19th, 2010

Although not officially supported by Adobe, ColdFusion 8 can be successfully installed and run on Ubuntu.

The following can be used for installing ColdFusion on Ubuntu 10.04 (32 bit):

Make sure that Apache (sudo apt-get install apache2) and and libc6-i686 are installed (sudo apt-get install libc6-i686).

sudo ./coldfusion-801-lin.bin

Specify the following:

Apache Configuration Directory: /etc/apache2
Apache Binary File: /usr/sbin/apache2
Apache Control File: /etc/init.d/apache2

sudo /etc/init.d/apache2 restart

For Geeks Only

WordPress - Exclude Posts From Certain Categories On Home Page

June 19th, 2010

If you want to exclude posts from certain categories you can add the following to your index.php page for the given theme that you are using.

Before the block of code that checks for posts with have_posts just add the following:


This line of code, along with the surrounding code is:



        

To determine the category ID’s you can log into the WordPress administration area and look at the links for the category ID’s. The - in front of the category ID’s above specifies that those category id’s won’t be shown.

For Geeks Only

IE7 and Flash Plugin Behavior

February 6th, 2009

Two weeks ago, I started to experience some issues with my Flash plugin in IE7.  Some sites that previously detected my plugin correctly, were now reporting that I had the incorrect version of the plugin installed.  Every time I went to Adobe’s Flash site to install the plugin, it would tell me I had the most recent version installed.  I performed a number of uninstalls and reinstalls, to no avail.  I scoured the web for other people who were having the same problem.  It appears that there are a lot of people having similar issues!  There were even some very detailed fixes posted on some of the sites that I found.  I tried them all.

Most people would say, “why not just use FireFox as your browser?”  Well, I use IE7, FF3, and Safari for Windows on a regular basis to test client projects and ensure browser compatibility.  So it was not acceptable that the browser that still holds the biggest share of the market was not working for me.  But I couldn’t find a solution.

Last night, I found an obscure article, that had nothing to do with Flash, but did mention some weird behavior in IE7 under a very particular condition.  That particular condition was, the user-agent string reported by the browser to servers being longer than 260 characters.  After I read that, I did a quick check on my browser user-agent string, and found it to be approaching 300 characters!  It seems with the addition of some other plugins and software to my machine a few weeks ago, I pushed myself over this obscure and rarely documented threshhold.

To fix this problem, I had to edit my registry, and remove some of the things that IE7 was reporting back in my user-agent.  While I offer this as the solution that worked for me, I note that editing your registry can be a risky endeavor, and should not be taken lightly.  Make sure you set a restore point for your machine before you touch your registry.

The list of values that are reported in the user-agent can be found in the following location in your registry:

HKEY_LOCAL_MACHINE|SOFTWARE|Microsoft|CurrentVersion|Inernet Settings|5.0|User Agent|Post Platform

I removed a few of the values there (right click, chose “delete”) and restarted my browser.  Voila!  Problem solved!

Fixes, For Geeks Only , , , ,

Accessing NTFS Partitions From Linux

January 28th, 2009

The following steps can be used to access an NTFS partition from Linux.  We did this in order to be able to connect a MyBook drive formatted with an NTFS partition to a Linux computer.

1. Download Fuse and NTFS-3G.

2. As a non root user untar fuse and ntfs-3g using tar -zxvf <file>

3. Change to the untarred fuse directory and run ./configure && make .  After that completes become root and run make install in the fuse directory.

4. Run lsmod

5. Run modprobe fuse

6. As a non root user change to the untarred ntfs-3g directory and run ./configure && make .  After that completes become root and run make install in the ntfs-3g directory.

7. You should now be able to run mount -t ntfs-3g /dev/<device> /mnt/<some directory>

For Geeks Only

Deleting an Open File in Linux

January 18th, 2009

Some applications such as Apache need to be restarted after deleting a log file.  One way to clear out the contents of a log file is to simply write the contents of /dev/null to the file by using the following command:

cat /dev/null > <somefile>

My guess is that this works because the file preserves the same inode so that the application can continue to write to the file.

For Geeks Only

Adding Virtual Hosts without Restarting Apache

January 18th, 2009

We had a requirement of setting up an Apache 2.2 / ColdFusion 8 web server that could have virtual hosts added throughout the day without any disruption to running pages.  Initially it looked like an Apache graceful restart would be a fine solution for this.  However, what we ended up finding is that any running ColdFusion pages actually received a”JRun Connector Protocol Error” message.

We confirmed that this issue existed by creating a ColdFusion page that outputted a message every second (using CFFLUSH to make it outputted to the screen).  While this was running we then ran “kill -SIGUSR1 `cat /var/run/httpd.pid`” and received the following message:

———-

Server Error
The server encountered an internal error and was unable to complete your request.
JRun Connector Protocol Error.

———-

It turned out that the solution was to use VirtualDocumentRoot instead of just the plain old DocumentRoot setting for a single virtual host.  This allowed specifying the $0 variable as part of the value.  So we ended up being able to have “VirtualDocumentRoot /somedir/$1″.  More information about using this solution can be found at the following URL:

http://httpd.apache.org/docs/2.2/vhosts/mass.html

For Geeks Only ,