npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

proxmox-usb-hotplug

v0.1.6

Published

Hot Plug any new USB device to a running proxmox KVM

Downloads

11

Readme

proxmox-usb-hotplug

  • NPM Version

This script monitor and plug any new USB device to running KVM hosted by a proxmox server.

Usage: proxmox-usb-hotplug [options]

Hotplug any new Usb device to your proxmox

Options:
  -V, --version              output the version number
  --vmid <vmid>              vmid will receive USB Devices, by default the first running VM having an hostpci0
  --user <user>              host to connect if not root@pam (default: "root@pam")
  --port <port>              port to connect if not 8006 (default: "8006")
  --host <host>              host to connect if not 127.0.0.1 (default: "127.0.0.1")
  -p, --pass [pass]          host password, prefed stdin, nodejs script can not hide password from command line
  -c, --config <configFile>  provide a configuration file
  -h, --help                 display help for command

configuration file

# username used to connect to proxmox API
username = root@pam
# password used to connect to proxmox API
password = prOxmOxp@sswOd
# host used to connect to proxmox API should always be localhost
host = 127.0.0.1

# the node name to used
# by default use the first node, if you are using a cluster you should give the cluster name
;node=proxmox

# deny an usb device
deny-usb=001c:100d
# deny an usb hub 
# you should always deny USB hub to avoid a dual passthrough 
deny-usb=1a40:0101


# Connect some device at startup recommanded for keyboard and mouse
# a keyboard
force-usb=258a:1006
# a mouse
force-usb=18f8:0f97

# not implemented yet.
; watch = 60

# unplug all existing device on script startup
# then reconnect all force-usb devices
flush = 1

# try to autodetect USB Hub to avoid dual passthrough
no-hub=1

sample

# on the dom0
echo password = myPassword > conf.txt
echo flush = 1 >> conf.txt
proxmox-usb-hotplug -c conf.txt

use as a service

/etc/usb-hotplug.conf

password = prOxmOxp@sswOd
deny-usb=001c:100d
deny-usb=1a40:0101
force-usb=258a:1006
force-usb=18f8:0f97
flush = 1
no-hub=1

proxmox-usb-hotplug.config.js

module.exports = {
    apps: [{
        name: "proxmoxUsbHotplug",
        script: "proxmox-usb-hotplug",
        args: ["--config", "/etc/hotplug-usb.conf"],
        watch: [ "/etc/hotplug-usb.conf" ],
    }]
}
chmod 600 /etc/usb-hotplug.conf
npm install -g proxmox-usb-hotplug
npm install -g pm2
pm2 install pm2-logrotate
pm2 startup
# read the instruction
pm2 status proxmox-usb-hotplug.config.js
pm2 save

TODO

  • Deal with USB 3.x.
  • auto detect current cluster name.