Reset a PCI device and update python installation with additional dependenciesmaster
#!/usr/bin/env bash | #!/usr/bin/env bash | ||||
declare -a py_versions=( \ | declare -a py_versions=( \ | ||||
"3" \ | |||||
"3.5" \ | |||||
"3.6" \ | |||||
"3.7" \ | |||||
"3.8" \ | |||||
) | |||||
"3" \ | |||||
"3.5" \ | |||||
"3.6" \ | |||||
"3.7" \ | |||||
"3.8" \ | |||||
) | |||||
if [ -f /etc/os-release ]; then | if [ -f /etc/os-release ]; then | ||||
source /etc/os-release | source /etc/os-release | ||||
tk-dev \ | tk-dev \ | ||||
libffi-dev \ | libffi-dev \ | ||||
liblzma-dev \ | liblzma-dev \ | ||||
libxml2-dev \ | |||||
libxmlsec1-dev \ | |||||
python3-openssl \ | python3-openssl \ | ||||
git \ | git \ | ||||
graphviz \ | graphviz \ |
#!/usr/bin/bash | |||||
# Find the PCI ID of the device you want to reset | |||||
# # lspci | grep -i usb | |||||
# ... | |||||
# 0c:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03) | |||||
# Remove the device from the system | |||||
# # echo 1 > /sys/bus/pci/devices/0000\:0c\:00.0/remove | |||||
# Rescan the PCI bus | |||||
# # echo 1 > /sys/bus/pci/rescan |
#!/usr/bin/env bash | |||||
# Copied from slhck on | |||||
# https://superuser.com/questions/538161/how-to-bulk-rename-files-with-invalid-encoding-or-bulk-replace-invalid-encoded-c/858671#858671 | |||||
find "$1" -depth -print0 | while IFS= read -r -d '' file; do | |||||
d="$( dirname "$file" )" | |||||
f="$( basename "$file" )" | |||||
#new="${f//[^a-zA-Z0-9\/\._\-]/}" | |||||
new="${f//[\\\/\:\*\?\"<>|]/}" | |||||
if [ "$f" != "$new" ] # if equal, name is already clean, so leave alone | |||||
then | |||||
if [ -e "$d/$new" ] | |||||
then | |||||
echo "Notice: \"$new\" and \"$f\" both exist in "$d":" | |||||
ls -ld "$d/$new" "$d/$f" | |||||
else | |||||
echo mv "$file" "$d/$new" # remove "echo" to actually rename things | |||||
fi | |||||
fi | |||||
done |