Skip to content

Instantly share code, notes, and snippets.

View tormath1's full-sized avatar

Mathieu Tortuyaux tormath1

View GitHub Profile
@tormath1
tormath1 / README.md
Last active May 2, 2021 11:39
generateCVE summary from a CVE list

Usage example:

$ go run ./main.go -cvefile ./cves.txt | jq
[
  {
    "score": 5.9,
    "severity": "MEDIUM",
    "description": "A flaw was found in dnsmasq before version 2.83. A heap-based buffer overflow was discovered in dnsmasq when DNSSEC is enabled and before it validates the received DNS entries. A remote attacker, who can create valid DNS replies, could use this flaw to cause an overflow in a heap-allocated memory. This flaw is caused by the lack of length checks in rfc1035.c:extract_name(), which could be abused to make the code execute memcpy() with a negative size in get_rdata() and cause a crash in dnsmasq, resulting in a denial of service. The highest threat from this vulnerability is to system availability."
  },
  {
Apr 21 14:33:28 localhost systemd[1]: Starting kubelet.service...
Apr 21 14:33:28 localhost systemd[1]: Started kubelet.service.
Apr 21 14:33:28 localhost kubelet[2722]: Flag --register-schedulable has been deprecated, will be removed in a future version
Apr 21 14:33:28 localhost kubelet[2722]: Flag --pod-manifest-path has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Apr 21 14:33:29 localhost kubelet[2722]: I0421 14:33:29.498947 2722 server.go:417] Version: v1.18.0
Apr 21 14:33:29 localhost kubelet[2722]: I0421 14:33:29.499496 2722 plugins.go:100] No cloud provider specified.
Apr 21 14:33:29 localhost kubelet[2722]: I0421 14:33:29.592520 2722 server.go:646] --cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /
Apr 21 14:33:29 localhost kubelet[2722]: I0421 14:33:29.593185 2722 container_manager_linux.go:266] con
$ sudo ./bin/kola run -b cl -p qemu --qemu-image /home/mathieu/kinvolk/flatcar-sdk/src/build/images/amd64-usr/developer-2823.0.0+2021-04-06-1555-a1/flatcar_production_qemu_image.img
qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of qcow2)
=== RUN cl.update.badverity
=== RUN coreos.locksmith.tls
=== RUN cl.ignition.v1.users
=== RUN cl.verity
=== RUN cl.ignition.v1.xfsroot
=== RUN cl.ignition.v2_1.ext4checkexisting
=== RUN cl.network.initramfs.second-boot
=== RUN cl.basic
package main
import (
"fmt"
"net"
"os"
"runtime"
"github.com/vishvananda/netlink"
"github.com/vishvananda/netns"
@tormath1
tormath1 / play-pause.py
Created March 16, 2021 15:30
Play / Pause your Chromium multimedia using d-bus
#!/usr/bin/env python
# goal of this script is to control (play / pause) multimedia played
# on a chromium tab through dbus
# requirements:
# * dbus (session)
import dbus
# used to identify a Dbus chromium instance
{"format_version":"0.1","terraform_version":"0.13.5","variables":{"project":{"value":"toto1234"}},"planned_values":{"root_module":{"resources":[{"address":"google_container_cluster.primary","mode":"managed","type":"google_container_cluster","name":"primary","provider_name":"registry.terraform.io/hashicorp/google","schema_version":1,"values":{"description":null,"enable_binary_authorization":false,"enable_intranode_visibility":null,"enable_kubernetes_alpha":false,"enable_legacy_abac":false,"enable_shielded_nodes":false,"enable_tpu":null,"initial_node_count":1,"ip_allocation_policy":[],"location":"us-central1","maintenance_policy":[],"master_auth":[{"client_certificate_config":[{"issue_client_certificate":false}],"password":"","username":""}],"master_authorized_networks_config":[],"min_master_version":null,"name":"cluster-lab","network":"default","pod_security_policy_config":[],"private_cluster_config":[],"remove_default_node_pool":true,"resource_labels":null,"resource_usage_export_config":[],"timeouts":null,"ve
resource "google_container_cluster" "primary" {
name = "cluster-lab"
location = "us-central1"
# We can't create a cluster with no node pool defined, but we want to only use
# separately managed node pools. So we create the smallest possible default
# node pool and immediately delete it.
remove_default_node_pool = true
initial_node_count = 1
import json
import sys
if len(sys.argv) < 3:
print(f"usage: {sys.argv[0]} resources.tfstate resources12.tfstate")
exit(1)
source = sys.argv[1]
dest = sys.argv[2]
{"format_version":"0.1","terraform_version":"0.13.5","planned_values":{"root_module":{"child_modules":[{"resources":[{"address":"module.k8s.data.ignition_config.ignition[0]","mode":"data","type":"ignition_config","name":"ignition","index":0,"provider_name":"registry.terraform.io/terraform-providers/ignition","schema_version":0,"values":{"append":[],"arrays":null,"directories":null,"disks":null,"files":["{\"filesystem\":\"root\",\"group\":{},\"path\":\"/etc/hostname\",\"user\":{},\"contents\":{\"source\":\"data:text/plain;charset=utf-8;base64,bm9kZS0wMA==\",\"verification\":{}},\"mode\":420}"],"filesystems":null,"groups":null,"links":null,"networkd":["{\"contents\":\"[Match]\\nName=eth0\\n\\n[Network]\\nDHCP=ipv4\\n\",\"name\":\"00-wired.network\"}"],"replace":[],"systemd":[null,"{\"contents\":\"[Unit]\\nDescription=Setup Network Environment\\nDocumentation=https://github.com/kelseyhightower/setup-network-environment\\nRequires=network-online.target\\nAfter=network-online.target\\n\\n[Service]\\nExecStartPre=-
@tormath1
tormath1 / main.go
Created November 8, 2020 17:59
NTP Go Client
package main
import (
"bufio"
"bytes"
"encoding/binary"
"fmt"
"net"
"os"
"time"