Skip to content

Instantly share code, notes, and snippets.

@pommi
pommi / get-accounts-recursive.sh
Created October 12, 2022 09:38 — forked from atheiman/get-accounts-recursive.sh
Get all accounts within an AWS Organizations organizational unit recursively (all accounts nested under any child OUs)
#!/bin/bash
if [ -z "$1" ]; then
echo "Error - Usage: $0 <parent-id>"
exit 1
fi
set -eu
# set -x
@pommi
pommi / download-top2000-2018.sh
Last active December 26, 2021 20:01
Download the NPO Radio 2 Top 2000 2018
#!/bin/sh
for i in $(seq 25 31); do
curl -s https://www.nporadio2.nl/uitzendinggemist?date=$i-12-2018 | grep '/gemist/uitzending' | cut -d'"' -f 2 | xargs -i echo "https://www.nporadio2.nl{}" | tac >> pages
done
for p in $(cat pages); do
curl -s $p | grep broadcaststream | cut -d '"' -f 2 | xargs -i echo "https:{}" >> mp3
done
# remove the 1st 4 items (00:00-02:00, 02:00-04:00, 04:00-06:00, 06:00-08:00)

Keybase proof

I hereby claim:

  • I am pommi on github.
  • I am pommib (https://keybase.io/pommib) on keybase.
  • I have a public key whose fingerprint is 84FE 4880 08DA C5FC B8CA 459B 20C2 D39D 50A8 EDDA

To claim this, I am signing this object:

@pommi
pommi / trac2down.py
Last active October 9, 2019 00:55 — forked from sgk/trac2down.py
Trac Wiki to Markdown converter
#!/usr/bin/python
# vim:set fileencoding=utf-8 sw=2 ai:
# downloaded from https://gist.github.com/tcchau/4628317
# ... which is a fork from https://gist.github.com/sgk/1286682
import sqlite3
import datetime
import re
# additional imports --ah
@pommi
pommi / mendix-in-docker12.sh
Created December 13, 2013 15:40
Check if the application is running
root@host:~# curl -XGET http://172.17.0.5:7000/
-- a lot of html --
root@host:~# curl -XGET http://172.17.0.5:7000/xas/
-- a lot of html --
root@host:~#
@pommi
pommi / mendix-in-docker11.sh
Last active December 31, 2015 06:09
Upload, unpack and start an MDA
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:~# # set config after unpack (unpack will overwrite your config)
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 / mendix-in-docker10.sh
Created December 13, 2013 15:39
Now configure Mendix to use this database server.
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 -XGET http://172.17.0.5:5000/config/
{
"DatabaseHost": "172.17.0.4:5432",
"DTAPMode": "P",
"MicroflowConstants": {},
"BasePath": "/home/mendix",
"DatabaseUserName": "docker",
"DatabasePassword": "docker",
@pommi
pommi / mendix-in-docker9.sh
Created December 13, 2013 15:38
Pull a PostgreSQL container from the Docker Index and start it
root@host:~# docker pull zaiste/postgresql
Pulling repository zaiste/postgresql
0e66fd3d6a6f: Download complete
27cf78414709: Download complete
...
046559147c70: Download complete
root@host:~# docker run -d zaiste/postgresql
9ba56a7c4bb132ef0080795294a077adca46eaca5738b192d2ead90c16ac2df2
root@host:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
@pommi
pommi / mendix-in-docker8.sh
Created December 13, 2013 15:35
m2ee-api: ask for it's status or show it's configuration
root@host:~# curl -XGET http://172.17.0.5:5000/status/
The application process is not running.
root@host:~# curl -XGET http://172.17.0.5:5000/config/
{
"DatabaseHost": "127.0.0.1:5432",
"DTAPMode": "P",
"MicroflowConstants": {},
"BasePath": "/home/mendix",
"DatabaseUserName": "mendix",
"DatabasePassword": "mendix",
@pommi
pommi / mendix-in-docker7.sh
Last active December 31, 2015 06:09
Pull the container and start it
root@host:~# docker pull mendix/mendix
Pulling repository mendix/mendix
c39ee75463d6: Download complete
eaea3e9499e8: Download complete
...
855acec628ec: Download complete
root@host:~# docker run -d mendix/mendix
bd7964940dfc61449da79cddd1c0e8845d61f6ec1092b466e8e2e582726a5eea
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bd7964940dfc mendix/mendix:latest /bin/su mendix -c /u 19 seconds ago Up 18 seconds 5000/tcp, 7000/tcp tender_hawkings