Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@laclaro
laclaro / mx3.xml
Created November 19, 2017 21:06
Kodi keymap for MX3 remote
<!--
kodi keymap file for MX3 remote, available at
https://www.amazon.de/gp/product/B01IVJH0IG/ref=oh_aui_detailpage_o00_s00?ie=UTF8&th=1
This document is distributed under a creative commons licence CC BY-NC-SA 3.0.
-->
<keymap>
<home>
<!-- map color keys on the home screen -->
<keyboard>
<!-- red -->
@laclaro
laclaro / write_playlist_for_radio_stream.py
Created September 22, 2023 21:26
Create playlist from radio stream by querying stream titles.
#!/usr/bin/python3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#EXTM3U
#EXTINF:-1 tvg-name="ZDF HD" tvg-id="ZDF.de" group-title="ZDF" tvg-logo="https://raw.githubusercontent.com/jnk22/kodinerds-iptv/master/logos/tv/zdfhd.png",ZDF HD
pipe://ffmpeg -loglevel fatal -i https://zdf-hls-01.akamaized.net/hls/live/2002460/de/9f87d3ce9cf217b6f4de75631022195f/5/5.m3u8 -i https://zdf-hls-01.akamaized.net/hls/live/2002460/de/9f87d3ce9cf217b6f4de75631022195f/4/4.m3u8 -vcodec copy -acodec copy -metadata service_name=ZDF\ HD -metadata service_provider=ZDF -mpegts_service_type advanced_codec_digital_hdtv -f mpegts pipe:1
#EXTINF:-1 tvg-name="ZDFneo HD" tvg-id="ZDFneo.de" group-title="ZDFneo" tvg-logo="https://raw.githubusercontent.com/jnk22/kodinerds-iptv/master/logos/tv/zdfneohd.png",ZDFneo HD
pipe://ffmpeg -loglevel fatal -i https://zdf-hls-02.akamaized.net/hls/live/2002461/de/203772183f9e4182f6a9f4b5536004b4/5/5.m3u8 -i https://zdf-hls-02.akamaized.net/hls/live/2002461/de/203772183f9e4182f6a9f4b5536004b4/4/4.m3u8 -vcodec copy -acodec copy -metadata service_name=ZDFneo\ HD -metadata s
@laclaro
laclaro / mailsystem_check_restart.sh
Created May 23, 2020 10:44
check postfix and cyrus-imapd health with expect
#!/bin/bash
# Copyright (C) <year> <name of author>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@laclaro
laclaro / gist:d7b2dcb3416e1b8d0e26c214a999bbbc
Created April 24, 2020 15:32
privacyidea server error to #49
[2020-04-24 17:29:57,728][6537][139756680177472][DEBUG][privacyidea.api.before_after:84] Begin handling of request '/auth?'
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.api.lib.utils:254] Can not get param: Expecting value: line 1 column 1 (char 0)
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.audit:189] Entering getAudit with arguments HIDDEN and keywords HIDDEN
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.utils:1198] klass: <class 'privacyidea.lib.auditmodules.loggeraudit.Audit'>
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.audit:198] Exiting getAudit with result <privacyidea.lib.auditmodules.loggeraudit.Audit object at 0x7f1b92906860>
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.config:186] Entering get_from_config with arguments ('OverrideAuthorizationClient',) and keywords {}
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.config:323] Cloning request-l
@laclaro
laclaro / gist:bcf7ccb2daf2d959520b594f51c345e4
Created April 24, 2020 15:31
privacyidea server error to #49
[2020-04-24 17:29:57,728][6537][139756680177472][DEBUG][privacyidea.api.before_after:84] Begin handling of request '/auth?'
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.api.lib.utils:254] Can not get param: Expecting value: line 1 column 1 (char 0)
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.audit:189] Entering getAudit with arguments HIDDEN and keywords HIDDEN
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.utils:1198] klass: <class 'privacyidea.lib.auditmodules.loggeraudit.Audit'>
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.audit:198] Exiting getAudit with result <privacyidea.lib.auditmodules.loggeraudit.Audit object at 0x7f1b92906860>
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.config:186] Entering get_from_config with arguments ('OverrideAuthorizationClient',) and keywords {}
[2020-04-24 17:29:57,729][6537][139756680177472][DEBUG][privacyidea.lib.config:323] Cloning request-l
@laclaro
laclaro / gist:b9d331bd0ca5756ed5961c15ce0b5516
Created April 24, 2020 15:27
privacyideaadm error to #49
~$ privacyidea -n -U http://localhost:5000 -a admin -p test token list
No cryptography package available. You can not enroll yubikeys with static password.
Traceback (most recent call last):
File "/path/to/privacyideaadm/venv/bin/privacyidea", line 7, in <module>
exec(compile(f.read(), __file__, 'exec'))
File "/path/to/privacyideaadm/scripts/privacyidea", line 134, in <module>
main()
File "/path/to/privacyideaadm/scripts/privacyidea", line 126, in main
cli(obj={})
@laclaro
laclaro / privacyidea_error_500_jwt
Created April 17, 2020 15:48
privacyidea_error_500_jwt
[2020-04-17 17:44:36,067][13845][139848312690496][INFO][privacyidea.lib.auditmodules.loggeraudit:85] {"action": "POST /auth", "action_detail": "", "administrator": "admin", "client": "127.0.0.1", "client_user_agent": null, "info": "internal admin", "policies": "", "privacyidea_server": "localhost:5000", "realm": null, "success": true, "timestamp": "2020-04-17T15:44:36.067535", "user": ""}
[2020-04-17 17:44:36,067][13845][139848312690496][DEBUG][privacyidea.api.lib.utils:254] Can not get param: No JSON object could be decoded
[2020-04-17 17:44:36,069][13845][139848312690496][DEBUG][privacyidea.api.before_after:90] End handling of request u'/auth?'
[2020-04-17 17:44:36,072][13845][139848312690496][DEBUG][privacyidea.api.before_after:84] Begin handling of request u'/token/?'
[2020-04-17 17:44:36,073][13845][139848312690496][ERROR][privacyidea.app:1892] Exception on /token/ [GET]
Traceback (most recent call last):
File "/home/henning/Dokumente/Dev/test/venv2/local/lib/python2.7/site-packages/flask/app.py", line
@laclaro
laclaro / logging_logstash_simple.cfg
Last active March 30, 2020 15:23
simple logging config file for privacyIDEA to send to logstash
# /etc/privacyidea/logging_logstash_simple.cfg
[handlers]
keys=logstash_async
[handler_logstash_async]
# https://python-logstash-async.readthedocs.io/en/latest/usage.html#usage-with-logging-file-config
class=logstash_async.handler.AsynchronousLogstashHandler
level=INFO
args=('%(host)s', %(port)s,'%(database_path)s')
host=192.168.56.150
@laclaro
laclaro / logging.yml
Created March 26, 2020 15:00
logging.yml file for privacyIDEA
# logging configuration file /etc/privacyidea/logging.yml for privacyIDEA 3.3
# as given for the guide given at privacyidea.org
# https://www.privacyidea.org/event-based-logging-with-privacyidea-and-logstash
version: 1
formatters:
detail:
class: privacyidea.lib.log.SecureFormatter
format: >-
[%(asctime)s][%(process)d][%(thread)d][%(levelname)s][%(name)s:%(lineno)d]
%(message)s