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 | |
# NOTE: the following commands are rather simplistic and ignore the logic around deny-installation, which should also hypothetically affect these lists, but really taking that into account requires more logic than I'm willing to put into a jq command | |
echo ">>> GADGET SNAP SLOT INTERFACES <<<" | |
echo | |
# Get all slots that can be used on a gadget snap specifically | |
snap debug base-declaration | \ | |
head -n -1 | \ |
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 -e | |
INSTANCE="$1" | |
if [ -z "$INSTANCE" ]; then | |
echo "first argument must be the GCE instance" | |
exit 1 | |
fi | |
next=0 |
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 | |
############################################################################## | |
############################################################################## | |
# | |
# THIS IS DEPRECATED - PLEASE USE THE NEW HOME FOR THIS SCRIPT: | |
# https://github.com/snapcore/snapd/blob/master/debug-tools/snap-debug-info.sh | |
# | |
############################################################################## | |
############################################################################## |
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 -e | |
# TODO: programatically figure these out | |
PREV_VERSION=2.51.6 | |
NEW_VERSION=2.51.7 | |
MAJOR_VERSION=2.51 | |
IS_MINOR=1 | |
RELEASE_BRANCH=release/$MAJOR_VERSION |
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
# Get the object path for a service with the "easy name" | |
sudo busctl --verbose --system call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager GetUnit s snap.docker.dockerd.service | |
# get the ActiveState d-bus property of the Unit object | |
sudo busctl --verbose --system get-property org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/snap_2edocker_2edockerd_2eservice org.freedesktop.systemd1.Unit ActiveState | |
# get the OOMScoreAdjust d-bus property of the Service object | |
sudo busctl --verbose --system get-property org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/snap_2edocker_2edockerd_2eservice org.freedesktop.systemd1.Service OOMScoreAdjust |
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
// -*- Mode: Go; indent-tabs-mode: t -*- | |
/* | |
* Copyright (C) 2021 Canonical Ltd | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License version 3 as | |
* published by the Free Software Foundation. | |
* | |
* This program is distributed in the hope that it will be useful, |
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
// -*- Mode: Go; indent-tabs-mode: t -*- | |
/* | |
* Copyright (C) 2021 Canonical Ltd | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License version 3 as | |
* published by the Free Software Foundation. | |
* | |
* This program is distributed in the hope that it will be useful, |
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
// -*- Mode: Go; indent-tabs-mode: t -*- | |
/* | |
* Copyright (C) 2020 Canonical Ltd | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License version 3 as | |
* published by the Free Software Foundation. | |
* | |
* This program is distributed in the hope that it will be useful, |
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 -e | |
# first argument is the name of the key to sign the assertion with | |
if [ "$#" != 1 ]; then | |
echo "usage: ./sign-system-user-assertion <key-name>" | |
exit 1 | |
fi |
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
func hashMapAndBool(b bool, m map[string]string) string { | |
h := sha256.New() | |
// hashing maps is not deterministic because it is not sorted, so we have | |
// to manually hash each key value into another hash after sorting | |
// first we hash the string representation of the bool | |
h.Write([]byte(fmt.Sprintf("%v", b))) | |
keys := make([]string, len(m)) | |
i := 0 |
NewerOlder