Skip to content

Instantly share code, notes, and snippets.

View donnydavis's full-sized avatar

Donny Davis donnydavis

View GitHub Profile
@donnydavis
donnydavis / chromeify
Created March 12, 2018 22:27
OSX Google Chrome Appify
#!/bin/sh
#This is not new, just a few minor edits to an old script for OSX.
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name=$inputline
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
@donnydavis
donnydavis / pfsense-2.4-extractor.json
Created March 30, 2018 19:06
pfsense 2.4 graylog Extractors
{
"extractors": [
{
"title": "pfSense filterlog: IPv6 TCP",
"extractor_type": "regex",
"converters": [
{
"type": "csv",
"config": {
"column_header": "RuleNumber,SubRuleNumber,Anchor,Tracker,Interface,Reason,Action,Direction,IPVersion,Class,FlowLabel,HopLimit,Protocol,ProtocolID,Length,SourceIP,DestIP,SourcePort,DestPort,DataLength,TCPFlags,Sequence,ACK,Window,URG,Options"
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0/block/sr0':
KERNEL=="sr0"
SUBSYSTEM=="block"
clear@cl-ucd~ $ sudo udevadm info -q all /dev/sr0
P: /devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0/block/sr0
N: sr0
L: 0
S: disk/by-id/ata-QEMU_DVD-ROM_QM00001
S: disk/by-path/pci-0000:00:01.1-ata-1
E: DEVPATH=/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0/block/sr0
E: DEVNAME=/dev/sr0
E: DEVTYPE=disk
E: MAJOR=11
KERNEL!="sr[0-9]", GOTO="no_config_drive_end"
# Import FS info udev
IMPORT{program}="/sbin/blkid -o udev -p %N"
ACTION!="add", GOTO="no_config_drive_end"
SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="iso9660|udf|vfat", ENV{ID_FS_LABEL}=="config-2|CONFIG-2", RUN+="/usr/bin/ucd --user-data-once"
# Exit
LABEL="no_config_drive_end"
KERNEL!="sr[0-9]", GOTO="no_config_drive_end"
# Import FS info
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{fs_name}="%E{ID_FS_LABEL}"
# Global mount options
# Filesystem-specific mount options
ACTION=="add", ENV{fs_name}=="config-2|CONFIG-2", ENV{ID_FS_TYPE}=="iso9660|udf|vfat", RUN+="/usr/bin/ucd --user-data-once"
# Exit
LABEL="no_config_drive_end"
root@cl-ucd~ # udevadm info -q all /dev/sr0
P: /devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0/block/sr0
N: sr0
L: 0
S: disk/by-id/ata-QEMU_DVD-ROM_QM00001
S: disk/by-path/pci-0000:00:01.1-ata-1
E: DEVPATH=/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0/block/sr0
E: DEVNAME=/dev/sr0
E: DEVTYPE=disk
E: MAJOR=11