Skip to content

Instantly share code, notes, and snippets.

View docwyatt2001's full-sized avatar
😵
Not knowing where to start...

Malcolm White docwyatt2001

😵
Not knowing where to start...
View GitHub Profile
@owenlamont
owenlamont / pic_to_excel.py
Created December 29, 2019 05:59
Command line script to take an image and convert it into an Excel spreadsheet (xlsx) file
import argparse
from PIL import Image
import numpy as np
from pathlib import Path
import xlsxwriter
from tqdm.auto import trange
from matplotlib.colors import rgb2hex
def main(input_file: Path, output_file: Path, column_width: float, row_height: float):
class Delta:
def __init__(self,old,new):
newset = set(new.rules)
oldset = set(old.rules)
self.deleted = list(oldset - newset)
self.added = list(newset - oldset)
self.retained = list(oldset & newset)
@tom-henderson
tom-henderson / unifi-devices.py
Last active February 7, 2018 10:01
Get a list of connected devices from a Unifi controller
import sys
import json
import requests
def get_clients():
PORTAL_URL = 'https://0.0.0.0:8443/'
PORTAL_LOGIN_PARAMS = {
'username': '',
'password': '',
@hdml
hdml / custom-ssl-cert-rdp.md
Created April 19, 2017 21:24
Custom SSL Certificate for Windows RDP Service

##Custom SSL Certificate for Windows RDP Service

Requirements

  • Windows 8+ or Server 2012+
  • Certificate with private key (*.p12)
  • Intermediate CA certificate (*.cer)
  • Administrative rights to modify the certificate store
@lummie
lummie / enum.go
Last active November 4, 2023 18:09
Golang Enum pattern that can be serialized to json
package enum_example
import (
"bytes"
"encoding/json"
)
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred
type TaskState int