Skip to content

Instantly share code, notes, and snippets.

@kosztik
kosztik / elastichsearch_delete_indexes.sh
Last active September 7, 2020 08:39
Delete Elasticsearch indexes per month
month="08"
logs=`curl -XGET 'localhost:9200/_cat/indices?v'|grep -oh -E "wazuh-.+\.$month\.[0-9][0-9]"|grep wazuh`
for i in $logs
do
l=`echo $i|grep wazuh`
if ! [ -z "$l" ]
then
echo $l
sleep 3
@kosztik
kosztik / delete_old_mail.py
Created September 28, 2020 06:44 — forked from Rathgore/delete_old_mail.py
Simple script to delete old messages in an IMAP mailbox
MAIL_SERVER = ''
USERNAME = ''
PASSWORD = ''
MAILBOX = 'Spam'
MAX_DAYS = 7 # Deletes messages older than a week
import imaplib
import datetime
today = datetime.date.today()
@kosztik
kosztik / README.md
Created November 23, 2020 19:18 — forked from guillaumevincent/README.md
Windows Service with Python 3.5 and pyinstaller
#!/bin/bash
# nilfs2 snapshot manager by Istvan Kosztik 2017-
dev="/dev/md1"
mp="/tmp"
_1=`lscp -s|cut -d' ' -f 30-40| tail -n +2 | head -1|sed 's/ //g'`
_2=`lscp -s|cut -d' ' -f 30-40| tail -n +3 | head -1|sed 's/ //g'`
_3=`lscp -s|cut -d' ' -f 30-40| tail -n +4 | head -1|sed 's/ //g'`