Skip to content

Instantly share code, notes, and snippets.

View Mchristos's full-sized avatar

chris Mchristos

  • Cape Town, South Africa
View GitHub Profile
@Mchristos
Mchristos / Dockerfile
Created October 12, 2023 08:47
Dockerfile for poetry projects
# 1. Build stage: install dependencies with Poetry into a venv
FROM python:3.11 AS builder
WORKDIR /app
RUN pip install poetry~="1.6.1"
COPY pyproject.toml ./pyproject.toml
COPY poetry.lock ./poetry.lock
RUN python -m venv /venv
RUN . /venv/bin/activate && poetry install --no-dev --no-root --verbose
# 2. App stage: create final image with code, venv etc
@Mchristos
Mchristos / docker-cheatsheet.md
Last active July 27, 2020 16:51
Useful Docker commands

RUNNING CONTAINERS

Show containers (optionally include non-running)

    docker ps (-a)

Create container

    docker create <image-name> <startup-command>
@Mchristos
Mchristos / .vimrc
Last active May 29, 2020 09:29
My vim setup on Ubuntu
" VIM PLUG (https://github.com/junegunn/vim-plug)
call plug#begin('~/.vim/plugged')
" Install easy-align from: https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
" Install vim-jsx-pretty from github
Plug 'maxmellon/vim-jsx-pretty'
" Install Prettier
Plug 'prettier/vim-prettier', {
\ 'do': 'npm install',
\ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] }
@Mchristos
Mchristos / CheatSheet.md
Last active February 21, 2020 15:28
Cheat Sheet of All Things

TMUX

    tmux attach -t <session>
    tmux kill-session -t <session>

SSH

    # generate new ssh key
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

connect to remote port from local port

@Mchristos
Mchristos / connect_to_jupyter.md
Last active February 21, 2020 15:27
Connect to jupyter Notebook on remote server via SSH
  1. Connect to remote and install Jupyter on remote

     ssh <user_name>@<remote_name>
     pip3 install jupyter --user
    
  2. Run Jupyter notebook on remote

     jupyter notebook --no-browser --port=8889
    
  3. On local, do

ssh -N -f -L localhost:8888:localhost:8889 @

@Mchristos
Mchristos / Snappy.nuspec
Last active February 7, 2017 12:16
How to make a nuget package
<?xml version="1.0"?>
<package >
<metadata>
<id>Snappy</id>
<version>0.1.0</version>
<title>Snappy</title>
<authors>ChrisM</authors>
<owners>ChrisM</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Snappy is library which snaps co-ordinates to OSM roads. </description>