Skip to content

Instantly share code, notes, and snippets.

View Azlirn's full-sized avatar

Cyb3rdude_ Azlirn

View GitHub Profile
#!/usr/bin/env python
# coding: utf-8
"""
This script will migrate data stored in the `D:\Data Analytics Projects\JTF-COVID\Testing Site Trends\Daily Reports`
directory to a a new `.xlsx` file which can be used for simple data analytics regarding JTF-COVID controlled COVID-19
testing sites.
**Note:** This file has hard coded paths in the `main()` and `writeTrendsReport()` functions.
"""
@Azlirn
Azlirn / NYS Regional COVID-19 Breakdown.Rmd
Last active November 4, 2020 19:50
[IN DEVELOPMENT] An R script that pulls COVID-19 data from a variety of sources and analyzes specific data points to track changes in regional COVID-19 severity for the state of New York.
---
title: "New York State Regional COVID-19 Breakdown"
output: html_notebook
---
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.
<hr>
```{r}
@Azlirn
Azlirn / IPDETAILS.py
Last active April 17, 2019 23:39
This short Python script uses the Free ipinfo.io API to gather information for a provided list of IP Address and write the results to a separate .csv file.
import csv
import ipinfo
import re
def main():
with open('data.csv', newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
details = getDetails(row['IPAddress'])
writeDetails(details)
from netaddr import *
import pprint
import socket
data = raw_input("Enter the CIDR you would like me to resolve: ")
network = IPNetwork(data)
file = open ("hostnames.txt", "a")
for ip in network:
import os
import re
import mysql.connector
from mysql.connector import Error
def getFiles(currentWD):
filesToRead = []
for dirname, dirnames, filenames in os.walk(currentWD):
for filename in filenames:
# ignore some files we don't care about
@Azlirn
Azlirn / emailStripper.py
Last active March 24, 2021 21:02
A simple script to remove strings from a given file. This script was originally built to remove domains from a text file but the concept can be applied to many applications.
import os
import time
# In the current configuration, this script should be able to process:
# 200,000 rps (records per second)
# GLOBAL VARIABLE
emailDomains = ['@hotmail.com', '@yahoo.com', '@gmail.com', '@aol.com', '@hotmail.fr', '@live.com', '@yahoo.fr',
'@yahoo.com.tw', '@hotmail.co.uk', '@ymail.com', '@msn.com', '@breakthru.com', '@rediffmail.com',
@Azlirn
Azlirn / AppendTextToLine.py
Created September 6, 2016 15:01
A simple python script to add text to a line in a text file.
readfile = raw_input("Please Enter The File You Wish To Read: ")
savefile = raw_input("Please Enter The File You Wish To Save: ")
read = open(readfile, "r")
save = open(savefile, "w+")
for line in read:
text = " " # Enter what you would like to append here
text2 = line
newline = text+text2 # You can swap the variables here if you want to add something to the beginning or end of the line.
@Azlirn
Azlirn / screengrab.py
Created September 1, 2016 20:33
A snippet that allows users to take a screenshot of a website after it opens in Firefox
from PIL import ImageGrab
import webbrowser
import time
browser = 'firefox'
url = 'https://twitter.com/cyb3rdude'
webbrowser.get(browser).open_new_tab(url)
# Wait a few seconds to allow the page to load
time.sleep(2)
@Azlirn
Azlirn / uptimeChecker.py
Last active June 26, 2019 17:56
A simple domain uptime checker
from threading import Thread
import requests
import time
with open('domains.txt') as f:
domainList = f.readlines()
domainList = [x.strip() for x in domainList]
#TODO: Check list for .onion domains and ignore said entries