Difference between revisions of "User:Pckizer"
Jump to navigation
Jump to search
(add a minor about me page to test editing) |
(add sample code to test highlighting and graph generation) |
||
Line 1: | Line 1: | ||
Sysadmin for Tekelec (was Estacado) that manages the reSIProcate infrastructure. | Sysadmin for Tekelec (was Estacado) that manages the reSIProcate infrastructure. | ||
+ | |||
+ | = Below is my personal testing ground for wiki code = | ||
+ | |||
+ | |||
+ | = Test syntax highlighting = | ||
+ | |||
+ | HTML: | ||
+ | |||
+ | <syntaxhighlight lang="html4strict" line start="100" highlight="5"> | ||
+ | <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> | ||
+ | |||
+ | DOT: | ||
+ | |||
+ | <syntaxhighlight lang="dot"> | ||
+ | digraph depends { | ||
+ | gen -> snmp; | ||
+ | snmp -> gen; | ||
+ | tnl -> gen; | ||
+ | tnl -> snmp; | ||
+ | gsm -> gen; | ||
+ | diameter -> gen; | ||
+ | diameter -> snmp; | ||
+ | mxp -> gen; | ||
+ | mxp -> snmp; | ||
+ | mxp -> tnl; | ||
+ | sctp -> gen; | ||
+ | |||
+ | IIW -> diameter; | ||
+ | IIW -> snmp; | ||
+ | IIW -> gen; | ||
+ | IIW -> gsm; | ||
+ | IIW -> mxp; | ||
+ | IIW -> tnl; | ||
+ | IIW -> sctp; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | Perl: | ||
+ | |||
+ | <syntaxhighlight lang="Perl"> | ||
+ | # Split the addr-tuple into IP address and port | ||
+ | (@split_data) = split(/:/, $address); | ||
+ | if (@split_data == 2) { | ||
+ | # IPv4 address and port | ||
+ | ($address,$port) = @split_data; | ||
+ | } elsif (@split_data > 2) { | ||
+ | # IPv6 address and port | ||
+ | $port = pop(@split_data); | ||
+ | $address = join(":",@split_data); | ||
+ | # This converts any proper [ip:v6::add:ress:es] to remove the brackets | ||
+ | $address =~ s/[\[\]]//g; | ||
+ | } else { | ||
+ | print STDERR "Error, not in the form of address:port: $key\n"; | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | = Test of an in-wiki dot/graphviz markup = | ||
+ | |||
+ | == Simple Graph == | ||
+ | <center> | ||
+ | <graphviz renderer='neato' caption='Hello Neato' format='svg'> | ||
+ | graph EXAMPLE2 { | ||
+ | node [fontsize=9]; | ||
+ | run -- intr; | ||
+ | intr -- runbl; | ||
+ | runbl -- run; | ||
+ | run -- kernel; | ||
+ | kernel -- zombie; | ||
+ | kernel -- sleep; | ||
+ | kernel -- runmem; | ||
+ | sleep -- swap; | ||
+ | swap -- runswap; | ||
+ | runswap -- new; | ||
+ | runswap -- runmem; | ||
+ | new -- runmem; | ||
+ | sleep -- runmem; | ||
+ | } | ||
+ | </graphviz> | ||
+ | |||
+ | == Digraph == | ||
+ | |||
+ | <graphviz renderer="fdp"> | ||
+ | digraph depends { | ||
+ | gen -> snmp; | ||
+ | snmp -> gen; | ||
+ | tnl -> gen; | ||
+ | tnl -> snmp; | ||
+ | gsm -> gen; | ||
+ | diameter -> gen; | ||
+ | diameter -> snmp; | ||
+ | mxp -> gen; | ||
+ | mxp -> snmp; | ||
+ | mxp -> tnl; | ||
+ | sctp -> gen; | ||
+ | |||
+ | IIW -> diameter; | ||
+ | IIW -> snmp; | ||
+ | IIW -> gen; | ||
+ | IIW -> gsm; | ||
+ | IIW -> mxp; | ||
+ | IIW -> tnl; | ||
+ | IIW -> sctp; | ||
+ | } | ||
+ | </graphviz> | ||
+ | |||
+ | == Digraph with clusters == | ||
+ | |||
+ | |||
+ | <graphviz> | ||
+ | digraph G { | ||
+ | subgraph cluster_0 { | ||
+ | label = "hello world"; | ||
+ | a -> b; | ||
+ | a -> c; | ||
+ | color = hot_pink; | ||
+ | } | ||
+ | subgraph cluster_1 { | ||
+ | label = "MSDOT"; | ||
+ | style= "dashed"; | ||
+ | color=purple; | ||
+ | x -> y; | ||
+ | x -> z; | ||
+ | y -> z; | ||
+ | y -> q; | ||
+ | } | ||
+ | top -> a; | ||
+ | top -> y; | ||
+ | y -> b; | ||
+ | } | ||
+ | </graphviz> | ||
+ | |||
+ | == Colours! == | ||
+ | |||
+ | <graphviz> | ||
+ | digraph G { | ||
+ | xyz [label = "hello\nworld", | ||
+ | fontsize=24, | ||
+ | style=filled, | ||
+ | fontname="Palatino-Italic", | ||
+ | color="purple", | ||
+ | fontcolor="pink"]; | ||
+ | node [style=filled]; | ||
+ | # Colors can be hue, saturation, brightness, | ||
+ | red [color="0.0 1.0 1.0"]; | ||
+ | # or colors can be red green blue, | ||
+ | green [color="#00FF00"]; | ||
+ | # or colors can be named. | ||
+ | blue [color=blue, fontcolor=black]; | ||
+ | cyan [color=cyan]; | ||
+ | magenta [color=magenta]; | ||
+ | yellow [color=yellow]; | ||
+ | orange [color=orange]; | ||
+ | red -> green; | ||
+ | red -> blue; | ||
+ | blue -> cyan; | ||
+ | blue -> magenta; | ||
+ | green -> yellow; | ||
+ | green -> orange; | ||
+ | } | ||
+ | </graphviz> | ||
+ | |||
+ | ---- | ||
+ | |||
+ | =Message sequence graph= | ||
+ | |||
+ | <mscgen format='svg'> | ||
+ | # Fictional client-server protocol | ||
+ | msc { | ||
+ | arcgradient = 8; | ||
+ | |||
+ | a [label="Client"],b [label="Server"]; | ||
+ | |||
+ | a=>b [label="data1"]; | ||
+ | a-xb [label="data2"]; | ||
+ | a=>b [label="data3"]; | ||
+ | a<=b [label="ack1, nack2"]; | ||
+ | a=>b [label="data2", arcskip="1"]; | ||
+ | |||; | ||
+ | a<=b [label="ack3"]; | ||
+ | |||; | ||
+ | } | ||
+ | </mscgen> | ||
+ | |||
+ | ---- | ||
+ | |||
+ | =Show more message-sequence commands= | ||
+ | <mscgen> | ||
+ | # MSC for some fictional process | ||
+ | msc { | ||
+ | hscale = "2"; | ||
+ | |||
+ | a,b,c; | ||
+ | |||
+ | a->b [ label = "ab()" ] ; | ||
+ | b->c [ label = "bc(TRUE)"]; | ||
+ | c=>c [ label = "process(1)" ]; | ||
+ | c=>c [ label = "process(2)" ]; | ||
+ | ...; | ||
+ | c=>c [ label = "process(n)" ]; | ||
+ | c=>c [ label = "process(END)" ]; | ||
+ | a<<=c [ label = "callback()"]; | ||
+ | --- [ label = "If more to run", ID="*" ]; | ||
+ | a->a [ label = "next()"]; | ||
+ | a->c [ label = "ac1()\nac2()"]; | ||
+ | b<-c [ label = "cb(TRUE)"]; | ||
+ | b->b [ label = "stalled(...)"]; | ||
+ | a<-b [ label = "ab() = FALSE"]; | ||
+ | } | ||
+ | </mscgen> | ||
+ | |||
+ | ---- | ||
+ | |||
+ | =MSC using boxes= | ||
+ | |||
+ | <mscgen> | ||
+ | |||
+ | # Example MSC using boxes | ||
+ | |||
+ | msc { | ||
+ | |||
+ | # The entities | ||
+ | A, B, C, D; | ||
+ | |||
+ | # Small gap before the boxes | ||
+ | |||; | ||
+ | |||
+ | # Next four on same line due to ',' | ||
+ | A box A [label="box"], | ||
+ | B rbox B [label="rbox"], | ||
+ | C abox C [label="abox"], | ||
+ | D note D [label="note"]; | ||
+ | |||
+ | # Example of the boxes with filled backgrounds | ||
+ | A abox B [label="abox", textbgcolour="#ff7f7f"]; | ||
+ | B rbox C [label="rbox", textbgcolour="#7fff7f"]; | ||
+ | C note D [label="note", textbgcolour="#7f7fff"]; | ||
+ | } | ||
+ | </mscgen> |
Revision as of 14:35, 26 April 2011
Sysadmin for Tekelec (was Estacado) that manages the reSIProcate infrastructure.
Contents
Below is my personal testing ground for wiki code
Test syntax highlighting
HTML:
<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>
DOT:
digraph depends {
gen -> snmp;
snmp -> gen;
tnl -> gen;
tnl -> snmp;
gsm -> gen;
diameter -> gen;
diameter -> snmp;
mxp -> gen;
mxp -> snmp;
mxp -> tnl;
sctp -> gen;
IIW -> diameter;
IIW -> snmp;
IIW -> gen;
IIW -> gsm;
IIW -> mxp;
IIW -> tnl;
IIW -> sctp;
Perl:
# Split the addr-tuple into IP address and port
(@split_data) = split(/:/, $address);
if (@split_data == 2) {
# IPv4 address and port
($address,$port) = @split_data;
} elsif (@split_data > 2) {
# IPv6 address and port
$port = pop(@split_data);
$address = join(":",@split_data);
# This converts any proper [ip:v6::add:ress:es] to remove the brackets
$address =~ s/[\[\]]//g;
} else {
print STDERR "Error, not in the form of address:port: $key\n";
}
Test of an in-wiki dot/graphviz markup
Simple Graph
<graphviz renderer='neato' caption='Hello Neato' format='svg'> graph EXAMPLE2 {
node [fontsize=9]; run -- intr; intr -- runbl; runbl -- run; run -- kernel; kernel -- zombie; kernel -- sleep; kernel -- runmem; sleep -- swap; swap -- runswap; runswap -- new; runswap -- runmem; new -- runmem; sleep -- runmem;
} </graphviz>
Digraph
<graphviz renderer="fdp"> digraph depends {
gen -> snmp; snmp -> gen; tnl -> gen; tnl -> snmp; gsm -> gen; diameter -> gen; diameter -> snmp; mxp -> gen; mxp -> snmp; mxp -> tnl; sctp -> gen; IIW -> diameter; IIW -> snmp; IIW -> gen; IIW -> gsm; IIW -> mxp; IIW -> tnl; IIW -> sctp;
} </graphviz>
Digraph with clusters
<graphviz> digraph G {
subgraph cluster_0 { label = "hello world";
a -> b; a -> c; color = hot_pink;
} subgraph cluster_1 {
label = "MSDOT"; style= "dashed"; color=purple; x -> y; x -> z; y -> z; y -> q;
} top -> a; top -> y; y -> b;
} </graphviz>
Colours!
<graphviz> digraph G {
xyz [label = "hello\nworld", fontsize=24, style=filled, fontname="Palatino-Italic", color="purple", fontcolor="pink"]; node [style=filled];
- Colors can be hue, saturation, brightness,
red [color="0.0 1.0 1.0"];
- or colors can be red green blue,
green [color="#00FF00"];
- or colors can be named.
blue [color=blue, fontcolor=black]; cyan [color=cyan]; magenta [color=magenta]; yellow [color=yellow]; orange [color=orange]; red -> green; red -> blue; blue -> cyan; blue -> magenta; green -> yellow; green -> orange;
} </graphviz>
Message sequence graph
<mscgen format='svg'>
- Fictional client-server protocol
msc {
arcgradient = 8;
a [label="Client"],b [label="Server"];
a=>b [label="data1"]; a-xb [label="data2"]; a=>b [label="data3"]; a<=b [label="ack1, nack2"]; a=>b [label="data2", arcskip="1"]; |||; a<=b [label="ack3"]; |||;
} </mscgen>
Show more message-sequence commands
<mscgen>
- MSC for some fictional process
msc {
hscale = "2";
a,b,c;
a->b [ label = "ab()" ] ; b->c [ label = "bc(TRUE)"]; c=>c [ label = "process(1)" ]; c=>c [ label = "process(2)" ]; ...; c=>c [ label = "process(n)" ]; c=>c [ label = "process(END)" ]; a<<=c [ label = "callback()"]; --- [ label = "If more to run", ID="*" ]; a->a [ label = "next()"]; a->c [ label = "ac1()\nac2()"]; b<-c [ label = "cb(TRUE)"]; b->b [ label = "stalled(...)"]; a<-b [ label = "ab() = FALSE"];
} </mscgen>
MSC using boxes
<mscgen>
- Example MSC using boxes
msc {
# The entities A, B, C, D;
# Small gap before the boxes |||;
# Next four on same line due to ',' A box A [label="box"], B rbox B [label="rbox"], C abox C [label="abox"], D note D [label="note"];
# Example of the boxes with filled backgrounds A abox B [label="abox", textbgcolour="#ff7f7f"]; B rbox C [label="rbox", textbgcolour="#7fff7f"]; C note D [label="note", textbgcolour="#7f7fff"];
} </mscgen>