This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
fuss:linux [2020/02/25 05:07] – [Determining the Last Power On Method] office | fuss:linux [2020/05/12 23:36] – [Scraping a Site Automatically using SystemD] office | ||
---|---|---|---|
Line 1118: | Line 1118: | ||
In doing so, the power management issue seems to be resolved. | In doing so, the power management issue seems to be resolved. | ||
+ | ====== Automatically Add all RNDIS Devices to a Bridge ====== | ||
+ | Edit or create the file at ''/ | ||
+ | < | ||
+ | SUBSYSTEM==" | ||
+ | </ | ||
+ | where: | ||
+ | * '' | ||
+ | followed by the command: | ||
+ | <code bash> | ||
+ | udevadm control --reload | ||
+ | </ | ||
+ | to reload all udev rules. | ||
+ | The reason this works is due to '' | ||
+ | <code bash> | ||
+ | udevadm info -a / | ||
+ | </ | ||
+ | will show at the top the RNDIS device without any identifiers whereas the parent '' | ||
+ | One usage case for this rule is to connect a bunch of RNDIS devices to an USB hub and have them join the network automatically as they are hotplugged; for instance, Raspberry Pis [[fuss/ | ||
+ | ====== Scraping a Site Automatically using SystemD ====== | ||
+ | |||
+ | FTP sites can be scraped elegantly by using systemd and tmux on Linux. By starting a '' | ||
+ | |||
+ | The following script contains a few parameters underneath the '' | ||
+ | * the download path ('' | ||
+ | * the '' | ||
+ | * a descriptive name for the '' | ||
+ | |||
+ | <code bash> | ||
+ | [Unit] | ||
+ | Description=Scrape FTP Site | ||
+ | Requires=network.target local-fs.target remote-fs.target | ||
+ | After=network.target local-fs.target remote-fs.target | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | |||
+ | [Service] | ||
+ | # Configuration | ||
+ | Environment=DOWNLOAD_DIRECTORY="/ | ||
+ | Environment=DOWNLOAD_URL=" | ||
+ | Environment=TMUX_SESSION_NAME=" | ||
+ | # Internals | ||
+ | Type=oneshot | ||
+ | KillMode=none | ||
+ | User=root | ||
+ | ExecStartPre = -/bin/mkdir -p \"" | ||
+ | ExecStart=/ | ||
+ | ExecStop=/ | ||
+ | RemainAfterExit=yes | ||
+ | |||
+ | </ | ||
+ | |||
+ | The file should be placed under ''/ | ||
+ | |||
+ | Upon every reboot, the service file will create a detached tmux terminal and start scraping files from the URL. |