Skip to content

Instantly share code, notes, and snippets.

View adiroiban's full-sized avatar
🇺🇦
Slava Ukraini!

Adi Roiban adiroiban

🇺🇦
Slava Ukraini!
View GitHub Profile
class FactoryWithProxyProtocolv2:
def buildProtocol(self, addr):
wrapped_protocol = super().buildProtocol(addr)
proxify_v2(wrapped_protocol)
<script setup lang="ts">
import {useData, withBase} from 'vitepress'
import Footer from './components/Footer.vue'
import Header from './components/Header.vue'
const { params, frontmatter } = useData()
</script>
<template>
<Header />
"""
Code for handling ZIP archives.
Inspired by pyzipper. MIT licence
"""
import struct
import zipfile
import zlib
import time
@adiroiban
adiroiban / list_shares.py
Last active September 25, 2025 09:02
List all shares on remote Windows server using smbprotocol
# Conversion of pysmb code to smbprotocol
# Original code at
# https://github.com/miketeo/pysmb/blob/76dc1708007fdcdd9d96a3703910938b84691704/python3/smb/base.py#L413-L548
#
import binascii
import uuid
import pprint
import struct
from smbprotocol.connection import Connection
@adiroiban
adiroiban / stdlib_ftp_client.py
Created May 25, 2024 09:40
Fork of Python stdlib ftp client that uses pyOpenSSL
"""
Standard library code adapted to support testing.
Fork of standard library code, started as a backport of Python ftplib from 2.7
to 2.5, and updated with some inspiration from Python 3.8.
https://github.com/python/cpython/blob/3.8/Lib/ftplib.py
This is a quick and dirty port.
pyOpenSSL is used instead of the standard ssl module.
@adiroiban
adiroiban / Dockerfile
Last active April 9, 2024 14:58
GitHub Actions ARC for Windows
# This is the docker file for building our GHA runner with servercore.
#
# Current size about 5.1GB
#
# We build this from Linux using Docker server on Windows.
# The final RUN is called by k8s.
FROM mcr.microsoft.com/windows/servercore:ltsc2022
LABEL maintainer="Chevah Project <[email protected]>"
LABEL name=arc-runner-windows
@adiroiban
adiroiban / Get-HNSNetwork
Last active November 7, 2023 00:37
Calico Windows VxLAN bare-metal
Get-HNSNetwork
ActivityId : B17F2C60-D0F2-4DB0-A289-3EDAC3BD9A40
AdditionalParams :
CurrentEndpointCount : 0
DNSServerCompartment : 3
DrMacAddress : 00-15-5D-EE-77-9E
Extensions : {@{Id=E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A; IsEnabled=False; Name=Microsoft Windows Filtering Platform},
@{Id=F74F241B-440F-4433-BB28-00F89EAD20D8; IsEnabled=True; Name=Microsoft Azure VFP Switch Extension},
@adiroiban
adiroiban / file.log
Created October 23, 2023 16:32
ARC constoller logs
$ kubectl logs -n arc-runners arc-gha-rs-controller-768bbf89f6-zwkdg
Error from server (NotFound): pods "arc-gha-rs-controller-768bbf89f6-zwkdg" not found
✘-1 ~/chevah/server [6279-arc-linux-arm64|✚ 2⚑ 6]
17:29 $ kubectl logs -n arc-systems arc-gha-rs-controller-768bbf89f6-zwkdg
2023-10-22T07:05:14Z INFO Update strategy set to: {"updateStrategy": "immediate"}
2023-10-22T07:05:14Z INFO AutoscalingListener image pull policy changed {"ImagePullPolicy": "IfNotPresent"}
2023-10-22T07:05:14Z INFO AutoscalingListener logging parameters changed {"LogLevel": "debug", "LogFormat": "text"}
2023-10-22T07:05:14Z INFO Registering scale set metrics
2023-10-22T07:05:14Z INFO starting manager
2023-10-22T07:05:14Z INFO Starting EventSource {"controller": "autoscalingrunnerset", "controllerGroup": "actions.github.com", "controllerKind": "AutoscalingRunnerSet", "source": "kind source: *v1alpha1.AutoscalingRunnerSet"}
@adiroiban
adiroiban / gha_try.yaml
Last active September 1, 2022 12:54
GitHub Actions poor man's replacement for the awesome Buildbot try tool.
#
# A workflow which is only available for manual trigger.
#
name: Try-Patch
on:
workflow_dispatch:
inputs:
tests:
description: Run selected tests
@adiroiban
adiroiban / list.txt
Created July 15, 2022 16:03
Legacy Twisted public lists
/var/lib/mailman/archives/public$ ls -1
divunal-author
divunal-author.mbox
divunal-devel
divunal-devel.mbox
divunal-list
divunal-list.mbox
divunal-players.mbox
inheritance
inheritance.mbox