This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Origin: https://update.greasyfork.org/scripts/5679/250853/Wait%20For%20Elements.js | |
| * @param obj - { | |
| * sel: 'a', // the selector you want to wait for (optional) | |
| * context: document.body, // scope of search for selector or mutations (optional, default document.body) | |
| * stop: true, // stop waiting after first result (optional, default false) | |
| * mode: 'M', // M to use mutation observer, S to use setInterval (optional, default M) | |
| * onchange: func, // if using mode 'M' this function will be called whenever mutation handler triggers | |
| * onmatch: func, // if selector is specified function will be called for each match with element as parameter | |
| * config: { attributes: true } // if using mode 'M' this object will override settings passed to mutation observer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin bash | |
| # | |
| # Kill all zombies kvm process to release memory and idle cpu | |
| # | |
| # bash <(curl https://gist.github.com/MittWillson/6b8e6b8b68af4c18bc9eb138713284e9/raw/proxmox-kill-zombie-kvm) | |
| # bash <(curl https://gist.github.com/MittWillson/6b8e6b8b68af4c18bc9eb138713284e9/raw/proxmox-kill-zombie-kvm) --kill | |
| RUNNING=($(ps -ef | grep "kvm -id" | grep -v grep | awk '{print $2}')) | |
| ALIVE_RUNNING=($(qm list|grep running|awk '{print $6}')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| OLD_HOSTNAME=$(hostname) | |
| NEW_HOSTNAME=$1 | |
| rename() { | |
| echo $OLD_HOSTNAME > /.old_nodename | |
| hostnamectl set-hostname "$NEW_HOSTNAME" | |
| # edit hostname file |