Skip to content

Instantly share code, notes, and snippets.

@laclaro
laclaro / write_playlist_for_radio_stream.py
Created September 22, 2023 21:26
Create playlist from radio stream by querying stream titles.
View write_playlist_for_radio_stream.py
#!/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
@laclaro
laclaro / mailsystem_check_restart.sh
Created May 23, 2020 10:44
check postfix and cyrus-imapd health with expect
View mailsystem_check_restart.sh
#!/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
View gist:d7b2dcb3416e1b8d0e26c214a999bbbc
[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
View gist:bcf7ccb2daf2d959520b594f51c345e4
[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
View gist:b9d331bd0ca5756ed5961c15ce0b5516
~$ 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
View 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
View logging_logstash_simple.cfg
# /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
View logging.yml
# 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
@laclaro
laclaro / logging.yml
Last active March 18, 2020 10:18
Logging configuration for privacyIDEA with logstash
View logging.yml
version: 1
formatters:
detail:
class: privacyidea.lib.log.SecureFormatter
format: >-
[%(asctime)s][%(process)d][%(thread)d][%(levelname)s][%(name)s:%(lineno)d]
%(message)s
handlers:
logfile:
@laclaro
laclaro / logging.yml
Created March 18, 2020 09:15
Logging configuration for privacyIDEA used with logstash
View logging.yml
# /etc/privacyidea/logging.yml
version: 1
formatters:
detail:
class: privacyidea.lib.log.SecureFormatter
format: >-
[%(asctime)s][%(process)d][%(thread)d][%(levelname)s][%(name)s:%(lineno)d]
%(message)s
handlers: