Re: Random tools I've found interesting

2020-03-18 Thread Nafallo Bjälevik
 Hi,

Thought I would add to this with my own findings. Taken from my Ansible
playbook, but should be fairly readable :-).

On 09/03/2020 11:50, Christian Ehrhardt wrote:

> Not my tool so I can't point to my repo.
> But also really helpful when dealing with git-repos on a daily base.
> 
> https://github.com/jimeh/git-aware-prompt
> 
> Lets your prompt always list in which branch you are (I also show if it
> is dirty).
> Let me know if you need help setting this up...

Display a multitude of GIT information in the prompt:
```
- name: Ensure GIT helper scripts
  get_url:
url: "{{ item.url }}"
dest: "{{ item.dest | default('~/.' + item.url | basename) }}"
backup: true
  loop:
- url:
https://github.com/git/git/raw/master/contrib/completion/git-prompt.sh

- name: Ensure GIT helper scripts in bashrc
  blockinfile:
path: ~/.bashrc
block: |
  if [ -r ~/.git-completion.bash ]; then
  source ~/.git-completion.bash
  fi
  if [ -r ~/.git-prompt.sh ]; then
  source ~/.git-prompt.sh
  GIT_PS1_SHOWDIRTYSTATE=true
  GIT_PS1_SHOWSTASHSTATE=true
  #GIT_PS1_SHOWUNTRACKEDFILES=true
  GIT_PS1_SHOWUPSTREAM="auto"
  #GIT_PS1_STATESEPARATOR="SP"
  #GIT_PS1_DESCRIBESTYLE="default"
  GIT_PS1_SHOWCOLORHINTS=true
  GIT_PS1_HIDE_IF_PWD_IGNORED=true
  SPLITPS1="\"$(echo $PS1 | awk -F\$ '{OFS="$";NF--;print $0;}'
| sed 's/\\$//')\" \"\\\$$(echo $PS1 | awk -F\$ '{OFS="$";print $NF;}') \""
  PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND;} __git_ps1
$SPLITPS1"
  fi
marker: "# {mark} GIT HELPERS"
```

Rename your TMUX window dynamically with your current directory:
```
- name: Ensure TMUX title set to $PWD
  blockinfile:
path: ~/.bashrc
block: |
  if [ -n "$TMUX" ] && [ -n "$BASH" ]; then
  __set_tmux_title() {
  if [ "$(pwd)" == "$(echo ~)" ]; then
  echo -ne "\033k$(hostname -s)\033\\"
  else
  title=$(pwd)
  echo -ne "\033k${title/*\//}\033\\"
  unset title
  fi
  }
  PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND;}
__set_tmux_title"
  fi
marker: '# {mark} TMUX TITLE'
insertbefore: '^# enable programmable completion'

- name: Ensure Byobu TMUX profile
  copy:
content: |
  source $BYOBU_PREFIX/share/byobu/profiles/tmux
  set-option -g allow-rename on
dest: ~/.byobu/profile.tmux
backup: true
```

Hopefully someone finds it useful :-)


Cheers,
Nafallo

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-09 Thread Christian Ehrhardt
On Mon, Mar 9, 2020 at 11:43 AM Christian Ehrhardt <
christian.ehrha...@canonical.com> wrote:

>
>
> On Mon, Mar 9, 2020 at 11:40 AM Christian Ehrhardt <
> christian.ehrha...@canonical.com> wrote:
>
>>
>>
>> On Thu, Mar 5, 2020 at 8:53 PM Bryce Harrington <
>> bryce.harring...@canonical.com> wrote:
>>
>>> 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
>>>
>>
>> Yes this is just what I had in mind - the storytelling to get attention
>> to it.
>>
>>
>
> Breaking into a new thread to talk about the non git backed one-liners and
> in-archive tools
>

As we discussed I have organized my pre-existing tools git-repo into
per-user subdirectory and shared them at [1].

In the fashion of this mails "storytelling" the README.md [3] serves as an
entry point to more easily discover what some of those tools might be about.

It is a start and let's grow from here ...
All members of ubuntu-server Team [2] have commit access there, so please
feel free to add your own ugly and broken scripts just as I did with mine
:-)

[1]:
https://code.launchpad.net/~ubuntu-server/ubuntu-helpers/+git/ubuntu-helpers
[2]: https://launchpad.net/~ubuntu-server
[3]: https://git.launchpad.net/~ubuntu-server/ubuntu-helpers/tree/README.md


> As you know if you often run the same lengthy command it just takes time
> without gain.
> While trivial I can't summarize how much time I saved with:
>
>  alias cdl="cd ~/work/libvirt/libvirt-ubuntu-git/"
>  alias cdq="cd ~/work/qemu/qemu.git/"
>
> On a similar note for git ubuntu sponsors:
>
>  alias gutu='git ubuntu tag --upload && git describe HEAD'
>
> And on complex multi remot many many branch git repos when you come back
> and don't know where you left
>
> alias gitltr="git for-each-ref --sort=committerdate refs/heads/
> --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) -
> %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) -
> %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
>
> The latter is a bit lengthy, but it lists you the last modified in order
> like "ls -ltr" but for git branches.
> Example:
> $ gitltr
>  ubuntu/devel - 1ed66190 - Import patches-unapplied version 1.8.5-5ubuntu1
> to ubuntu/focal-proposed - Steve Langasek (2 weeks ago)
>  i-c-build - 8dd15693 - changelog: go to pre 1.9 version for HW
> acceleration features - Christian Ehrhardt (44 minutes ago)
> * export-i-c-build - 9d4f471e - d/compat: set version 11 for Bionic -
> Christian Ehrhardt (37 minutes ago)
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-09 Thread Christian Ehrhardt
On Mon, Mar 9, 2020 at 11:40 AM Christian Ehrhardt <
christian.ehrha...@canonical.com> wrote:

>
>
> On Thu, Mar 5, 2020 at 8:53 PM Bryce Harrington <
> bryce.harring...@canonical.com> wrote:
>
>> 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
>>
>
> Yes this is just what I had in mind - the storytelling to get attention to
> it.
>
>
>> 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
>>
>
> I use that as well and if you git-clone syntastic into your vim you'll get
> it integrated (along others) on writing a file.
>
>   $ cd ~/.vim/bundle
>   $ git clone https://github.com/scrooloose/syntastic.git
>
> And BTW tools ..., managing vim plugins with
>   $ apt install vim-pathogen
>

Not my tool so I can't point to my repo.
But also really helpful when dealing with git-repos on a daily base.

https://github.com/jimeh/git-aware-prompt

Lets your prompt always list in which branch you are (I also show if it is
dirty).
Let me know if you need help setting this up...


>  == 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!
>>
>>
>>
>>
>>
>>
>> --
>> ubuntu-server mailing list
>> ubuntu-server@lists.ubuntu.com
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
>> More info: https://wiki.ubuntu.com/ServerTeam
>
>
>
> --
> Christian Ehrhardt
> Staff Engineer, Ubuntu Server
> Canonical Ltd
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-09 Thread Christian Ehrhardt
On Mon, Mar 9, 2020 at 11:40 AM Christian Ehrhardt <
christian.ehrha...@canonical.com> wrote:

>
>
> On Thu, Mar 5, 2020 at 8:53 PM Bryce Harrington <
> bryce.harring...@canonical.com> wrote:
>
>> 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
>>
>
> Yes this is just what I had in mind - the storytelling to get attention to
> it.
>
>

Breaking into a new thread to talk about the non git backed one-liners and
in-archive tools

As you know if you often run the same lengthy command it just takes time
without gain.
While trivial I can't summarize how much time I saved with:

 alias cdl="cd ~/work/libvirt/libvirt-ubuntu-git/"
 alias cdq="cd ~/work/qemu/qemu.git/"

On a similar note for git ubuntu sponsors:

 alias gutu='git ubuntu tag --upload && git describe HEAD'

And on complex multi remot many many branch git repos when you come back
and don't know where you left

alias gitltr="git for-each-ref --sort=committerdate refs/heads/
--format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) -
%(color:red)%(objectname:short)%(color:reset) - %(contents:subject) -
%(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"

The latter is a bit lengthy, but it lists you the last modified in order
like "ls -ltr" but for git branches.
Example:
$ gitltr
 ubuntu/devel - 1ed66190 - Import patches-unapplied version 1.8.5-5ubuntu1
to ubuntu/focal-proposed - Steve Langasek (2 weeks ago)
 i-c-build - 8dd15693 - changelog: go to pre 1.9 version for HW
acceleration features - Christian Ehrhardt (44 minutes ago)
* export-i-c-build - 9d4f471e - d/compat: set version 11 for Bionic -
Christian Ehrhardt (37 minutes ago)
-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-09 Thread Christian Ehrhardt
On Thu, Mar 5, 2020 at 8:53 PM Bryce Harrington <
bryce.harring...@canonical.com> wrote:

> 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
>

Yes this is just what I had in mind - the storytelling to get attention to
it.


> 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
>

I use that as well and if you git-clone syntastic into your vim you'll get
it integrated (along others) on writing a file.

  $ cd ~/.vim/bundle
  $ git clone https://github.com/scrooloose/syntastic.git

And BTW tools ..., managing vim plugins with
  $ apt install vim-pathogen

 == 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!
>
>
>
>
>
>
> --
> ubuntu-server mailing list
> ubuntu-server@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
> More info: https://wiki.ubuntu.com/ServerTeam



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-06 Thread Rafael David Tinoco
> On Fri, Mar 6, 2020 at 12:47 PM Ryan Harper  wrote:
> > # /home/rharper/.ssh/config.defaults
> > Host *.lxd
> > User ubuntu
> > IdentityFile /home/rharper/.ssh/id_rsa
> > StrictHostKeyChecking no
> > UserKnownHostsFile /dev/null
> > ProxyCommand nc $(lxc list -c s4 $(basename %h .lxd) | awk '/RUNNING/ 
> > {print $4}') %p
>
> I'm sad because DNS resolution used to work out of the box for *.lxd
> domains in the past. It was easy to configure "Hey, for this domain
> lxd, use that nameserver". I haven't been able to configure this
> anymore in recent ubuntu releases. The best I got was a dns loop and
> 100% cpu usage.

I loved using the proxy command for it. I've been putting lxd network
into kvm network and using the NSS libvirt plugins to solve lxc names:

rafaeldtinoco@workstation:~$ virsh net-dumpxml default

  default
  c6d5e95a-6c5a-4e17-9ae3-38f43c386c0d
  

  

  
  
  
  

  

  


rafaeldtinoco@workstation:~$ cat /etc/nsswitch.conf | grep hosts
hosts:  files libvirt_guest libvirt dns

rafaeldtinoco@workstation:~$ lxc profile show default | grep -B2 brdefault
name: eth0
nictype: bridged
parent: brdefault

So nss would solve all libvirt virtual machine names first, then
hostnames got by the dhcp leases from virtual machines AND lxd
containers and then all th rest. But I guess I can use .lxd and .kvm
(virsh list --all) and it will be better.

For the LXD profiles, I have a few depending on different needs:

https://github.com/rafaeldtinoco/provision/tree/master/lxd/profiles

$ lxc launch ubuntu-daily:focal apache2fix
$ lxc launch -p debian-default images: debian
$ lxc launch -p cluster ubuntu-daily:focal pacemakerdev

and all my networks are libvirt networks so I can have LXD and KVM
guests in the same bridges, like when using the cluster yaml profile
definition:

devices:
eth0:
name: eth0
nictype: bridged
parent: brdefault
type: nic
iscsi01:
name: iscsi01
nictype: bridged
parent: iscsi01
type: nic
iscsi02:
name: iscsi02
nictype: bridged
parent: iscsi02
type: nic
...

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-06 Thread Andreas Hasenack
Hi

On Fri, Mar 6, 2020 at 12:47 PM Ryan Harper  wrote:
> # /home/rharper/.ssh/config.defaults
> Host *.lxd
> User ubuntu
> IdentityFile /home/rharper/.ssh/id_rsa
> StrictHostKeyChecking no
> UserKnownHostsFile /dev/null
> ProxyCommand nc $(lxc list -c s4 $(basename %h .lxd) | awk '/RUNNING/ 
> {print $4}') %p

I'm sad because DNS resolution used to work out of the box for *.lxd
domains in the past. It was easy to configure "Hey, for this domain
lxd, use that nameserver". I haven't been able to configure this
anymore in recent ubuntu releases. The best I got was a dns loop and
100% cpu usage.

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-06 Thread Robie Basak
On Fri, Mar 06, 2020 at 09:46:29AM -0600, Ryan Harper wrote:
> (neipa) ~ % ssh f2.lxd
> Warning: Permanently added 'f2.lxd' (ECDSA) to the list of known hosts.
> 
> ubuntu@f2:~$

I have something similar, but different:
https://git.launchpad.net/~racb/+git/tools/tree/lxd-ssh

Differences:

No ssh host key spam as it automatically syncs ~/.ssh/known_hosts with
the container's public keys.

Doesn't need/rely on networking - it uses lxc exec internally.


signature.asc
Description: PGP signature
-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-06 Thread Ryan Harper
On Thu, Mar 5, 2020 at 1:53 PM Bryce Harrington <
bryce.harring...@canonical.com> wrote:

> 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:
>
>
> == 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 '
>

If you're using system containers with networking, I very much like this
ssh config:

# /home/rharper/.ssh/config.defaults
Host *.lxd
User ubuntu
IdentityFile /home/rharper/.ssh/id_rsa
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
ProxyCommand nc $(lxc list -c s4 $(basename %h .lxd) | awk '/RUNNING/
{print $4}') %p

With an update to the lxd default profile:

(neipa) ~ % cat user-data.txt
#cloud-config
ssh_authorized_keys:
- ssh-rsa  
(neipa) ~ % lxc profile set default user.user-data - < user-data.txt
(neipa) ~ % lxc launch ubuntu-daily:focal f2
Creating f2
Starting f2
(neipa) ~ % ssh f2.lxd
Warning: Permanently added 'f2.lxd' (ECDSA) to the list of known hosts.

ubuntu@f2:~$
-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Re: Random tools I've found interesting

2020-03-06 Thread Scott Moser
> == LXD Login ==
>
>   $ lxc alias add login 'exec @ARGS@ --mode interactive -- bash -xac $@bryce 
> - exec /bin/login -p -f '
>

This is similar to 'ctool exec --container=mycontainer --user=bryce'.

It doesn't use 'login', so I'm not sure what effect that actually has
on things, but you don't need 'script /dev/null'.

ctool is part of the scripts ubuntu server team uses for different
things.  It lives
https://github.com/CanonicalLtd/uss-tableflip/tree/master/scripts .

I just put a pull request up to add some better usage doc:

   https://github.com/CanonicalLtd/uss-tableflip/pull/38/files

On Thu, Mar 5, 2020 at 2:53 PM Bryce Harrington
 wrote:
>
> 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!
>
>
>
>
>
>
> --
> ubuntu-server mailing list
> ubuntu-server@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
> More info: https://wiki.ubuntu.com/ServerTeam

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam