Welcome to my blog! Feel free to post comments.
- Andrew


Visit Coldfusion Community


<< November, 2007 >>
SMTWTFS
123
45678910
11121314151617
18192021222324
252627282930
Search Blog

Categories
Archives
RSS


Powered by
BlogCFM v1.14

Rar7z - Notes after it has been put to use
21 November 2007

Not too long ago I posted a coldfusion component to handle compression for rar and 7z.  Here is a report from the first time using it.

For reference, here is the important info:

Download version 1.0 -- lib_rar7z_cfc_v100.zip

This is of course released as-is no warranty, no support, blah blah, and eventually if people like this, I will officially make it open source.  Its a small piece of code, so who knows how useful it will be.

There are a few sample pieces of code to help figure out how to use is.  It is relatively easy:

Compress a file:

<cfinvoke component="lib.rar7z" method="compressFile" returnvariable="compressFile">
    <cfinvokeargument name="SrcPathAndFile" value="#ExpandPath(".")#\myfile.dat">
    <cfinvokeargument name="ArchivePathAndFile" value="#ExpandPath(".")#\myfile.rar">
    <cfinvokeargument name="VolumeSize" value="3500">
    <cfinvokeargument name="Timeout" value="90">
    <cfinvokeargument name="Engine" value="rar">
</cfinvoke>

List an archive's contents:

<cfinvoke component="lib.rar7z" method="listContents" returnvariable="listContents">
    <cfinvokeargument name="ArchivePathAndFile" value="#ExpandPath(".")#\myfile.rar">
    <cfinvokeargument name="Timeout" value="90">
    <cfinvokeargument name="Engine" value="rar">
</cfinvoke>

Extract files from an archive:

<cfinvoke component="lib.rar7z" method="extractArchive" returnvariable="extractArchive">
    <cfinvokeargument name="ArchivePathAndFile" value="#ExpandPath(".")#\myfile.rar">
    <cfinvokeargument name="OutputDir" value="#ExpandPath("./extract")#">
    <cfinvokeargument name="Timeout" value="90">
    <cfinvokeargument name="Engine" value="rar">
</cfinvoke>

I initially tried using the component with the "rar" engine, which maps to a 16-bit dos program called "rar.exe."  This didn't work out for me since it apparently only supports 8.3 filenames, and I needed support for long filenames. 

Second, I used the 7-zip executable "7za.exe" which is the command-line version of the 7z tools.  This supported long file names without any problem, and is behaving the way I expected.

The part I didn't expect was just how long it takes to compress a file.  I compressed an 80M database dump file using 7z, and it took 5-10 minutes...  this is running on a machine with 4 P4 hyyperthreaded processors and 4G ram...  thats a LONG time.

So, moving forward, I would NOT recommend use of the "rar" engine, but rather stick to "7z" if you need support for long file names.  Also, if you are compressing large files, be sure to assign a long enough timeout to make sure that CF doesn't prematurely terminate the process.  Other than this, it worked great!  It did exactly what I expected the first time I put it in use.

Posted by aschwabe at 12:00 AM | Link | 0 comments


Sporterizing Yugo 59/66 SKS Rifle
922r compliance
20 November 2007
I have recently purchased a Yugo 59/66 SKS rifle.  I have decided that I would like to refit this rifle with some modern parts, which are readily available at shows and online.  The problem with this is that ATF regulations state that you cannot disassemble and re-assemble this rifle legally unless you re-assemble it with less than 10 imported parts (it has 14 or 17, this is debatable).  That means you need to buy US made parts so that the total number of imported parts is 10 or less when you re-assemble it.

There are a lot of pages out there that help explain this to some degree, but nearly all of them have to do with the Norinco (Chinese) variant of the rifle.  The Yugo version, which I have, is much more 'interesting' in that it has night sights and a grenade launcher.

It has become a ridiculous process to figure out what the exact part list is for a Yugo 59/66 SKS.

The most definitive information I have found is below.  I am quoting this source.

Just how many of these parts are in an SKS Carbine?

Here are the relevant parts in an SKS Carbine:

1. Receiver
2. Barrel
3. Bolt
4. Bolt carrier
5. Gas piston
6. Trigger housing
7. Trigger
8. Hammer
9. Sear
10. Disconnector (see below)
11. Stock
12. Handguard
13. Magazine body
14. Follower

Note: This list has been confirmed by ATF.



How many imported parts can be replaced in an SKS Carbine?

Using commercially available parts, you can replace the following parts:

1)   Replace the stock with aftermarket US-made version.

2)   Replace the handguard with aftermarket US-made version.

3)   Replace the gas piston with a US-made version from Tapco (#SKS6602), SKSMan or SKSParts (#SKS-034).

4)   Replace the magazine with a 100% US-made magazine, including the magazine body, follower and floorplate. (Replaces two imported parts.)

5)   On Yugoslavian Type 59/66 Carbines: Remove the grenade launcher and replace it with a US-made muzzle break (foreign muzzle attachments are counted). See the FAQ’s on removing the Yugoslavian Type M59/66 grenade launcher for more info.

On a typical SKS Carbine, you will need to replace four parts. On Yugoslavian Type 59/66 Rifle, you will need to replace five parts.

These US-made parts are sometimes known as “compliance parts”, since they are used to ensure that the resulting rifle is “compliant” with Title 18 USC § 922(r).


So, if any of you out there have REAL PROVEN RELIABLE information to add to this, please let me know.  If it is just opinion, and you don't have any credible proven source to back it up, I probably won't back up your info.  I'm only doing this for sanity sake so that there can be at least one useful page that has all the facts about this rifle.
Posted by aschwabe at 12:00 AM | Link | 0 comments

Ghost for Linux ?
19 November 2007
I have long been a supporter of using Ghost for imaging disks.  See a previous post on how to use Ghost 2003 with Windows Vista.

I have never, however, been able to find a replacement for Linux... until now.

I just came across this -- and pardon me if this is old news -- which seems very promising!

http://www.feyrer.de/g4u/

This is an open-source project based on NetBSD that allows you to boot from a CD, connect to an FTP site, and backup-to-image, or restore-from-image to the local drive, using the FTP site as the image storage location.  This sure sounds like what Ghost should have been!

I intend to try it out very soon.
Posted by aschwabe at 4:05 PM | Link | 0 comments

Why ColdFusion isn't free
18 November 2007

No, this isn't an "original" rant...  just spreading the word on an already available, and excellent eye-opening writeup of why CF doesn't fit the "mold" of other "programming languages" and why it isn't a simple process to say "this is free, why isn't CF free?"

Anyway, stop reading my blog, and read this instead:

http://www.cfinsider.com/index.cfm/2007/11/10/Things-ColdFusion-is-not-and-Why-ColdFusion-isnt-free

Thanks to CF Insider!

Posted by aschwabe at 1:22 PM | Link | 0 comments

Speeding up Windows Vista
13 November 2007

I have finally put a copy of vista on my machine, and I have a few observations:

  • It is pretty
  • It is different enough from Windows XP that some things are hard to find
  • The continual nagging and "are you sure" questions drives me crazy
  • It is slow

I wouldn't call it more efficient, but it is the newest windows, so we all better get confortable with it.

Here are some _wonderful_ resources I found online that allowed me to get vista running on my pc at about the same speed as winxp, and I am pleased to say that it is a bit more stable than XP as well.  After all, vista is based on the windows 2003 kernel, which has been very powerful and reliable.

Turn off the nagging:

The continual popups are from a new service called "UAC" or User Access Control.  Read this article (and google it for more info) and learn what it is, and deceide if you want to turn it off.  It may make your PC more vulnerable, but I will accept that risk.  What you do is up to you.

http://www.mydigitallife.info/2006/12/19/turn-off-or-disable-user-account-control-uac-in-windows-vista/

Turn off services, change the UI, etc, etc.

Here is a great guide to streamlining Vista, turning off services that Vista assumed you wanted, and some other neat tricks like using a USB memory key to speed up application access.  I was thoroughly impressed with the impact these changes had.

http://www.extremetech.com/article2/0,1697,2110595,00.asp

Overall, I was very hesitant to move forward using Vista.  It seemed too bulky and multimedia heavy to be productive.  Plus windows explorer is different!!  (I don't know why MS did this -- poor decision in my opinion).  These updates will help to have a manageable and usable windows vista machine.

Happy computing

Posted by aschwabe at 12:00 AM | Link | 0 comments

Using Ghost 2003 with Windows Vista
Partition to partition backups
12 November 2007

If you do a few google searches for "ghost" and "vista" you will find a ton of posts.  What I have found frustrating is the lack of clarity on one particular issue:

"If you back up a windows vista partition using ghost 2003 (dos based) to another drive or partition, can you restore it and have a bootable vista OS ?"

Answer: YES it works -- see below for how to do this.

There are many people who say if you clone a disk (i.e. you have two hard drives, clone A to B), that ghost 2003 works fine with vista, but nobody has clearly stated how and if it works on a partition to partition basis.

Here is how we setup all our computers:  The primary drive is split into 2 partitions, C: is for the OS, and D: is for files and backups.  In this scenario, the OS drive can be backed up to the D: drive using ghost.

This works great for any windows until Vista came around.  Now all of a sudden, changes to the boot sector make it more difficult.

So here is how to do it:

  1. Make sure your system is installed so that you have a C: and a D: partition
    • Note, we set this up so that all your "work files" are on D, so that if you restore a different OS, you can still access all your files.  This way you can have multiple configurations for your computer, one for work, one for games, one for fooling around, etc. and never lose any data.
  2. Make a "Bootable ghost CD" (or floppy disk, but our computers don't have disk drives anymore).
    • Here is some info on how to create a bootable ghost cd.
    • FYI you will need the bootable ghost CD because windows vista HATES ghost 2003, so its not easy to install it.  If you have a bootable CD, you have no worries, and just boot from the CD any time you want to backup or restore your system.
    • If you really have a hard time making a bootable ghost cd, email me, and I can help you out (for a small paypal donation).
  3. Backup your OS (all windows):
    • Boot up with your "Bootable Ghost CD"
    • Select "Local Partition to Image"
    • Pick your source drive and partition, destination drive and filename.
    • Get coffee.
  4. Restore your OS:
    • Windows 9x, 2000, ME, XP, 2003, linux, others:
      • Boot up with your "Bootable Ghost CD"
      • Select "Local Partition From Image"
      • Browse to and pick your ghost disk image
      • Pick the destination drive and partition
      • Get more coffee
      • When done, select "Reset computer"
    • Windows Vista
      • Boot up with your "Bootable Ghost CD" 
      • Quit ghost (should leave you at an A: prompt)
      • Type in "ghost -fdsp" (will re-launch ghost with alternate settings)
      • Select "Local Partition From Image"
      • Browse to and pick your vista ghost disk image
      • Pick the destination drive and partition
      • Get more coffee
      • When done, select to "Reset Computer"

And thats it.  I have found that this works very well with all modern windows versions, and with the few small differences, works great with vista too.  Since we can boot into ghost from a CD, we don't have to install it anymore either.  Now we can all have 10 OS's on our laptops and switch at will.

Posted by aschwabe at 8:56 AM | Link | 0 comments

Aptana Studio Released!
05 November 2007

I am truly impressed with what this group has brought to the development community.  Long ago I loved a code editor called "HomeSite+" which existed in several interesting flavors, ColdFusion Studio (i think?), and JRun Studio were two other flavors I remember. 

Then came the Dreamweaver shift...  I never really got on that bandwagon.  I resisted for a LONG time, then I tried it out, and just never really was thrilled with it.  I am a coder at heart.

Then came Eclipse.  Great concept, just not for the masses.  Then came Eclipse 3, and then CFEclipse... then came Flex Builder and the RDS plugins, all good still, but not thrilling.

HomeSite was great at letting you develop remotely.  Thats a big no-no in the software world now, but for web developers it is a big deal.  You don't always have _everything_ you need running on your laptop!

Anyway, I got off track.  After all these tools, finally comes an attempt to bring it all together: Aptana Studio.  In its development stage as Aptana IDE, I fell in love with it (well, with MOST of it anyway...).  It all runs on Eclipse, and gives the basic developer everything he or she needs to code html, php, javascript, xml, css, etc.  All the things that were either missing, or painfully buggy or incomplete in Eclipse.  Not to mention an FTP (and secure FTP) system that actually works!  And you can create new empty files on remote ftp servers too (a lot of us have been waiting for this feature for a while).

I can now safely say that I have found my HomeSite+ replacement :)

Download it, you know you want to: http://www.aptana.com/ (its free)

FYI, Aptana  was founded by Paul Colton, formerly of Allair.  If you can remember back that far, Allair was the company that originally built ColdFusion, before it was bought by Macromedia (and subsequently by Adobe).

Posted by aschwabe at 4:01 PM | Link | 0 comments