Skip to content

Instantly share code, notes, and snippets.

View JeremyMorgan's full-sized avatar

Jeremy Morgan JeremyMorgan

View GitHub Profile
@JeremyMorgan
JeremyMorgan / process.cs
Created June 15, 2021 18:11
Blazor Upload
private async Task processImage() {
// create single httpclient
HttpClient client = new HttpClient {
BaseAddress = new Uri(baseUrl + "/face/v1.0/detect?returnFaceAttributes=age,glasses,emotion,headpose,gender&ReturnFaceLandmarks=true")
};
HttpResponseMessage response = null;
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "xxxxxxxxxxxxxxxxxxx");
@JeremyMorgan
JeremyMorgan / installweb.bat
Created October 1, 2018 02:59
Quick batch file to install IIS if it's not installed
@ECHO OFF
dism /online /get-featureinfo /featurename:IIS-WebServer | find "State : Disabled" > nul
if %ERRORLEVEL% == 0 (
echo "IIS Web Server is not installed"
dism /online /enable-feature /featurename:IIS-WebServer /all
)
dism /online /get-featureinfo /featurename:IIS-WebServer | find "State"
@JeremyMorgan
JeremyMorgan / checktags.py
Created April 1, 2021 18:45
Check for doubled up tags
tags = self.webpage.pagedata["tags"].split('|')
for tag in tags:
if len(tag) > 1:
#Check if this is a doubled up tag
#some look like this "IT OpsSoftware Development"
cleantag = self.checktag(tag)
if len(cleantag) > 1:
stackedTags += "- " + cleantag[0] + "\n"
stackedTags += "- " + cleantag[1] + "\n"
else :
@JeremyMorgan
JeremyMorgan / pciconf.out.txt
Created December 29, 2020 17:27
Lenovo e590 Laptop FreeBSD Info
hostb0@pci0:0:0:0: class=0x060000 card=0x507217aa chip=0x3e348086 rev=0x0c hdr=0x00
vendor = 'Intel Corporation'
device = 'Coffee Lake HOST and DRAM Controller'
class = bridge
subclass = HOST-PCI
vgapci0@pci0:0:2:0: class=0x030000 card=0x507217aa chip=0x3ea08086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = 'UHD Graphics 620 (Whiskey Lake)'
class = display
subclass = VGA
@JeremyMorgan
JeremyMorgan / dmesg.out.txt
Created December 29, 2020 17:27
Lenovo e590 Laptop FreeBSD Info
ugen0.4: <Azurewave Integrated Camera> at usbus0
ums0 on uhub0
ums0: <Logitech USB Receiver, class 0/0, rev 2.00/12.10, addr 1> on usbus0
ums0: 16 buttons and [XYZT] coordinates ID=2
uhid0 on uhub0
uhid0: <Logitech USB Receiver, class 0/0, rev 2.00/12.10, addr 1> on usbus0
wlan0: link state changed to DOWN
Waiting (max 60 seconds) for system process `vnlru' to stop... done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining... 0 0 done
@JeremyMorgan
JeremyMorgan / devinfo.out.txt
Created December 29, 2020 17:26
Lenovo e590 FreeBSD info
nexus0
cryptosoft0
efirtc0
apic0
ram0
acpi0
acpi_ec0 pnpinfo _HID=PNP0C09 _UID=0 at handle=\_SB_.PCI0.LPCB.EC__
pcib0 pnpinfo _HID=PNP0A08 _UID=0 at handle=\_SB_.PCI0
pci0
hostb0 pnpinfo vendor=0x8086 device=0x3e34 subvendor=0x17aa subdevice=0x5072 class=0x060000 at slot=0 function=0 dbsf=pci0:0:0:0
@JeremyMorgan
JeremyMorgan / acpidump.out.txt
Created December 29, 2020 17:25
Lenovo e590 Laptop FreeBSD Info
/*
RSD PTR: OEM=LENOVO, ACPI_Rev=2.0x (2)
XSDT=0x000000007ae0c188, length=36, cksum=57
*/
/*
XSDT: Length=268, Revision=1, Checksum=25,
OEMID=LENOVO, OEM Table ID=TP-R0Y, OEM Revision=0x290,
Creator ID=PTEC, Creator Revision=0x2
Entries={ 0x0000000079a18000, 0x0000000079a6d000, 0x0000000079a6c000, 0x0000000079a33000, 0x0000000079a1d000, 0x0000000079a1c000, 0x0000000079a1b000, 0x000000007ac23000, 0x0000000079a19000, 0x0000000079a17000, 0x0000000079a16000, 0x0000000079a15000, 0x0000000079a14000, 0x00000000799ed000, 0x00000000799ec000, 0x00000000799eb000, 0x00000000799ea000, 0x00000000799e9000, 0x00000000799e8000, 0x00000000799e6000, 0x00000000799e5000, 0x00000000799e4000, 0x00000000799e3000, 0x0000000079806000, 0x0000000078a03000, 0x0000000078a01000, 0x00000000789ff000, 0x00000000789fe000, 0x000000007ac00000 }
*/
@JeremyMorgan
JeremyMorgan / callmon.class.php
Created August 23, 2020 19:38
Ancient Code3
<?php
/**
* Call Monitor Class
*
* This class builds the call monitor object, and is the first class that others are based off of.
* It stores info
*
*
* @package SSVS Call Monitor App
* @author Jeremy Morgan
@JeremyMorgan
JeremyMorgan / Code.gs
Last active February 20, 2020 15:18
Google Sheets Code to pull Dev.TO stats
function getFirstEmptyRow() {
var spr = SpreadsheetApp.getActiveSpreadsheet();
var column = spr.getRange('A:A');
var values = column.getValues(); // get all data in one call
var ct = 0;
while (values[ct][0] != "") {
ct++;
}
return (ct);
}
@JeremyMorgan
JeremyMorgan / badguyips.txt
Created February 8, 2020 05:02
All the idiots who've tried to attack my server recently
101.109.83.140
101.230.236.177
101.231.154.154
101.36.150.59
102.112.96.12
102.176.160.30
102.37.12.59
103.105.58.72
103.107.101.195
103.123.15.253