Skip to content

Instantly share code, notes, and snippets.

cli script vip_ssl_check.tcl {
proc script::init {} {
set ::cssl_profiles ""
set ::sssl_profiles ""
}
proc print_ssl_details {vip cs ss insp} {
puts "Virtual: $vip"
puts "\tClient-side encrypted: $cs"
puts "\tServer-side encrypted: $ss"
puts "\tInspection possible: $insp"
@f5-rahm
f5-rahm / heatmap_2022
Created November 17, 2022 22:47
Update of Colin Walker's original Heatmap iRule to utilize Google's Geocharts
ltm rule /Common/heatmap_2022 {
when RULE_INIT priority 500 {
set static::geochart "
<html>
<head>
<title>Heatmap</title>
<script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>
</head>
<body>
@f5-rahm
f5-rahm / heatmap
Last active November 17, 2022 22:49
Colin Walker's original heatmap iRule (for reference - use heatmap_2022 instead)
ltm rule /Common/heatmap {
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/heatmap"} {
set chld ""
set chd ""
foreach state [table keys -subtable states] {
append chld $state
append chd "[table lookup -subtable states $state],"
}
set chd [string trimright $chd ","]
@f5-rahm
f5-rahm / 2022_AoC_Day1.irul
Created January 12, 2023 21:46
iRules Solution to Day 1 of the 2022 Advent of Code. Requires iFiles as named with the test and puzzle data (with final newline)
ltm rule aoc_day1 {
proc find_sum { snack_list } {
set calorie_sum 0
foreach snack [string map { \{ "" \} "" } $snack_list] {
set calorie_sum [expr {$calorie_sum + $snack}]
}
return $calorie_sum
}
"""
Source File CSV Contents:
10.10.10.10,
10.10.10.11,hi there
10.10.11.0/24,
10.10.12.0/24,/url/path/here
10.10.13.0/24,
Output File Txt Contents:
host 10.10.10.10,
@f5-rahm
f5-rahm / poolstats.py
Created May 26, 2023 17:11
Download LTM pool members stats from all partitions
from bigrest.bigip import BIGIP
from time import sleep
import argparse
import getpass
import sys
def build_parser():
parser = argparse.ArgumentParser()
parser.add_argument("host", help="BIG-IP IP/FQDN")
@f5-rahm
f5-rahm / poolstats.tcl
Created May 26, 2023 17:13
Collect LTM Pool Member Stats
proc script::run {} {
# where to store the data - /shared/images
set fp [open "/shared/images/poolstats.csv" w+]
tmsh::cd /
# CSV HEADER
puts $fp "pool,member,ss.bits-in,ss.bits-out,ss.pkts-in,ss.pkts-out"
@f5-rahm
f5-rahm / dc-code-tag-fix.js
Last active May 30, 2023 19:54
DevCentral code block client-side fix with Tampermonkey
// ==UserScript==
// @name DC Code Tag Fix v2
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Jason Rahm w/ ChatGPT Assist
// @match https://community.f5.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=f5.com
// @grant none
// ==/UserScript==
@f5-rahm
f5-rahm / gist:11bae66d697f24eda888cd6b34116b27
Created November 29, 2023 23:57
BIG-IP Session Table Control
ltm rule session_table_control {
when HTTP_REQUEST {
set APPNAME "subtables";
set luri [string tolower [HTTP::uri]]
set app [getfield $luri "/" 2];
set cmd [getfield $luri "/" 3];
set tname [URI::decode [getfield [HTTP::uri] "/" 4]];
set arg1 [URI::decode [getfield [HTTP::uri] "/" 5]];
set arg2 [URI::decode [getfield [HTTP::uri] "/" 6]];
@f5-rahm
f5-rahm / ce_coords.py
Created January 8, 2024 22:23
Get Lat/Lon coordinates by address for F5 Distributed Cloud CE devices
"""
Usage:
~/testlab/venv/bin/python ~/testlab/ce_coords.py
Enter the installation address for your F5 Distributed Cloud CE device:
801 5th Ave, Seattle WA 98104
Latitude: 47.60518879999999, Longitude: -122.33104424785958