Skip to content

Instantly share code, notes, and snippets.

View koi8-r's full-sized avatar
🐧

Valentin Nagornyy koi8-r

🐧
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@koi8-r
koi8-r / cloudSettings
Last active March 4, 2021 10:46
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-13T19:11:22.092Z","extensionVersion":"v3.4.3"}
const express = require('express')
const vm = require('vm')
let app = express()
app.use(function(req, res, next) {
req.body = ''
req.setEncoding('utf8');
  • collections.deque:
    • double linked list
    • bad with random insert
  • list:
    • bad with pop, push to top
  • apt install qemu-kvm qemu-system-x86 qemu-utils libvirt-daemon-system libvirt-clients virtinst virt-manager virt-viewer
    adduser koi8-r libvirt
    adduser koi8-r libvirt-qemu
    adduser koi8-r kvm
    adduser koi8-r qemu
    
    virt-install --virt-type kvm --name buster --memory 512 --location http://httpredir.debian.org/debian/dists/buster/main/installer-amd64/ --disk size=4 --os-variant debiantesting --extra-args "console=ttyS0"
# udevadm info --path=/class/net/wlxe894f61788fc --attribute-walk --query env
# udevadm control --reload-rules
# udevadm trigger
# udevadm monitor --subsystem=net
# udevadm test --action=add /class/net/wlxe894f61788fc
SUBSYSTEM=="net", SUBSYSTEMS=="usb", ACTION=="add", DRIVERS=="?*", ATTRS{product}=="*", ATTR{type}=="1", KERNEL=="wlan*", NAME="%k%n"
@koi8-r
koi8-r / cur.py
Last active October 10, 2019 23:07
from __future__ import annotations
import typing as ty
import abc
class ModelMeta(abc.ABCMeta):
def __new__(msc, name, bases, ns):
cls = super().__new__(msc, name, bases, ns)
try:
# We do not need something like To's id here
@koi8-r
koi8-r / eventsim.py
Created February 21, 2019 15:47 — forked from damonjw/LICENSE
Event driven simulator in Python, using async/await
import heapq
import asyncio
class EventSimulator(asyncio.AbstractEventLoop):
'''A simple event-driven simulator, using async/await'''
def __init__(self):
self._time = 0
self._running = False
self._immediate = []