This file contains hidden or 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
| # INSIDE WSL, install gdb (one-time instruction) | |
| sudo apt install gdb | |
| # Add the following to your kernel Makefile CFLAGS, so that gcc will generate | |
| # debug symbols that the debugger can use | |
| # Note: The thing being added is -g, so as of lesson 12 it should look like this. | |
| # Delete all the contents of the lib folder to force a recompile | |
| CFLAGS = -ffreestanding -fshort-wchar -g | |
| # Add the following to your qemu invocation and start QEmu: |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |