Ver código fonte

Add Reset Inst for PCI & Update Python Install

Reset a PCI device and update python installation with additional
dependencies
master
Nate Bohman 3 anos atrás
pai
commit
7f25bd9d03
Acessado por: Nate Bohman <natrinicle@gmail.com> ID da chave GPG: C10546A54ABA1CE5
3 arquivos alterados com 41 adições e 6 exclusões
  1. +8
    -6
      install_python_versions.sh
  2. +12
    -0
      reset_pcie_device.sh
  3. +21
    -0
      windows_safe_filenames.sh

+ 8
- 6
install_python_versions.sh Ver arquivo

@@ -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 \

+ 12
- 0
reset_pcie_device.sh Ver arquivo

@@ -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

+ 21
- 0
windows_safe_filenames.sh Ver arquivo

@@ -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

Carregando…
Cancelar
Salvar