Difference between pages "ConsoleOutput MediaWiki Extension" and "Package:Rutorrent"

(Difference between pages)
 
m
 
Line 1: Line 1:
The ConsoleOutput MediaWiki extension was created by Daniel Robbins to provide highlighting of user input for interactive terminal session blocks. To use it, surround user input with  <tt>&lt;console&gt;</tt> opening and closing tags. This tag works similarly to a <tt>&lt;pre&gt;</tt> tag, and preserves output formatting in the quoted text.
+
{{Ebuild
 +
|Summary=ruTorrent is a front-end for the popular Bittorrent client rTorrent
 +
|CatPkg=www-apps/rutorrent
 +
|Homepage=http://code.google.com/p/rutorrent/
 +
}}
  
To highlight text typed by a user, rather than program output, put a <tt>##i##</tt> input code immediately before user input on each line. This will cause all text from the <tt>##i##</tt> to the end of the line to be highlighted in orange to offset it from the prompt and other other program output.
+
rutorrent is a front end to {{package|net-p2p/rtorrent}} and is designed to look like utorrent =D
  
* {{c|##i##}} - Tag all following text on this line as user input.
+
{{console|body=###i## emerge www-apps/rutorrent}}
* {{c|##b##}} - Highlight the rest of the line in bold.
+
* {{c|##b##text here##!b##}} - Highlight the text between both markers in bold.
+
* {{c|##i##text here##!i##}} - Highlight the text between both markers as user input.
+
* {{c|##g##}} - Green
+
* {{c|##y##}} - Yellow
+
* {{c|##bl##}} - Blue
+
* {{c|##r##}} - Red
+
  
=== Examples ===
+
===prereqs===
Here are a few examples of the ConsoleOutput extension. First this is how you might typically display {{c|ls}} output, with a particular directory highlighted:
+
*Install your web server {{package|www-servers/nginx}}, and get {{package|dev-lang/php}} with the fpm use flag running first.
 +
*you must turn on scgi_pass in the {{package|net-p2p/rtorrent}} config.
  
<console>
+
===configuration===
www@www-smw ~/public_html $ ##i##ls
+
==== optional security lock down stuff ====
COPYING  LocalSettings.php    api.php  ##b##extensions##!b##  index.php  maintenance          redirect.php    skins              thumb_handler.php5
+
{{warning|possibly broken, untested}}
CREDITS  README                api.php5  images        index.php5  mw-config            redirect.php5  tests              wiki.phtml
+
FAQ      RELEASE-NOTES-1.19    bin      img_auth.php  languages  opensearch_desc.php  redirect.phtml  thumb.php
+
HISTORY  StartProfiler.sample  cache    img_auth.php5  load.php    opensearch_desc.php5  resources      thumb.php5
+
INSTALL  UPGRADE              docs      includes      load.php5  profileinfo.php      serialized      thumb_handler.php
+
www@www-smw ~/public_html $ ##i##cd extensions/
+
</console>
+
  
And here is how you might display a more detailed example of console output, using colors:
+
first figure out what php you're using
  
{{console|body=
+
{{console|body=###i##eselect php list fpm
# ##i##bluetoothctl
+
[1]   php5.5 *
[##g##NEW##!g##] Controller 00:02:72:C9:62:65 antec [default]
+
###i## eselect php list cgi
##bl##[bluetooth]##!bl### ##i##power on
+
[1]   php5.5 *
Changing power on succeeded
+
###i## eselect php list apache2
##bl##[bluetooth]##!bl### ##i##agent on
+
[1]   php5.5 *
Agent registered
+
###i## eselect php list cli
##bl##[bluetooth]##!bl### ##i##scan on
+
[1]   php5.5 *
Discovery started
+
##bl##[bluetooth]##!bl### ##i##devices
+
Device 00:1F:20:3D:1E:75 Logitech K760
+
##bl##[bluetooth]##!bl### ##i##pair 00:1F:20:3D:1E:75
+
Attempting to pair with 00:1F:20:3D:1E:75
+
[##y##CHG##!y##] Device 00:1F:20:3D:1E:75 Connected: yes
+
##r##[agent]##!r## Passkey: 454358
+
##r##[agent]##!r## Passkey: ##i##4##!i##54358
+
##r##[agent]##!r## Passkey: ##i##45##!i##4358
+
##r##[agent]##!r## Passkey: ##i##454##!i##358
+
##r##[agent]##!r## Passkey: ##i##4543##!i##58
+
##r##[agent]##!r## Passkey: ##i##45435##!i##8
+
##r##[agent]##!r## Passkey: ##i##454358##!i##
+
[##y##CHG##!y##] Device 00:1F:20:3D:1E:75 Paired: yes
+
Pairing successful
+
[##y##CHG##!y##] Device 00:1F:20:3D:1E:75 Connected: no
+
##bl##[bluetooth]##!bl### ##i##connect 00:1F:20:3D:1E:75
+
Attempting to connect to 00:1F:20:3D:1E:75
+
[##y##CHG##!y##] Device 00:1F:20:3D:1E:75 Connected: yes
+
Connection successful
+
##bl##[bluetooth]##!bl### ##i##quit
+
[##r##DEL##!r##] Controller 00:02:72:C9:62:65 antec [default]
+
#
+
 
}}
 
}}
  
To install, make the following modifications to your skin:
+
edit the respective php.ini
  
<syntaxhighlight lang="css">
+
Edit the open_basedir in
--- mediawiki-1.19.1/skins/vector/screen.css    2012-06-13 18:22:39.000000000 +0000
+
/etc/php/fpm-php5.5/php.ini
+++ public_html/skins/vector/screen.css 2012-08-27 04:34:47.507912892 +0000
+
{{file|name=/etc/php/fpm-php5.5/php.ini|lang=|desc=php basedir|body=
@@ -683,10 +683,47 @@
+
open_basedir = /var/www/localhost/htdocs/rutorrent/conf:/var/www/localhost/htdocs/rutorrent/php:/var/www/localhost/htdocs/rutorrent/
        list-style-image: url(images/bullet-icon.png);
+
}}
}
+
+
-pre {
+
-      line-height: 1.3em;
+
+/* ConsoleOutput.php start */
+
+
+
+.shell, pre, code, tt, div.mw-geshi {
+
+        font-size: 12px;
+
+        font-family: Consolas, 'andale mono','lucida console', monospace;
+
+}
+
+
+
+.shell, pre, div.mw-geshi {
+
+        background-color: #F8F8FF;
+
+        line-height: 15px;
+
+        padding: 10px;
+
+        border: none;
+
+        border-top: 2px solid #C6C9E0;
+
+        border-bottom: 2px solid #C6C9E0;
+
+        margin: 0;
+
+        overflow-x: auto;
+
+        overflow-y: hidden;
+
+}
+
+
+
+.code {
+
+        color: #666;
+
+}
+
+
+
+.code_input {
+
+        color: #000;
+
}
+
+
+.code_red {
+
+        color: #f00;
+
+}
+
+
+
+.code_blue {
+
+        color: #00f;
+
+}
+
+
+
+.shell_green {
+
+        color: #080;
+
+}
+
+
+
+/* ConsoleOutput.php end */
+
+
+
/* Site Notice (includes notices from CentralNotice extension) */
+
#siteNotice {
+
        font-size: 0.8em;
+
</syntaxhighlight>
+
  
Then install the following code in your <tt>extensions</tt> directory and include it with a <tt>require_once( "$IP/extensions/ConsoleOutput.php" );</tt> in <tt>LocalSettings.php</tt>:
+
=== nginx config===
 +
{{file|name=/etc/nginx/sites-available/localhost|lang=|desc=nginx configuration|body=
 +
server {
 +
listen 127.0.0.1:80;
 +
server_name localhost;
 +
access_log /var/log/nginx/localhost.access_log main;
 +
error_log /var/log/nginx/localhost.error_log info;
 +
root /var/www/localhost/htdocs;
 +
index index.php index.cgi index.htm index.html;
 +
autoindex on;
  
<syntaxhighlight lang="php">
+
        location ~ \.php$ {
<?php
+
                fastcgi_pass 127.0.0.1:9000;
$wgExtensionCredits['validextensionclass'][] = array(
+
include fastcgi.conf;
    'name' => 'ConsoleOutput',
+
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
    'author' => 'Daniel Robbins',
+
        }
    'url' => 'https://github.com/danielrobbins/mediawiki-consoleoutput',
+
    'description' => 'This extension allows you to display colorized console output in mediawiki'
+
);
+
  
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
+
          location /rutorrent {
        $wgHooks['ParserFirstCallInit'][] = 'consoleOutputSetup';
+
              include scgi_params;
} else {
+
              scgi_pass localhost:5000;
        $wgExtensionFunctions[] = 'consoleOutputSetup';
+
          }
 
}
 
}
 +
}}
  
function consoleOutputSetup( $data )
+
restart nginx
{
+
{{console|body=###i## /etc/init.d/nginx restart}}
    global $wgParser;
+
    $wgParser->setHook('console', 'consoleRender');
+
    return true;
+
}
+
  
function consoleRender($input, $args, $parser)
+
point your browser to
{
+
    if (count($args))
+
    {
+
        return "<strong class='error'>" .
+
              "ConsoleOutput: arguments not supported" .
+
              "</strong>";
+
    }
+
  
    # Display < and > as literals, so escape them:
+
http://127.0.0.1/rutorrent
  
    $input = preg_replace('/>/','&gt;', $input);
+
or
    $input = preg_replace('/</','&lt;', $input);
+
  
    # http://www.perlmonks.org/?node_id=518444
+
http://localhost/rutorrent
    # See "Matching a pattern that doesn't include another pattern:
+
 
+
    $input = preg_replace('/##i##((?:(?!##!i##).)*)##!i##/','<span class="code_input">$1</span>', $input);
+
    $input = preg_replace('/##i##(.*)/','<span class="code_input">$1</span>', $input);
+
    $input = preg_replace('/##b##((?:(?!##!b##).)*)##!b##/','<b>$1</b>', $input);
+
    $input = preg_replace('/##b##(.*)/','<b>$1</b>', $input);
+
    return "<pre class=\"code\">" . $input . "&lt;/pre>";
+
}
+
?>
+
</syntaxhighlight>
+
  
[[Category:MediaWiki Hacks]]
+
{{PageNeedsUpdates}}
 +
{{EbuildFooter}}

Revision as of 06:51, March 8, 2015

www-apps/rutorrent


Source Repository:Repository:Gentoo Portage Tree

http://code.google.com/p/rutorrent/

Summary: ruTorrent is a front-end for the popular Bittorrent client rTorrent


News

Drobbins

IP Space Migration Continues

All Funtoo user containers in the 8.28 IP space will be moving into our new IP space (172.97) over the next few days. If you have DNS set up -- be sure to watch your container and update to the new IP! container.host.funtoo.org DNS will be updated after the move.
2015-08-27 by Drobbins
Drobbins

Funtoo Hosting IP Move

Funtoo user containers with IPs in the 72.18.x.x range will be gradually migrating to new IP addresses this week. If you have DNS entries for your containers, please be aware that your DNS will need to be updated.
2015-08-11 by Drobbins
Drobbins

New ARM Stages

New ARM Stages, built with a new toolchain, are now hitting mirrors. Existing ARM users should re-install using these stages (dated Aug 3, 2015 or later,) rather than upgrade using emerge.
2015-08-06 by Drobbins
More...

Rutorrent

Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


rutorrent is a front end to Package:Rtorrent and is designed to look like utorrent =D

# emerge www-apps/rutorrent


prereqs

configuration

optional security lock down stuff

Warning

possibly broken, untested

first figure out what php you're using

#eselect php list fpm
[1]   php5.5 *
# eselect php list cgi
[1]   php5.5 *
# eselect php list apache2
[1]   php5.5 *
# eselect php list cli
[1]   php5.5 *


edit the respective php.ini

Edit the open_basedir in /etc/php/fpm-php5.5/php.ini

/etc/php/fpm-php5.5/php.ini - php basedir
open_basedir = /var/www/localhost/htdocs/rutorrent/conf:/var/www/localhost/htdocs/rutorrent/php:/var/www/localhost/htdocs/rutorrent/

nginx config

/etc/nginx/sites-available/localhost - nginx configuration
server {
	listen 127.0.0.1:80;
	server_name localhost;
	access_log /var/log/nginx/localhost.access_log main;
	error_log /var/log/nginx/localhost.error_log info;
	root /var/www/localhost/htdocs;
	index index.php index.cgi index.htm index.html;
	autoindex on;

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
		include fastcgi.conf;
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
        }

           location /rutorrent {
               include scgi_params;
               scgi_pass localhost:5000;
           }
}

restart nginx

# /etc/init.d/nginx restart


point your browser to

http://127.0.0.1/rutorrent

or

http://localhost/rutorrent