Skip to content

Instantly share code, notes, and snippets.

@pommi
pommi / mendix-in-docker6
Created December 13, 2013 15:32
m2ee API limited set of actions
GET /about/ # about m2ee-api
GET /status/ # app status
GET /config/ # show configuration
POST /config/ # set configuration
POST /upload/ # upload a new MDA
POST /unpack/ # unpack the uploaded MDA
POST /start/ # start the app
POST /stop/ # stop the running app
POST /terminate/ # terminate the running app
POST /kill/ # kill the running app
@pommi
pommi / mendix-in-docker5.sh
Last active December 31, 2015 06:09
Let's show it
root@host:~#
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
mendix/mendix latest c39ee75463d6 10 seconds ago 589.6 MB
mendix/wheezy latest 1bee0c7b9ece 3 minutes ago 218.6 MB
root@host:~#
@pommi
pommi / mendix-in-docker4.sh
Last active December 31, 2015 06:09
To create the Mendix container run
docker build -t mendix/mendix .
@pommi
pommi / mendix-in-docker3.sh
Last active December 31, 2015 06:09
Let's show the image we've just created
root@host:~# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
mendix/wheezy latest 1bee0c7b9ece 6 seconds ago 218.6 MB
root@host:~#
@pommi
pommi / mendix-in-docker2.sh
Last active December 31, 2015 06:09
A Debian GNU/Linux Wheezy image
debootstrap wheezy wheezy http://cdn.debian.net/debian
tar -C wheezy -c . | docker import - mendix/wheezy
@pommi
pommi / mendix-in-docker1.sh
Last active December 31, 2015 06:09
Run a Mendix App in a Docker container in seconds
root@host:~# docker run -d mendix/mendix
root@host:~# curl -XPOST -F [email protected] http://172.17.0.5:5000/upload/
File uploaded.
root@host:~# curl -XPOST http://172.17.0.5:5000/unpack/
Runtime downloaded and Model unpacked.
root@host:~# curl -XPOST -d "DatabaseHost=172.17.0.4:5432" -d "DatabaseUserName=docker" -d "DatabasePassword=docker" -d "DatabaseName=docker" http://172.17.0.5:5000/config/
Config set.
root@host:~# curl -XPOST http://172.17.0.5:5000/start/
App started. (Database updated)
@pommi
pommi / rsnapshot_plug_rm_btrfs
Created August 31, 2012 19:19
a small shell script that can be used within rsnapshot as cmd_rm. It provides snapshots generated with btrfs instead of hard-links
#!/bin/sh
# Arg 1: -rf
# Arg 2: /testbtrfs/backups/hourly.4/
# echo 1: $1 2: $@
# Try to delete the given path with btrfs subvolume delete first
# Check if inode number == 256 (all subvolumes have inode number 256)
if [ "$1" = "-rf" -a "$3" = "" -a $(stat --printf='%i' $2) -eq 256 ]; then