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 python | |
import sys | |
from dciclient.v1.api import context as dci_context | |
from dciclient.v1.api import topic as dci_topic | |
from dciclient.v1.api import component as dci_component | |
from dciclient.v1.api import job as dci_job | |
parent_id = sys.argv[1] |
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 python | |
import requests | |
import shutil | |
import tempfile | |
registry = 'http://192.168.1.147:5000' | |
def get_digests(repo, tag): | |
# See: https://docs.docker.com/registry/spec/manifest-v2-2/#example-manifest-list |
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 python | |
import datetime | |
import time | |
def interne(): | |
with open('/sys/bus/w1/devices/28-0416747fbbff/w1_slave', 'r') as fd: | |
return float(fd.readlines()[1].split()[-1].split('=')[1]) / 1000 | |
while True: |
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
nmcli con add ifname maison type bridge con-name maison | |
nmcli con add type bridge-slave ifname enp4s0 master maison | |
nmcli con modify maison bridge.stp no | |
nmcli con down enp4s0 | |
nmcli con up maison |
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
vim /etc/libvirt/libvirtd.conf | |
#unix_sock_group = "libvirt" -> unix_sock_group = "libvirt" | |
sudo systemctl restart libvirtd | |
sudo usermod -a -G qemu,libvirt $USER |
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
virt-install --connect qemu:///system \ | |
-n esxi-65 -r 4096 \ | |
--vcpus=sockets=1,cores=2,threads=2 \ | |
--cpu host --disk path=/var/lib/libvirt/images/esxi-65.qcow2,size=30 \ | |
-c /home/goneri/Downloads/VMware-VMvisor-Installer-6.5.0.update01-5969303.x86_64.iso --os-type generic \ | |
--accelerate --network=bridge:virbr0,model=e1000 \ | |
--hvm --graphics vnc,listen=0.0.0.0 |
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
# pkg install py27-cloud-init | |
# cd /usr/local/lib/python2.7/site-packages/cloudinit | |
# curl -L https://code.launchpad.net/~goneri/cloud-init/+git/cloud-init/+merge/364997/+preview-diff/867430/+files/preview.diff | patch -u -p2 | |
# Use the following branch: https://github.com/goneri/cloud-init/tree/freebsd_apply_network | |
# Add the blkid fake binary: | |
root@localhost:/mnt # cat /usr/local/bin/blkid | |
#!/bin/sh |
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
# Grab an image from http://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/ | |
# Start it using QEMU, e.g: qemu-system-x86_64 -drive file=FreeBSD-13.0-CURRENT-amd64.qcow2 -net nic,model=virtio -net user -m 1G | |
# Login and fetch the script: | |
# fetch --no-verify-peer https://gist.githubusercontent.com/XXXXX | |
# sh cloudify.sh | |
# Done | |
export ASSUME_ALWAYS_YES=YES | |
cd /tmp |
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
See: https://github.com/virt-lightning/freebsd-cloud-images |
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
#!/bin/sh | |
set -eux | |
MNT=new | |
FILE=new.img | |
VND=vnd0 | |
mkdir new | |
dd if=/dev/zero of=${FILE} bs=4096 count=1015200 progress=62000 | |
vnconfig ${VND} ${FILE} |