Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bboozzoo
bboozzoo / gist:3474167c47857ecdca36342d2c50939b
Created February 19, 2019 10:46
snap connections output
$ snap connections wire
Plug Slot Interface Notes
wire:gtk-3-themes gtk-common-themes:gtk-3-themes content -
wire:icon-themes gtk-common-themes:icon-themes content -
wire:sound-themes gtk-common-themes2:sound-themes content -
$ snap connections wire
#!/bin/bash
set -eu
export LC_ALL=C
LOOPS=40
COUNT="${COUNT-20}"
PREFIX=/tmp/mounttest
@bboozzoo
bboozzoo / corrupt.py
Last active May 15, 2018 05:09
Corrupt FAT directory entries
#!/usr/bin/env python3
# prepare image:
# dd if=/dev/zero of=img bs=1M count=1
# mkfs.vfat img
# echo 'foo=bar' > uboot.env
# mcopy -i img uboot.env ::uboot.env
# mcopy -i img uboot.env ::'uboot canary long name.env'
# ./corrupt.py img --corrupt 'uboot canary long name.env' --short=uboot.env --long=uboot.env --update-checksum
# /snap/core/current/sbin/fsck.vfat -av img
@bboozzoo
bboozzoo / gopkgsize
Last active April 16, 2018 15:04
tool for listing Golang package sizes
#!/bin/bash
set -e -o pipefail
tmpfile=$(mktemp -t gopkgsize.XXXXX)
sizesfile=$(mktemp -t gopktsize-output.XXXXX)
trap "rm -f $tmpfile" EXIT
go build -work -v -x "$@" 2>$tmpfile
@bboozzoo
bboozzoo / pipe.go
Last active December 18, 2017 15:13
pipe with go
package main
import (
"fmt"
"io"
"log"
"os"
"os/exec"
"strconv"
)
@bboozzoo
bboozzoo / order_test.go
Last active December 7, 2017 17:33
before/after ordering test
package main
import (
"errors"
"fmt"
"testing"
)
type App struct {
Name string
@bboozzoo
bboozzoo / run-qemu
Last active January 28, 2020 19:45
helper for running qemu
#!/bin/bash
if [ -n "$V" ]; then
set -x
fi
PORT_BASE=59401
make_port_number() {
echo $((PORT_BASE + RANDOM % 100))