Skip to content

Instantly share code, notes, and snippets.

#!/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'`
@kosztik
kosztik / README.md
Created November 23, 2020 19:18 — forked from guillaumevincent/README.md
Windows Service with Python 3.5 and pyinstaller
@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 / 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
AUG
21
Mailpiler - Importing & Deduplicating email from PST Files
Hi there,
I'll be tackling getting mail from PST files into mailpiler, and deduping them before the import.
This howto is written for Ubuntu 16.04 - as my Piler install howto is for the same.
#!/usr/bin/env python
import socket
import struct
import sys
import os
def ip2int(addr):
return struct.unpack("!I", socket.inet_aton(addr))[0]
@kosztik
kosztik / stm2csv.py
Last active February 27, 2020 13:17
convert bank stm to csv
#!/usr/bin/python
import sys
print ("tranzakcio tipus; banki azonosito; megbizas osszege; megbizas devizaneme; megbizo bankja; megbizo neve; megbizo szamlaszama; \
kozlemeny1; kozlemeny2; kozlemeny3; kozlemeny4; kedvezmenyezett bankja; kedvezmenyezett neve; kedvezmenyezett szamlaszama; \
bizonylatszam; hatarido; jovairas szamlaszama; jovairas devizaneme; jovairas vegso osszege; jovairas erteknapja; \
terheles szamlaszama; terheles devizaneme; terheles vegso osszege; terheles erteknapja")
filepath = sys.argv[1]
@kosztik
kosztik / email-i.sh
Last active December 23, 2019 15:06
#!/bin/bash
#
# Use: email-i.sh /var/log/mail.info <from/to pattern>
# Used with postfix
if [[ $1 =~ gz ]]; then
cat="zcat"
else
@kosztik
kosztik / rename_accent
Last active August 31, 2019 05:51
rename accent files and dirs
#!/bin/bash
PATH="/home/ebfijjk/anks"
# Put the old filenames in a file.
ls $PATH >> oldValues
# Put the new names without accents in another file
cat oldValues | sed -e 'y/āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜĀÁǍÀĒÉĚÈĪÍǏÌŌÓǑÒŪÚǓÙǕǗǙǛ/aaaaeeeeiiiioooouuuuüüüüAAAAEEEEIIIIOOOOUUUUÜÜÜÜ/' >> newValues
#!/bin/bash
softMail=400
#^^^^^nincs használatban
maxMail=500
#^^^^^^^^^^ Ezt hasznalom jelenleg