Skip to content

Instantly share code, notes, and snippets.

View cathay4t's full-sized avatar

Gris Ge cathay4t

View GitHub Profile
From a6a46107644eafc99abda0ca32fce4493370bbd8 Mon Sep 17 00:00:00 2001
From: Gris Ge <[email protected]>
Date: Tue, 19 May 2020 15:27:20 +0800
Subject: [PATCH] Fix compiling failure regarding ctags
Using patch from https://github.com/varlink/libvarlink/pull/23
Signed-off-by: Gris Ge <[email protected]>
---
PKGBUILD | 7 +++++--
---
routes:
config:
- destination: 192.168.2.0/24
metric: 108
next-hop-address: 192.168.1.3
next-hop-interface: eth1
table-id: 200
- destination: 2001:db8:a::/64
metric: 108
From 5df03769da166222b2abf9ac239df1eca0c4e2d1 Mon Sep 17 00:00:00 2001
From: Gris Ge <[email protected]>
Date: Tue, 3 Mar 2020 13:26:12 +0800
Subject: [PATCH] nm bridge: Merge port options
The `state.dict_update` only do full copy on list items.
When bridge editing its slave list, slave port options also need to be
copied from current state.
Added `appliers.linux_bridge.merge_linux_bridge_ports()` to handle this
#!/usr/bin/python3
from libnmstate.schema import LinuxBridge as LB
def create_setting(iface_state, base_con_profile):
bridge_setting = _get_current_bridge_setting(base_con_profile)
if not bridge_setting:
bridge_setting = nmclient.NM.SettingBridge.new()
bridge_setting.props.vlan_filtering = _have_port_vlan(iface_state)
#!/usr/bin/python3
import sys
import toml
import pyotp
from pathlib import Path
CONF_PATH = f"{Path.home()}/.config/token.conf"
KEY = "key"
#!/bin/bash
PYTEST='pytest-3'
SUDO='sudo'
if [ $HOSTNAME == 'Gris-Laptop' ];then
SUDO=''
fi
which $PYTEST 1>/dev/null 2>/dev/null
if [ $? -ne 0 ];then
---
interfaces:
- name: br0
mtu: 3000
---
interfaces:
- name: eth1
type: ethernet
state: up
- name: br0
type: linux-bridge
state: up
bridge:
port:
#!/usr/bin/python3
from distutils.version import StrictVersion
import logging
logging.basicConfig(level="DEBUG")
import gi
gi.require_version("NM", "1.0")