Skip to content

Instantly share code, notes, and snippets.

View icecore2's full-sized avatar
🎯
Focusing

Dmitry Banny icecore2

🎯
Focusing
View GitHub Profile
@icecore2
icecore2 / simple-proxy-server.py
Created September 2, 2023 10:31
simple-proxy-server.py
import socket
import threading
def handle_client(client_socket, remote_ip, remote_port):
# Create a socket object for remote connection
remote_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect to the remote server
remote_socket.connect((remote_ip, remote_port))
import pikepdf
import os
import pathlib
pdf_pass = 'PASSWORD'
pdf_path = ''
if not pdf_path:
curr_path = pathlib.Path(__file__).parent.absolute()
@icecore2
icecore2 / zip_content_list_of_dicts.py
Last active February 1, 2023 12:11
List of dicts from zip file list: {path: "", filename: ""}
"""
This gist will create list of dictionaries.
"""
import pyzipper
def test():
with pyzipper.PyZipFile(file="/home/dima/Desktop/test.zip") as fz:
files = fz.filelist
list = []
@icecore2
icecore2 / pushover_message.py
Created July 17, 2022 11:22
Pushover service with pushing message.
# Full page of API: https://pushover.net/api
# Get tokens page: https://pushover.net/#apps
import requests
class PushOverHandler:
def __init__(self,token, user_token):
self.token = token
self.user_token = user_token
@icecore2
icecore2 / google_forms_autofill.py
Created June 1, 2020 06:54
This script is for filling the google forms automatically by entry ID and value. This includes Date, ID and Full name, need modify only the ID and the Full name between the brackets.
''' This script is for filling the google forms automatically by entry ID and value.
This includes Date, ID and Full name, need modify only the ID and the Full name between the brackets.
'''
import requests
from datetime import datetime
url = 'https://docs.google.com/forms/d/<ID>/formResponse' # Change the ID to a proper one
date = datetime.now()
@icecore2
icecore2 / countdown.py
Last active March 31, 2020 13:56
Countdown
import time
def countdown(t):
while t:
mins, secs = divmod(t, 60)
timeformat = '{:02d}:{:02d}'.format(mins, secs)
print(timeformat, end='\r')
time.sleep(1)
t -= 1
print('Goodbye!\n\n\n\n\n')
@icecore2
icecore2 / media_file_convertion.bat
Created August 11, 2018 14:00
Media file extention convertion to MKV with MKVMerge
@echo off
set mkvmergepath=mkvmerge.exe path
set videofileformat=file extention
:: Files counter for convertion
echo.
echo =========== Counter to convertion ================
set filesCounter=0
for /r . %%A IN (*.%videofileformat%) do (
set /a filesCounter+=1
@icecore2
icecore2 / files_scanner_counter.bat
Created August 11, 2018 13:57
files_scanner_counter.bat
@echo off
set mkvmergepath=mkvmerge.exe path
set videofileformat=file extention
:: Files counter for convertion
echo.
echo =========== Counter to convertion ================
set filesCounter=0
for /r . %%A IN (*.%videofileformat%) do (
set /a filesCounter+=1