System

Description

This will run unix-command on the server and include its output in the page in which it is specified formatted according to inclusion-mode, which may be one of:

/!\ Be aware that if a page is editable by anyway then anyway could insert calls to this macro in order to run any command on your computer. Imagine if they put something like:

[[System(cat /etc/passwd,raw)]] 

Download & Release Notes

Download

Release Version

Moin Version

Release Notes

System.py

20131031

1.5.8

final version by AlexisHuxley

Usage

Syntax: [[System(unix-command,inclusion-mode)]]

Example

Example #1:

The output of man pdb, pre-formatted:

[[System(man pdb,pre)]] 

Example #2:

An inline shell script generating wiki markup:

[[System(date ,wiki)]] 

Example #3:

The HTML output of w3m -dump_source http://checkip.dyndns.org/:

[[System(w3m -dump_source http://checkip.dyndns.org/ 2>/dev/null,raw)]] 

Example #4:

Here's a Google Maps map embedded in a wiki page:

[[System(echo "<iframe width=\"800\" height=\"350\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=oberammergau+bahnhof&amp;sll=47.595608%2C11.066837&amp;sspn=0.005072%2C0.010471&amp;ie=UTF8&amp;s=AARTsJpW-Xn5cQHRchUDNrmbbLGggtcVfA&amp;ll=47.597713%2C11.073446&amp;spn=0.010129%2C0.034332&amp;z=15&amp;output=embed\"></iframe>",raw)]] 

Note that the Google Maps URL has had:

  1. commas changed to %2C to prevent Moin interpreting them as macro argument separators,
  2. double quotes have been backslash-escaped to prevent the shell from interpreting them as string delimiters.

(C) AlexisHuxley 2007-2011 and are distributed under the terms of the GPL.

Bugs

Discussion

MoinMoin: MacroMarket/System (last edited 2013-10-31 09:49:02 by 134)