Skip to content

Instantly share code, notes, and snippets.

View thomascenni's full-sized avatar

Thomas Cenni thomascenni

View GitHub Profile
# yaml-language-server: $schema=https://raw.githubusercontent.com/kjellberg/mrsk/validate-with-json-schema/lib/mrsk/configuration/schema.yaml
# Name of your application. Used to uniquely configure containers.
service: my-app
# Name of the container image.
image: my-app
# Deploy to these servers.
servers:
services:
- type: web
name: umami
env: docker
repo: https://github.com/thomascenni/umami.git
region: oregon # optional (defaults to oregon)
plan: free
branch: main
numInstances: 1
envVars:
{
"Statement": [{
"Action": ["s3:GetBucketLocation", "s3:ListBucket"],
"Effect": "Allow",
"Principal": {
"AWS": ["*"]
},
"Resource": ["arn:aws:s3:::job-offers"]
}, {
"Action": ["s3:GetObject"],
@thomascenni
thomascenni / invoiceninja5.yml
Last active November 4, 2021 13:04
InvoiceNinja one-click app for Caprover (work in progress)
captainVersion: 4
services:
$$cap_appname-db:
image: mysql:5.7.32
restart: always
environment:
MYSQL_ROOT_PASSWORD: $$cap_db_root_password
MYSQL_DATABASE: ninja
MYSQL_USER: invoiceninja
captainVersion: 4
services:
$$cap_appname-mail:
image: bytemark/smtp
restart: always
environment:
RELAY_HOST: $$cap_RELAY_HOST
RELAY_PORT: $$cap_RELAY_PORT
RELAY_USERNAME: $$cap_RELAY_USERNAME
@thomascenni
thomascenni / composer.json
Created October 13, 2020 00:49
mPDF Example
{
"require": {
"mpdf/mpdf": "^8.0"
}
}
#!/bin/bash
php -v
curl -LO https://cecil.app/cecil.phar
chmod +x cecil.phar
./cecil.phar -V
./cecil.phar new:site mywebsite
cd mywebsite
# add a blog page
../cecil.phar new:page blog/my-first-post.md
@thomascenni
thomascenni / dfToexcel.py
Last active April 17, 2023 01:16
Return Excel file from Pandas Dataframe in Django
import pandas as pd
from io import BytesIO
from django.http import HttpResponse
# suppose to have a Dataframe object
# inside a Django view
df = pd.DataFrame(...)
with BytesIO() as b:
# Use the StringIO object as the filehandle.
{
"captainVersion": "2",
"documentation": "Taken from https://github.com/thomascenni/djcap",
"displayName": "DjCap",
"description": "Deploy a Django application with Caprover PaaS.",
"dockerCompose": {
"version": "2",
"services": {
"$$cap_appname": {
"image": "alpine:3.8",
#! /usr/bin/env bash
# Run collect static and migrations
python manage.py collectstatic --noinput
python manage.py migrate