Skip to content

Instantly share code, notes, and snippets.

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

Paolo D. pdonorio

🔍
searching...
View GitHub Profile
FROM myapp:myversion
COPY docker-entrypoint.sh /usr/local/bin
ENTRYPOINT ['docker-entrypoint.sh']
@pdonorio
pdonorio / Dockerfile
Last active May 13, 2022 21:20
A template for best practices in writing a docker image
#######################
## BUILD BASE
# Small image
FROM alpine:3.5
# or
FROM ubuntu:16.04
# LTS
@pdonorio
pdonorio / Dockerfile
Last active January 4, 2018 03:42
Install and use iRODS iCAT server 4.2.0 with docker containers
FROM ubuntu:16.04
# LTS
MAINTAINER "Paolo D'Onorio De Meo"
# Preparation
RUN apt-get update -qq && apt-get install -y \
## normal base
wget git vim expect lsof sudo \
## fix adding irods to source list
@pdonorio
pdonorio / add_user.sh
Created March 5, 2017 08:46
Create a new password-less user for Docker containers and give him sudo powers with no password prompt
# Choose the user
MYUSER="guest"
# Check if it already exists
checkuser=$(getent passwd $MYUSER)
if [ "$checkuser" == "" ]; then
# add user
adduser --disabled-password --gecos 'user description' $MYUSER
# add to sudo
adduser $MYUSER sudo
# enable sudo with no password
@pdonorio
pdonorio / Dockerfile
Last active March 5, 2017 13:32
iRODS iCAT 4.2 server on Ubuntu 16.04 LTS with Docker
FROM ubuntu:16.04
# LTS
MAINTAINER "Paolo D'Onorio De Meo <p.donoriodemeo@cineca.it>"
# Preparation
RUN apt-get update -qq && apt-get install -y \
# normal base
wget git vim expect lsof sudo \
## fix adding irods to source list
@pdonorio
pdonorio / README.md
Last active July 22, 2019 00:53
[PoC] Subscriptions in a REST API environment

Proof of Concept with web Subscriptions

Based on a question on reddit about rethinkdb we decided to test socket.io.

The PoC is executed on a docker container environment. My current nodejs image is based on alpine and contains also the rethinkdb javascript driver and socket.io.

The directory you are in should contain the javascript files below. Important: app.js has to be inside a directory called js.

@pdonorio
pdonorio / Example.py
Last active September 27, 2016 15:22
Internally parse request parameters
from ..base import ExtendedApiResource
class MyTest(ExtendedApiResource):
@decorate.add_endpoint_parameter('test')
@decorate.apimethod
def get(self, id=None):
"""
This works for all methods: GET, POST, PUT, PATCH, DELETE
"""
@pdonorio
pdonorio / Additionals.md
Last active July 4, 2016 09:16
Asynchronous tasks

We may check celery tasks queued at any time. Let's see how.

Save the id

When you launch the task you get the AsyncResult back. To save the id you may:

res = my_async_task.delay(i)
@pdonorio
pdonorio / README.md
Last active November 6, 2015 09:22
Github repository automatic creation for a python project

A way to easily start the next python project with one command line command

Based on the following python libraries:

  • argparse for command line options
  • pyscaffold for first packaging setup
  • mkdocs instead of sphinx for documentation in markdown
  • requests for connecting to github api
  • plumbum to integrate command line executables inside python