Here are some of the projects I've worked on in a bit more detail:
ResmonBox is a project I put together that uses the terminal to
create a simple to understand interface to monitor a group of computers'
hardware stats, such as CPU usage or GPU temperature, in a simple to
way. The server and client should be lightweight, so that they
run on weaker computers or single board computers, such as the Raspberry Pi.
This project is open source, so you can check out the code on my Github.
OpenBaitTools is a commandline program that can help discover scam
websites, such as fake virus popups, using user-made config files
that are parsed and used in google searches to find potential matches.
The project is closed-source, to prevent it being used by bad actors
but below are a few code snippets:
# Crawling URLs using magic_google
for page in range(0,pagesDeep*10,10):
for url in google.search_url(query=str(searchTerm),start=page):
foundSites.append(str(url))
print("\n")
for word in safeWords:
for url in foundSites:
if str(word).lower() in str(url).lower():
print("Found match of the word '" + word + "' in " + url + ". Removing...")
foundSites.pop(foundSites.index(url))
# Function to get phone numbers from a URL.
def getNumbers(url):
# Grabs the html of a page, decodes it to utf8 then saves to pageContents.
req = Request(url, headers={'User-Agent': 'Mozilla/5.0'})
try:
page = webpage = urlopen(req)
except (socket.gaierror, urllib.error.URLError,urllib.error.HTTPError):
return(None)
pageBytes = page.read()
pageContents = pageBytes.decode("utf8")
page.close()
# Uses a regex to find any potential phone numbers.
foundNumbers= re.findall(phoneNumberRegex, pageContents)
# Removing duplicate values.
foundNumbers = list(dict.fromkeys(foundNumbers))
if len(foundNumbers) != 0: # what. this was a weird fix
return("No numbers Found. \n")
# Adds all the found numbers to a string for an easy return statement.
numbersStr = ""
for number in foundNumbers:
numbersStr =+ str(number) + "\n"
return(numbersStr)
Quotebot is a Discord Bot written in Python 3 using discord.py that
records user-made quotes to a local database that is used to randomly
pick a new 'quote of the day', as well as mash several quotes together.
It allows for quotes involving multiple people and multiple lines and
can use these quotes with the aforementioned commands.
Quotebot is currently closed-source, as I'm still actively developing it for
use on a small private discord server with some of my friends. However, some
code snippets are below:
# The command to ADD quotes to quote.db
@slash.slash(name="quote",
description="Records a quote, it's speaker as well as the current date and time to a database.",
guild_ids=guild_id_list,
options=[
create_option(
name="quote",
description="The quote itself",
option_type=3,
required=True
),
create_option(
name="speaker",
description="The Speaker of the quote (NOT an @Username)",
option_type=3,
required=True
)
])
async def quote(ctx, quote: str, speaker: str):
# Gets the current time
currentDatetime = datetime.datetime.now()
# Submits the quote to the local database
sendQuoteToDB(quote,speaker,currentDatetime)
# Prepares a formatted quote
response = formatQuoteData(quote,speaker,currentDatetime)
# Sends the formatted quote in response
await ctx.send(content=response)