Use Python to:
- send a plain text email
- send an email with attachment
- receive and filter emails according to some criteria
#!/bin/bash | |
############################################################ | |
### Shell script to uninstall Mac Os X packages ### | |
### Based on pkgutil. ### | |
### Created by Adam Wallner <adam.wallner at gmail.comu> ### | |
### V1.0.1 ### | |
############################################################ | |
IFS=$'\n' | |
function get_pkgid { |
#!/usr/bin/env bash | |
export cluster_name=$1 | |
export host=$(hostname -f) | |
export ambari_pass=$2 | |
export knox_ldap_pass=$3 | |
hostname=$(hostname -f) | |
current_dir=$(pwd) | |
cd /tmp | |
#Copy config-update to /tmp | |
cp /tmp/masterclass/ranger-atlas/HortoniaMunichSetup/config_update.py . |
# 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 |
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 |
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 |
#!/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 |
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 |
Use Python to:
[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 |