This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zpool status | while IFS=$'\n' read line; do | |
if [[ "$line" == *"ata-"* ]]; then | |
id=$(echo "$line" | grep -oP '(ata-[^\s]+)') | |
count=$(sudo smartctl -a /dev/disk/by-id/$id | grep Reallocated_Sector_Ct | grep -oP '(\d+)$') | |
echo "$line - bad sectors: $count" | |
else | |
echo "$line" | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subgridPolyfill(parent: HTMLElement, mode: "rows" | "columns") { | |
const go = () => { | |
const parentStyle = getComputedStyle(parent); | |
if (parentStyle.display != "grid") return; | |
const subgrids = Array.from(parent.children); | |
for (const child of subgrids) { | |
if (!(child instanceof HTMLElement)) throw new Error("child not instance of HtmlElement"); | |
if (mode == "rows") { | |
child.style.gridTemplateRows = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias genpass="dd if=/dev/random bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev" |