Skip to content

Instantly share code, notes, and snippets.

View hatifnatt's full-sized avatar

Roman hatifnatt

View GitHub Profile
@hatifnatt
hatifnatt / 47771-map.log
Created May 22, 2018 20:58
Salt issue 47771 logs
[DEBUG ] Reading configuration from /etc/salt/cloud
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/engine.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/engine.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/f_defaults.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/f_defaults.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/lxc_profiles.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/lxc_profiles.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/reactor.conf'
@hatifnatt
hatifnatt / clean_zabbix_db.sh
Created April 17, 2018 11:07
Clean old data from Zabbix database
#!/usr/bin/env bash
# Inspired by http://whatizee.blogspot.com/2016/10/zabbix-history-table-clean-up.html
# This scrip clean history* and trends* tables. It will copy "right" data to new tables
# and then drop old bloated ones.
# Enable debug
#set -x
DATE_MINUS_3M=$(date -d "now -3months" +%Y-%m-%d)
Pillar
acme_sh:
hatifnatt:
userconf:
accountemail: hatifnatt@domain.tld
test: True
certconf:
domain.tld:
altnames:
- www.domain.tld
@hatifnatt
hatifnatt / dummyFileCreator.sh
Created April 1, 2015 16:21
Script to create dummy files with dates in past. Created to test GFS backup rotation
#!/bin/bash
# Script to create dummy files with dates in past
# Count of months and weeks must not be greater than 99, count of days must not be greater than 999
### CONFIG BEGIN ###
# Count of files to create, including current month, week and day
MONTHS=12
WEEKS=10
@hatifnatt
hatifnatt / removeOlderThanDays.sh
Last active July 1, 2022 11:25
Simple script to delete files older than specific number of days from FTP
#!/bin/bash
# Simple script to delete files older than specific number of days from FTP. Provided AS IS without any warranty.
# This script use 'lftp'. And 'date' with '-d' option which is not POSIX compatible.
# FTP credentials and path
FTP_HOST="ftp.host.tld"
FTP_USER="usename"
FTP_PASS="password"
FTP_PATH="/ftp/path"
# Full path to lftp executable