Factor Mystic

27Jul/08Off

Default Programs Editor 1.2 update

Version 1.2

  • Fixed a critical bug that caused an immediate crash on Vista x64.
  • Added automatic online error reporting (can be disabled in Advanced Configuration).
  • Added a friendly error dialog when the program crashes, replacing the generic .Net one.
  • A couple of minor UI adjustments.
Default Programs Editor- Error Dialog

Default Programs Editor- Error Dialog

What information does the crash report have?
OS version, last executed method from a logging functions, and a stack trace. No personal identifying information. Each crash dump is saved to C:\Users\<user>\AppData\Local\factormystic.net\Default Programs Editor\<version>\ , which is also where the advanced.config file is saved.

64 bit

The x64 bug was quite odd. I was initially debugging on a vanialla rtm install, and the program worked fine. It wasn't until I installed hotfix KB932471, an update for .Net 3.0, that it successfully crashed. I'm not sure exactly what changed in the framework to make it start crashing, but the bug was a relatively simple fix.

Download.

23Jul/08Off

How to run Ruby scripts in a browser without mod_ruby

I'm sure this is a horror in dozens of ways, but eruby sucks and my host doesn't have mod_ruby. So I got creative.

The .htaccess rewrites requests for any file ending in .rb to this handler.php, which confirms that the requested ruby script exists, then executes it and prints the result.

//PHP script to execute ruby scripts when the host doesn't have a cgi handler for .rb
//Use with this .htaccess:

/*
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.rb$ handler.php?rb=$1.rb [NC,QSA]
*/

$file = $_GET['rb'];

if(in_array($file, scandir('.')))
{
foreach($_REQUEST as $key=>$value) if($key != 'rb') $args .= " $key=".urlencode($value);
echo exec(escapeshellcmd('./'.$file.$args));
}
else
{
echo '404- Page not found';
}
?>

Here's an example ruby script using this hack- nothing special to do here at all:

#!/usr/local/bin/ruby

require 'cgi'

print "Hello from Ruby!<br>"
print "All of the input variables:<hr>"

ARGV.each do |arg|
print CGI::unescape(arg.to_s)
print "<br>"
end

All the GET, POST, and COOKIE variables are at your fingertips in ARGV! (You could get them with Ruby's CGI module as well.)

So here's what it looks like to users:

Screenshot of ruby without mod_ruby hack

Screenshot of ruby without mod_ruby hack

15Jul/08Off

Default Programs Editor 1.1 update

Version 1.1

  • Now distributing as the exe and this changes file in a zip instead of just the exe.
  • Put Context Menu and File Type properties group boxes into separate tabs.
  • Replaced File Type column in the main extension list with Friendly Type Name.
  • Autogenerated key names are now converted to lower case to fit with convention.
  • A couple of additional minor UI adjustments.
  • Url in the exported .reg comment was wrong.
  • "Show shell extensions" checkbox moved to the Advanced Config tab (which means its state is persistent across sessions now).
  • Searching for an extension in both the main extension list, and the File Type dialog now also transparently searches file type key names.
  • Fixed the bug on XP where showing shell extension verbs caused it to crash
  • New File Types are now created in the Select File Type dialog.
  • The Add Extension dialog has been reworked to be more intuitive.

Here's the biggest change to the UI- tabs replaced panes for Context Menu and File Type groups:

Default Programs Editor 1.1 screenshot

Download