Skip to content

Instantly share code, notes, and snippets.

View Icebreaker454's full-sized avatar

Paul Pukach Icebreaker454

  • Ferret Go
  • Lviv, Ukraine
View GitHub Profile
@Icebreaker454
Icebreaker454 / test_smtpd.py
Created October 20, 2021 09:32
Setting up a fake SMTPD server for pytest with pytest-asyncio, aiosmtpd and aiosmtplib
from collections import namedtuple
from functools import partial
import pytest
from aiosmtpd.handlers import Debugging as SMTPDDebuggingHandler
from aiosmtpd.smtp import SMTP as SMTPD
from aiosmtplib import SMTP
RecordedMessage = namedtuple(
"RecordedMessage",
@Icebreaker454
Icebreaker454 / main.py
Last active January 15, 2021 08:21
Bokeh visualization of COVID-19 cases in Ukraine by region, 2020
""" A Bokeh visualization of COVID-19 cases per Ukraine region, 2020 """
import json
import pandas as pd
import geopandas as gpd
from bokeh.io import output_notebook, show, output_file, curdoc
from bokeh.plotting import figure
from bokeh.models import GeoJSONDataSource, LinearColorMapper, ColorBar
@Icebreaker454
Icebreaker454 / main.py
Last active January 12, 2021 12:10
SQLAlchemy 1.4 test script
import asyncio
import sqlalchemy as sa
from sqlalchemy import select
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
postgresql_url = "postgresql+asyncpg://localhost:5432/test_sqlalchemy_db"
engine = create_async_engine(postgresql_url, echo=True)

Keybase proof

I hereby claim:

  • I am Icebreaker454 on github.
  • I am icebreaker454 (https://keybase.io/icebreaker454) on keybase.
  • I have a public key whose fingerprint is 4A38 5369 4E42 F4F7 C3B1 021C D4A6 DA72 5B2D 6767

To claim this, I am signing this object:

Basics

  • $LOCAL_HOST: 'localhost' or hostname from local network
  • $LOCAL_PORT: open port on local machine
  • $REMOTE_HOST: remote hostname visible from remote network
  • $REMOTE_PORT: port on $REMOTE_HOST

Forward Tunnel: map port from remote machine/network on local machine

ssh -L $LOCAL_PORT:$REMOTE_HOST:$REMOTE_PORT $USER@$SERVER

Reverse Tunnel: make local port accessable to remote machine