Skip to content

Instantly share code, notes, and snippets.

View zealws's full-sized avatar

Zeal Wierslee zealws

View GitHub Profile
@zealws
zealws / Makefile
Last active October 24, 2021 00:09
Calling a Go function from Python
libgreet.so: greet.go
go build -o libgreet.so -buildmode=c-shared greet.go
@zealws
zealws / client output (after the changes)
Last active September 30, 2020 20:25
Demonstration of Unix socket connector error before/after change to aiohttp
(venv) zeal@zealx1 ~ $ python client.py
Traceback (most recent call last):
File "/home/zeal/dev/aiohttp/venv/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-linux-x86_64.egg/aiohttp/connector.py", line 1113, in _create_connection
_, proto = await self._loop.create_unix_connection(
File "/usr/lib/python3.8/asyncio/unix_events.py", line 244, in create_unix_connection
await self.sock_connect(sock, path)
File "/usr/lib/python3.8/asyncio/selector_events.py", line 494, in sock_connect
return await fut
File "/usr/lib/python3.8/asyncio/selector_events.py", line 499, in _sock_connect
sock.connect(address)
# /etc/systemd/system/hello@.service
[Unit]
Description=say hello
OnFailure=hello2.service
[Service]
Type=oneshot
ExecStart=/bin/echo "%I"
ExecStart=/bin/echo "%i"
[2017-11-06T21:10:36-08:00] INFO: Processing service[systemd-networkd.socket] action enable (fb_systemd::networkd line 18)
[2017-11-06T21:10:36-08:00] DEBUG: Skipping service[systemd-networkd.socket] due to only_if ruby block
[2017-11-06T21:10:36-08:00] INFO: Processing service[systemd-networkd.socket] action start (fb_systemd::networkd line 18)
[2017-11-06T21:10:36-08:00] DEBUG: Skipping service[systemd-networkd.socket] due to only_if ruby block
[2017-11-06T21:10:36-08:00] INFO: Processing service[disable systemd-networkd.socket] action stop (fb_systemd::networkd line 24)
[2017-11-06T21:10:36-08:00] DEBUG: Skipping service[disable systemd-networkd.socket] due to not_if ruby block
[2017-11-06T21:10:36-08:00] INFO: Processing service[disable systemd-networkd.socket] action disable (fb_systemd::networkd line 24)
[2017-11-06T21:10:36-08:00] DEBUG: Skipping service[disable systemd-networkd.socket] due to not_if ruby block
[2017-11-06T21:10:36-08:00] INFO: Processing service[systemd-networkd.service] action enable
zeal@drcid ~ $ cat /etc/systemd/system/archon.service
[Unit]
Description=Container archon
ConditionPathExists=/var/lib/sandbox/archon
[Service]
ExecStart=/usr/bin/systemd-nspawn --boot \
--quiet \
--keep-unit \
--directory=/var/lib/sandbox/archon \
subprocess.CalledProcessError: Command '['systemd-nspawn', '--quiet', '--directory=/var/lib/sandbox/.mkosi-sbcfbsy1/root', '--uuid=240ad8bb1c2041ad9068fc7b3454924e', '--machine=mkosi-fea05e9b7e714bde8b25bac0df05d0a6', '--as-pid2', '--register=no', '--bind=/var/lib/sandbox/.mkosi-sbcfbsy1/var-tmp:/var/tmp', '--setenv=DEBIAN_FRONTEND=noninteractive', '--setenv=DEBCONF_NONINTERACTIVE_SEEN=true', '--', '/usr/bin/apt-get', '--assume-yes', '--no-install-recommends', 'install', 'dbus', 'libpam-systemd']' returned non-zero exit status 100.
Traceback (most recent call last):
File "/usr/lib/python3.6/weakref.py", line 624, in _exitfunc
f()
File "/usr/lib/python3.6/weakref.py", line 548, in __call__
return info.func(*info.args, **(info.kwargs or {}))
File "/usr/lib/python3.6/tempfile.py", line 797, in _cleanup
_shutil.rmtree(name)
File "/usr/lib/python3.6/shutil.py", line 480, in rmtree
_rmtree_safe_fd(fd, path, onerror)
Starting Chef Client, version 12.17.44
resolving cookbooks for run list: ["base::x11"]
Synchronizing Cookbooks:
- base (0.1.0)
- dropbox (0.1.0)
- pacman (1.1.1)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: base::x11
# cat /root/blah.timer
[Unit]
Description=Run scheduled task blah
After=network.target
[Timer]
OnCalendar=*:0/5:0
AccuracySec=1s
Persistent=false
RandomizedDelaySec=3600s
$ make test
/usr/local/lib/go/bin/go test -v github.com/facebook/augmented-traffic-control/src/daemon
/usr/local/lib/go/bin/go test -v github.com/facebook/augmented-traffic-control/src/api
Running shaping tests as root.
sudo PATH=/home/zeal/.rvm/gems/ruby-1.9.3-p551/bin:/home/zeal/.rvm/gems/ruby-1.9.3-p551@global/bin:/home/zeal/.rvm/rubies/ruby-1.9.3-p551/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/zeal/bin:/usr/local/lib/go/bin:/home/zeal/go/bin:/home/zeal/.rvm/bin GOROOT=/usr/local/lib/go GOPATH=/home/zeal/go /usr/local/lib/go/bin/go test -v github.com/facebook/augmented-traffic-control/src/shaping
=== RUN TestCreatesRootQdisc
2016/05/23 14:14:13 warning: Could not delete root qdisc (foo): no such file or directory
--- PASS: TestCreatesRootQdisc (0.01s)
shaping_linux_test.go:386: run_cmd "tc qdisc show dev foo"
qdisc h
2016/05/23 12:38:33 DB: Cleaned 1 empty groups