Help:Script Samples: Difference between revisions
Caleb Cooper (talk | contribs) |
Caleb Cooper (talk | contribs) Tag: 2017 source edit |
||
| (27 intermediate revisions by 2 users not shown) | |||
| Line 130: | Line 130: | ||
| |
| |
||
;scroll |
;scroll |
||
<code>class="scroll"</code> |
|||
| |
| |
||
<pre> |
<pre> |
||
| Line 144: | Line 145: | ||
| |
| |
||
;inline |
;inline |
||
<code>class="inline"</code> |
|||
| |
| |
||
<pre> |
<pre> |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="lisp" class="inline"> |
||
(define-behavior (bounce |
|||
double AttackerSuccessProbability(double q, int z) |
|||
:start-when (or (bump?) |
|||
{ |
|||
bounce-trigger? ) |
|||
double p = 1.0 - q; |
|||
:abort-when (bump-edge?) |
|||
:onetime? t |
|||
) |
|||
) |
|||
for (k = 0; k <= z; k++) |
|||
{ |
|||
double poisson = exp(-lambda); |
|||
for (i = 1; i <= k; i++) |
|||
poisson *= lambda / i; |
|||
sum -= poisson * (1 - pow(q / p, z - k)); |
|||
} |
|||
return sum; |
|||
} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
</pre> |
</pre> |
||
| |
| |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="lisp" class="inline"> |
||
(define-behavior (bounce |
|||
double AttackerSuccessProbability(double q, int z) |
|||
:start-when (or (bump?) |
|||
{ |
|||
bounce-trigger? ) |
|||
double p = 1.0 - q; |
|||
:abort-when (bump-edge?) |
|||
:onetime? t |
|||
) |
|||
) |
|||
for (k = 0; k <= z; k++) |
|||
{ |
|||
double poisson = exp(-lambda); |
|||
for (i = 1; i <= k; i++) |
|||
poisson *= lambda / i; |
|||
sum -= poisson * (1 - pow(q / p, z - k)); |
|||
} |
|||
return sum; |
|||
} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
| Use for smaller text blocks, if it is not desired that pre extend to the full width of the page |
| Use for smaller text blocks, if it is not desired that pre extend to the full width of the page |
||
| Line 186: | Line 172: | ||
|} |
|} |
||
== Syntax Highlighting == |
|||
<br><br> |
|||
If a programming language is not used the language can be specified as '''text''', also the highlight attribute can be set to highlight lines of code:<br><br> |
If a programming language is not used the language can be specified as '''text''', also the highlight attribute can be set to highlight lines of code:<br><br> |
||
| Line 203: | Line 190: | ||
17 8 8 Cluster FS8600 18 15 18 0 4 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757 |
17 8 8 Cluster FS8600 18 15 18 0 4 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757 |
||
Walk: Display 4 of 4 |
Walk: Display 4 of 4 |
||
</syntaxhighlight |
</syntaxhighlight> |
||
<code></syntaxhighlight></code><br> |
<code></syntaxhighlight></code><br> |
||
<br><br> |
<br><br> |
||
---- |
---- |
||
Demo of color coding using HTML markup and displaying line numbers: |
|||
<br><br> |
|||
<code><syntaxhighlight lang="html4strict" line class="inline"></code><syntaxhighlight lang="html4strict" line class="inline"> |
|||
<table align=center style="background: ivory;color:maroon;font-style:italic;font-family:arial;font-weight:bold;font-size:10pt;"> |
|||
This is the only example where it looks different in IE and the other browsers if the code is longer than the page and width is not set, IE will add scroll bars automatically no other browser will:<br><br> |
|||
<caption>This is the top caption</caption> |
|||
<code><syntaxhighlight lang="text" highlight="8-11" class="scroll"></code> |
|||
<tr><th> Heading 1 </th><th> Heading 2 </th></tr> |
|||
<syntaxhighlight lang="text" highlight="8-11" class="scroll"> |
|||
<tr> |
|||
map profile show where ManagementApp FLUIDFS |
|||
<td style="padding:10px;"> This is cell 1 text </td> |
|||
<60756 (?)> |
|||
<td style="padding:10px;"> This is cell 2 text </td> |
|||
[60756] Mapping:MappingProfile 02/15/2013 12:53:34 AM |
|||
</tr> |
|||
</table> |
|||
Index Server Server Volume MZ MZ MultiPat LUN Persona Personali Boot Write VM Managemen Admin DebugOu Active Bad Path LUN OS OS ManagementApp Active |
|||
</syntaxhighlight><code></syntaxhighlight></code><br> |
|||
Name Subsyst VolumeI Max Actual Preferr Actual Volume Protect Connect Status PathCo PathCo DownCo OnlyOne Product Version Controller |
|||
======= ======== =================================== ======= ======= ======= ======== ====== ======= ========= ======= ======= ========= ========= ======== ======= ====== ====== ====== ========= ============ ============ ============================== ========== |
|||
14 8 8 Cluster FS8600 15 15 15 0 1 0 60756 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60756 |
|||
15 8 8 Cluster FS8600 16 15 16 0 2 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757 |
|||
16 8 8 Cluster FS8600 17 15 17 0 3 0 60756 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60756 |
|||
17 8 8 Cluster FS8600 18 15 18 0 4 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757 |
|||
Walk: Display 4 of 4 |
|||
</syntaxhighlight> |
|||
<code></syntaxhighlight></code><br> |
|||
<br><br> |
<br><br> |
||
| Line 246: | Line 225: | ||
<code></syntaxhighlight></code> |
<code></syntaxhighlight></code> |
||
<br/><br/> |
<br/><br/> |
||
== Changing Colours == |
|||
{| class="wikitable" |
|||
! class !! Code !! Result !! style="width:200px;" | When to use |
|||
|- |
|||
| |
|||
;blue-white |
|||
<code>class=blue-white</code> |
|||
| |
|||
<pre> |
|||
<pre class="blue-white"> |
|||
buffer = OPENSSL_malloc(1 + 2 + payload + padding); |
|||
bp = buffer; |
|||
/* Enter response type, length and copy payload */ |
|||
*bp++ = TLS1_HB_RESPONSE; |
|||
s2n(payload, bp); |
|||
memcpy(bp, pl, payload); |
|||
bp += payload; |
|||
/* Random padding */ |
|||
RAND_pseudo_bytes(bp, padding); |
|||
</pre></pre> |
|||
</pre> |
|||
| |
|||
<pre class="blue-white"> |
|||
buffer = OPENSSL_malloc(1 + 2 + payload + padding); |
|||
bp = buffer; |
|||
/* Enter response type, length and copy payload */ |
|||
*bp++ = TLS1_HB_RESPONSE; |
|||
s2n(payload, bp); |
|||
memcpy(bp, pl, payload); |
|||
bp += payload; |
|||
/* Random padding */ |
|||
RAND_pseudo_bytes(bp, padding); |
|||
</pre> |
|||
| |
|||
White on a Blue background |
|||
|- |
|||
| |
|||
;black-white |
|||
<code>class=black-white</code> |
|||
| |
|||
<pre> |
|||
<syntaxhighlight lang="javascript" highlight="13" class="black-white"> |
|||
JSFX.FireSpark.prototype.changeColour = function() |
|||
{ |
|||
var colour=""; |
|||
r2= Math.random()*255; |
|||
g2= r2; |
|||
b2= 0; |
|||
if(!(r2 | g2 | b2)) |
|||
{ |
|||
r2=255; |
|||
g2=255; |
|||
b2=0; |
|||
} |
|||
colour = "#" + dec2hex(r2) + dec2hex(g2) + dec2hex(b2); |
|||
this.setBgColor(colour); |
|||
} |
|||
</syntaxhighlight> |
|||
</pre> |
|||
| |
|||
<div style="width:400px;"> |
|||
<syntaxhighlight lang="javascript" highlight="13" class="black-white"> |
|||
JSFX.FireSpark.prototype.changeColour = function() |
|||
{ |
|||
var colour=""; |
|||
r2= Math.random()*255; |
|||
g2= r2; |
|||
b2= 0; |
|||
if(!(r2 | g2 | b2)) |
|||
{ |
|||
r2=255; |
|||
g2=255; |
|||
b2=0; |
|||
} |
|||
colour = "#" + dec2hex(r2) + dec2hex(g2) + dec2hex(b2); |
|||
this.setBgColor(colour); |
|||
} |
|||
</syntaxhighlight></div> |
|||
| |
|||
White on a black background |
|||
|- |
|||
| |
|||
;black-green |
|||
<code>class=black-green</code> |
|||
| |
|||
<pre> |
|||
<syntaxhighlight lang="text" highlight="9" class="black-green scroll"> |
|||
TEXT BASED TABLE OUTPUT HERE |
|||
</syntaxhighlight> |
|||
</pre> |
|||
| |
|||
<div style="width:400px;"> |
|||
<syntaxhighlight lang="text" highlight="9" class="black-green scroll"> |
|||
map profile show where ManagementApp FLUIDFS |
|||
<60756 (?)> |
|||
[60756] Mapping:MappingProfile 02/15/2013 12:53:34 AM |
|||
Index Server Server Volume MZ MZ MultiPat LUN Persona Personali Boot Write VM Managemen Admin DebugOu Active Bad Path LUN OS OS ManagementApp Active |
|||
Name Subsyst VolumeI Max Actual Preferr Actual Volume Protect Connect Status PathCo PathCo DownCo OnlyOne Product Version Controller |
|||
======= ======== =================================== ======= ======= ======= ======== ====== ======= ========= ======= ======= ========= ========= ======== ======= ====== ====== ====== ========= ============ ============ ============================== ========== |
|||
14 8 8 Cluster FS8600 15 15 15 0 1 0 60756 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60756 |
|||
15 8 8 Cluster FS8600 16 15 16 0 2 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757 |
|||
16 8 8 Cluster FS8600 17 15 17 0 3 0 60756 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60756 |
|||
17 8 8 Cluster FS8600 18 15 18 0 4 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757 |
|||
Walk: Display 4 of 4 |
|||
</syntaxhighlight></div> |
|||
| Green on a Black background |
|||
|- |
|||
|} |
|||
== Indenting <code><pre></code> tags == |
== Indenting <code><pre></code> tags == |
||
{{Caution|The only reliable way to get indents with <code><pre></code> tags is to use: <code>{{indent{{!}}<pre> code here <p/pre>}}</code>; <br /> For <code><code></code> and <code><syntaxhighlight></code> tags a <code>:</code> works fine}} |
|||
{{Note|There is something intermittent about this working which I haven't figured out yet. It doesn't render correctly below but it does on other pages}} |
|||
<pre> |
|||
{{Indent|{{Pre|class=blue-white|# for i in $(diskview -I s {{!}} awk '/Online/{print $2}'); do echo -e "\n::: ${i} :::"; dd if{{eq}}/dev/rpd${i}d bs{{eq}}512 count{{eq}}1 of{{eq}}/pss/cc/o-dsb-${i}.bin; done}}}} |
|||
</pre> |
|||
{{Indent|{{Pre|class=blue-white|# for i in $(diskview -I s {{!}} awk '/Online/{print $2}'); do echo -e "\n::: ${i} :::"; dd if{{eq}}/dev/rpd${i}d bs{{eq}}512 count{{eq}}1 of{{eq}}/pss/cc/o-dsb-${i}.bin; done}}}} |
|||
{{Note|There is something intermittent about the method below working which I haven't figured out yet. It doesn't render correctly below but it does on other pages |
|||
[[File:Pre in a numbered list.png]] |
|||
}} |
|||
| Line 264: | Line 377: | ||
| |
| |
||
# one |
# one |
||
# |
#<pre> |
||
#::some stuff |
#::some stuff |
||
#::some more stuff |
#::some more stuff |
||
</pre> |
|||
# two |
# two |
||
|} |
|} |
||
| Line 309: | Line 423: | ||
<pre> |
<pre> |
||
;Same works for code tags: |
|||
{{Indent|{{Pre|class=blue-white|# for i in $(diskview -I s {{!}} awk '/Online/{print $2}'); do echo -e "\n::: ${i} :::"; dd if{{eq}}/dev/rpd${i}d bs{{eq}}512 count{{eq}}1 of{{eq}}/pss/cc/o-dsb-${i}.bin; done}}}} |
|||
:<code>Indented code snippet</code> |
|||
</pre> |
</pre> |
||
{{Indent|{{Pre|class=blue-white|# for i in $(diskview -I s {{!}} awk '/Online/{print $2}'); do echo -e "\n::: ${i} :::"; dd if{{eq}}/dev/rpd${i}d bs{{eq}}512 count{{eq}}1 of{{eq}}/pss/cc/o-dsb-${i}.bin; done}}}} |
|||
;Same works for code tags: |
|||
:<code>Indented code snippet</code> |
|||
== Annotate <code><pre></code> contents with Pointers / Boxes == |
== Annotate <code><pre></code> contents with Pointers / Boxes == |
||
| Line 401: | Line 518: | ||
<br> |
|||
=== Highlighting === |
|||
{| class="wikitable" |
|||
Or use poem tags instead of pre: |
|||
! class !! Code !! Result !! style="width:200px;" | Colour |
|||
|- |
|||
| |
|||
NA |
|||
| |
|||
<pre> |
<pre> |
||
<syntaxhighlight lang=text highlight="2" inline"> |
|||
<poem> |
|||
line one |
|||
In [[Wikipedia:Xanadu|Xanadu]] did Kubla Khan |
|||
line two |
|||
A stately pleasure-dome decree: |
|||
line three |
|||
Where Alph, the '''sacred river''', ran |
|||
line four |
|||
Through caverns measureless to man |
|||
</syntaxhighlight> |
|||
Down to a sunless sea. |
|||
So twice five miles of fertile ground |
|||
With walls and towers were girdled round: |
|||
And there were gardens bright with sinuous rills, |
|||
Where blossomed many an incense-bearing tree; |
|||
And here were <span style="color:green">forests</span> ancient as the hills, |
|||
Enfolding sunny spots of greenery. |
|||
</poem> |
|||
</pre> |
</pre> |
||
| |
|||
<syntaxhighlight lang=text highlight="2" inline"> |
|||
Results in: |
|||
line one |
|||
<poem> |
|||
line two |
|||
In [[Wikipedia:Xanadu|Xanadu]] did Kubla Khan |
|||
line three |
|||
A stately pleasure-dome decree: |
|||
line four |
|||
Where Alph, the '''sacred river''', ran |
|||
</syntaxhighlight> |
|||
Through caverns measureless to man |
|||
| |
|||
Down to a sunless sea. |
|||
Mediawiki Default Yellow Highlight |
|||
|- |
|||
So twice five miles of fertile ground |
|||
| |
|||
With walls and towers were girdled round: |
|||
;orange-highlight |
|||
And there were gardens bright with sinuous rills, |
|||
<code>class="orange-highlight"</code> |
|||
Where blossomed many an incense-bearing tree; |
|||
| |
|||
And here were <span style="color:green">forests</span> ancient as the hills, |
|||
<pre> |
|||
Enfolding sunny spots of greenery. |
|||
<syntaxhighlight lang=text highlight="3" class="orange-highlight inline"> |
|||
</poem> |
|||
line one |
|||
line two |
|||
line three |
|||
line four |
|||
</syntaxhighlight> |
|||
</pre> |
|||
| |
|||
<syntaxhighlight lang=text highlight="3" class="orange-highlight inline"> |
|||
line one |
|||
line two |
|||
line three |
|||
line four |
|||
</syntaxhighlight> |
|||
| |
|||
Fluorescent Orange |
|||
|- |
|||
| |
|||
;green-highlight |
|||
<code>class="green-highlight"</code> |
|||
| |
|||
<pre> |
|||
<syntaxhighlight lang=text highlight="1" class="green-highlight inline"> |
|||
line one |
|||
line two |
|||
line three |
|||
line four |
|||
</syntaxhighlight> |
|||
</pre> |
|||
| |
|||
<syntaxhighlight lang=text highlight="1" class="green-highlight inline"> |
|||
line one |
|||
line two |
|||
line three |
|||
line four |
|||
</syntaxhighlight> |
|||
| Fluorescent Green |
|||
|- |
|||
| |
|||
;pink-highlight |
|||
<code>class="pink-highlight"</code> |
|||
| |
|||
<pre> |
|||
<syntaxhighlight lang=text highlight="4" class="pink-highlight inline"> |
|||
line one |
|||
line two |
|||
line three |
|||
line four |
|||
</syntaxhighlight> |
|||
</pre> |
|||
| |
|||
<syntaxhighlight lang=text highlight="4" class="pink-highlight inline"> |
|||
line one |
|||
line two |
|||
line three |
|||
line four |
|||
</syntaxhighlight> |
|||
| Fluorescent Pink |
|||
|- |
|||
| |
|||
;blue-highlight |
|||
<code>class="blue-highlight"</code> |
|||
| |
|||
<pre> |
|||
<syntaxhighlight lang=text highlight="3" class="blue-highlight inline"> |
|||
line one |
|||
line two |
|||
line three |
|||
line four |
|||
</syntaxhighlight> |
|||
</pre> |
|||
| |
|||
<syntaxhighlight lang=text highlight="3" class="blue-highlight inline"> |
|||
line one |
|||
line two |
|||
line three |
|||
line four |
|||
</syntaxhighlight> |
|||
| Fluorescent Blue |
|||
|- |
|||
|} |
|||
Latest revision as of 09:56, 20 April 2023
This help page details the extended functionality on the Support Wikis : specifically for text-display and highlighting.
Four Main Tags
| Tag | Code | Result | When to use |
|---|---|---|---|
|
To check consumed disk space use |
To check consumed disk space use |
A short excerpt of code inline with a sentence or paragraph of text |
|
<pre> WHENEVER A(1).E.FENCE.OR.A(2).E.FENCE.OR.A(3).E.FENCE PRFULL.($'R'1INSTRUCTIONS:$) PRFULL.($ '4MAIL NAME1 NAME2 PROB1 PROG1 PROB2 PROG2 ...$) PRFULL.($ WHERE '=NAME1 NAME2'= IS THE FILE TO BE MAILED,$) PRFULL.($ AND '=PROBN PROGN'= ARE DIRECTORIES TO WHICH '8$, 1 $IT IS TO BE SENT.'B$) CHNCOM.(0) END OF CONDITIONAL </pre> |
WHENEVER A(1).E.FENCE.OR.A(2).E.FENCE.OR.A(3).E.FENCE PRFULL.($'R'1INSTRUCTIONS:$) PRFULL.($ '4MAIL NAME1 NAME2 PROB1 PROG1 PROB2 PROG2 ...$) PRFULL.($ WHERE '=NAME1 NAME2'= IS THE FILE TO BE MAILED,$) PRFULL.($ AND '=PROBN PROGN'= ARE DIRECTORIES TO WHICH '8$, 1 $IT IS TO BE SENT.'B$) CHNCOM.(0) END OF CONDITIONAL |
Most commonly used when a preformed block of text is required |
|
<syntaxhighlight lang="bash">
#!/bin/bash
fileCount=800000
b=0
while [ $b -le $fileCount ]
do
echo B = $b
dd if=/dev/urandom of=/mnt/nfs/file$b.txt bs=2k count=1
((b++))
done
</syntaxhighlight>
|
#!/bin/bash
fileCount=800000
b=0
while [ $b -le $fileCount ]
do
echo B = $b
dd if=/dev/urandom of=/mnt/nfs/file$b.txt bs=2k count=1
((b++))
done
|
Used to format code blocks according to the syntax of a language |
|
<poem> In [[Wikipedia:Xanadu|Xanadu]] did Kubla Khan A stately pleasure-dome decree: Where Alph, the '''sacred river''', ran Through caverns measureless to man Down to a sunless sea. So twice five miles of fertile ground With walls and towers were girdled round: And there were gardens bright with sinuous rills, Where blossomed many an incense-bearing tree; And here were <span style="color:green">forests</span> ancient as the hills, Enfolding sunny spots of greenery. </poem> |
In Xanadu did Kubla Khan |
The poem tags are designed for poetry and prose, though they can be adapted for code listings. Unlike the other 3 they allow the use of wiki markup inside the tags. |
Scrollbars and Text wrapping
| class | Code | Result | When to use |
|---|---|---|---|
|
default |
<pre> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </pre> |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
Default Behavior text is wrapped |
|
<pre class="scroll" style="width:300px;"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </pre> |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
Use for text based tables where it is easier to read if the text doesn't wrap |
|
<syntaxhighlight lang="lisp" class="inline">
(define-behavior (bounce
:start-when (or (bump?)
bounce-trigger? )
:abort-when (bump-edge?)
:onetime? t
)
)
</syntaxhighlight>
|
(define-behavior (bounce
:start-when (or (bump?)
bounce-trigger? )
:abort-when (bump-edge?)
:onetime? t
)
)
|
Use for smaller text blocks, if it is not desired that pre extend to the full width of the page |
Syntax Highlighting
If a programming language is not used the language can be specified as text, also the highlight attribute can be set to highlight lines of code:
<syntaxhighlight lang="text" highlight="8-11" class="scroll">
map profile show where ManagementApp FLUIDFS
<60756 (?)>
[60756] Mapping:MappingProfile 02/15/2013 12:53:34 AM
Index Server Server Volume MZ MZ MultiPat LUN Persona Personali Boot Write VM Managemen Admin DebugOu Active Bad Path LUN OS OS ManagementApp Active
Name Subsyst VolumeI Max Actual Preferr Actual Volume Protect Connect Status PathCo PathCo DownCo OnlyOne Product Version Controller
======= ======== =================================== ======= ======= ======= ======== ====== ======= ========= ======= ======= ========= ========= ======== ======= ====== ====== ====== ========= ============ ============ ============================== ==========
14 8 8 Cluster FS8600 15 15 15 0 1 0 60756 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60756
15 8 8 Cluster FS8600 16 15 16 0 2 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757
16 8 8 Cluster FS8600 17 15 17 0 3 0 60756 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60756
17 8 8 Cluster FS8600 18 15 18 0 4 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757
Walk: Display 4 of 4
</syntaxhighlight>
Demo of color coding using HTML markup and displaying line numbers:
<syntaxhighlight lang="html4strict" line class="inline">
<table align=center style="background: ivory;color:maroon;font-style:italic;font-family:arial;font-weight:bold;font-size:10pt;">
<caption>This is the top caption</caption>
<tr><th> Heading 1 </th><th> Heading 2 </th></tr>
<tr>
<td style="padding:10px;"> This is cell 1 text </td>
<td style="padding:10px;"> This is cell 2 text </td>
</tr>
</table>
</syntaxhighlight>
It is also possible to number the lines of code as demonstrated below:
<syntaxhighlight lang="html4strict" line start="100" highlight="5" enclose="div">
<!--This is a comment. Comments are not displayed in the browser-->
<table align=center style="background: ivory;color:maroon;font-style:italic;font-family:arial;font-weight:bold;font-size:10pt;">
<tr><th> Heading 1 </th><th> Heading 2 </th></tr>
<tr>
<td style="padding:10px;"> This is cell 1 text </td>
<td style="padding:10px;"> This is cell 2 text </td>
</tr>
</table>
</syntaxhighlight>
Changing Colours
| class | Code | Result | When to use |
|---|---|---|---|
|
<pre class="blue-white"> buffer = OPENSSL_malloc(1 + 2 + payload + padding); bp = buffer; /* Enter response type, length and copy payload */ *bp++ = TLS1_HB_RESPONSE; s2n(payload, bp); memcpy(bp, pl, payload); bp += payload; /* Random padding */ RAND_pseudo_bytes(bp, padding); </pre> |
buffer = OPENSSL_malloc(1 + 2 + payload + padding); bp = buffer; /* Enter response type, length and copy payload */ *bp++ = TLS1_HB_RESPONSE; s2n(payload, bp); memcpy(bp, pl, payload); bp += payload; /* Random padding */ RAND_pseudo_bytes(bp, padding); |
White on a Blue background |
|
<syntaxhighlight lang="javascript" highlight="13" class="black-white">
JSFX.FireSpark.prototype.changeColour = function()
{
var colour="";
r2= Math.random()*255;
g2= r2;
b2= 0;
if(!(r2 | g2 | b2))
{
r2=255;
g2=255;
b2=0;
}
colour = "#" + dec2hex(r2) + dec2hex(g2) + dec2hex(b2);
this.setBgColor(colour);
}
</syntaxhighlight>
|
JSFX.FireSpark.prototype.changeColour = function()
{
var colour="";
r2= Math.random()*255;
g2= r2;
b2= 0;
if(!(r2 | g2 | b2))
{
r2=255;
g2=255;
b2=0;
}
colour = "#" + dec2hex(r2) + dec2hex(g2) + dec2hex(b2);
this.setBgColor(colour);
}
|
White on a black background |
|
<syntaxhighlight lang="text" highlight="9" class="black-green scroll"> TEXT BASED TABLE OUTPUT HERE </syntaxhighlight> |
map profile show where ManagementApp FLUIDFS
<60756 (?)>
[60756] Mapping:MappingProfile 02/15/2013 12:53:34 AM
Index Server Server Volume MZ MZ MultiPat LUN Persona Personali Boot Write VM Managemen Admin DebugOu Active Bad Path LUN OS OS ManagementApp Active
Name Subsyst VolumeI Max Actual Preferr Actual Volume Protect Connect Status PathCo PathCo DownCo OnlyOne Product Version Controller
======= ======== =================================== ======= ======= ======= ======== ====== ======= ========= ======= ======= ========= ========= ======== ======= ====== ====== ====== ========= ============ ============ ============================== ==========
14 8 8 Cluster FS8600 15 15 15 0 1 0 60756 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60756
15 8 8 Cluster FS8600 16 15 16 0 2 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757
16 8 8 Cluster FS8600 17 15 17 0 3 0 60756 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60756
17 8 8 Cluster FS8600 18 15 18 0 4 0 60757 (0) Fal (0) Fal (3) Both (1) Auto (1) Enab (0) Fal 0 0 0 42949672* Compellent FS8600 1.x FLUIDFS 60757
Walk: Display 4 of 4
|
Green on a Black background |
Indenting <pre> tags
<pre> tags is to use: {{indent|<pre> code here <p/pre>}}; For
<code> and <syntaxhighlight> tags a : works fine
{{Indent|{{Pre|class=blue-white|# for i in $(diskview -I s {{!}} awk '/Online/{print $2}'); do echo -e "\n::: ${i} :::"; dd if{{eq}}/dev/rpd${i}d bs{{eq}}512 count{{eq}}1 of{{eq}}/pss/cc/o-dsb-${i}.bin; done}}}}
| Code | # one #:<pre> #::some stuff #::some more stuff</pre> # two |
| Result |
|
; Something to notice in bash example below :<syntaxhighlight lang=bash inline> #!/bin/bash fileCount=800000 b=0 while [ $b -le $fileCount ] do echo B = $b dd if=/dev/urandom of=/mnt/nfs/file$b.txt bs=2k count=1 ((b++)) done </syntaxhighlight>
- Something to notice in bash example below
#!/bin/bash fileCount=800000 b=0 while [ $b -le $fileCount ] do echo B = $b dd if=/dev/urandom of=/mnt/nfs/file$b.txt bs=2k count=1 ((b++)) done
- Something to notice in bash example below
#!/bin/bash fileCount=800000 b=0 while [ $b -le $fileCount ] do echo B = $b dd if=/dev/urandom of=/mnt/nfs/file$b.txt bs=2k count=1 ((b++)) done
;Same works for code tags: :<code>Indented code snippet</code>
- Same works for code tags
Indented code snippet
Annotate <pre> contents with Pointers / Boxes
Annotations can be added to <pre> elements ( including <syntaxhighlight> using lang="text" and highlight options )
Example
<pre>
disk show CA Table Display Request Time: 00.001_536_431 [10722] DiskManager:Disk 04/29/2012 09:14:25 am <10722 (?)> Index Name ManagementDiscipline OperStatus ParentFolder Class TotalBlockCoun UnallocatedBlo DiskSize Health ===== ==================== ==================== ========== ============ ===== ============== ============== ============== ==================== 65 (1) Managed (1) Up 3 1 286749488 20124944 136.73 GB Healthy 105 (1) Managed (1) Up 3 1 286749488 20124944 136.73 GB Healthy 106 (1) Managed (<point-here>2) Down 3 1 286749488 286749456 136.73 GB <box>WriteError</box> 107 (1) Managed (1) Up 3 1 286749488 20124944 136.73 GB Healthy
</pre>
Pointer inside the <pre>
To add a pointer, the single <point-here> tag can used like this (use lowercase : UPPERCASE is used here to prevent any JS action! )
106 (1) Managed (2) <point-here>Down 3 1
Pointer Direction
To specify pointer direction, use <point-here-tl> for "top left", <point-here-tr> for "top right", <point-here-br> for "bottom right" etc..
106 (1) Managed (2) <point-here-br>Down 3 1
Floating Box over Word
- To Box a word, use the
<box>tag like this (use lowercase : UPPERCASE is used here to prevent any JS action! )
286749488 286749456 136.73 GB <box>WriteError</box>
Traditional shell colouring
- Use the class "shell" to colour the background of a pre black with green text:
<pre class="shell"> 286749488 286749456 136.73 GB <box>WriteError</box> </pre>
Results in:
286749488 286749456 136.73 GB <box>WriteError</box>
Use links and formatting inside a code block
For this use pre template instead of pre tags ({{pre|code goes here}}):
{{Pre|class=black-white inline|
[caleb_cooper@ola cfd7416402094f6a2b8dcbccb9bad4d439b1d21a]$ egrep -c "0x0000244[57]" node_[ab]/command_output/pmcli/netinfo.txt
{{Color|purple|node_a/command_output/pmcli/netinfo.txt}}{{Color|cyan|:}}{{H|4|red}}
{{Color|purple|node_b/command_output/pmcli/netinfo.txt}}{{Color|cyan|:}}0
[caleb_cooper@ola cfd7416402094f6a2b8dcbccb9bad4d439b1d21a]$
}}
[caleb_cooper@ola cfd7416402094f6a2b8dcbccb9bad4d439b1d21a]$ egrep -c "0x0000244[57]" node_[ab]/command_output/pmcli/netinfo.txt node_a/command_output/pmcli/netinfo.txt:4 node_b/command_output/pmcli/netinfo.txt:0 [caleb_cooper@ola cfd7416402094f6a2b8dcbccb9bad4d439b1d21a]$
{{pre}} was used in conjunction with {{Color}} (to provide a text color change) and {{H}} to change the background color of the font for the number 4
= and | always have to be escaped in templates, the templates {{!}} and {{eq}} have been provided for this purpose, example below requiring this. Also it is not possible to use : for indents, use {{Indent}} template instead
Highlighting
| class | Code | Result | Colour |
|---|---|---|---|
|
NA |
<syntaxhighlight lang=text highlight="2" inline"> line one line two line three line four </syntaxhighlight> |
line one
line two
line three
line four
|
Mediawiki Default Yellow Highlight |
|
<syntaxhighlight lang=text highlight="3" class="orange-highlight inline"> line one line two line three line four </syntaxhighlight> |
line one
line two
line three
line four
|
Fluorescent Orange |
|
<syntaxhighlight lang=text highlight="1" class="green-highlight inline"> line one line two line three line four </syntaxhighlight> |
line one
line two
line three
line four
|
Fluorescent Green |
|
<syntaxhighlight lang=text highlight="4" class="pink-highlight inline"> line one line two line three line four </syntaxhighlight> |
line one
line two
line three
line four
|
Fluorescent Pink |
|
<syntaxhighlight lang=text highlight="3" class="blue-highlight inline"> line one line two line three line four </syntaxhighlight> |
line one
line two
line three
line four
|
Fluorescent Blue |
