Skip to content

Instantly share code, notes, and snippets.

View zyga's full-sized avatar
🏠
Working from home

Zygmunt Bazyli Krynicki zyga

🏠
Working from home
View GitHub Profile
@zyga
zyga / keybase.md
Created August 22, 2014 16:35
keybase.md

Keybase proof

I hereby claim:

  • I am zyga on github.
  • I am zyga (https://keybase.io/zyga) on keybase.
  • I have a public key whose fingerprint is B76C ED9B 45CA F155 7D27 1A6A 2894 E93A 28C6 7B47

To claim this, I am signing this object:

@zyga
zyga / dir-scanner
Created June 4, 2014 19:56
Directory scanner / hash collector
#!/usr/bin/env python3
#
# Copyright (c) Zygmunt Krynicki
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@zyga
zyga / pactl.py
Last active November 23, 2023 17:13
Parser for `pactl list` output
#!/usr/bin/env python3
# Copyright 2013 Canonical Ltd.
# Written by:
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"""
Parser for `pactl list` output
"""
from argparse import ArgumentParser
@zyga
zyga / display-port-audio-test-program.txt
Last active December 16, 2015 19:50
Display Port test program (plan)
# Display Port Audio Test Program
# -------------------------------
#
# Goal:
# To play sound through the attached monitor,
# connected using a display port cable,
# without using a passive adapter.
# Purpose:
# To aid in manual testing of audio for hardware certification
# Requirements:
@zyga
zyga / mcls2.py
Created April 10, 2013 13:16
python metaclass trickery, type() vs type.__new__()
#!/usr/bin/env python2
class Meta(type):
def __new__(mcls, name, bases, ns):
ns['_meta_for'] = name
return type.__new__(mcls, name, bases, ns)
class Base(object):
@zyga
zyga / testtrace.py
Created April 3, 2013 18:20
Experiment in tracing tests back to source they execute
#!/usr/bin/env python
from __future__ import absolute_import, print_function, unicode_literals
from collections import defaultdict, namedtuple
from gettext import gettext as _, ngettext
from unittest import TestCase
from unittest.loader import TestLoader
from unittest.result import TestResult
from unittest.suite import TestSuite
@zyga
zyga / vbox-iscsi.sh
Created April 1, 2013 14:28
Attach iSCSI disk to VirtualBox, works without auth
VBoxManage storageattach "Ubuntu Precise Server" --storagectl "SATA" --port 0 --device 0 --type hdd --medium iscsi --server 192.168.0.5 --target "iqn.2013-01.silverbox:precise-server" --tport 3260
@zyga
zyga / iomediator.py
Last active December 15, 2015 13:19
Toy example for producer/consumer pattern that may either talk bytes or strings
#!/usr/bin/env python3
# Producers
def text_producer() -> str:
yield "I write"
yield "some text"
yield "some of which zażółć gęślą jaźń is in Polish"
@zyga
zyga / vboxbug.c
Created March 7, 2013 18:33
Test program for reproducing vboxfs bug, see text for details
/*
Alleged vboxfs bug test program.
Copyright (c) 2013, Zygmunt Krynicki
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@zyga
zyga / shared.py
Last active December 14, 2015 07:39
def shared(**kwargs):
class Shared(object):
@classmethod
def get_shared_data(cls):
return kwargs
return Shared
BaseSharedStuff = shared(username="user", password="pass")