summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xhl_FW9
-rwxr-xr-xhl_df10
-rwxr-xr-xhl_diff9
-rwxr-xr-xhl_heartbeat13
-rwxr-xr-xhl_ifconfig2
-rw-r--r--hl_ifconfig.data23
-rwxr-xr-xhl_percent11
-rwxr-xr-xhl_test13
-rw-r--r--hl_test.out15
-rwxr-xr-xhl_validate_IP9
-rwxr-xr-xhl_virsh_list9
11 files changed, 122 insertions, 1 deletions
diff --git a/hl_FW b/hl_FW
new file mode 100755
index 0000000..bdbbb65
--- /dev/null
+++ b/hl_FW
@@ -0,0 +1,9 @@
+#!/bin/bash
+#
+# Colorize iptables directives
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# @(#) [MB] cr_hl_FW Version 1.1 du 15/04/08 -
+#
+
+hl -e -c INPUT -y 'FORWARD|POSTROUTING' -b '#.*' -W 'OUTPUT' -g '.*ACCEPT.*' -r '.*(DROP|REJECT).*' -m 'iptables.*-F.*' -w '^iptables .*'
diff --git a/hl_df b/hl_df
new file mode 100755
index 0000000..7ce69a8
--- /dev/null
+++ b/hl_df
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# Colorize the output of the df command
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# @(#) [MB] cr_hl_df Version 1.1 du 15/04/07 -
+#
+
+#df -P | hl -e -r '\<(100|9[5-9])%' -y '\<(8[0-9]|9[0-4])%' -g '\<[0-9]+%' -b '^Filesystem.*'
+hl -e -r '\<(100|9[5-9])%' -y '\<(8[0-9]|9[0-4])%' -g '\<[0-9]+%' -b '^Filesystem.*'
diff --git a/hl_diff b/hl_diff
new file mode 100755
index 0000000..e7054b2
--- /dev/null
+++ b/hl_diff
@@ -0,0 +1,9 @@
+#!/bin/bash
+#
+# Colorize the output of the diff command
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# @(#) [MB] cr_hl_diff Version 1.2 du 15/04/07 -
+#
+
+hl -e -y '^<.*' -g '^>.*' -c '^[0-9]+(,[0-9]+)?[a-z][0-9]+(,[0-9]+)?'
diff --git a/hl_heartbeat b/hl_heartbeat
new file mode 100755
index 0000000..88e6069
--- /dev/null
+++ b/hl_heartbeat
@@ -0,0 +1,13 @@
+#!/bin/bash
+#
+# Colorize hearbeat logs
+# ~~~~~~~~~~~~~~~~~~~~~~
+#
+# @(#) [MB] cr_hl_heartbeat Version 1.1 du 15/03/24 -
+#
+
+hl -ei -r'stop(|ped)|error|fail\>|failed|dead|disabled?|\<down|\<no\>' \
+ -g 'success|running|start(ed|ing)?|OK|yes|shutdown complete' \
+ -y 'warn' \
+ -W 'eth[0-9](\.[0-9]+)?(:[0-9]+)' \
+ -b 'info'
diff --git a/hl_ifconfig b/hl_ifconfig
index cc97ddf..4945fc9 100755
--- a/hl_ifconfig
+++ b/hl_ifconfig
@@ -3,7 +3,7 @@
# Colorize ifconfig output
# ~~~~~~~~~~~~~~~~~~~~~~~~
#
-# %Z% [%Y%] %M% Version %I% du %E% - %Q%
+# @(#) [MB] cr_hl_ifconfig Version 1.1 du 15/04/08 -
#
hl -ei -m '^(eth|(vir)?br|vnet)[0-9.]*:[0-9]+\>' \
diff --git a/hl_ifconfig.data b/hl_ifconfig.data
new file mode 100644
index 0000000..9f119ec
--- /dev/null
+++ b/hl_ifconfig.data
@@ -0,0 +1,23 @@
+#
+# @(#) [MB] cr_hl_ifconfig.data Version 1.1 du 15/04/08 -
+#
+
+eth0 Link encap:Ethernet HWaddr 00:00:5a:9d:86:ba
+ inet addr:192.168.1.181 Bcast:192.168.1.255 Mask:255.255.255.0
+ inet6 addr: fe80::200:5aff:fe9d:86ba/64 Scope:Link
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:41029968 errors:0 dropped:29644 overruns:0 frame:0
+ TX packets:643930 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:2172299915 (2.0 GiB) TX bytes:54385010 (51.8 MiB)
+ Interrupt:17
+
+lo Link encap:Local Loopback
+ inet addr:127.0.0.1 Mask:255.0.0.0
+ inet6 addr: ::1/128 Scope:Host
+ UP LOOPBACK RUNNING MTU:16436 Metric:1
+ RX packets:44 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:0
+ RX bytes:22032 (21.5 KiB) TX bytes:22032 (21.5 KiB)
+
diff --git a/hl_percent b/hl_percent
new file mode 100755
index 0000000..b5866f9
--- /dev/null
+++ b/hl_percent
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Colorize percentages according to thresholds
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# @(#) [MB] cr_hl_percent Version 1.1 du 15/04/07 -
+#
+
+# echo '0% 1% 10% 50% 79% 80% 90% 94% 95% 100%' | hl -e -r '\<(100|9[5-9])%' -y '\<(8[0-9]|9[0-4])%' -g '\<[0-9]+%'
+
+hl -e -r '\<(100|9[5-9])%' -y '\<(8[0-9]|9[0-4])%' -g '\<[0-9]+%'
diff --git a/hl_test b/hl_test
new file mode 100755
index 0000000..3f3f3f9
--- /dev/null
+++ b/hl_test
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+<<-EOF ./hl -r 'red' -g 'green' -y 'yellow' -b 'blue' -m 'magenta' -c 'cyan' -w 'white' -R 'RED' -G 'GREEN' -Y 'YELLOW' -B 'BLUE' -M 'MAGENTA' -C 'CYAN' -W 'WHITE'
+ ./hl -r 'red' -g 'green' -y 'yellow' -b 'blue' -m 'magenta' -c 'cyan' -w 'white' -R 'RED' -G 'GREEN' -Y 'YELLOW' -B 'BLUE' -M 'MAGENTA' -C 'CYAN' -W 'WHITE'
+EOF
+
+<<-EOF ./hl -r 'A' -g 'B' -y 'C' -b 'D' -m 'E' -c 'F' -w 'G' -R 'H' -G 'I' -Y 'J' -B 'K' -M 'L' -C 'M' -W 'N'
+ ABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZ
+EOF
+
+<<-EOF ./hl -e -r '^A[^F]*E' -g 'B|Z$' -y 'C' -b 'D' -m 'E' -c 'F' -w 'G' -R 'H' -G 'T[^S]*Z$' -Y 'J' -B 'K' -M 'L' -C 'M' -W 'N'
+ ABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZ
+EOF
diff --git a/hl_test.out b/hl_test.out
new file mode 100644
index 0000000..59cce1c
--- /dev/null
+++ b/hl_test.out
@@ -0,0 +1,15 @@
+[ 1] ^A[^F]*E
+[ 2] B
+[ 3] C
+[ 4] D
+[ 5] E
+[ 6] F
+[ 7] G
+[ 8] H
+[ 9] T[^S]*Z$
+[10] J
+[11] K
+[12] L
+[13] M
+[14] N
+ABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZABCDEFGHIJKMNOPQRSTUVWXYZ
diff --git a/hl_validate_IP b/hl_validate_IP
new file mode 100755
index 0000000..5824883
--- /dev/null
+++ b/hl_validate_IP
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+# Validation d'expressions regulieres
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# @(#) [MB] cr_hl_validate_IP Version 1.1 du 15/03/24 -
+#
+
+hl -e -g '\<(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>' -r '[0-9]'
diff --git a/hl_virsh_list b/hl_virsh_list
new file mode 100755
index 0000000..76a19b7
--- /dev/null
+++ b/hl_virsh_list
@@ -0,0 +1,9 @@
+#!/bin/bash
+#
+# Coloration de la commande virsh list --all
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# @(#) [MB] cr_hl_virsh_list Version 1.1 du 15/04/07 -
+#
+
+hl -e -c '^ *Id.*|^--*' -g '.*running*' -m '.*shut off' -y '.*paused'