This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
elastic-node1: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2 | |
container_name: elastic-node1 | |
environment: | |
- node.name=elastic-node1 | |
- discovery.type=single-node | |
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping | |
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SAVE TO /etc/letsencrypt/renewal-hooks/post/generate-bundle-certs.sh | |
# chmod a+x /etc/letsencrypt/renewal-hooks/post/generate-bundle-certs.sh | |
find /etc/letsencrypt/live -mindepth 1 -maxdepth 1 -type d -print0 | while IFS='' read -d $'\0' dir; do | |
# Update only if necessary | |
test -e "$dir/fullchain.pem" -a \ | |
-e "$dir/privkey.pem" -a \ | |
-e "$dir/fullchain_and_privkey.pem" && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "/usr/local/lib/python3.6/site-packages/elastalert/util.py", line 26, in get_module | |
module_path, module_class = module_name.rsplit('.', 1) | |
ValueError: not enough values to unpack (expected 2, got 1) | |
During handling of the above exception, another exception occurred: | |
Traceback (most recent call last): | |
File "/usr/local/lib/python3.6/site-packages/elastalert/loaders.py", line 461, in load_alerts | |
alert_field = [create_alert(a, b) for a, b in alert_field] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change shell title before running ssh | |
function ssh() { | |
# mess with title only if shell is interactive | |
# .bashrc should have a guard against non-interactive execution | |
# so this is just for additional safety - not good idea to break ssh | |
if [[ $- == *i* ]]; then | |
local host=$(echo "$@" | sed 's/-[a-zA-Z] //' | tr -d ' ' | cut -d' ' -f1) | |
echo -ne "\033]0;$host\007" | |
fi | |
$(type -f -p ssh || echo /usr/bin/ssh) "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import os | |
import smtplib | |
from email.mime.text import MIMEText | |
mail_host = 'email-smtp.eu-west-1.amazonaws.com' | |
mail_port = 465 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnicodeEncodeError: 'ascii' codec can't encode characters in position 57566-57569: ordinal not in range(128) | |
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last): | |
File \"/root/.ansible/tmp/ansible-tmp-1563092412.49-239477708342027/AnsiballZ_zabbix_template.py\", line 125, in <module> | |
_ansiballz_main() | |
File \"/root/.ansible/tmp/ansible-tmp-1563092412.49-239477708342027/AnsiballZ_zabbix_template.py\", line 117, in _ansiballz_main | |
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) | |
File \"/root/.ansible/tmp/ansible-tmp-1563092412.49-239477708342027/AnsiballZ_zabbix_template.py\", line 54, in invoke_module | |
imp.load_module('__main__', mod, module, MOD_DESC) | |
File \"/tmp/ansible_zabbix_template_payload_StS_pq/__main__.py\", line 742, in <module> | |
File \"/tmp/ansible_zabbix_template_payload_StS_pq/__main__.py\", line 689, in main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Content of the file /etc/logstash/conf.d/auditd.conf | |
# Tested on the CentOS 7 auditspd logs forwarded to logstash via rsyslog | |
input { | |
syslog { | |
type => AUDITD | |
port => xxxx | |
host => "xxx.xxx.xxx.xxx" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
noblacklist ${HOME}/.Upwork | |
mkdir ${HOME}/.Upwork | |
whitelist ${HOME}/.Upwork | |
noblacklist ${HOME}/.config/Upwork | |
mkdir ${HOME}/.config/Upwork | |
whitelist ${HOME}/.config/Upwork | |
noblacklist ${HOME}/.cache/Upwork | |
mkdir ${HOME}/.cache/Upwork |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
function die { | |
echo "ERROR: $*"; | |
exit 1 | |
} | |
usage_info="Usage: $0 ca_dir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
function die { | |
echo "ERROR: $*"; | |
exit 1 | |
} | |
usage_info="Usage: $0 ca_dir client|server certificate_name |