Skip to content

Instantly share code, notes, and snippets.

View mtdeguzis's full-sized avatar

Michael T. DeGuzis mtdeguzis

  • Geisinger Health System
View GitHub Profile
>>> print path
/filedrop-dev/folder3new
>>> print key
/filedrop-dev/folder3new
>>> print bad_key
/filedrop-dev/folder
>>> p = re.compile(bad_key)
@mtdeguzis
mtdeguzis / docker-cleanup-resources.md
Created February 6, 2018 22:47 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mtdeguzis
mtdeguzis / supervisord.service
Created February 9, 2018 22:54 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
@mtdeguzis
mtdeguzis / 0_python_email.md
Created August 2, 2018 13:58 — forked from nickoala/0_python_email.md
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "icinga_dbversion" does not exist
LINE 1: SELECT icinga_dbversion.version FROM icinga_dbversion
^, query was: SELECT icinga_dbversion.version FROM icinga_dbversion
#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(String, Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(816): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(1400): Zend_Db_Adapter_Abstract->fetchOne(Object(Zend_Db_Select))
#5 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(832): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->getIdoVers
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "icinga_dbversion" does not exist
LINE 1: SELECT icinga_dbversion.version FROM icinga_dbversion
^, query was: SELECT icinga_dbversion.version FROM icinga_dbversion
#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(String, Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(816): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#4 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(1400): Zend_Db_Adapter_Abstract->fetchOne(Object(Zend_Db_Select))
#5 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php(832): Icinga\Module\Monitoring\Backend\Ido\Query\IdoQuery->getIdoVers
#!/bin/bash
# If specified value is true, return valid
# Else return invalid
#
# Allows concatenation via && and ||
evaluate_boolean() {
if [ "${1}" == "True" ] || \
[ "${1}" == "true" ] || \
[ "${1}" == "1" ]; then
https://blog.seocahill.com/docker-postgres-cluster-with-high-availability-and-disaster-recovery/
https://github.com/paunin/PostDock
https://github.com/zalando/spilo
https://github.com/sorintlab/stolon
1. Stop Kafka.
2. In Custom kafka-broker section in Ambari Configs, click Add Property and create
inter.broker.protocol.version with the following values and click Save.
Key: inter.broker.protocol.version
Value: CURRENT_KAFKA_VERSION
Where CURRENT_KAFKA_VERSION is the version of Kafka you are currently running. For
example, 0.10.1.
3. In Custom kafka-broker section in Ambari Configs, click Add Property and
createlog.message.format.version with the following values and click Save.
Key: log.message.format.version
# How to create an RPM repository
# This is for Redhat 64 bit versions of Linux. You can create your own RPM repository # to host your custom RPM packages.
#
# See "How to create an RPM from source with spec file" for more information.
# https://gist.github.com/1376973
# Step: 1
# Install createrepo