Skip to content

Instantly share code, notes, and snippets.

🐍
snek snek snek snek

Jamie Bliss astronouth7303

🐍
snek snek snek snek
Block or report user

Report or block astronouth7303

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@astronouth7303
astronouth7303 / proto.md
Created Feb 8, 2020
Untitled RPC Protocol
View proto.md

(Unnamed RPC Protocol)

  • Pulls a bunch of ideals from varlink
  • Encoded as two msgpack streams, one in each direction
  • The stream is broken up into channels, where there is a single call and potentially many responses.
  • Method names are forward-dotted paths (eg com.foobar.service.Method)
  • Parameters and returns are both maps; at the application level, methods only take keyword arguments and return named return values
  • Methods may return 0 or more returns or errors
@astronouth7303
astronouth7303 / server-build.py
Last active Jan 26, 2020
buildahscript proof of concept
View server-build.py
#!/usr/bin/env buildahscript
#| pip: requests
#| arg: eula: bool
#| arg: version: str = "latest"
#| arg: type: str = "vanilla"
with TemporaryDirectory() as td:
bin = td / 'bin'
bin.mkdir()
with workspace('rust:buster') as build:
@astronouth7303
astronouth7303 / test.py
Created Jan 8, 2020
Podman Varlink Networking Tests
View test.py
import contextlib
import json
import os.path
import subprocess
import tempfile
import time
from varlink import Client
IMG = "quay.io/libpod/alpine_nginx:latest"
View rcon-test.py
#!/usr/bin/python3
import enum
import dataclasses
import struct
import asyncio
import weakref
class InvalidPacket(Exception):
"""
@astronouth7303
astronouth7303 / README.md
Last active Aug 28, 2019
Importable GraphQL
View README.md

The basic idea: Define GraphQL queries as importable modules.

For example:

# queries.gql
#!starwars

query HeroForEpisode($ep: Episode!) {
  hero(episode: $ep) {
@astronouth7303
astronouth7303 / README.md
Last active Aug 5, 2019
How to make a chrome "app"
View README.md
@astronouth7303
astronouth7303 / 99-phonebackup.rules
Created Mar 16, 2019
Automatic Phone Backup (via udev and systemd)
View 99-phonebackup.rules
ACTION=="add", ENV{ID_SERIAL}=="*?", RUN+="/home/astraluma/udev-handler"
View sysfs.py
import collections.abc
import pathlib
__all__ = ('root',)
class AttrsView(collections.abc.KeysView):
def __init__(self, root):
self._root = pathlib.Path(root)
View fails1.py
import functools
from gi.repository import GObject
from gi.repository import Gio
from gi.repository import GLib
def runloop(func):
@functools.wraps(func)
def wrapped(*pargs, **kwargs):
func(None)
@astronouth7303
astronouth7303 / README.md
Last active Dec 10, 2018
Python Async+SSH
View README.md

Proof of Concept of using Python+Async to connect to a server over SSH.

Requires:

  • Python >= 3.6
  • msgpack
  • tornado<5

Run client.py, assumes you're running ssh-server on localhost and that you can log in to it.

You can’t perform that action at this time.