Skip to content

Instantly share code, notes, and snippets.

View RonnyPfannschmidt's full-sized avatar
🦖
catching up with backlog

Ronny Pfannschmidt RonnyPfannschmidt

🦖
catching up with backlog
View GitHub Profile
import attr
import importlib
from operator import attrgetter
@attr.s
class DefferedImport(object):
module = attr.ib()
attribute = attr.ib(default=None)
def __get__(self, instance, owner):
#!/run/current-system/sw/bin/env nix-shell
#! nix-shell -f script_env.nix -i python3 -p python3
import click
@click.command()
def test():
print("hi")
[root@ronny-work-nix:~]# nix-channel --update
downloading Nix expressions from ‘https://d3g5gsiof5omrk.cloudfront.net/nixpkgs/nixpkgs-17.03pre96825.497e6d2/nixexprs.tar.xz’...
downloading ‘https://d3g5gsiof5omrk.cloudfront.net/nixpkgs/nixpkgs-17.03pre96825.497e6d2/nixexprs.tar.xz’... [5619/7892 KiB, 5616.7 KiB/s]
unpacking channels...
[root@ronny-work-nix:~]# nixos-rebuild switch
warning: Nix search path entry ‘/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs’ does not exist, ignoring
error: file ‘nixpkgs/nixos’ was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:13
building Nix...
warning: Nix search path entry ‘/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs’ does not exist, ignoring
{pkgs ? (import <nixpkgs> {})}:
let
src = pkgs.fetchFromGitHub {
owner = "borgbackup";
repo = "borg";
rev = "7e5ed40e2fe49ebf75ba6594e5247e763a2f9e68";
sha256 = null;
};
borg = pkgs.stdenv.lib.overrideDerivation pkgs.borgbackup (old: {
@RonnyPfannschmidt
RonnyPfannschmidt / rebuild.log
Created November 23, 2016 08:16
current failure on my nix on rebuild
$ nixos-rebuild build
building Nix...
building the system configuration...
these derivations will be built:
/nix/store/3xl8l4vddvfqx0gyd9z3fgm0jr2by04a-system-path.drv
/nix/store/mpqrssb0kp9w7gw7ba9sp5w4a4ghbdx5-dbus-conf.drv
/nix/store/6ksh6khm1zhbaaajrnz19xn0r7vkf8yr-unit-dbus.service.drv
/nix/store/ik8s9nl1yp0kqmjyq7ln2sn0886wpqk0-xsession.drv
/nix/store/6nq41xm72h8vyyh1a9f4hmqcya54zifz-desktops.drv
/nix/store/mrq5406caknwwkdd6cvhlm7wg6g9dsbh-hwdb.bin.drv
import contextlib
@contextlib.contextmanager
def raises_kind(exc_type, kind):
with pytest.raises(exc_type) as e:
yield
assert e.value.kind == kind
351 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/350
349 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/347
348 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/346
347 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/345
346 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/344
345 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/343
344 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/342
343 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/341
341 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/339
340 - Bitbucket: https://bitbucket.org/hpk42/tox/issue/338
@RonnyPfannschmidt
RonnyPfannschmidt / logging setup snippets.py
Last active September 6, 2016 09:53
examples to show the issues detected
class WarningsRelpathFilter(logging.Filter):
"""filter to modify warnings messages, to use relative paths in the project"""
def filter(self, record):
if record.args:
new_record = record.args[0].replace(project_path.strpath, '.')
record.args = (new_record,) + record.args[1:]
return True
@RonnyPfannschmidt
RonnyPfannschmidt / out.txt
Created September 1, 2016 06:15
borg check output
$ borg check -v --debug borg
using builtin fallback logging configuration
29 self tests completed in 0.12 seconds
Starting repository check
Index object count mismatch. 3379815 != 3379816
Completed repository check, errors found.
# written in browser#
class ChangeProxy(object):
def __init__(self, observed, tracker):
self.__observed = observed
self.__tracker = tracker
def __getattr__(self, key):
if key in self.__tracker:
return self.__tracker[key]