From 60b05c878127644d84446174d6169b680a794092 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Fri, 11 Jan 2019 17:18:02 -0500 Subject: [PATCH] Created a `snap` cheatsheet --- cheat/cheatsheets/snap | 98 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 cheat/cheatsheets/snap diff --git a/cheat/cheatsheets/snap b/cheat/cheatsheets/snap new file mode 100644 index 0000000..3d0429a --- /dev/null +++ b/cheat/cheatsheets/snap @@ -0,0 +1,98 @@ +# To find the `foo` snap: +snap find foo + +# To view detailed information about snap `foo`: +snap info foo + +# To view all private snaps (must be logged in): +snap find --private + +# To install the `foo` snap: +sudo snap install foo + +# To install the `foo` snap from the "beta" channel: +sudo snap install foo --channel=beta + +# To view installed snaps: +snap list + +# To list all revisions of installed snaps: +snap list --all + +# To (manually) update all snaps: +sudo snap refresh + +# To (manually) update the `foo` snap: +sudo snap refresh foo + +# To update the `foo` snap to the "beta" channel: +sudo snap refresh foo --channel=beta + +# To revert the `foo` snap to a prior version: +sudo snap revert foo + +# To revert the `foo` snap to revision 5: +snap revert foo --revision 5 + +# To remove the `foo` snap: +sudo snap remove foo + +# To log in to snap (must first create account online): +sudo snap login + +# To log out of snap: +snap logout + +# To view a transaction log summary: +snap changes + +# To view details of item 123 in the transaction log: +snap change 123 + +# To watch transaction 123: +snap watch 123 + +# To abort transaction 123: +snap abort 123 + +# To download the `foo` snap (and its assertions) *without* installing it: +snap download foo + +# To install the locally-downloaded `foo` snap with assertions: +snap ack foo.assert +snap install foo.snap + +# To install the locally-downloaded `foo` snap without assertions: +# NB: this is dangerous, because the integrity of the snap will not be +# verified. You should only do this to test a snap that you are currently +# developing. +snap install --dangerous foo.snap + +# To install snap `foo` in "dev mode": +# NB: this is dangerous, and bypasses the snap sandboxing mechanisms +snap install --devmode foo + +# To install snap `foo` in "classic mode": +# NB: this is likewise dangerous +snap install --classic foo + +# To view available snap interfaces: +snap interfaces + +# To connect the `foo:camera` plug to the ubuntu core slot: +snap connect foo:camera :camera + +# To disconnect the `foo:camera` plug from the ubuntu core slot: +snap disconnect foo:camera + +# To disable the `foo` snap +snap disable foo + +# To enable the `foo` snap +snap enable foo + +# To set snap `foo`'s `bar` property to 10: +snap set foo bar=10 + +# To read snap `foo`'s current `bar` property: +snap get foo bar