Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
api_url=http://localhost:3001
# TODO jinja template api url?
# TODO nice readme
# TODO auth option
if [ $(curl -o /dev/null -w '%{http_code}\n' -s -I $api_url) != 200 ]
then
echo no connection to "$api_url"
@phuntik
phuntik / calendar
Created June 28, 2023 10:04
i3blocks notify-send calendar
#! /bin/bash
send_current() {
TODAY=$(date '+%-d')
month=$(ncal -bhM)
BODY=$( tail -n7 <<< $month | sed -z "s/$TODAY/<span bgcolor='white' color='black'>$TODAY<\/span>/1" | sed "s/\(.*\)\(.\{7\}\)$/\1<span color='IndianRed'>\2<\/span>/")
HEAD=$(echo "$month" | head -n1)
notify-send -u critical \
"$HEAD" "$BODY"
}
import requests
import json
import datetime
from clickhouse_http_client import ClickHouse
# define variables
ch = ClickHouse(user="moira",password="moira",database="moira")
moira_url="http://localhost:3002"
# get active alarms list