Archive

Archive for January, 2009

Path to php.ini is incorrect in phpinfo() on Windows

January 28th, 2009 No comments

I just did a manual install of php on a windows xp box using IIS and no mysql server.  The mysql server is on another box.  However, in order to get my scripts to work with the mysql server, I need to load the php_mysql extension within the php.ini file.

I was able to get PHP running correctly (the file-level permissions are really picky if your running into trouble) but I  noticed from phpinfo() that the mysql extension was not showing up and that path to php.ini was not correct.

By default PHP recommends placing the php.ini file in the same directory as the other php files, usually something like c:\php.  However, even when the windows system path variable is setup and the machine rebooted, php is not looking for its own .ini file.

The resolution is to place the php.ini file in the C:\windows directory and restart the web service.  Apparently php is compiled with the windows directory as default and doesn’t want to change the path.

Deleting a Windows Service Manually

January 23rd, 2009 No comments

sc delete [servicename]

You should probably check to see that the service is stopped, and use this as a last resort.

Categories: Windows 2003 Server Tags:

Applying Group Policies to Outlook 2007

January 22nd, 2009 No comments
Categories: Windows 2003 Server Tags:

Scheduling a task to execute in ASP.Net

January 15th, 2009 No comments

I came across this article when I was looking into scheduling the execution of a ASP.Net script nightly:

http://www.asp101.com/articles/john/schedule/default.asp

The best part of the article is the HttpRequestor.vbs script, which is a very lightweight script to execute a webpage with no other program or desktop interaction needing to be performed.  To execute a webpage in a schedule task, you would put in something like “C:\path\HttpRequester.vbs http://localhost/ScheduleMe.asp".

Note:  There is a similar HttpRequest.vbs script going around, that is much, much heavier than this one.  Don’t confuse the two.

Attached files:
HttpRequestor.vbs

Categories: ASP.Net Tags:

Assigning a null value to some ASP.Net parameterized queries

January 14th, 2009 No comments

In some situations an error will be thrown when trying to assign “null” to a parameter for a query.  In this situation, assign “DBNull.Value” to the parameter.

Example:

thisCommand.Parameters.Add(“@datLastCalExpr”, System.Data.SqlDbType.DateTime).Value = DBNull.Value;

Categories: Uncategorized Tags:

Adding a single quote into a database using ASP.Net

January 14th, 2009 No comments

Want to add a single quote into a database using ASP.NET without the PITA factor of escaping strings?

Use parameterized queries!

http://www.4guysfromrolla.com/webtech/092601-1.2.shtml

Categories: ASP.Net Tags:

Printing directly from PHP

January 12th, 2009 No comments

The inherent nature of PHP makes it difficult to print directly from a PHP page.  PHP is a web based scripting language that is based on a server/client architecture.  For security reasons, PHP tries to maintain a separation from the server and any printers attached to the server.

Luckily for us, this separation is not perfect, and there are ways around it.

Two possible methods for printing directly from PHP

  • Use the embedded printer functions in PHP (windows only)
  • Use the embedded program execution functions in PHP to execute scripts (linux or windows)

The method I came up was using the embedded printer functions in PHP.  My main web server was linux based, but I setup a separate windows server running IIS and PHP to facilitate direct printing.  The linux server does a server request to the windows server, and passes a query string of information.  The windows server then takes this query string information and uses it to print something directly to a printer.  This method is very stable and was made the primary method for printing from an ERP system for a large warehouse.

Requirements:

  • Windows XP or 2000 web server
  • IIS installed
  • PHP installed
  • Php_printer.dll from PECL extensions (http://pecl.php.net/)

Instructions:

  • Copy the php_printer.dll into the php extensions directory.
  • Edit the php.ini, in the windows extensions section, add the entry “extension=php_printer.dll” after the php_sqlite item
  • Install printers onto the server
  • Install a code39 font if barcodes are desired
  • From this point forward, use the printer functions build into PHP to send print jobs directly to a printer attached to the server. (http://us3.php.net/manual/en/book.printer.php)

Code samples coming soon.

Categories: PHP Tags: , ,

Replacing the input shaft bearing in a Honda Civic and Civic Del Sol Transmissions

January 11th, 2009 No comments

Identifying:

Transmission makes grinding noises at lower rpms in gear and chattering noises at idle in neutral with the clutch out (engaged).  Chattering/grinding noises in neutral and in gear go away as soon as the clutch is pressed in (disengaged).  High rpm whining may be present also in gear with the clutch out.  The transmission will need to be removed, opened, and the input shaft bearing replaced.

If the noise occurs when the clutch is disengaged (in) but not engaged (out), then the problem is most likely your throwout bearing.   Throwout bearing replacement requires the transmission to be removed, but the transmission itself will not need repair.

Tools needed
10, 12, 14, 17, 19, 32 mm sockets
Impact gun (may be needed to remove axle nut)
Breaker bar (removing axle nut)
Ball joint separator
Pry bar (removing axles, transmission)
Hammer
Screwdrivers
Needle nose pliers
Punch or awl (removing shift linkage pin)
Helms Manual (92-95 Civic shop service), a definite must!
Haynes Manual (preferred, but not required)
Transmission jack (you can try doing it by hand, but I wouldn’t recommend it)
Jack, jack stands
3 Jaw Bearing puller (cheap at harbor freight.  Not required, but preferred)

Parts needed
Clutch kit, or at the very least, a clutch alignment tool
Bearing grease
Silicone gasket maker
2 new axle nuts
Input shaft bearing
Input shaft oil seal

The helms manual is an absolute must, available here.  If you don’t want to pay the crazy price, download it online, its available in lots of places.  The haynes manual is also helpful, as our online sources reference at the end of this article.

A few tips before you begin:

  • Organize bolts/small parts in ziploc bags and label them!  Do NOT skip this part!
  • Buy a clutch kit, your taking off the transmission already, you don’t want to take it off again to replace a clutch.
  • Take the flywheel off and get it turned if you put in a new clutch.
  • Do yourself a favor, get 4 jack stands and jack the car as high as possible on all four corners, it will be worth it.
  • If you have an intermediate driveshaft, you do not need to remove it from the rest of the driveshaft.  Just remove the entire axle.
  • When you are attempting to spread the snap ring to separate the transmission housings, pry apart the housings carefully.  This will make it much easier to separate the housings.
  • Make sure you align the interlock guide bolt with the groove under the shift arm when you reassemble, its easy to forget this part.

To remove the transmission and to fix the transmission, follow the helms manual and this simple walkthrough, pulled directly from http://honda-tech.com/showthread.php?t=596873

Primary Sources:

http://honda-tech.com/showthread.php?t=596873
http://honda-tech.com/showthread.php?t=811691
http://honda-tech.com/showthread.php?t=2048165
http://www.honda-tech.com/showthread.php?t=1740097
http://www.autozone.com/az/cds/en_us/0900823d/80/14/1f/96/0900823d80141f96/repairInfoPages.htm
http://www.autozone.com/az/cds/en_us/0900823d/80/14/21/21/0900823d80142121/repairInfoPages.htm

Additional sources:

http://honda-tech.com/
http://www.solsociety.com
http://www.superhonda.com
http://www.hondacivicforum.com
http://www.civicforums.com/
http://www.jdmcivic.com