Skip to content

Instantly share code, notes, and snippets.

View futureworkai's full-sized avatar
💭
I may be slow to respond.

Nathan futureworkai

💭
I may be slow to respond.
View GitHub Profile
@futureworkai
futureworkai / testperf.py
Created May 1, 2022 22:44
Compare Different VM/Physical Machines and Different Python Versions
# Run Fibonacci Sequence 35 Times Pure Python Engine Performance Test
# Run on Same machine with 3.10 and NEW 3.11
# https://medium.com/@Sabrina-Carpenter/python-alpha-5-is-here-5-promising-features-that-will-blow-your-mind-a4abd406d0ad
# https://programtalk.com/python-examples/psutil.boot_time/
import platform
import datetime
import timeit
import os
# NOTE: PS UTIL may need installation
import psutil
@futureworkai
futureworkai / IMDBGetDatasetsNoDateCheck.ps1
Created December 16, 2021 22:11
Quick Script to Get IMDB GZ Files and Extract the TSV Inside of thim this can be annoying on Windows.
#Requires -Version 7.0
$versionMinimum = [Version]'7.0.0'
if ($versionMinimum -gt $PSVersionTable.PSVersion) {
throw "This script requires PowerShell $versionMinimum"
}
<#
Author: nathan@futurework.ai
Users: Hopefully NObody other than Nathan
Purpose:
from diagrams import Cluster, Diagram, Edge
from diagrams.onprem.analytics import Spark
from diagrams.onprem.compute import Server
from diagrams.onprem.database import PostgreSQL
from diagrams.onprem.inmemory import Redis
from diagrams.onprem.monitoring import Grafana, Prometheus
from diagrams.onprem.network import Nginx
from diagrams.onprem.queue import Kafka
#from diagrams.Elasticsearch import ES
from diagrams.elastic.elasticsearch import Elasticsearch, MachineLearning, Kibana, Logstash, Sql
import requests
import urllib
import json
# TODO: Build the Date String Portion
backDoorAnnounceURI = r"https://asx.api.markitdigital.com/asx-research/1.0/markets/announcements?page=0&itemsPerPage=500&summaryCountsDate=2021-07-07"
# Get From URI
response = requests.get(backDoorAnnounceURI)
json_formatted_str = json.dumps(response.json(), indent=2)
print (json_formatted_str)
@futureworkai
futureworkai / howReadable.py
Last active July 6, 2021 06:24
Quick and Dirty Python Script to Calculate Reading Age Estimates
from readability import Readability
'''
nathan@futurework.ai
NOTE: Just a Hack Together Script
pip install nltk
pip install py-readability-metrics
python -m nltk.downloader punkt
https://github.com/cdimascio/py-readability-metrics
'''
@futureworkai
futureworkai / oobe.sh
Last active August 26, 2020 05:15
OOBE Script to Run over Fresh Ubuntu Installation (WSL,Virtual or BareMetal)
#!/bin/bash
# OOBE Script to Run over Fresh Ubuntu Installation (WSL,Virtual or BareMetal)
# Freshen It Up oobe.sh (GitHub GIST)
sudo apt-get --assume-yes upgrade
# Expecting to See Packages listed
#apt list --upgradable
# Run this Command on all Fresh Installs eg WSL 2 from App Store
sudo apt-get update && sudo apt-get upgrade
# 7Zip + RAR
sudo apt-get install p7zip-full
@futureworkai
futureworkai / requirements.txt
Last active August 28, 2020 04:50
List of Python Requirements
# For Data Science
scipy
numpy
matplotlib
pandas
statsmodels
# For Ansible
jinja2
PyYAML
cryptography
@futureworkai
futureworkai / roam.bash_aliases
Last active August 26, 2020 09:26
A Roaming List of Aliases intented for Ubuntu Instances Will be Pull Updated via a Local Python Script
# GhettoGistSync:https://gist.githubusercontent.com/futureworkai/e5dddec3305f419a5c69291cf625d918/raw/7fd10eb29ff79428e4eb67ec8b7953e176885351/roam.bash_aliases
# A Roaming List of Aliases intented for Ubuntu Instances Will be Pull Updated via a Local Python Script
alias agi='sudo apt-get install'
alias agr='sudo apt-get remove'
alias agu='sudo apt-get update'
alias acs='apt-cache search'
alias cls='clear'
alias k='kubernetes'
alias e='exit'
alias pip='pip3'
@futureworkai
futureworkai / pushsafer.py
Created May 24, 2020 11:54
Very Simple Example Script for PushSafer API
from urllib.parse import urlencode
from urllib.request import Request, urlopen
# NOTE: You need to sign up for an Account it's free for low volume testing.
# https://www.pushsafer.com/en/pushapi
url = 'https://www.pushsafer.com/api' # Set destination URL here
post_fields = { # Set POST fields here
"t" : "Straight Through to the Keeper.",
"m" : "Not Pushy",
@futureworkai
futureworkai / TeamsBot.ps1
Created May 24, 2020 11:09
Very Basic Script Demonstrating Team Incoming WebHooks.ps1
# ORIGIN: https://www.scriptinglibrary.com/languages/powershell/how-to-trigger-incoming-webhooks-in-microsoft-teams-with-powershell/
# Webhooks Channel
$TeamsChannelUri = "https://outlook.office.com/webhook/%YOUNEEDTOCOPYTHERESTFROMTHEADDEDAPPINTEAMSFULLSTRINGISAROUND160CHARACTERS%"
# $BodyTemplate = @"
# {
# "@type": "MessageCard",
# "@context": "https://schema.org/extensions",
# "summary": "ADUserLockOut-Notification",