Skip to content

Instantly share code, notes, and snippets.

View fepitre's full-sized avatar

Frédéric Pierret fepitre

  • France
View GitHub Profile
@Joeviocoe
Joeviocoe / qvm-portfwd-iptables
Last active June 16, 2021 11:40 — forked from daktak/qvm-exposeip.sh
Qubes-os port forwarding to allow external connections
#!/bin/sh
# Inspired by https://gist.github.com/daktak/f887352d564b54f9e529404cc0eb60d5
# Inspired by https://gist.github.com/jpouellet/d8cd0eb8589a5b9bf0c53a28fc530369
ip() { qvm-prefs -g -- "$1" ip; }
netvm() { qvm-prefs -g -- "$1" netvm; }
forward() {
local from_domain=$1
local to_domain=$2
@cyberang3l
cyberang3l / Libvirt-Start-VMs-In-Order-Instructions.md
Last active February 23, 2024 13:41
Necessary scripts and procedure to start libvirt VMs in a provided order, with an given delay before starting each subsequent VM.
  1. Ensure that your VMs can shutdown gracefully when the power-button is pressed.

  2. Place the file vm-boot-order.py in /opt directory

  3. Make it executable: chmod +x /opt/vm-boot-order.py

  4. Check that the script starts and shuts down your VMs as expected. The script can be executed as follows:

     /opt/vm-boot-order.py start
     /opt/vm-boot-order.py stop
     /opt/vm-boot-order.py status
    
  5. Make a systemd service to execute the script when booting or shutting down the hypervisor:

@stuart-warren
stuart-warren / CreateJob.sh
Last active March 8, 2024 16:20
Create a job in Jenkins (or folder) using the HTTP API
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder