Skip to content

Instantly share code, notes, and snippets.

View lakpa-tamang9's full-sized avatar

Lakpa Tamang lakpa-tamang9

  • Geelong, Australia
  • 16:35 (UTC -12:00)
View GitHub Profile
@lakpa-tamang9
lakpa-tamang9 / image_resizer.py
Created April 14, 2023 06:24
Resize images to uniform sizes.
import cv2
import os
root = "./photos/data"
files = os.listdir(root)
SIZE = (640, 480)
output_path = "./photos/resized_data"
if not os.path.exists(output_path): os.makedirs(output_path)
for file in files:
@lakpa-tamang9
lakpa-tamang9 / getipmac.py
Created April 14, 2023 05:30
Getting the IP and MAC address of the current devices connected to the same network
import os
import re
# os.system('arp -a')
outputs = os.popen('arp -a').read().split('\n')
addresses = []
for output in outputs:
if output != '':
ip = output.split(" ")[1]
ip = re.sub(r'\(|\)', '', ip)