Random tools I've found interesting

Bryce Harrington bryce.harrington at canonical.com
Thu Mar 5 19:52:10 UTC 2020


As followup to our retrospective, this past year I've found and played
with several tools, that I thought might be worth show-and-telling
about, and given our corona-sprint we're in will do so via email:


== so-trello ==

This CLI allows programmatic interaction with Trello boards.  It was
written by our own Kernel team's Andy Whitcroft.

This looks like it could be handy for bulk operations, cronned/automated
card update tasks, and the like.

So-trello can be downloaded from the snap store
(https://snapcraft.io/so-trello), or installed directly:

  $ sudo snap install so-trello


== LXD Login ==

I'm always looking for ways to improve my user experience with lxc
containers.  Logging in has always felt a bit baroque, so I've been
scouring for simpler solutions.  I found out that LXD supports
'aliases', and that you can construct a login alias, which works pretty
good.

  $ lxc alias add login 'exec @ARGS@ --mode interactive -- bash -xac $@bryce - exec /bin/login -p -f '

(The trailing space after the -f is important).  Replace 'bryce' with
'ubuntu' or whatever username you use in your containers.

Unfortunately, it still requires running `script /dev/null` after
logging in... would love to figure out how to eliminate that step.

Bonus, here's an alias to make a prettier lxc listing:

  $ lxc alias add ls 'list -c ns4,user.comment:comment'

If I'm late to the party and y'all already know about lxd aliases, well
boo, but show me *your* aliases!  (And we should add this to starter
docs...)


== YAML Parser for Bash scripts - yaml.sh ==

I like YAML and I like writing in Bash, but the two don't fit together
naturally.  Scouring the web for solutions, I found AdrianDC's yaml.sh
which reads a YAML file and registers its parameters as prefixed ENV
vars.  Quite handy.

yaml.sh can be downloaded from:

  $ wget https://raw.githubusercontent.com/jasperes/bash-yaml/master/script/yaml.sh


== shellcheck ==

Probably known to all Bash aficionados already, but 'shellcheck' is so
handy worth extra mention.  It runs a lint check on bash scripts to
identify syntax improvements.  Very helpful for catching errors too.

  $ sudo apt-get install shellcheck


== distro-info ==

Another one I'm sure you all already know about, but if not, distro-info
is another handy tool for looking up information about Debian and Ubuntu
releases.  Good way to avoid hardcoding things in your own scripts.

  $ sudo apt-get install distro-info

What's the current development version's codename?

  $ distro-info -d
  focal

What's bionic's release number?

  $ distro-info --release --series bionic | cut -d' ' -f1
  18.04

Is disco still supported?

  $ (distro-info --supported | grep disco) || echo "Nope!"
  Nope!








More information about the ubuntu-server mailing list