Skip to content

Instantly share code, notes, and snippets.

@rtfmoz2
Last active March 15, 2019 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtfmoz2/81ae6821f8d3d70f4888a409694c53dc to your computer and use it in GitHub Desktop.
Save rtfmoz2/81ae6821f8d3d70f4888a409694c53dc to your computer and use it in GitHub Desktop.
BIG-IP Coffee iRule
when HTTP_REQUEST {
set coffee { 5)3;; 4(3;; 2+1-5+1;; 2|1 5|1]1;; 2\1-5/1;;_9_2;;\1_9/1}
set response "Coffee 3.0\n\n"
switch [HTTP::uri] {
"/coffee" {
foreach {mychar myrepeat} [ split $coffee {} ] {
if {$mychar equals ";"} {
append response "[format "%-15s" $cuppa]$cuppa\n"
unset cuppa
} else {
append cuppa [string repeat $mychar $myrepeat]
}
}
append response "\n\nYour coffee's are ready.\n\n"
append response "The Virtual Coffee Machine"
HTTP::respond 200 content $response Content-Type "text/plain" Connection Close
event disable all
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment