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
# A tiny 16-bit guest "kernel" that infinitely prints an incremented number to the debug port | |
# | |
# Build it: | |
# | |
# as -32 guest.S -o guest.o | |
# ld -m elf_i386 --oformat binary -N -e _start -Ttext 0x10000 -o guest guest.o | |
# | |
.globl _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
#!/bin/bash | |
set -x | |
fsid="$1" | |
cephadm rm-cluster --fsid $fsid --force | |
source /etc/os-release | |
sudo systemctl stop tripleo_\* | |
sudo systemctl stop ceph\* | |
sudo pcs cluster destroy | |
if [ $VERSION_ID == "7" ]; then | |
sudo docker ps -a -q | xargs docker rm -f |
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
package main | |
import ( | |
"bytes" | |
"io" | |
"log" | |
"os" | |
"os/exec" | |
) |
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://ixday.github.io/post/golang-cancel-copy/ | |
import ( | |
"io" | |
"context" | |
) | |
// here is some syntaxic sugar inspired by the Tomas Senart's video, | |
// it allows me to inline the Reader interface | |
type readerFunc func(p []byte) (n int, err error) |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
) |
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
package main | |
import ( | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
"time" | |
"net" | |
"log" | |
"fmt" | |
"crypto/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
#!/usr/bin/python | |
""" Glance client to convert QCOW2 images in Glance to RAW """ | |
# from pprint import pprint | |
from os import environ as env | |
import collections | |
import subprocess | |
# import sys | |
from glanceclient.v2 import client as glclient |
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
package main | |
import ( | |
"exec" | |
"log" | |
"os" | |
"syscall" | |
"unsafe" | |
) |