Skip to content

Instantly share code, notes, and snippets.

View yomimono's full-sized avatar
https://ko-fi.com/yomimono

yomimono yomimono

https://ko-fi.com/yomimono
View GitHub Profile
I figured out some of the wiring for this script to clear out and add firewall rules. Change `ocamldev` to the dev VM you'll launch, and `fetchmotron` to the VM which is a client of the firewall under test if necessary (you should only need to do this in update-firewall).
In dom0:
make a file in /etc/qubes-rpc called yomimono.updateFirewall:
```
sudo bash
@yomimono
yomimono / 3.1.0-announce.txt
Created June 21, 2018 16:45
draft annoucement for mirageos 3.1.0
Hello all,
We are happy to announce the release of version 3.1.0 of MirageOS. Full release notes are available at https://github.com/mirage/mirage/releases/tag/3.1.0. Thanks to hannes for handling this release, and to mato for documentation updates!
3.1.0 is compatible with the recently-released version 0.3.0 of the solo5 execution environment. solo5 (and, in 3.1.0, therefore MirageOS) now includes experimental support for several new environments:
* the Muen Separation Kernel[1] (with `mirage configure -t muen`)
* FreeBSD vmm (with `mirage configure -t ukvm`)
* OpenBSD vmm (with `mirage configure -t ukvm`)
* ARM64 hosts[2] (with `mirage configure -t ukvm`)
user@whale:~/minim$ cat Dockerfile
FROM ocaml/opam:alpine-3.5_ocaml-4.04.0 as ocaml
FROM scratch
COPY --from=ocaml /bin/sh /
CMD ["/sh"]
user@whale:~/minim$ docker build -t minim .
Sending build context to Docker daemon 53.76kB
Step 1/4 : FROM ocaml/opam:alpine-3.5_ocaml-4.04.0 as ocaml
@yomimono
yomimono / mirageos-unikernels-miragesdk.md
Last active May 16, 2017 07:11
mirageos/unikernels update from docker internal systems summit, 20 april 2017

MirageOS/Unikernels (but secretly something else)

  • speaking now: @mindypreston (@yomimono on github)

Very Quick MirageOS Update

  • we released version 3.0 in February
  • tl;dr: supports KVM via the solo5 project
    • better errors
  • better logs
@yomimono
yomimono / gist:e6c90105ac8f3f80cecd01761dd644d9
Last active January 24, 2017 22:07
MirageOS 3 description of changes.
Less Code, Less Magic, More Results
## Major Changes
* The solo5 targets `ukvm` and `virtio` (see [https://mirage.io/blog/introducing-solo5]), which allow unikernels to run on KVM hypervisors and on FreeBSD via bhyve, are now available in the mainline `mirage` package. These targets use a newly refactored freestanding OCaml runtime (see [https://github.com/mirage/ocaml-freestanding]).
* The `V1` and `V1_LWT` modules, which contained module type definitions agreed upon by implementations used in `mirage`, have been renamed to `Mirage_types` and `Mirage_types_lwt`. The module type definitions themselves are no longer contained in this repository, but have been moved to their own independently-versioned repositories and are merely referenced from `Mirage_types` and `Mirage_types_lwt`.
* Across the universe of module type definitions, errors in computation are now signalled by a `result` type and a set of polymorphic variants representing common errors that might occur. Individual implementations may extend
@yomimono
yomimono / ec2-ebs-ami.sh
Last active June 21, 2016 12:21
Automate creation of an EC2-ready Mirage unikernel.
#!/bin/bash
#set -e
#set -x
fail() {
echo $1
[ -e ${EBS_DEVICE} ] && [ "$VOLUME_ID" != "" ] && [ $REGION != "" ] && {
ec2-detach-volume --region $REGION $VOLUME_ID
ec2-delete-volume --region $REGION $VOLUME_ID
@yomimono
yomimono / Makefile
Last active January 2, 2016 01:39
An implementation of the Sieve of Eratosthenes, which answers the the question "what is the nth prime?", as long as n is <= 10001.
CFLAGS = -g -Wall
all : problem_7
problem_7 : problem_7.c
$(CC) $(CFLAGS) -o $@ $< -lm
@yomimono
yomimono / coruscate.ino
Created December 14, 2013 07:28
An Arduino program which instructs independently-addressable wearable LEDs to change color at random while avoiding certain undesirable states, and to set their intensity in accordance with input from a light sensor.
#include <Wire.h>
#include <Adafruit_NeoPixel.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2561.h>
#define PIN 6
#define MINIMUM_LUX 20
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
@yomimono
yomimono / pcb_snippet.ml
Created June 25, 2015 14:30
snippet of pcb.ml
337 (* Compose the overall thread from the various tx/rx threads
338 and the main listener function *)
339 let tx_thread = (Tx.thread t pcb ~send_ack ~rx_ack) in
340 let rx_thread = (Rx.thread pcb ~rx_data) in
341 let wnd_thread = (Wnd.thread ~utx ~urx ~wnd ~state ~tx_wnd_update) in
342 let threads = [ tx_thread; rx_thread; wnd_thread ] in
343 let catch_and_cancel = function
344 | Lwt.Canceled -> ()
345 | ex ->
346 (* cancel the other threads *)
@yomimono
yomimono / client.ml
Created February 23, 2015 17:46
stackv4.create_connection fails with statically configured interface
open Lwt
open V1_LWT
module Main (C: V1_LWT.CONSOLE) (CLIENT_STACK: V1_LWT.STACKV4) = struct
let local_webserver="8.8.8.8"
let port = 5162
let start c client_stack =
let construct_request () =
let buf = Io_page.(to_cstruct (get 1)) in