Skip to content

Instantly share code, notes, and snippets.

View hirman74's full-sized avatar

hirman hirman74

  • Singapore
  • 23:14 (UTC +08:00)
View GitHub Profile
@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)
@paalfe
paalfe / CiscoKeyGen.py
Created May 17, 2015 20:45
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()