Skip to content

Instantly share code, notes, and snippets.

View thanosa75's full-sized avatar

Thanos thanosa75

View GitHub Profile
@thanosa75
thanosa75 / tunnelviapod.sh
Created May 23, 2022 10:45
Create a socket tunnel via a pod on a kubernetes namespace
#!/usr/bin/env bash
#
# A simple 'tunnel-via-pod' mechanism, that allows you to test pod or
# namespace connectivity to specific services.
# See the help() function for more documentation
#
# USE -AS-IS- NO LICENSE PROVIDED
# requires kubectl in classpath and a valid $TMPDIR location.
set -e
@thanosa75
thanosa75 / jitsi-finalize.sh
Created February 2, 2022 08:10
A simple finalize script for Jitsi Meet Recordings, that uses FFMPEG to resize and convert to h265
#!/bin/bash
#
# a script to process Jitsi Meet recordings (JIBRI) and convert to a lower definition while converting
# to a more optimal video format - a few tunables are listed below
#
## encoding quality (lower == better)
# 23 is about 1.5x aka 45 FPS average on my hardware (6 core 12 thread Xeon 2.6GHz)
QENC=23
#scaling (find the default for your JIBRI, mine is 1080p)
VSCALE_720P="-vf scale=720:-1"
@thanosa75
thanosa75 / revoke_ipsec_vpn_certificate.sh
Last active August 8, 2021 19:17
Revoking a certificate for IPSEC vpn setups
#!/bin/bash
#
# Script to revoke a certificate from the IPSEC vpn lists from https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/ikev2-howto.md#revoke-a-client-certificate
#
#
if [ -z "$1" ]; then
echo ""
echo ""
echo "Use the script as follows: $0 <name of the user certificate>"
echo ""
@thanosa75
thanosa75 / finalize.sh
Created May 22, 2020 15:05
Jitsi Meet (Jibri) 'finalize.sh' script - a script that is executed just after the recording is completed.
#!/bin/bash
#
# BSD 3-clause LICENSE
# Copyright 2020 A. Angelatos (agelatos at g-mail-com)
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that
# the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
@thanosa75
thanosa75 / extensions_custom.conf
Last active March 28, 2019 19:04
Getting Asterisk ( version > 13 ) to report the audio codecs selected for incoming or outgoing calls
; custom extension context to log audio media used in a call
; Now logs in CDR (visible in CDR report as userfield)
; Thanos 27/3/19 - sample: https://cdn1.imggmi.com/uploads/2019/3/28/1e6ff7f430551fb30fce25cb5069fa64-full.png
[from-pstn-custom]
exten => _.!,1,Verbose("Incoming: Audio Read: ${CHANNEL(audioreadformat)} - Audio Write: ${CHANNEL(audiowriteformat)} - native Audio ${CHANNEL(audionativeformat)}")
exten => _.!,2,Set(CDR(userfield)="R/W:${CHANNEL(audioreadformat)}/${CHANNEL(audiowriteformat)} N:${CHANNEL(audionativeformat)}")
[from-internal-custom]
exten => _.!,1,Verbose("Outgoing: Audio Read: ${CHANNEL(audioreadformat)} - Audio Write: ${CHANNEL(audiowriteformat)} - native Audio ${CHANNEL(audionativeformat)}")
exten => _.!,2,Set(CDR(userfield)="R/W:${CHANNEL(audioreadformat)}/${CHANNEL(audiowriteformat)} N:${CHANNEL(audionativeformat)}")
#!/bin/bash
##############################################################
##
## rdelta-ghetto.sh - create reverse-delta incremental backups from
## ghettoVCB ESXi backups.
##
## Author : A. Angelatos (@thanosa75)
## History:
## - 2018/06/22 - first version
## - 2018/06/26 - found/fixed issue with ghetto rotation
@thanosa75
thanosa75 / Dialplan for Greek SIP trunk (OTE)
Last active November 20, 2020 21:21
Asterisk: Postfix email relay to Gmail / OmniVOICE / OTE SIP Trunk
# 3 (emergency) or 5 digit numbers
1XX
ZXXXX
# 10 digit numbers incl mobile (6xxxx...) and land (2xxxx...)
ZXXXXXXXXX
# solution for saved numbers that have either 0030 or +30
# to go through the Greek OTE trunk
+30|6XXXXXXXXX
@thanosa75
thanosa75 / Template Linux Disk IO.xml
Last active December 27, 2017 17:45
Configuration for Zabbix agent for retrieval of disk metrics: OPS / ms / sectors etc
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2017-12-27T13:49:57Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@thanosa75
thanosa75 / check_speedport2i.sh
Last active May 28, 2022 17:55
Fetching ZTE SpeedPort Entry 2i (VDSL modem/router, COSMOTE Greece) modem statistics for Zabbix or other purposes
#!/bin/bash
## Available to all; taken from https://github.com/NMichas/icinga-speedport2i - slight mods
## to work with Zabbix 3.4
##
## -h (hostname) Mandatory. script does not work without.
## if no other parameter is provided, a summary with all values is given.
##
## each of the other parameters calls it again grepping the particular value.
# Gather command-line parameters.
@thanosa75
thanosa75 / check-power.sh
Last active February 23, 2017 09:17
Script that checks a monitor host (via MAC address) to see if it is alive. If not, it will SSH (assume keys have been setup) to another host and shut it down.
#!/bin/bash
#
# A quick-and-dirty UPS shutdown monitor by Thanos
#
# Can perform shutdown of a "precious" machine that is on a UPS
# based on network reachability of a "inexpensive" machine that is
# not on a UPS. In my case, the "inexpensive" is a RPI that is always on.
#
# Cron entry for this script (uses "pi" user):
# */2 * * * * /home/pi/check-power.sh > /home/pi/powercheck.log 2>&1