Skip to content

Instantly share code, notes, and snippets.

View certPolicy.ps1
Add-Type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
@nuriel77
nuriel77 / doDomainSnapshot.py
Created Apr 23, 2017
Do libvirt snapshot for domain and define how many recent snapshots to keep
View doDomainSnapshot.py
#!/usr/bin/env python
import argparse
import libvirt
import logging
import time
import sys
import os
from pprint import pformat
from heapq import nlargest
@sphaero
sphaero / gstseamlessloop.py
Last active Sep 20, 2021
Gstreamer seamless loop test
View gstseamlessloop.py
#/usr/bin/env python3
#
# Seamless loop test
# Copyright (c) 2015 Arnaud Loonstra <arnaud@sphaero.org>
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@toabctl
toabctl / libvirt-listen-events.py
Last active Apr 23, 2021
Listen for libvirt events
View libvirt-listen-events.py
#!/usr/bin/python
import libvirt
import sys
# virDomainEventType is emitted during domain lifecycles (see libvirt.h)
VIR_DOMAIN_EVENT_MAPPING = {
0: "VIR_DOMAIN_EVENT_DEFINED",
1: "VIR_DOMAIN_EVENT_UNDEFINED",
2: "VIR_DOMAIN_EVENT_STARTED",