Skip to content

Instantly share code, notes, and snippets.

@os11k
os11k / Template Freeswitch.xml
Created September 20, 2019 12:46 — forked from crashdump/Template Freeswitch.xml
Freeswitch - Zabbix Monitoring
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-12-04T16:01:36Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@os11k
os11k / gist:17258d1d81f4f706b6496f8799a9471a
Created November 19, 2021 09:50
Homer7 Lua script to change body of header user-agent in CANCEL method
-- With this Lua code we will substitute body of header "User-Agent" to cisco, if there are more then one User-Agent headers, then we will fix them all.
-- Just add this to your docker compose part for heplify-server:
-- volumes:
-- - ./lua:/lua
-- put your script in ./lua directory and restart docker-container
-- this function will be executed first
function checkRAW()
local protoType = GetHEPProtoType()
@os11k
os11k / price.sh
Last active December 25, 2021 15:53
Kraken prices to file, so we can grab them with node exporter
# script should be located under /adapools directory and statistic file in /adapools/stats directory
# mkdir -p /adapools/stats
# our crontab entry:
# * * * * * /adapools/price.sh
# node exporter should be reading /adapools/stats directory something like this:
# --collector.textfile.directory=/adapools/stats
# following metrics should be availlable in grafana, if you did everything right - adaeur, adausd, btcusd & ethusd
PRICES=$(curl -s https://api.kraken.com/0/public/Ticker?pair=ADAEUR,ADAUSD,XXBTZUSD,XETHZUSD)
echo $PRICES | jq .result.ADAEUR.c | jq .[0] | sed 's/"//g'| sed 's/^/adaeur /' > /adapools/stats/price.prom
echo $PRICES | jq .result.ADAUSD.c | jq .[0] | sed 's/"//g'| sed 's/^/adausd /' >> /adapools/stats/price.prom
@os11k
os11k / testnet-topology.json
Last active June 13, 2022 19:05
p2p testnet-topology.json example for relays, don't forget to enable p2p by "EnableP2P": true in testnet-config.json
{
"LocalRoots": {
"groups": [
{
"localRoots": {
"accessPoints": [
{
"address": "bp-host-name/ip",
"port": 3001
},
@os11k
os11k / loki-dashboard-grafana
Created May 7, 2022 18:28
Grafana dashboard to search logs in Loki. Credits: https://grafana.com/grafana/dashboards/13639
{
"__inputs": [
{
"name": "DS_LOKI",
"label": "Loki",
"description": "",
"type": "datasource",
"pluginId": "loki",
"pluginName": "Loki"
}
@os11k
os11k / wise.sh
Created May 17, 2022 18:41
GBPEUR from wise to prometheus
GBPEUR=$(curl -s "https://api.transferwise.com/v3/comparisons/?sourceCurrency=GBP&targetCurrency=EUR&sendAmount=8000" | jq .providers | jq '.[] | select( .alias == "wise" ).quotes' | jq .[].rate)
echo "gbpeur ${GBPEUR}" > /adapools/stats/wise.prom
#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######
# PLEASE MAKE SURE DURING BUILD TRANSACTION STEP YOU PUT YOUR OWN POOL ID after required-signer-hash!!!!!!!!!!!!!!!!
# PLEASE MAKE SURE DURING BUILD TRANSACTION STEP YOU PUT YOUR OWN POOL ID after required-signer-hash!!!!!!!!!!!!!!!!
# PLEASE MAKE SURE DURING BUILD TRANSACTION STEP YOU PUT YOUR OWN POOL ID after required-signer-hash!!!!!!!!!!!!!!!!