Skip to content

Instantly share code, notes, and snippets.

View stlehmann's full-sized avatar
:bowtie:

Stefan Lehmann stlehmann

:bowtie:
View GitHub Profile
@stlehmann
stlehmann / SimpleTcpRedirector.py
Created February 24, 2021 17:24 — forked from sivachandran/SimpleTcpRedirector.py
A simple TCP redirector in python
#!/usr/bin/env python
import socket
import threading
import select
import sys
terminateAll = False
class ClientThread(threading.Thread):
@stlehmann
stlehmann / install-docker-compose.sh
Created February 23, 2019 09:40
Installation script for docker-compose
#/bin/bash
curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
@stlehmann
stlehmann / install-docker.sh
Last active February 23, 2019 09:25
Installation script for docker on Debian
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
if apt-key finger | grep -q "0EBF CD88"; then
add-apt-repository \
@stlehmann
stlehmann / Microsoft.PowerShell_profile.ps1
Created November 30, 2018 12:38
My PowerShell Profile
new-item alias:venv -value venv/Scripts/Activate.ps1
new-item alias:l -value ls
function flaskd {flask run --debugger --reload}
Import-Module git-aliases -DisableNameChecking
Import-Module posh-git
Import-Module z
Clear-Host
@stlehmann
stlehmann / setup.cfg
Last active September 23, 2018 09:01
My setup.cfg template
[flake8]
max_line_length = 88
[mypy]
ignore_missing_imports = True
follow_imports = silent
disallow_untyped_calls = false
disallow_untyped_defs = true
[pydocstyle]
@stlehmann
stlehmann / lint.py
Last active September 23, 2018 08:55
Script for linting a Python project
"""
Script for linting the current project.
:author: Stefan Lehmann <[email protected]>
:license: MIT, see license file or https://opensource.org/licenses/MIT
:created on 2018-06-28 15:10:47
:last modified by: Stefan Lehmann
:last modified time: 2018-06-28 15:12:56
@stlehmann
stlehmann / .xonshrc
Last active July 12, 2021 20:37
My Xonsh config file for Windows
# Set aliases
aliases['l'] = ['dir']
aliases['ls'] = ['dir']
aliases['g'] = ['git']
aliases['glog'] = ['git', 'log', '--decorate', '--oneline', '--graph']
aliases['gst'] = ['git', 'status']
aliases['gc'] = ['git', 'commit']
aliases['ga'] = ['git', 'add']
aliases['gau'] = ['git', 'add', '-u']
aliases['gaa'] = ['git', 'add', '-A']
@stlehmann
stlehmann / pip_autoupgrade.bat
Created April 25, 2018 08:11
Autoupgrade script for pip
REM Powershell Script
pip list --outdated --format=freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}
@stlehmann
stlehmann / mypy.ini
Last active January 20, 2020 07:38
mypy.ini [strict]
[mypy]
ignore_missing_imports = True
follow_imports = silent
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_decorators = True
@stlehmann
stlehmann / lint.py
Last active April 30, 2018 08:51
Script for linting a Python project
import click
import subprocess
click.echo('\n--- Running Mypy ---')
res = subprocess.call(['mypy', '.'])
if res == 0:
click.echo(click.style('OK', fg='green'))
click.echo('\n--- Running Flake8 ---')