December 30, 2004

Spam Research Tool -- SpamVampire

Scare away spammers?

Spam Research Tool -- SpamVampire

December 29, 2004

Want a free gmail account?

I thought about doing something like this but looks like this guy cornered the market.

isnoop.net gmail invite spooler

December 6, 2004

Using ColdFusion to work with SQL binary data

<CFSET FileName = "HotDogVendor.jpg">
<CFFILE ACTION="readbinary" FILE="D:\WebFiles\MyWebsite\Images\Postcards\#FileName#" VARIABLE="NEWDATA">

<cfset NewObject = toBinary(NEWDATA)>

<cfquery name="insertImage" datasource="MyDatasource" username="myusername" password="mypassword">
update images
set content = <CFQUERYPARAM VALUE="#NewObject#" CFSQLType="CF_SQL_BLOB">
where NAME = '#FileName#'
</cfquery>

...And now, how to output an image, which is stored in a SQL Server table as an image data type? Here is code which I found on another forum that appears to work (but still not the perfect solution):

<cfquery name="GetImage" datasource="MyDatasource" username="myusername" password="mypassword">
select content
from Images
where NAME = '#FileName#'
</cfquery>

<cfcontent type="image/gif; charset=8859_1">

<CFSCRIPT>
writeOutput(toString(GetImage.Content));
</cfscript>

November 24, 2004

Creating XP icons that work with VB

Things you will need:

  1. Illustrator or Freehand
  2. Photoshop
  3. Gamani GIF Movie Gear
  4. MSDN cheat sheet

Things you hopefully won't need:

Providing a proper VB Application Icon, Including Large Icons and 32-Bit Alpha Images


Its pretty simple once you've done it once.
  1. Build your icons for 48px, 32px and 16px.
  2. Take them into photoshop if they are not there already.
  3. Create a layered file with the three sizes in 32-bit color
  4. Save each size as a new file and covert it to index (256) color. This makes the 8-bit versions.
  5. Save each size as a new file with index (16) colors. This makes the 4-bit versions.
  6. Import the layered psd file plus the 6 other files into GIF Movie Gear.
  7. Crop the frames of the imported layered file to the correct size.
  8. Save as an icon.

In order to use the icon file in VB it must have an 8-bit version.

October 27, 2004

Fancy checkbox validation javascript

<!-- javascript function
function chx(myForm)
{
var sendit = false;
  for (var i=0;i < myForm.length;i++) {
    fldObj = myForm.elements[i];
    if (fldObj.type == 'checkbox') {
      if (fldObj.checked == true) {
        sendit = true;
      }
    }
  }
  if (sendit == true) {
    return true;
  } else {
    alert('Error Msg.');
    return false;
  }
}
--->

<!-- code for form -->
<form onSubmit="return chx(this);">

October 22, 2004

Memory Checker / Leak Checker for Linux

http://rcswww.urz.tu-dresden.de/~muepfeff/tipps/Memory.html

Memcheck is the quickest way to find major leaks, but nothing can beat Valgrind for it's complete search of linked library and source library leaks.

Linux Memory Mangement Sucks!

DK

PXE Booting Linux Install

http://www.linux.duke.edu/doc/pxe-Quick-Start.ptml

Change: append initrd=initrd-7.3.img lang= lowres devfs=nomount ramdisk_size=8192 console=ttyS0,9600

to: append initrd=initrd-7.3.img lang= lowres devfs=nomount ramdisk_size=8192

KPC Child Support and Alimony Address

Kansas Payment Center
P. O. Box 758599
Topeka, KS 66675-8599

MSN Instant Messenger Protocal API

http://www.hypothetic.org/docs/msn/index.php


MSN Instant Messenger Protocol Forum and API

DK

Beej's Guide to Network Programming

http://www.ecst.csuchico.edu/~beej/guide/net/html/

Linux Sockets programming guide.

DK

Using SYSPREP to create XP Pro Images

http://www.uea.ac.uk/itcs/software/xp/xp-sysprep.html

SetupMGR.exe, sysprep.exe and the other tools required are usually found on the XP installation Cd under c:\windows\tools

DK

Restoring a Linux Image with Acronis True Image

After you do the restore using the bootable True Image CD the mbr and Grub config are munged.

Do the following.

Boot into a linux install cd and enter rescue mode by typing: linux rescue at the command prompt.

It will take you thru a few screens; accept the defaults and then it will tell you it is going to search for your linux install, if it finds one it will mount it using /mnt/sysimage as the path.

Once you are at a prompt type chroot /mnt/sysimage to change the root mount to your unbootable linux install on the hard drive.

Next look at grub.conf in /etc/ and determine which HD device holds the grub info and the kernal you want to boot.

Example:
title Red Hat Linux (2.4.18-24.7.x)
root (hd0,0)
kernel /vmlinuz-2.4.18-24.7.x ro root=/dev/hda3
initrd /initrd-2.4.18-24.7.x.img

title Red Hat Linux (2.4.18-19.7.x)
root (hd0,0)
kernel /vmlinuz-2.4.18-19.7.x ro root=/dev/hda3
initrd /initrd-2.4.18-19.7.x.img

AS we can see, the root file system is located in (hd0,0) this is (hard drive #, partition #)

Now exit that file and type grub at the command prompt:

Next type

root (hd0,0)
setup (hd0,0)

This will setup stage2 and correct the MBR on your boot drive and enable you to boot the restored server.

--Thats it.

DK



August 31, 2004

Linksys Blue Box Router HOWTO

Linksys Blue Box Router HOWTO: "There are three ways you can upgrade your Linksys firmware."

The third way is to use tftp. This is how I did it. There is a tftp client included with Red Hat Linux. To upgrade your firmware this way, do the following steps:

Capture a copy of your settings. The firmware upgrade may wipe some of them. Older versions nuked everything back to factory defaults; newer versions preserve your basic settings but clear some advanced ones.

Download a copy of the new firmware. You should find it at Firmware Upgrades for your Linksys Products on the Linksys site. Note that what you get may well be marked "For Windows Users" and be a zip archive. Open it in a scratch directory, because it will rudely create several Windows files wherever you unpack it. The file you need will be called CODE.BIN.

Disable the router password Note that every attempt I made to do this with Mozilla failed (both under 1.38 and 1.44). Konqueror worked fine. Go to the Password tab, backspace over both sets of asterisks until both the Password and Confirm fields are blank, and click Apply.

Cross your fingers and load the firmware The command session you want will to see will look something like this, with your router's IP address substituted for 192.168.1.1:

tftp 192.168.1.1
tftp> binary
tftp> put code.bin
Sent 386048 bytes in 10.3 seconds
tftp>



Don't panic if the client hangs for a bit before returning and do not abort the transfer. The command is writing to firmware, and the Linksys hasn't got much of a brain. Wait for it to finish.

Re-enable your router password and other settings. You'll be able to tell the upgrade worked because the firmware version number has changed.

You're done.



August 17, 2004

ADSI COM code for CFMX

<cfscript>
ADSys = createObject("COM", "ADSystemInfo");
UserName = ADSys.UserName;
</cfscript>

<cfdump var="#UserName#">

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/iadsadsysteminfo.asp

CFMX QuotedValueList

I found out today that if you are going to use #quotedvaluelist()# in a query that you have to use it in the query and not set it as a variable before hand.

Good:

SELECT *
FROM table
WHERE something NOT IN (#quotedvaluelist(query.column)#)

Bad:

SELECT *
FROM table
WHERE something NOT IN (#varname#)

The bad example escapes the single quotes once it is used in the query. Not fun.

August 4, 2004

Adding additional file types to verity on CFMX 6.1

Verity content-type handling is done with the style.uni file. Each collection has its own style.uni file for both file and custom collection types.

The style.uni file can be found in:

C:\FusionMX\verity\collections\collection_name\custom\style\style.uni
C:\FusionMX\verity\collections\collection_name\file\style\style.uni

You can modify the default style.uni files so that any new collections will have the new settings.

These default files are found under:
C:\FusionMX\lib\common\style\style.uni
C:\FusionMX\lib\common\style\file\style.uni
C:\FusionMX\lib\common\style\custom\style.uni

The easiest way to add new file types is to change the default setting at the bottom of the page.
default:
# /action = skip
/charset = guess


Random.org - True Random Number Service

Random.org - True Random Number Service

July 30, 2004

Welcome

This is where we post pieces of various knowledge that we had to learn for one reason or another.