Skip to content

Instantly share code, notes, and snippets.

View juffaz's full-sized avatar

Juffaz juffaz

  • Baku
View GitHub Profile
@juffaz
juffaz / haproxy-redis-ms
Created December 4, 2018 06:09
haproxy for redis master slave
#### redis ###
defaults REDIS
mode tcp
option tcplog
timeout connect 4s
timeout server 30s
timeout client 30s
frontend ft_redis
[root@cobbler ansible-frontend]# cat centos7redis.yml
---
- hosts: frontend-redis
tasks:
- name: 1.Check if EPEL repo is already configured.
stat: path=/etc/yum.repos.d/epel.repo
register: epel_repofile_result
- name: 2.Install EPEL repo.
yum: name="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" state=present
[root@juff2018 ~]# echo 'import crypt,getpass; print crypt.crypt(getpass.getpass(), "$6$NEWpass")' | python2 -
[root@cobbler01 ansible-backprod]# cat centos7deploy-key.yml
---
- hosts: all
gather_facts: no
remote_user: root
# sudo: yes
tasks:
- name: Set authorized key without validating the TLS/SSL certificates
authorized_key: user=devops
key=https://github.com/user.keys
[devops@centreon01 ansible]$ cat deploy-apache-debian.yml
---
- hosts: all
gather_facts: no
remote_user: devops
sudo: yes
vars:
apache_vhosts:
- {servername: "chost.site.com", documentroot: "/var/www/html", serveradmin: "support@site.com"}
#!/bin/bash
# ########################################################
# Written by Andor Westphal andor.westphal@gmail.com #
# Created: 2013-02-22 (version 1.0) #
# Modified:2013-03-12 (version 1.1) #
# Modified:2015-03-29 (version 1.2) http://fm4dd.com/ #
# === public@frank4dd.com === #
# #
# checks the count of active jails #
# checks for banned IP's #
---
## This playbook installs and configures AD authentication
- name: Install and configure AD authentication
hosts: all
gather_facts: no
become: yes
## become_method: sudo
vars_prompt:
- name: "bind_password"
prompt: "Password for aplinux"
[devops@centreon01 ansible]$ sudo ansible-galaxy install geerlingguy.firewall geerlingguy.glusterfs
[devops@centreon01 ansible]$ ansible-playbook deploy-glusterfs-debian-fs.yml -l app -b
[devops@centreon01 ansible]$ cat deploy-glusterfs-debian-fs.yml
---
- hosts: all
remote_user: devops
sudo: yes
vars:
[root@test ~]# cat fail2ban-unbanall.sh
#!/bin/bash
if [ -z "$1" ]
then
fail2ban-client status
echo "Please choice JAIL for argument."
echo "Sample: ./fail2ban-unbanall.sh jail-name"
exit 0
fi
regular exp for "08-Jan-2019 17:42:25.431" tomcat log
^[0-9]{1,2}-[A-Z,a-z]{3}-[0-9]{4}\s[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}[.][0-9]{3}
enable multiline - yes, Multiline pattern is negated = yes
multiline.negate: true
multiline.match: after
regular exp for space(...) and "Caused by" tomcat log
multiline.pattern: '^[[:space:]]+(at|\.{3})\b|^Caused by:'
enable multiline - yes