Keybase proof
I hereby claim:
- I am athoune on github.
- I am athoune (https://keybase.io/athoune) on keybase.
- I have a public key ASAJyjChoVZ45_odQgM9uacmNqeKRTFAQMhtV7UhoFSdkwo
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
import signal | |
import os | |
from flask import Flask, abort | |
from werkzeug.serving import run_simple | |
state = True |
#!/usr/bin/env python3 | |
from pathlib import Path | |
def containerd(): | |
for p in Path("/sys/fs/cgroup/memory/system.slice/containerd.service/").iterdir(): | |
if not p.is_dir(): | |
continue | |
print(p.name) | |
with (p / "memory.stat").open("r") as f: |
#!/usr/bin/env python3 | |
import pwd | |
import sys | |
import re | |
import subprocess | |
import tempfile | |
import os | |
import io | |
from collections import namedtuple |
package pubsub | |
import ( | |
"sync" | |
) | |
type Pubsub struct { | |
channels map[string]map[int]*Channel | |
cpt int | |
lock sync.Mutex |
from collections import defaultdict | |
from asyncio import gather | |
class Pubsub: | |
channels = defaultdict(list) | |
def add_handler(self, key: str, handler): | |
self.channels[key].append(handler) |
async def github_webhook(secret :str, request :web.Request) -> dict: | |
assert request.content_length < 1000000, "Request content too fat" # 1M | |
digest, signature = request.headers['X-HUB-SIGNATURE'].split("=", 1) | |
assert digest == "sha1", "Digest must be sha1" # use a whitelist | |
body = await request.content.read() | |
h = hmac.HMAC(bytes(secret, "UTF8"), msg=body, digestmod=digest) | |
assert h.hexdigest() == signature, "Bad signature" | |
return json.loads(body.decode('UTF8')) |
import logging | |
from jsonrpc.jsonrpc2 import JSONRPC20Request | |
def jsonrpcrequest(data): | |
logging.debug(data) | |
if isinstance(data, list): | |
for d in data: | |
yield JSONRPC20Request.from_data(d) |
local a={} | |
local queues=redis.call('smembers', 'resque:gitlab:queues') | |
for i,v in ipairs(queues) do | |
a[i*2-1] = 'queue:' .. v | |
a[i*2] = redis.call('llen', 'resqueue:gitlab:queue:' .. v) | |
end | |
return a |
package acme | |
import ( | |
"crypto/tls" | |
"encoding/base64" | |
"encoding/json" | |
"io/ioutil" | |
) | |
type Cert struct { |
I hereby claim:
To claim this, I am signing this object: