This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# Restart USB 3.0 to ethernet adapter (ASIX Electronics Corp. AX88179 Gigabit Ethernet) | |
# | |
# The device will stop functioning with this error message below: | |
# | |
# [ 1179.475926] kernel: xhci_hcd 0000:04:00.0: WARN: TRB error for slot 1 ep 5 on endpoint | |
# [ 1179.607026] kernel: xhci_hcd 0000:04:00.0: WARN waiting for error on ep to be cleared | |
# [ 1179.607049] kernel: xhci_hcd 0000:04:00.0: WARN waiting for error on ep to be cleared |
This file contains hidden or 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
#!/bin/sh | |
ubus call network.interface.wan status | grep uptime | sed 's/[^0-9]//g' |
This file contains hidden or 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
/** | |
* source: [Create GUID / UUID in JavaScript?, broofa]{@link https://stackoverflow.com/a/2117523} | |
*/ | |
export function uuidv4() { | |
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => | |
( | |
c ^ | |
(crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4))) | |
).toString(16), | |
); |