Reset a PCI device and update python installation with additional dependenciesmaster
@@ -1,12 +1,12 @@ | |||
#!/usr/bin/env bash | |||
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 | |||
source /etc/os-release | |||
@@ -31,6 +31,8 @@ if which apt > /dev/null; then | |||
tk-dev \ | |||
libffi-dev \ | |||
liblzma-dev \ | |||
libxml2-dev \ | |||
libxmlsec1-dev \ | |||
python3-openssl \ | |||
git \ | |||
graphviz \ |
@@ -0,0 +1,12 @@ | |||
#!/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 |
@@ -0,0 +1,21 @@ | |||
#!/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 |