Skip to content

Instantly share code, notes, and snippets.

View waleedahmad's full-sized avatar
🏠
Working from home

Waleed Ahmad waleedahmad

🏠
Working from home
View GitHub Profile
@waleedahmad
waleedahmad / ping.py
Last active March 10, 2018 10:42
Python Ping test script with multiple hosts support and configurable delay time.
import sys
import json
import time
import datetime
import subprocess
import threading
from urllib.request import urlopen
threads = []
hits = 0
@waleedahmad
waleedahmad / read_pop3ssl_emails.py
Created July 8, 2018 11:41
Read and Parse emails using POP3 in Python
import poplib, getpass, email
import re
Mailbox = poplib.POP3_SSL('mail.privateemail.com')
Mailbox.user('[email protected]')
Mailbox.pass_('pass')
emails = []
tries = 0
fail_tries = 300
@waleedahmad
waleedahmad / backup.sh
Created October 22, 2018 20:31
Bash script for opening gnome-terminals to run rsync processes for each directory separately.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
mkdir -p /media/waleed/storage/backups/home/waleed
mkdir -p /media/waleed/storage/backups/www
mkdir -p /media/waleed/storage/backups/etc