Skip to content

Instantly share code, notes, and snippets.

View bonnefoa's full-sized avatar

Anthonin Bonnefoy bonnefoa

View GitHub Profile
@bonnefoa
bonnefoa / .gitignore
Last active March 21, 2024 09:11
pg-tracing-forwarder example
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
@bonnefoa
bonnefoa / README.md
Last active May 31, 2023 06:22
Dump ethtool ioctl payloads

Small script to dump ethtool driver info and metrics as hexadecimal dump. Used to generate test for network integration (see https://github.com/DataDog/integrations-core/blob/master/network/tests/common.py#L77-L93)

python get_ethtool.py 'eth0'

("eth0", b'\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
@bonnefoa
bonnefoa / go.mod
Last active January 18, 2023 09:25
Example of pq array + valuer usage
module github.com/bonnefoa/test-sql
go 1.18
require github.com/lib/pq v1.10.7
@bonnefoa
bonnefoa / get_ethtool.py
Created October 4, 2022 07:28
Get ethtool
import socket
import fcntl
import array
import struct
import sys
from six import PY3
import pprint
SIOCETHTOOL = 0x8946
ETHTOOL_GSTRINGS = 0x0000001B
package com.izforge.izpack.core.container;
import com.izforge.izpack.api.container.BindeableContainer;
import com.izforge.izpack.api.container.DependenciesFillerContainer;
import org.picocontainer.Characteristics;
import org.picocontainer.MutablePicoContainer;
/**
* Abstract container
*/