Skip to content

Instantly share code, notes, and snippets.

View pdonorio's full-sized avatar
🔍
searching...

Paolo D. pdonorio

🔍
searching...
View GitHub Profile
@pdonorio
pdonorio / README.md
Last active June 12, 2018 05:47
The power of docker compose

How easy is to quick test and prototype

Nowadays docker compose is getting life so much easy for developers.

Let's say I want to quickly test some python code on elasticsearch... I just need to have a compose file like the one below, and then from the same directory:

docker-compose up -d
@pdonorio
pdonorio / Dockerfile
Last active June 25, 2022 19:20
Dockerfile best practices
###################
# 1. start with a small image (e.g. alpine OS)
FROM alpine:3.7
# or with the 'alpine' version of the official build
# FROM nginx:1.13.9-alpine
# 2. fix a tag to image version
###################
# 3. Provide info about who you are
@pdonorio
pdonorio / README.md
Created November 3, 2017 10:57
B2SAFE implemented for EPOS

EPOS b2safe

Download the repo

git clone https://github.com/EUDAT-B2STAGE/http-api.git myb2safe
cd myb2safe && git checkout b2safe_development

STEP 1: prepare sql

  • change passwords IRODS_PASSWORD and ALCHEMY_PASSWORD in projects/b2safe/project_configuration.yaml
@pdonorio
pdonorio / README.md
Created October 31, 2017 09:31
B2SAFE-B2ACCESS certificates issue

B2SAFE <-> B2ACCESS certificates issue

Reproducing the issue with the dockerized environment of the HTTP-API, using the 'debug' mode.

A simple guide step-by-step.

@pdonorio
pdonorio / README.md
Created August 7, 2017 14:59
Pickable iRODS session

Since iRODS uses thread locks I tried overriding the original session class to make it possible.

Test it with:

import pickle
import base64

original_session = iRODSPickleSession(...)
@pdonorio
pdonorio / README.md
Last active July 19, 2017 06:24
python process lock

Simple and lightweight python process LOCK

Use a lock across python processes or threads.

Based on sqlite/sqlalchemy implementation. Tested on python 3.4+.

To see how it works launch process.py multiple times.

@pdonorio
pdonorio / Dockerfile
Created July 18, 2017 08:00
Add a kernel to a jupyter (dockerized) notebook based on Anaconda
FROM jupyter/datascience-notebook # <-- use a jupyter image here
MAINTAINER "Paolo D'Onorio De Meo <p.donoriodemeo@gmail.com>"
# Python 3.6 virtualenv
ENV PY36 Python3.6
RUN conda create -y -n $PY36 python=3.6.1 \
&& conda clean -y --all
RUN /bin/bash -c "source activate $PY36 && pip install mypy ipython ipykernel version_information"
@pdonorio
pdonorio / Dockerfile
Created July 10, 2017 13:51
dockerized python app
FROM alpine:3.6
RUN apk update && apk add \
gcc \
# there is a 'limit.h' missing in alpine when compiling psycopg2:
# https://stackoverflow.com/a/30873179
# linux-headers \
musl-dev \
# other dev packages necessary are:
@pdonorio
pdonorio / myinterpreter.py
Created May 16, 2017 08:26
A simple base for stupid interpreter in Python 3
# -*- coding: utf-8 -*-
def main():
"""
A python interpreter
https://ruslanspivak.com/lsbasi-part1/
"""
while True:
try:
@pdonorio
pdonorio / README.md
Created April 9, 2017 00:06
A minimal setup for Flask with latest Injector working

This works for now only if configure is enabled