Skip to content

Instantly share code, notes, and snippets.

View titom73's full-sized avatar
:octocat:

Thomas Grimonet titom73

:octocat:
View GitHub Profile
@titom73
titom73 / dummy-stage02.py
Last active November 13, 2023 16:37
Anta Hackathon Solution
"""
Test functions related to system-level features and protocols
"""
## Please refer to https://github.com/titom73/atd-anta-demo/blob/main/docs/demo-tests.md for complete description
from typing import Optional
from anta.models import AntaTest, AntaCommand
@titom73
titom73 / input.yml
Last active August 2, 2023 14:24
Traceback PR 315
anta.tests.routing:
bgp:
- VerifyBGPIPv4UnicastCount:
vrfs:
default: des

Webhooks

Webhook for new device

{
    "alerts": [
        {
            "annotations": {
                "description": "New device DF502B50F29141129E775AF71A350E46 was detected with Zerotouch disabled",
#!/usr/bin/python
# coding: utf-8 -*-
import sys
import logging
import pprint
import random
from pydantic import BaseModel, ValidationError, validator
from anta import inventory
from anta.inventory import AntaInventory
@titom73
titom73 / bump-version.sh
Last active March 22, 2022 12:37
Bump SemVer
#! /bin/bash
# Author:
# Date: 2022-03-22
# Version: 0.1.0
# Info: Script to bump version based on SemVer syntax. DEV id is based on week number
# Example:
# # Assuming current version is v3.32.1.dev2
# # Bump MAJOR version
# $ bash .github/bump-dev-version.sh major
@titom73
titom73 / pytest.md
Created December 8, 2021 09:56 — forked from kwmiebach/pytest.md
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@titom73
titom73 / volume-backup.sh
Created October 20, 2021 18:53
Docker volume backup
#!/bin/bash
# This script allows you to backup a single volume from a container
# Data in given volume is saved in the current directory in a tar archive.
CONTAINER_NAME=$1
VOLUME_NAME=$2
usage() {
echo "Usage: $0 [container name] [volume name]"
exit 1
}
@titom73
titom73 / zshrc.zsh
Created October 2, 2021 18:38
zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@titom73
titom73 / expose-eapi.sh
Created September 17, 2021 11:40
iptables-for-private-lab
#!/bin/bash
echo "Jumphost Remote access configuration"
_EAPI_PORT=443
_SSH_PORT=22
_SRC_IF='ens3'
_DST_IF='ens4'
echo '* Activate kernel routing'
@titom73
titom73 / cv_v3_device_example.yml
Created May 3, 2021 10:14
Deploy Arista EOS with CV v3 modules
- name: Cloudvision v3 test playbook
hosts: cv_server
connection: local
gather_facts: false
collections:
- arista.avd
- arista.cvp
vars:
execute_tasks: true
CVP_DEVICES: