Skip to content

Instantly share code, notes, and snippets.

View angeloxx's full-sized avatar
🎯
Focusing

angeloxx angeloxx

🎯
Focusing
View GitHub Profile
@angeloxx
angeloxx / nagios_check_perfdata.py
Last active July 29, 2022 06:52
Nagios/Icinga2 monitor perfdata
#!/usr/bin/python3
import os, glob, time, sys, argparse
# The script navigate Nagios/Icinga2's perfdata and read it in order to create additional treshold based on last value or the trend in a specific timespan.
# python3 scripts/check_perfdata.py -H SERVER -S ILO_HEALTH -V Inlet_Ambient -C 21 -W 19.1 --trend-period-minutes 10 -P var/spool/icinga2/perfdata/ --trend-warning=1 --trend-critical=2
INVALIDVALUE = -999
latestValue = INVALIDVALUE
latestValueTime = INVALIDVALUE
trendFirstValue = INVALIDVALUE
@angeloxx
angeloxx / shBrushCLI.js
Last active April 3, 2022 17:19
Unix Syntax Hightligher Brush
/**
* SyntaxHighlighter Brush for Command Line Interface
* Author: Angelo Conforti
* License: GPL-2 | GPL-3
*/
SyntaxHighlighter.brushes.cli = function()
{
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
@angeloxx
angeloxx / Ansible, VMware and Atlassian Confluence integration
Last active January 6, 2022 14:53
Export to Atlassian Confluence via API the list of vCenter VMs using Ansible
This small playbook:
* get the list of registered VMs and dump in a temporary json file (tag discover)
* create or edit a page on Confluence (tag report)
You can reuse the task confluence-page.yaml to generate automatically pages via Ansible

Case

Sep 13 00:01:36 mail-c-eqs postfix/smtpd[20124]: SSL_accept error from xxxx.xxxxx.xxxx[xxx.xxx.xxx.xxx]: -1
Sep 13 00:01:36 mail-c-eqs postfix/smtpd[20124]: warning: TLS library problem: 20124:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:s3_pkt.c:293:
Sep 13 00:01:36 mail-c-eqs postfix/smtpd[20124]: lost connection after STARTTLS from xxxx.xxxxx.xxxx[xxx.xxx.xxx.xxx]
Sep 13 00:01:36 mail-c-eqs postfix/smtpd[20124]: disconnect from xxxx.xxxxx.xxxx[xxx.xxx.xxx.xxx]

Solution

  • disable starttls for specific client with this (mail.cf):
@angeloxx
angeloxx / modsec-clamscan.lua
Last active September 26, 2022 18:21
ModSecurity ClamAV integration script (LUA)
#!/usr/bin/lua
--[[
This script can be used to inspect uploaded files for viruses
via ClamAV. To implement, use with the following ModSecurity rule:
SecRule FILES_TMPNAMES "@inspectFile /opt/modsecurity/bin/modsec-clamscan.lua" "phase:2,t:none,log,deny"
Author: Angelo Conforti (based on Josh Amishav-Zlatin code)
Requires the clamav-server and clamav-scanner

Keybase proof

I hereby claim:

  • I am angeloxx on github.
  • I am angeloxx (https://keybase.io/angeloxx) on keybase.
  • I have a public key whose fingerprint is 0F4D 1CBF 4455 2732 1A31 55B9 140F 537E D0BB 8CAA

To claim this, I am signing this object:

@angeloxx
angeloxx / RTGUI-Start-Stop-All.md
Last active July 24, 2016 14:49
RTgui start/stop all rtorrent downloads

This snippet adds the stopall/startall command to RTgui, you can call it via http://hostname/control.php?cmd=startall GET request and integrate it, like me, the Torrent download with the home automation system (ie VantageControls InFusion system via UselessAngelo.Generic HTTP Client driver). In this way I stop the BitTorrent client when I power on the TV set and restart it when power off the TV or arm the burgalarm system.

@angeloxx
angeloxx / VMwareToolsUpdate.sh
Created December 14, 2015 07:45
non-interactive vmware tools install/update
#!/bin/sh
mount /media/cdrom
cd /usr/src
rm -rf vmware-tools-distrib
tar -xzf /media/cdrom/VM*.tar.gz
umount /media/cdrom
cd vmware-tools-distrib
./vmware-install.pl --default
cd ..
rm -rf vmware-tools-distrib