Skip to content

Instantly share code, notes, and snippets.

View CristianCantoro's full-sized avatar
🎯
Focusing

Cristian Consonni CristianCantoro

🎯
Focusing
View GitHub Profile
@MartinBrugnara
MartinBrugnara / NFS 4 uses wrong clientaddr
Created March 27, 2021 18:00
NFS 4 uses wrong clientaddr
TL;DR; Force the use nfs4.0 (the issue arises with nfs > 4.1).
# Situation:
* NFS server with multiple IP. E.g. different subnets for different access levels and or bandwidth/MTU.
IPs
192.168.10.1
192.168.20.1
Exports:
/srv/nfs/lvl10 192.168.10.0/255.255.255.0
@beala
beala / argy.py
Created August 11, 2012 15:48
A command line argument parser using generators and co-routines.
"""
Inspired by:
http://eli.thegreenplace.net/2009/08/29/co-routines-as-an-alternative-to-state-machines/
"""
def parse_args(target):
"""A generator that parses a stream of arguments one character at a time.
As soon as a flag, or flag value pair ("-a" or "-a value") is processed
the pair is sent off as a tuple to the 'target' generator.