Skip to content

Instantly share code, notes, and snippets.

@Symeon-Carle
Symeon-Carle / torrent-file-size.py
Created June 16, 2018 10:44 — forked from DonnchaC/torrent-file-size.py
Get total file sizes of contents for a set of .torrent files
import os
import sys
import bencodepy
import humanize
import argparse
def total_size_files_torrent(file_name):
try:
parsed = bencodepy.decode_from_file(file_name)
@Symeon-Carle
Symeon-Carle / ping.py
Last active May 6, 2023 05:38 — forked from athoune/ping.py
async ping for python 3 on Windows
import asyncio
# How to use : Launch next to a file named MachineList.txt with one address per line
# Out comes Results.csv with the address and either "Up" or "Down" on each line
# Original line order is preserved
# Pings ~1700 hosts in 30 seconds on my laptop
async def ping(adresse, indice, tableau):
proc = await asyncio.create_subprocess_shell('ping -n 1 ' + adresse + " | find \"TTL\"",
stdout=asyncio.subprocess.PIPE)