Skip to content

Instantly share code, notes, and snippets.

View strikaco's full-sized avatar
💋
Chaotic Good

Johnny strikaco

💋
Chaotic Good
View GitHub Profile
DESCRIPTION OF SUSPECT #1 – Unknown male, 20s, heavy build, black hair, brown complexion, wearing a black shirt and blue jeans
DESCRIPTION OF SUSPECT #2 – Unknown female, 20s, medium build, black hair, tan complexion, tattoo down center of back, wearing a blue skirt and white halter top
DESCRIPTION OF SUSPECT #3 – Unknown male, 20s, heavy build, black hair, brown complexion, wearing a white shirt and white pants.
DESCRIPTION OF SUSPECT #4 – Unknown mixed Asian female, 40s, with straight black hair, wearing a black with a green print dress, long black sweater, and glasses on head.
@strikaco
strikaco / gist:ce9f6d59d620303ff9f0fe45da7a4c54
Created July 13, 2023 01:59
Cuda error: no kernel image is available for execution on the device
# https://github.com/pytorch/pytorch/issues/31285
pip3 install torch torchvision torchaudio --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu116
import requests
import json
# Define your Azure app registration details
client_id = 'your_client_id'
client_secret = 'your_client_secret'
tenant_id = 'your_tenant_id'
authority = f"https://login.microsoftonline.com/{tenant_id}"
scope = ["https://graph.microsoft.com/.default"]
graph_url = 'https://graph.microsoft.com/v1.0/'
@strikaco
strikaco / values.py
Created April 14, 2022 02:23
Value Container
from dataclasses import dataclass, field, asdict
from enum import Enum, auto
class Scale(Enum):
NONE = 0
LOW = 25
MEDIUM = 50
HIGH = 75
MAX = 100
@strikaco
strikaco / components.py
Created April 1, 2022 18:31
Python - Component dataclasses as class properties
from dataclasses import dataclass, field, fields, replace, asdict
_MISSING = object()
@dataclass
class Component(object):
"""
Collection of attributes.
"""
_key: str = field(default=None, hash=False, repr=False, compare=False)
@strikaco
strikaco / test.py
Created December 6, 2020 01:59 — forked from OrganicPanda/test.py
A basic CherryPy/SQLAlchemy example site to demonstrate a multi-user issue
import cherrypy
import sqlalchemy
from sqlalchemy import Table, Column, ForeignKey, MetaData, Integer, String
from sqlalchemy.orm import scoped_session, sessionmaker, mapper, relationship
from sqlalchemy.orm.properties import ColumnProperty
from sqlalchemy.orm.util import object_mapper
# The base class from which all entities will extend
class BaseEntity(object):
def __repr__(self):
@strikaco
strikaco / graph.json
Created October 17, 2020 20:42 — forked from eyaler/graph.json
Force-Directed Graph with Drag/Zoom/Pan/Center/Resize/Labels/Shapes/Filter/Highlight
{
"graph": [],
"links": [
{"source": 0, "target": 1},
{"source": 0, "target": 2},
{"source": 0, "target": 3},
{"source": 0, "target": 4},
{"source": 0, "target": 5},
{"source": 0, "target": 6},
{"source": 1, "target": 3},
@strikaco
strikaco / sqlalchemy_example.py
Created October 17, 2020 20:38 — forked from ronreiter/sqlalchemy_example.py
SQLAlchemy Example
from sqlalchemy import Column, Integer, String, ForeignKey, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref, sessionmaker, joinedload
# For this example we will use an in-memory sqlite DB.
# Let's also configure it to echo everything it does to the screen.
engine = create_engine('sqlite:///:memory:', echo=True)
# The base class which our objects will be defined on.
Base = declarative_base()
@strikaco
strikaco / cim.txt
Last active October 11, 2018 00:24
CIM Format (JSON)
{"Dataset name": "Alerts", "Possible values": [], "Model": "Alerts", "Expected values": [], "Data type": "string", "Description": "The application involved in the event, such as win:app:trendmicro, vmware, nagios.", "Field name": "app"}
{"Dataset name": "Alerts", "Possible values": [], "Model": "Alerts", "Expected values": [], "Data type": "string", "Description": "The body of a message.", "Field name": "body"}
{"Dataset name": "Alerts", "Possible values": [], "Model": "Alerts", "Expected values": [], "Data type": "string", "Description": "The destination of the alert message, such as an email address or SNMP trap. You can alias this from more specific fields, such as dest_host, dest_ip, or dest_name.", "Field name": "dest"}
{"Dataset name": "Alerts", "Possible values": [], "Model": "Alerts", "Expected values": [], "Data type": "string", "Description": "The business unit associated with the destination. This field is automatically provided by asset and identity correlation features of applications like ClownS
from django.test import TestCase
from pandas import DataFrame
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
import numpy
import os