Skip to content

Instantly share code, notes, and snippets.

View Vincinator's full-sized avatar

Vincent Riesop Vincinator

View GitHub Profile
@r15ch13
r15ch13 / iommu.sh
Last active July 3, 2024 13:32
List IOMMU Groups and the connected USB Devices
#!/usr/bin/env bash
shopt -s nullglob
lastgroup=""
for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do
for d in $g/devices/*; do
if [ "${g##*/}" != "$lastgroup" ]; then
echo -en "Group ${g##*/}:\t"
else
echo -en "\t\t"
@lukego
lukego / 14_12_1220_syndrome_list.log
Created August 15, 2016 08:51
Mellanox error syndrome lists
BAD_RES_STATE | 0x25B161 | destroy_ctx - context doesn't exist or doesn't match type
BAD_RES_STATE | 0x4A6FC9 | destroy_ctx - context in use
BAD_RES_STATE | 0x60DA55 | destroy_dct - dct not in drained state
BAD_PARAM | 0x67A6F2 | slrg doesnt support write;
BAD_PARAM | 0x0F0E35 | ppamp doesnt support write;
BAD_PKT | 0x4A22F | access reg MAD with specified register id not supported
BAD_PKT | 0x16C592 | mad_ifc: process_smp_lid mkey check failed - silently discarded
INTERNAL_ERR | 0x079233 | set_get_port_info: silently discarded.
BAD_PKT | 0x468496 | mad_ifc: ATTRV_SM_INFO handled by SW
BAD_PKT | 0x071808 | mad_ifc: smp trap repress silently discarded after processing.
@brantfaircloth
brantfaircloth / cool_argparse_stuff.py
Created December 7, 2011 16:47
Some cool argparse stuff
class FullPaths(argparse.Action):
"""Expand user- and relative-paths"""
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values)))
def is_dir(dirname):
"""Checks if a path is an actual directory"""
if not os.path.isdir(dirname):
msg = "{0} is not a directory".format(dirname)
raise argparse.ArgumentTypeError(msg)