This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This script is a companion to my FOSDEM 2024 presentation, | |
# "Lift and shift: Modernising a legacy LAMP application with systemd-nspawn". | |
# | |
# Author: Martin Lucina <martin@lucina.net> | |
# License: Public domain. | |
# | |
if [ "$(id -u)" -ne 0 ]; then | |
echo "ERROR: This needs to run as root." 1>&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copyright (c) 2015-2020 Contributors as noted in the AUTHORS file | |
# | |
# This file is part of Solo5, a sandboxed execution environment. | |
# | |
# Permission to use, copy, modify, and/or distribute this software | |
# for any purpose with or without fee is hereby granted, provided | |
# that the above copyright notice and this permission notice appear | |
# in all copies. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 0.758655] Run /init as init process | |
2019/11/05 14:49:25 Welcome to u-root! | |
_ | |
_ _ _ __ ___ ___ | |_ | |
| | | |____| '__/ _ \ / _ \| __| | |
| |_| |____| | | (_) | (_) | |_ | |
\__,_| |_| \___/ \___/ \__| | |
2019/11/05 14:49:25 Executing Command: /bbin/date | |
Tue Nov 5 14:49:25 GMT 2019 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PKG lwt mirage mirage-types mirage-types-lwt functoria-runtime tcpip yojson cstruct | |
S . | |
B _build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034] | |
[ 0.000000] Linux version 4.16.0-00004-g38ce33513343 (mato@nodbug) (gcc version 6.3.0 20170516 (Debian 6.3.0-18)) #2 SMP PREEMPT Thu Apr 5 11:34:46 CEST 201 | |
8 | |
[ 0.000000] Machine model: Olimex A64-Olinuxino | |
[ 0.000000] efi: Getting EFI parameters from FDT: | |
[ 0.000000] efi: UEFI not found. | |
[ 0.000000] cma: Reserved 16 MiB at 0x000000007f000000 | |
[ 0.000000] NUMA: No NUMA configuration found | |
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x000000007fffffff] | |
[ 0.000000] NUMA: NODE_DATA [mem 0x7efe2e80-0x7efe497f] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: https://www.olimex.com/wiki/images/1/1b/A64olinuxino_ubuntu_16.04.3_20171110.torrent | |
Extracted with: dd if=a64olinuxino_ubuntu_16.04.3_20171110.img of=boot0.bin bs=8k skip=1 count=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gmake depend | |
opam pin add --no-action --yes mirage-unikernel-https-virtio . | |
[NOTE] Package mirage-unikernel-https-virtio is already path-pinned to | |
/usr/home/mato/mirage3-skeleton/applications/static_website_tls. | |
This will erase any previous custom definition. | |
Proceed ? [Y/n] y | |
[mirage-unikernel-https-virtio] /usr/home/mato/mirage3-skeleton/applications/static_website_tls/ synchronized | |
[mirage-unikernel-https-virtio] Installing new package description from | |
/usr/home/mato/mirage3-skeleton/applications/static_website_tls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <err.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/time.h> | |
#include <sched.h> | |
#include <string.h> | |
int main(int argc, char *argv[]) | |
{ | |
time_t start; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rumprun-bake hw_virtio hello.bin hello args | |
[...] | |
$ cat > hello.json | |
{ | |
"rc": [ | |
{ "bin": "args", "argv": [ "first", "1", "2", "3", "4" ] }, | |
{ "bin": "args", "argv": [ "first again", "1", "2", "3", "4" ] }, | |
{ "bin": "hello", "argv": [ "hello" ] }, | |
{ "bin": "args", "argv": [ "and again", "1", "2", "3", "4" ] }, | |
{ "bin": "args", "argv": [ "again", "1", "2", "3", "4" ] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
running=$(docker ps -q | wc -l) | |
all=$(docker ps -a -q | wc -l) | |
images=$(docker images | awk '/^<none>/ { print $3 }' | wc -l) | |
echo "Found ${running} running containers." | |
echo "Found ${all} total containers." | |
echo "Found ${images} untagged images." | |
cat <<EOM | |
This will stop *all* Docker containers, delete them and then delete |
NewerOlder