Skip to content

Instantly share code, notes, and snippets.

Avatar
☢️

John Andersen pdxjohnny

☢️
View GitHub Profile
@pdxjohnny
pdxjohnny / default-values.patch
Created Jun 16, 2020
DFFML memory support default values TODO
View default-values.patch
diff --git a/dffml/df/memory.py b/dffml/df/memory.py
index 7d29c84f..f6c7cdfb 100644
--- a/dffml/df/memory.py
+++ b/dffml/df/memory.py
@@ -586,8 +586,27 @@ class MemoryInputNetworkContext(BaseInputNetworkContext):
],
)
)
- # Return if there is no data for an input
+ # There is no data in the network for an input
@pdxjohnny
pdxjohnny / cmd.sh
Last active Jun 16, 2020
DFFML sharedconfig
View cmd.sh
dffml service dev export -configloader yaml test:dataflow
@pdxjohnny
pdxjohnny / cmds.patch
Created Jun 10, 2020
DFFML display model config as yaml-ish for `dffml model list`
View cmds.patch
diff --git a/dffml/util/cli/cmds.py b/dffml/util/cli/cmds.py
index 26227b49..0ccb2c25 100644
--- a/dffml/util/cli/cmds.py
+++ b/dffml/util/cli/cmds.py
@@ -1,3 +1,4 @@
+import json
import inspect
from typing import List
@@ -9,6 +10,7 @@ from ...base import config, field
@pdxjohnny
pdxjohnny / cvedb-asyncio.py
Created May 20, 2020
Original cve-bin-tool CVE db code (async)
View cvedb-asyncio.py
'''
Retrieval access and caching of NIST CVE database
'''
import os
import re
import gzip
import json
import glob
import asyncio
import hashlib
@pdxjohnny
pdxjohnny / tar_vs_shutil.py
Created May 15, 2020
Untaring vs. using shutil.unpack_archive
View tar_vs_shutil.py
import os
import shutil
import pathlib
import tempfile
import functools
import subprocess
import contextlib
import urllib.request
View deffeature.diff
diff --git a/dffml/feature/feature.py b/dffml/feature/feature.py
index 9e9c1341..e6d92cca 100644
--- a/dffml/feature/feature.py
+++ b/dffml/feature/feature.py
@@ -14,6 +14,7 @@ from typing import List, Dict, Type, Any
from .log import LOGGER
from ..util.entrypoint import Entrypoint
+from ..util.data import parser_helper
@pdxjohnny
pdxjohnny / NETCAT.md
Created May 11, 2020
Netcat tips and tricks
View NETCAT.md

Display a file as plain text in a browser

$ (echo -e 'HTTP/1.0 200 OK\n' && cat myfile.txt) | nc -lp 8080
View bsae.diff
diff --git a/dffml/service/dev.py b/dffml/service/dev.py
index 982f30fe..a94e0b39 100644
--- a/dffml/service/dev.py
+++ b/dffml/service/dev.py
@@ -7,6 +7,7 @@ import shutil
import asyncio
import pathlib
import getpass
+import inspect
import tempfile
@pdxjohnny
pdxjohnny / WIREGUARD.md
Last active Jun 21, 2020
Wireguard Setup
View WIREGUARD.md

How to use Wireguard

Wireguard is a VPN that comes built into Linux kernels >= 5.6 It also has clients for OSs like Windows, OSX, and Android.

If you're looking for how to have a virtual LAN party, Wireguard is a great way to do it. Since it's cross platform. You can even play Windows games on Linux using Lutris and network them with Wireguard to get Windows and Linux machines playing together.

@pdxjohnny
pdxjohnny / VIRTUALBOX.md
Created Mar 27, 2020
VirtualBox Tips and Tricks
View VIRTUALBOX.md

VirtualBox Tips and Tricks

Port Forwarding

Expose a port in a guest when NAT is enabled (the default networking mode).

vbox-port-forward