<commit_before>* lxc-wrapper

An opinionated LXC wrapper.

** Motivation

I use LXC in a very opinionated way, and has some manual maintenance to
do every time I do something with LXCs. So I created this tool to
automate what I do with them.

** What it does

-  I always forget the =--name= option. lxc-wrapper assumes that the
   argument is the name of the container.
-  Writing =--fancy= when I want an ls should be the default. No
   argument needed.
-  When creating a container, it assigns a static IP to it, adds an
   entry to the hosts file so that the container is reachable, and adds
   a symbolic link to the rootfs in a defined folder.
-  Destroying a container cleans up behind itself.

** Installation<commit_msg>Adds examples in the readme<commit_after>* lxc-wrapper

An opinionated LXC wrapper.

** Motivation

I use LXC in a very opinionated way, and has some manual maintenance to
do every time I do something with LXCs. So I created this tool to
automate what I do with them.

** What it does

-  I always forget the =--name= option. lxc-wrapper assumes that the
   argument is the name of the container.
-  Writing =--fancy= when I want an ls should be the default. No
   argument needed.
-  When creating a container, it assigns a static IP to it, adds an
   entry to the hosts file so that the container is reachable, and adds
   a symbolic link to the rootfs in a defined folder.
-  Destroying a container cleans up behind itself.

** Example session

Starting a new project "bar" based on the "foo" stack.

#+BEGIN_EXAMPLE
$ sudo lxc-wrapper --base foo create bar
Created container foo as copy of lamp
$ sudo lxc-wrapper ls
NAME      STATE    IPV4      IPV6  GROUPS  AUTOSTART  
----------------------------------------------------
bar       STOPPED  -         -     -       NO         
foo       STOPPED  -         -     -       NO         
$ sudo lxc-wrapper start bar
$ sudo lxc-wrapper ls
NAME      STATE    IPV4      IPV6  GROUPS  AUTOSTART  
----------------------------------------------------
bar       STOPPED  10.0.3.4  -     -       NO         
foo       STOPPED  -         -     -       NO         
$ ssh ubuntu@bar.lxc
#+END_EXAMPLE

When done with the project:

#+BEGIN_EXAMPLE
$ sudo lxc-wrapper stop bar
$ sudo lxc-wrapper destroy bar
$ sudo lxc-wrapper ls
NAME      STATE    IPV4      IPV6  GROUPS  AUTOSTART  
----------------------------------------------------
foo       STOPPED  -         -     -       NO         
#+END_EXAMPLE

** Installation
{'fraction_non_alphanumeric': 0.11316211878009631, 'fraction_numerical': 0.004414125200642055, 'mean_word_length': 1.9089848308051343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2293639', 'n_tokens_mistral': 749, 'n_tokens_neox': 693, 'n_words': 332}