wikish

Jake Donham jake at bitmechanic.com
Sat Sep 3 23:11:09 EDT 2005


Hi,

A couple hours' hack: a wiki (based on why's) with a "run" action which
runs the page as Ruby code:

  http://jaked.org/wikish.user.rb

(You shouldn't put this on a MouseHole that is publically accessible,
since it has no protection of any kind at the moment.)

The idea is that it is a web-based shell like YubNub, but you can
execute arbitrary code. There is no input form at the moment--I'm using
it by setting keyword.URL to http://127.0.0.1:37004/wikish/run/ from
about:config in Firefox so I can type commands at the URL bar.

This doesn't have anything particularly to do with proxying (neither
does why's wiki) but if you are already running a personal server, that
seems like the right place to put it.

So far I haven't done anything except redirections. Here are a few:

del: (change username to taste)

  response['location'] = "http://del.icio.us/jaked/#{args.join('+')}"
  raise WEBrick::HTTPStatus::Found

amaz:

  response['location'] = "http://www.amazon.com/exec/obidos/external-search?mode=blended&field-keywords=#{args.join('+')}"
  raise WEBrick::HTTPStatus::Found

edit: (so you can say e.g. "edit amaz")

  response['location'] = "http://127.0.0.1:37004/wikish/edit/#{args[0]}"
  raise WEBrick::HTTPStatus::Found

Some ideas for the future:

  security
  more shell syntax--variables, pipes? or more ruby-ish? see scsh
  call code on a wiki page from another page's code--wiki page defines a subroutine
  OS auth so you can look at your files etc
  wiki-ish editing of OS files
  other web interfaces to things on the OS
  commands to control MouseHole--enable/disable scripts etc.
  forward commands to a different wikish or to an OS command shell
  convenience methods for things like redirections

Jake


More information about the Mousehole-scripters mailing list