Skip to content

Instantly share code, notes, and snippets.

Avatar

istvan kosztik

View GitHub Profile
@kosztik
kosztik / README.md
Created Nov 23, 2020 — forked from guillaumevincent/README.md
Windows Service with Python 3.5 and pyinstaller
View README.md
@kosztik
kosztik / delete_old_mail.py
Created Sep 28, 2020 — forked from Rathgore/delete_old_mail.py
Simple script to delete old messages in an IMAP mailbox
View delete_old_mail.py
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 Sep 7, 2020
Delete Elasticsearch indexes per month
View elastichsearch_delete_indexes.sh
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
View mailpilerimport.txt
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.
View aton.py
#!/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 Feb 27, 2020
convert bank stm to csv
View stm2csv.py
#!/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]
View email-i.sh
#!/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 Aug 31, 2019
rename accent files and dirs
View rename_accent
#!/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
View send_nsca_saslauth
#!/bin/bash
softMail=400
#^^^^^nincs használatban
maxMail=500
#^^^^^^^^^^ Ezt hasznalom jelenleg
@kosztik
kosztik / suhosinFirewall.sh
Last active Aug 7, 2019
punishment based on suhosin
View suhosinFirewall.sh
#!/bin/bash
# run screen; screen -r; watch /root/suhsoinFirewall.sh
#
ip=tail -1 /var/log/syslog| grep suhosin |grep ALERT | grep -v memory_limit|grep "([0-9]{1,3}[\.]){3}[0-9]{1,3}" -o -E
You can’t perform that action at this time.