Skip to content

Instantly share code, notes, and snippets.

@feth
feth / get_groups_for_user.sh
Created May 20, 2019 12:41
get groups for samba user (in AD context)
#!/bin/bash
# bash 4 required
# get groups for samba user (in AD context)
set -eu
user=$1
mapfile -t allgroups < <( samba-tool group list )
for agroup in "${allgroups[@]}"
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import datetime
import socket
import sys
import serial, time, struct
import http.client, urllib.request, urllib.parse, urllib.error
import time
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import datetime
import sys
import serial, time, struct
import http.client, urllib.request, urllib.parse, urllib.error
ser = serial.Serial("/dev/ttyUSB0", baudrate=9600, stopbits=1, parity="N", timeout=2)
@feth
feth / Py3.py
Last active July 22, 2016 09:33
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import serial
import struct
import http.client
import urllib.request, urllib.parse, urllib.error
from pyramid.exceptions import HTTPBadRequest
from cornice.resource import Service
from biologie.views.forms import ROOTNODE
from biologie.views.forms import AppNode
activite_generale = AppNode(
name='Activité générale',
path='activite_generale/',
from __future__ import division
import collections
import logging
import linecache
import re
import sys
log = logging.getLogger(__name__)

Keybase proof

I hereby claim:

  • I am feth on github.
  • I am feth (https://keybase.io/feth) on keybase.
  • I have a public key whose fingerprint is 0969 CD89 B991 5E83 3459 4626 8CA5 6E09 A903 0823

To claim this, I am signing this object:

@feth
feth / log.py
Created October 14, 2015 05:27
wrapper for Python logging - limited but so easy!
"""
logging tools
logging is mainly configured in app.ini
Here lie only a few wrappers/tools, including those used by the app.ini config
"""
import inspect
import logging
@feth
feth / log.py
Created June 19, 2015 00:01
python logging wrapper
"""
logging tools
logging is mainly configured in app.ini
Here lie only a few wrappers/tools, including those used by the app.ini config
"""
import inspect
import logging