Simple function to (properly) compare version strings in bash
You can not do alphabetic comparison:
#!/bin/bash | |
# This exists because I couldn't figure out to to make | |
# any of the relevant system units wait for my zpool to become available | |
# before importing it. | |
# | |
# zpool `tank` is a ThunderBay 6 connected via Thunderbolt 3. | |
# | |
# bolt.service -> ? -> zfs-import-cache | |
# ? is possibly just time as it takes a bit for the drives to spin up. | |
# The nvme pools work fine, for example. |
#!/usr/bin/env python3 | |
# | |
# NOTE: This assumes that all modules and versions are built for at | |
# least one kernel. If that's not the case, adapt parsing as needed. | |
import os | |
import subprocess | |
# Permission check. | |
if os.geteuid() != 0: | |
print("You need to be root to run this script.") |
[161312.500002] usb 3-2: new full-speed USB device number 3 using xhci_hcd
[161312.926854] usb 3-2: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[161312.926860] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[161312.926863] usb 3-2: Product: FT232R USB UART
[161312.926866] usb 3-2: Manufacturer: FTDI
[161312.926869] usb 3-2: SerialNumber: AC01PV6Q
[161312.966524] usbcore: registered new interface driver usbserial_generic
[161312.966534] usbserial: USB Serial support registered for generic
#!/usr/bin/python | |
# For mojave only | |
# In order for this to work, you will need to go to System Preferences in Mojave -> Security & Privacy -> Privacy -> Full Disk Access and grant Terminal.app permissions | |
import sqlite3 | |
conn = sqlite3.connect('/var/db/SystemPolicyConfiguration/KextPolicy') | |
c = conn.cursor() | |
query = 'SELECT * FROM kext_policy' | |
c.execute(query) |
Add the following chunk to your existing ISC dhcpd.conf
file.
if exists user-class and ( option user-class = "iPXE" ) {
filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
filename "undionly.kpxe";
}
(or see https://gist.github.com/4008017 for a more elaborate setup
#install gcc git build-essential python3 | |
$ sudo aptitude install gcc git build-essential python3 | |
#from http://www.pip-installer.org/en/latest/installing.html | |
$ curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py | |
$ mkdir python3_prole | |
$ cd python3_prole/ | |
$ python virtualenv.py -p /usr/bin/python3 env | |
$ python virtualenv.py --relocatable -p /usr/bin/python3 env |
#!/usr/bin/env python | |
""" | |
Python functions for finding open files and PIDs that have opened a file. | |
""" | |
import numbers | |
import subprocess | |
try: |
What I had:
What I wanted: