Starting a fire(fox) 
Tuesday - February 13, 2007, 02:30 PM
Occasionally when running Firefox on OS X with the Mac version of roaming profiles the lock file Firefox creates does not get deleted resulting in an error which states that Firefox is already running and needs to be closed.


Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system.


To fix this delete the .parentlock file found under the users profile on the server in OS X or on the local machine for windows.

Mozilla has a page dedicated to the location of the user profile.

Where's My Profile


[ 42 comments ] ( 140 views )   |  permalink  |   ( 3 / 4025 )
Force an SSL connection using PHP 
Sunday - July 2, 2006, 02:28 PM - Web Authoring, Scripting, PHP
Got some sensitive information and want your users to be forced into an SSL connection. Here's a quick and easy little code snippet you can put at the top of the page to secure.
if ($_SERVER['HTTPS'] == 'off') { 
	$header_string = "Location:https://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
	header ($header_string); // Redirect to SSL connection
	exit; // Kill this script
}


[ 235 comments ] ( 485 views )   |  permalink  |   ( 3 / 329 )
Update Mcafee Anti-Virus using a Super DAT from the command line. 
Saturday - July 1, 2006, 05:23 PM - Scripting, Command Line
Should you ever need to force an update to McAfee Anti-Virus, this script will copy the latest SuperDAT update from a local server and initiate a forced silent installation. After the SDAT is executed it uses a WMI query to search for the process. Once the process has terminated it will clean up after itself.

Be sure to change the path to your server in the Copy section.

Enjoy!

@ECHO off
ECHO -------------------------------------------------------
ECHO - mcafee_sdat_update.cmd  - Larry Wickham - 7/1/2006
ECHO -
ECHO - Purpose: COPY the latest sdat update file from a UNC
ECHO -          path and execute it using the SILENT and
ECHO -          FORCE options.
ECHO -
ECHO -------------------------------------------------------

ECHO     COPY file from UNC path
ECHO -------------------------------------------------------

COPY \\SERVER\SHARE\sdat*.exe .

ECHO     Generate a batch file to execute it
ECHO -------------------------------------------------------

ECHO @ECHO off > sdat_update_child.cmd
ECHO ECHO ***** sdat_update_child.cmd initiated > sdat_update_child.cmd
DIR /b sdat*.exe > sdat.list
FOR /F %%i in (sdat.list) DO ECHO %%i /SILENT /F >> sdat_update_child.cmd 

ECHO     Execute the batch file
ECHO -------------------------------------------------------

CALL sdat_update_child.cmd


ECHO     Checking operating system version 
ECHO -------------------------------------------------------
VER | find "XP" 
IF !%errorlevel%! == !1! GOTO EXIT

ECHO Windows XP detected

ECHO     Wait for process to complete
ECHO -------------------------------------------------------

:CHECK_FOR_PROCESS
WMIC PROCESS get Caption,Processid | find "sdat" /I
IF !%errorlevel%! == !0! GOTO CHECK_FOR_PROCESS


ECHO     Clean up
ECHO -------------------------------------------------------

DEL sdat_update_child.cmd
DEL sdat*.exe

:EXIT


[ 40 comments ] ( 127 views )   |  permalink  |   ( 3 / 4846 )
Which compression method is best, quick survey. 
Saturday - July 1, 2006, 01:54 AM - Misc. Computing
At work today there was a bit of debate as to which compression method was best. I personally did not have a preference in the discussion but my curiosity was ignited. I decided to do a little test to see which method was the best. I fired up 7Zip and Win Rar to duke it out. Here are the results, taken directly from a command window.

100 Power Point template files, these are pretty big files with images inside.

Powerpoint Tmpl 100 File(s) 7,481,344 bytes
4,454,809 Powerpoint Tmpl.7z
4,926,588 Powerpoint Tmpl.rar
4,948,264 Powerpoint Tmpl.zip

Best Compression: 7 Zip 59.55% of the original size.

Now how about plain old text files, I grabbed 100 RFCs and zipped them up.

rfc (text) 100 File(s) 5,515,893 bytes
898,401 rfc (text).7z
1,068,499 rfc (text).rar
1,345,080 rfc (text).zip

Best Compression: 7 Zip 16.29% of the original size.

Now what about a distributed setup file, it already has some files compressed in to it. Behold windows media player 11 beta installation. This should be interesting...

wmp11-windowsxp-x86-enu.exe 1 File 24,070,456 bytes
24,030,963 wmp11-windowsxp-x86-enu.zip
24,070,547 wmp11-windowsxp-x86-enu.rar
24,312,838 wmp11-windowsxp-x86-enu.7z

Best Compression: Zip 99.83% of the original size.

The verdict, just as it has always been the best compression method depends on what you are compressing. Based on this simple test 7Zip seems to be great for just about anything, unless you are packaging a bunch of setup files in which case the Zip method seems best.

What makes this whole comparison even better is 7Zip is licenced under the GNU LGPL, which makes it easy to afford. Right now development is moving along nicely as evidenced by the 3 release versions (4.23-4.42) posted on the 7zip home page in the last year.

http://www.7zip.org

[ 36 comments ] ( 114 views )   |  permalink  |   ( 3 / 2252 )
Vista Nueva, Portales New Mexico 
Wednesday - June 28, 2006, 01:48 AM - Hosted Sites


[ 37 comments ] ( 123 views )   |  permalink  |   ( 3 / 4589 )

Next