Skip to content

Instantly share code, notes, and snippets.

View suicidesky92's full-sized avatar
🎯
Focusing

Artem Khalitov suicidesky92

🎯
Focusing
  • Saint Petersburg
View GitHub Profile
import smtplib
from email.mime.text import MIMEText
# Настройки SMTP
SMTP_HOST = "smtp.gmail.com"
SMTP_PORT = 587
SMTP_USERNAME = "automail@mail.com"
SMTP_PASSWORD = "pasSWORD"
SMTP_MAIL_FROM = "automail@mail.com" # От кого (обычно совпадает с SMTP_USERNAME)
RECIPIENT = "viewer@gmail.com" # Кому отправить тестовое письмо
@suicidesky92
suicidesky92 / python-check.py
Created March 15, 2021 17:21
check version
from concurrent.futures import ThreadPoolExecutor
modules = {"ansible": "2.10.4", "requests": "2.25.1"}
class Tester(object):
def __init__(self, module, reqversion):
self.module = module
self.reqversion = reqversion
@suicidesky92
suicidesky92 / ping.py
Last active March 1, 2021 21:16
This code check your network by ping. If device answer - you are see it. #python3 ping.py '192.168.1.' '22'
import shlex
import subprocess
from concurrent.futures import ThreadPoolExecutor
import sys
try:
ip_pool = sys.argv[1]
except:
ip_pool = '192.168.1.'
@suicidesky92
suicidesky92 / getup.py
Last active March 1, 2021 15:14
ping test of host\ip and send message when host down to Pushbullet. before start need 'export PB_TOKEN={you_token}'
## root@365k3791:~# export PB_TOKEN=qwe123; python3 get.py 10.8.0.7
from time import sleep
import os, sys
from pushbullet import Pushbullet
import shlex, subprocess
import requests
try:
host = sys.argv[1]
except IndexError:
@suicidesky92
suicidesky92 / bash_import_to_zsh.py
Last active February 12, 2021 09:53
Import history from bash to zsh. Python3 code.
#----------------------------------------------------------------
# This script allows you to save the history of entering bash commands, and transfer this history to zsh.
# Now you can see your story in a new environment.
#
# Usage: python3 bash_import_to_zsh.py
#
# Author: https://github.com/suicidesky92
# Find out if a new version is available: https://gist.github.com/suicidesky92/1731f894bd279d27b12225c8360db45f#file-bash_import_to_zsh-py
#----------------------------------------------------------------