jenkins-stats.py is used to generate statics for jenkins server, so far it display the plugin's usage in each job, see related stackoverflow question:how can I know whether the plugin is used by any jobs in jenkins
python-requests module is required
| func debounceChannel(interval time.Duration, output chan int) chan int { | |
| input := make(chan int) | |
| go func() { | |
| var buffer int | |
| var ok bool | |
| // We do not start waiting for interval until called at least once | |
| buffer, ok = <-input | |
| // If channel closed exit, we could also close output |
| sudo apt-get update | |
| sudo apt-get install -y python-software-properties software-properties-common | |
| sudo add-apt-repository -y ppa:pi-rho/dev | |
| sudo apt-get update | |
| sudo apt-get install -y tmux=2.0-1~ppa1~t |
| wait4eth1() { | |
| CNT=0 | |
| until ip a show eth1 | grep -q UP | |
| do | |
| [ $((CNT++)) -gt 60 ] && break || sleep 1 | |
| done | |
| sleep 1 | |
| } | |
| wait4eth1 |
jenkins-stats.py is used to generate statics for jenkins server, so far it display the plugin's usage in each job, see related stackoverflow question:how can I know whether the plugin is used by any jobs in jenkins
python-requests module is required
| package main | |
| import ( | |
| "bytes" | |
| "compress/gzip" | |
| "fmt" | |
| "encoding/base64" | |
| "io/ioutil" | |
| ) |
| 1. Create a rule for the DFU | |
| $ (echo '# DFU (Internal bootloader for STM32 MCUs)' echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/45-stdfu-permissions.rules > /dev/null | |
| 2. Monitor connection and find your model (unplug/plug the fc while this cmd is active) | |
| $ udevadm monitor --environment --udev | grep ID_MODEL_ID | |
| 3. Update the /etc/udev/rules.d/45-stdfu-permissions.rules file with your model. E.g, my MODEL_ID is 5740, and the .rules file | |
| ends up like this: |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
| function password_encode(password) | |
| local bcrypt = require 'bcrypt' | |
| return bcrypt.digest(password, 12) | |
| end | |
| function check_password(password, encoded_password) | |
| local bcrypt = require 'bcrypt' | |
| return bcrypt.verify(password, encoded_password) | |
| end |
Now to build these you'll need Packer and the virtualization tool you are building the box for, Virtualbox or VMware Workstation (or Parallels on Mac). Packer is written in Go and doesn't really require any external dependencies. If you are on Linux you can possibly find Packer in your package management tool, but it is best to grab the latest binary from https://packer.io and extract it to /usr/local/bin/ as packer or put it in ~/.local/bin/ if you have that in your PATH variable. On macOS use Homebrew from https://brew.sh to install with brew install packer. On W
curl -L https://releases.hashicorp.com/packer/1.4.5/packer_1.4.5_linux_amd64.zip -o ~/Downloads/packer.zip
unzip packer.zip
sudo install -m 755 packer /usr/local/bin/ # Allows any user to run it
sudo apt install virtualbox # or grab it from the https://virtualbox.org website
Go