Skip to content

Instantly share code, notes, and snippets.

@bttb123
bttb123 / tcp.py
Created August 25, 2021 09:50 — forked from kytta/tcp.py
TCP packet built from scratch in Python 3
# tcp.py -- example of building and sending a raw TCP packet
# Copyright (C) 2020 Nikita Karamov <[email protected]>
#
# With code from Scapy (changes documented below)
# Copyright (C) 2019 Philippe Biondi <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@bttb123
bttb123 / async.py
Created June 29, 2021 14:34 — forked from phizaz/async.py
Python turn sync functions to async (and async to sync)
import functools
def force_async(fn):
'''
turns a sync function to async function using threads
'''
from concurrent.futures import ThreadPoolExecutor
import asyncio
pool = ThreadPoolExecutor()
@bttb123
bttb123 / aproducer.py
Created June 6, 2021 05:24 — forked from dabeaz/aproducer.py
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:
@bttb123
bttb123 / giltab-runner-local-docker.md
Created November 25, 2020 02:53 — forked from mrVanboy/giltab-runner-local-docker.md
Debugging Gitlab CI without installing gitlab-runner

Debugging Gitlab CI jobs locally

You can find a bunch of articles about debugging Gitlab CI jobs locally. My top results from google:

But in all that articles the described way is to install Docker and gitlab-runner executable, run gitlab-runner exec docker JOB_NAME_FROM_GITLAB_CI_YML after that in your repo.

I don't like this approach because I want a simpler way to run appropriate gitlab-runner executable and don't