Skip to content

Instantly share code, notes, and snippets.

@TarasKindrat
TarasKindrat / playbook.yml
Created October 25, 2021 14:35 — forked from altnight/playbook.yml
ansible playbook for install python 3.4
---
- hosts: 127.0.0.1
connection: local
user: (user)
vars:
tmpdir: "/Users/(user)/tmpfile/python"
name: "Python"
version: "3.4.0"
tasks:
- name: "make dir"
@TarasKindrat
TarasKindrat / delete_unassigned_shards.sh
Created November 26, 2019 11:30 — forked from melnikk/delete_unassigned_shards.sh
Delete unassigned shards from Elasticsearch
#!/bin/bash
curl -XDELETE `curl http://localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason | grep UNASS | awk '{print "http://localhost:9200/" $1}'`
@TarasKindrat
TarasKindrat / grok-patterns
Created November 22, 2019 23:08 — forked from mesimeris/grok-patterns
LOGSTASH: syslog listener filtering with grok patterns and applying useful tags
# NOTE: These patterns take into account the additional log-line information passed to the logstash listener from rsyslog. YMMV.
DHCPD ((%{SYSLOGTIMESTAMP:timestamp})\s*(%{HOSTNAME:hostname})\s*dhcpd\S+\s*(%{WORD:dhcp_action})?.*[for|on] (%{IPV4:dhcp_client_ip})?.*[from|to] (%{COMMONMAC:dhcp_client_mac})?.*via (%{USERNAME:interface}))
IPTABLES ((%{SYSLOGTIMESTAMP:nf_timestamp})\s*(%{HOSTNAME:nf_host})\s*kernel\S+\s*(%{WORD:nf_action})?.*IN=(%{USERNAME:nf_in_interface})?.*OUT=(%{USERNAME:nf_out_interface})?.*MAC=(%{COMMONMAC:nf_dst_mac}):(%{COMMONMAC:nf_src_mac})?.*SRC=(%{IPV4:nf_src_ip}).*DST=(%{IPV4:nf_dst_ip}).*PROTO=(%{WORD:nf_protocol}).?*SPT=(%{INT:nf_src_port}?.*DPT=%{INT:nf_dst_port}?.*))
DNS ((%{MONTHDAY:day})-(%{MONTH:month})-(%{YEAR:year}) (%{TIME:timestamp}) client (%{IPV4:dns_client_ip})#(%{NONNEGINT:dns_uuid})?.*query: (%{HOSTNAME:dns_dest}) (%{WORD:dns_type}) (%{WORD:dns_record})?.*(%{IPV4:dns_server}))
PGSQL ((%{SYSLOGTIMESTAMP:pgsql_timestamp}) (%{HOSTNAME:pgsql_hostname})?.*SAST >(%{WORD:pgs
@TarasKindrat
TarasKindrat / iptables.grok
Created November 22, 2019 23:07 — forked from Caligatio/iptables.grok
iptables Grok Pattern
# GROK Custom Patterns (add to patterns directory and reference in GROK filter for iptables events):
# GROK Patterns for iptables Logging Format
#
# Created 6 Aug 2016 by Brian Turek <brian.turek@gmail.com>
# Most of this was taken from another source but now I cannot find it for credit
#
# Usage: Use the IPTABLES pattern
NETFILTERMAC %{MAC:dest_mac}:%{MAC:src_mac}:%{ETHTYPE:ethtype}
ETHTYPE (?:(?:[A-Fa-f0-9]{2}):(?:[A-Fa-f0-9]{2}))
@TarasKindrat
TarasKindrat / mysql_secure.sh
Created July 27, 2019 20:56 — forked from Mins/mysql_secure.sh
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10