Skip to content

Instantly share code, notes, and snippets.

View dtaivpp's full-sized avatar

David Tippett dtaivpp

View GitHub Profile
@dtaivpp
dtaivpp / ssl_verify_error.log
Last active September 2, 2021 13:20
A sample of a SSL Cert Verify Log
2021-04-30 10:38:14,360 - __main__ - ERROR - HTTPSConnectionPool(host='api-you-want-to-use.com', port=443): Max retries exceeded with url: /ccx/service/customreport2/org/wamitchell/ORG_Network_ID_Validation_-_IT_Location?Effective_as_of_Date=2021-04-30-01%3A00 (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)'),))
Traceback (most recent call last):
File "c:\Software\<some-repo>\venv\lib\site-packages\urllib3\connectionpool.py", line 706, in urlopen
chunked=chunked,
File "c:\Software\<some-repo>\venv\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "c:\Software\<some-repo>\venv\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "c:\Software\<some-repo>\venv\lib\site-packages\urllib3\connection.py", line 421, in connect
tls_in_tls=tls_in_tls,
@dtaivpp
dtaivpp / pfx_to_cert_and_key
Last active March 8, 2021 21:11
Convert a .pfx to a cert and key file
# Credit to Mark Brilman https://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
# Output Key
# pkcs12 is just .pfx
openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]
# Output Cert
openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]
# Output Decrypted Key
@dtaivpp
dtaivpp / firewall_rule_esxi_v7
Last active November 18, 2023 21:24
Adding ESXI v7 Persistent Firewall Rule
#!/bin/sh
# local configuration options
# Note: modify at your own risk! If you do/use anything in this
# script that is not part of a stable API (relying on files to be in
# specific places, specific tools, specific output, etc) there is a
# possibility you will end up with a broken system after patching or
# upgrading. Changes are not supported unless under direction of
# VMware support.
@dtaivpp
dtaivpp / promise_chaining.js
Created September 1, 2020 12:40
A simple example of how you can slowly change the opacity of an html element using a promise chain.
// html has some element with the id heading
// <h1 id="heading">IM FADING IN</h1>
window.onload = () =>{
heading = document.getElementById("heading");
create_await_chain(heading);
}
function create_await_chain(fade_object, depth=0){
// Creates a promise chain to slowly load the bar
import threading
import requests
sites = {
'site1.com': ['https://site1.com/page1' ...],
'site2.com': ['https://site2.com/page1' ...],
'site3.com': ['https://site3.com/page1' ...],
'site4.com': ['https://site4.com/page1' ...]
}
import logging
import requests
logger = logging.getLogger(__name__)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
fileHandle = logging.FileHandler('failed_requests.log')
fileHandle.setLevel(logging.WARNING)
fileHandle.setFormatter(formatter)
logger.addHandler(fileHandle)
@dtaivpp
dtaivpp / Epicor_BPM_pop_up_message.cs
Created March 11, 2020 14:15
Simple BPM Debugging Pop-Up Message
string msg ="Imma Message";
this.PublishInfoMessage(msg,
Ice.Common.BusinessObjectMessageType.Information,
Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
import random
from time import time
import numpy as np
import pandas as pd
# Initilize Random
random.seed(time())
#### List Tests ####
# Courtesy of https://stackabuse.com/sorting-algorithms-in-python/
def heapify(nums, heap_size, root_index):
# Assume the index of the largest element is the root index
largest = root_index
left_child = (2 * root_index) + 1
right_child = (2 * root_index) + 2
# If the left child of the root is a valid index, and the element is greater
# than the current largest element, then update the largest element
# Courtesy of https://stackabuse.com/sorting-algorithms-in-python/
def merge(left_list, right_list):
sorted_list = []
left_list_index = right_list_index = 0
# We use the list lengths often, so its handy to make variables
left_list_length, right_list_length = len(left_list), len(right_list)
for _ in range(left_list_length + right_list_length):