<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[ZRHDEV]]></title><description><![CDATA[ZRHDEV]]></description><link>https://zrh.dev/</link><image><url>https://zrh.dev/favicon.png</url><title>ZRHDEV</title><link>https://zrh.dev/</link></image><generator>Ghost 3.0</generator><lastBuildDate>Sat, 19 Oct 2024 18:56:33 GMT</lastBuildDate><atom:link href="https://zrh.dev/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Writing a report in LaTeX using an automated build pipeline]]></title><description><![CDATA[<h2 id="environment">Environment</h2><h3 id="setup-latex">Setup LaTeX</h3><p>First of all a fully working LaTeX Environment is necessary. There are tons of tutorials to handle the installation. </p><ul><li><a href="http://www.tug.org/mactex/">http://www.tug.org/mactex/</a> (I've used this)</li><li><a href="http://www.tug.org/texlive/">http://www.tug.org/texlive/</a></li></ul><p>The local build automation process requires more tools to work:</p><ul><li><a href="https://mg.readthedocs.io/latexmk.html">https://mg.readthedocs.io/latexmk.</a></li></ul>]]></description><link>https://zrh.dev/latex/</link><guid isPermaLink="false">5e0187710ce239036ba30384</guid><category><![CDATA[latex]]></category><category><![CDATA[github]]></category><category><![CDATA[tex]]></category><category><![CDATA[circleci]]></category><dc:creator><![CDATA[Jan Minder]]></dc:creator><pubDate>Wed, 10 Nov 2021 15:22:53 GMT</pubDate><content:encoded><![CDATA[<h2 id="environment">Environment</h2><h3 id="setup-latex">Setup LaTeX</h3><p>First of all a fully working LaTeX Environment is necessary. There are tons of tutorials to handle the installation. </p><ul><li><a href="http://www.tug.org/mactex/">http://www.tug.org/mactex/</a> (I've used this)</li><li><a href="http://www.tug.org/texlive/">http://www.tug.org/texlive/</a></li></ul><p>The local build automation process requires more tools to work:</p><ul><li><a href="https://mg.readthedocs.io/latexmk.html">https://mg.readthedocs.io/latexmk.html</a>‌‌  <em>used to build the pdf version</em></li><li>make (preinstalled on most unix systems)‌‌for windows: <a href="http://gnuwin32.sourceforge.net/packages/make.htm">http://gnuwin32.sourceforge.net/packages/make.htm</a></li></ul><p>I've used <strong>pandoc</strong> to generate other file formats based on my LaTeX report, like ms word or open document.</p><ul><li><a href="https://pandoc.org/installing.html">https://pandoc.org/installing.html</a></li></ul><h3 id="setup-vscode">Setup VSCode</h3><p>The full installation of LaTeX ships two different applications to work with LaTeX files (<a href="http://www.tug.org/texworks/">TeXworks</a> or <a href="https://pages.uoregon.edu/koch/texshop/">TeXShop</a>). These are really powerfull and extensive editors. But I'm more famliar with development environments like IntelliJ or VS Code. For this reason I prefered to use VS Code.  The following tutorial describes the vs code setup using the plugin LaTeX Workshop: </p><p><a href="https://medium.com/@rcpassos/writing-latex-documents-in-visual-studio-code-with-latex-workshop-d9af6a6b2815"><em>https://medium.com/@rcpassos/writing-latex-documents-in-visual-studio-code-with-latex-workshop-d9af6a6b2815</em></a></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://zrh.dev/content/images/2019/12/latex_vscode-1.png" class="kg-image"><figcaption>Visual Studio Code with LaTeX Workshop Plugin</figcaption></figure><hr><p>Now the document bootstrap will be created. I need a report and a presentation based on the same content and references. Each chapter and section will be stored in separated files.</p><!--kg-card-begin: markdown--><pre><code>.
├── chapters
│   └── introduction
│       ├── abstract.tex
│       └── references.tex
├── figures
│   ├── images
│   ├── pdf
│   └── tables
├── keynote.tex
├── report.tex
└── shared-deps.tex
</code></pre>
<!--kg-card-end: markdown--><h2 id="dependencies">Dependencies</h2><p>All shared dependencies are stored in <code>shared-deps.tex</code> file. The file will be imported by <code>report.tex</code> and <code>keynote.tex</code>. A working file can be downloaded on <a href="https://github.com/jjmc-collective/latex-templates/blob/master/shared-deps.tex">github</a>.</p><!--kg-card-begin: markdown--><pre><code class="language-tex">% ----- Deps -- Figures and Graphics
\usepackage{graphicx} % https://ctan.org/pkg/graphicx
\usepackage{tikz} % https://ctan.org/pkg/pgf
</code></pre>
<!--kg-card-end: markdown--><p>All packages can be found on the <a href="https://ctan.org/">Comprehensive TeX Archive Network</a>. If your code does not fully relay on the LaTeX default installation you have to customize your deployment container. </p><h2 id="setup-document">Setup Document</h2><p>Your <code>report.tex</code> file contains your main document definition. You can import each chapter file to get a better overview of the structure. </p><!--kg-card-begin: markdown--><pre><code>\documentclass[a4paper, 12pt]{report}
\input{shared-deps.tex} % Load shared dependencies

\begin{document}

    \begin{titlepage}
        % your titlepage
    \end{titlepage}
    
    \chapter{Intro}
    \input{chapters/intro/intro}
    
\end{document}
</code></pre>
<!--kg-card-end: markdown--><h2 id="add-references">Add References</h2><p>You can use different references systems. I've worked with <a href="https://ctan.org/pkg/biblatex">biblatex</a> and its own data backend called <code>biber</code> .  Put all your references to a the <code>bibliography.bib</code> file. I've used <a href="https://bibdesk.sourceforge.io/">BibDesk</a> to manage my reference library.</p><!--kg-card-begin: markdown--><pre><code>@book{book:maintainable-software,
    Author = {Joost Visser, Sylvan Rigal},
    Isbn = {9781491953495},
    Keywords = {testing, benchmarking},
    Publisher = {O'Reilly Media},
    Title = {Building Maintainable Software - Java Edition},
    Year = {2016}}
</code></pre>
<!--kg-card-end: markdown--><p>Before you can use them, you have to import the required packages:</p><!--kg-card-begin: markdown--><pre><code>\usepackage[german]{babel} % Local language support
\usepackage[backend=biber,style=alphabetic]{biblatex}
\usepackage[hidelinks,bookmarks=true]{hyperref}
\addbibresource{bibliography.bib} % import glossary entries
</code></pre>
<!--kg-card-end: markdown--><h3 id="use-references">Use references</h3><p>Now you can use these entries in your report for example with the <a href="https://www.overleaf.com/learn/latex/Footnotes#Introduction">footnote</a> command: <code>\footnote{This is the content of footnote}</code>. You can also use citiations in footnote with a custom style. Overwrite the \footcite command with  your stylings. Place the code (from <a href="https://tex.stackexchange.com/a/50260">stackexchange</a>) in your <code>report.tex</code> befor your document begins.</p><!--kg-card-begin: markdown--><pre><code>\DeclareCiteCommand{\footcite}[\mkbibfootnote] 
	{\usebibmacro{prenote}}                                 
	{\usebibmacro{citeindex}
		\printfield{labelalpha}
		\setunit{\labelnamepunct}
		\printfield[citetitle]{title}
	}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}
</code></pre>
<!--kg-card-end: markdown--><p>Now you'll be able to use your layout with a key from your bibliography in your footnotes:</p><!--kg-card-begin: markdown--><pre><code>\footcite{book:maintainable-software}
</code></pre>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://zrh.dev/content/images/2020/07/image-1.png" class="kg-image"><figcaption>Custom styled \footcite command</figcaption></figure><h3 id="print-references">Print references</h3><p>Print a list of your used references with the <code>\printbibliography</code> command in your report file where you want to place the page.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://zrh.dev/content/images/2020/06/literatur-1.png" class="kg-image"><figcaption>Output of command <code>printbibliography</code></figcaption></figure><h2 id="add-glossaries">Add Glossaries</h2><p>For glossaries and acronyms i've used the <a href="https://ctan.org/pkg/glossaries">glossaries</a> package. With this package you're able to store your entries in a separate file. In this file you define your glossary and acronym items as followed in the <code>glossary.tex</code> file:</p><!--kg-card-begin: markdown--><pre><code>\newacronym{go}{Go}{Golang}
\newglossaryentry{mutex}{
	name=Mutex,
	plural=Mutex,
	description={Englische Abkürzung für \textbf{m}utual \textbf{e}xclusion}
}
</code></pre>
<!--kg-card-end: markdown--><p>You can use this entries by importing the file in your report. Your glossary will be generated by the <code>\makeglossaries</code> command. To use these index in a automates pipeline with latexmk you have to add a <code>.latexmk</code> configuration. Follow <a href="https://tex.stackexchange.com/a/44316">this post</a> to understand why.</p><!--kg-card-begin: markdown--><pre><code>\usepackage[acronym, toc]{glossaries} % https://ctan.org/pkg/glossaries

\makeglossaries
\loadglsentries{glossary}
</code></pre>
<!--kg-card-end: markdown--><blockquote>Link your glossary and reference entries with the <a href="https://ctan.org/pkg/hyperref">hyperref</a> package.</blockquote><p>If you run the report file in visual studio code you have to generate the index manually with the command: <code>makeglossaries report</code> .</p><p>Now you can print your glossarie tables with these commands: </p><!--kg-card-begin: markdown--><pre><code>\printglossary
\printglossary[type=\acronymtype, title=Begriffe und Abkürzungen, toctitle=Begriffe und Abkürzungen] 
</code></pre>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://zrh.dev/content/images/2020/06/glossar.png" class="kg-image"><figcaption>Output of command <code>printglossary</code></figcaption></figure><h2 id="build-process">Build Process</h2><p>The report can now be built to a single pdf file. To simplify this process, use a <code>Makefile</code> with following content. Run <code>make</code> to build the document. Read the <a href="https://www.gnu.org/software/make/manual/html_node/Simple-Makefile.html#Simple-Makefile">docs</a> of the make tool to enhance the file. </p><!--kg-card-begin: markdown--><pre><code># dependencies
# - gcc
# - latexmk

.PHONY: setup clean pub

REPORT_NAME = report
PRESENATION_NAME = keynote
OUT_DIR = dist/

all: clean setup report pub

setup:
    mkdir -p ${OUT_DIR}
    
report: report.tex
    latexmk -bibtex -diagnostics -jobname=${REPORT_NAME} --file-line-error --interaction=nonstopmode -pdf report.tex
   
keynote: presentation.tex
		latexmk -bibtex -diagnostics -jobname=${PRESENATION_NAME} --file-line-error --interaction=nonstopmode -pdf keynote.tex

pub:
    cp ${REPORT_NAME}.pdf ${OUT_DIR}
    cp ${PRESENATION_NAME}.pdf ${OUT_DIR}
    
clean: 
    latexmk -CA
    rm -rf dist
    rm -f ${REPORT_NAME}.pdf
    rm -f ${PRESENATION_NAME}.pdf
</code></pre>
<!--kg-card-end: markdown--><p>I've used a continuous build pipeline to archive my built reports.</p><h3 id="github-workflows">Github Workflows</h3><p>You can use for example github workflows. It's well integrated and easy to use. Create the file <code>.github/workflows/build.yml</code> and add following pipeline definition. I've used the action from <a href="https://github.com/xu-cheng/latex-action">xu-cheng</a>. When the built process is finished, all files from dist folder will be available as zip archive to download.</p><!--kg-card-begin: markdown--><pre><code class="language-yaml">name: build
on: [push, pull_request]

jobs:
    build_report:
        runs-on: ubuntu-latest
        name: Build Report
        steps:
          - name: Set up Git repository
            uses: actions/checkout@v2
          - name: Setup LaTeX
            uses: xu-cheng/latex-action@v2
            with:
              root_file: report.tex
          - uses: actions/upload-artifact@v2
            with:
              name: report
              path: report.pdf
</code></pre>
<!--kg-card-end: markdown--><h3 id="circleci">CircleCI</h3><p>You can also use the circleCI Service. The pipelines runs faster with this provider than github workflows. The free credits (2500) from circleci allows you to build the report about 70 (4m build time) to 140 (2m build time) times a week. Create a file named <code>.circleci/config.yml</code> and add following snippet. I've used the docker container from  <a href="https://github.com/aergus/dockerfiles/blob/master/latex/Dockerfile">aergus</a>. </p><!--kg-card-begin: markdown--><pre><code class="language-yaml">version: 2
jobs:
  build:
    docker:
      - image: aergus/latex
    steps:
      - checkout
      - run:
          name: Build Case Study
          command: make all
      - store_artifacts:
          path: dist/
          destination: dist
</code></pre>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://zrh.dev/content/images/2020/07/image-2.png" class="kg-image"></figure>]]></content:encoded></item><item><title><![CDATA[Some insights from GoLab 2019]]></title><description><![CDATA[<p>I attended the GoLab conference in Florence and would like to present some of the topics I took with me. </p><h3 id="dependency-management">Dependency Management</h3><p>A large topic was the handling of dependencies mainly in the context of internal networks. The prerequisite for the presented solutions are Go modules which are activated by</p>]]></description><link>https://zrh.dev/some-insights-from-golab-2019/</link><guid isPermaLink="false">5db0ce3f7f0ef80348b2f1aa</guid><category><![CDATA[go]]></category><category><![CDATA[golab]]></category><category><![CDATA[florence]]></category><dc:creator><![CDATA[Jan Minder]]></dc:creator><pubDate>Fri, 25 Oct 2019 00:39:36 GMT</pubDate><content:encoded><![CDATA[<p>I attended the GoLab conference in Florence and would like to present some of the topics I took with me. </p><h3 id="dependency-management">Dependency Management</h3><p>A large topic was the handling of dependencies mainly in the context of internal networks. The prerequisite for the presented solutions are Go modules which are activated by default as of <a href="https://golang.org/doc/go1.13#modules">Go 1.13</a> (when there is a go.mod file available in the project root).</p><p><a href="https://blog.jetbrains.com/go/author/florin-patanjetbrains-com/">Florin Pățan</a> from Jetbrains demonstrated the use of Go modules very well using the development environment GoLand. He also wrote a <a href="https://blog.jetbrains.com/go/2019/01/22/working-with-go-modules/">blog post</a> about it.</p><p>Several solutions were presented to load dependencies via a proxy. In some cases they even work in a supplementary way.<br></p><ul><li><a href="https://proxy.golang.org/">https://proxy.golang.org</a></li><li><a href="https://github.com/gomods/athens">https://github.com/gomods/athens</a></li><li><a href="https://jfrog.com/integration/go-registry/">https://jfrog.com/integration/go-registry</a></li></ul><h3 id="benchmarking">Benchmarking</h3><p>Many of the speakers have presented a number of different ways to debug their applications and identify performance problems.</p><p>There are packages which can be used directly from go subrepos to benchmark different ranges.</p><p><a href="https://pkg.go.dev/golang.org/x/benchmarks/build">golang.org/x/benchmarks/build</a><br><em>Build is a benchmark that examines compiler and linker performance.</em></p><p><a href="https://pkg.go.dev/golang.org/x/benchmarks/driver">golang.org/x/benchmarks/driver</a><br>Package driver provides common benchmarking logic shared between benchmarks.</p><p><a href="https://pkg.go.dev/golang.org/x/benchmarks/garbage">golang.org/x/benchmarks/garbage</a><br><em>Garbage is a benchmark that stresses garbage collector.</em></p><p><a href="https://pkg.go.dev/golang.org/x/benchmarks/http">golang.org/x/benchmarks/http</a><br><em>HTTP is a benchmark that examines client/​server http performance.</em></p><p><a href="https://pkg.go.dev/golang.org/x/benchmarks/json">golang.org/x/benchmarks/json</a><br><em>JSON benchmark marshals and unmarshals ~2MB json string with a tree-like object hierarchy, in 4*GOMAXPROCS goroutines.</em></p><p>Profiling data can be exposed by an endpoint with the <a href="https://golang.org/pkg/net/http/pprof/">http pprof package</a>. This is very useful to visualize these data directly in the browser or use a cli interface like <a href="https://github.com/rakyll/gom">gom</a>.</p><h3 id="debugging">Debugging</h3><p>In some cases you want to know a trace of all calls in your runtime. The <a href="https://golang.org/pkg/runtime/">runtime package</a> from go provides these capabilities. An interesting article from <a href="https://dave.cheney.net/" rel="home">Dave Cheney</a> explains the details <a href="https://dave.cheney.net/tag/godebug">here</a>. </p><p>With <a href="https://golang.org/pkg/expvar/">expvar</a> you are able to extract debug informations from your production (like pprof for performance issues) environment over an endpoint. </p><p>A very interesting talk by <a href="https://github.com/Pippolo84/" rel="noopener noreferrer">Fabio Falzoi</a>. A deep insight into garbage collection of Go. He has his slides on <a href="https://github.com/Pippolo84/golab2019-talk">github</a> as <a href="https://github.com/Pippolo84/golab2019-talk/raw/master/An%20Insight%20into%20Go%20Garbage%20Collection.pdf">pdf</a> available.</p><h3 id="webservices">Webservices</h3><p>If you run several goroutines in parallel, you can cause conflicts. Roberto Clapis explained how to find the causes and minimize them. To do this, he introduced his debugging methods and helped to understand the problem of contention better. Get the slides <a href="https://clap.page.link/swstory">here</a>.</p><p>Bill Kennedy has introduced a <a href="https://github.com/ardanlabs/service">starter-kit</a> for webservices. The focus is on robustness and configuration. </p><h3 id="functional-programming-with-go">Functional Programming with Go</h3><p>Last but not least, I would like to mention <a href="https://www.slideshare.net/feyeleanor/an-introduction-to-functional-programming-with-go-redux">Eleanor McHugh's talk</a>. She presented exciting implementations to apply functional concepts in Go.</p>]]></content:encoded></item><item><title><![CDATA[Install Gitlab in a LXD Container]]></title><description><![CDATA[<p>Run a gitlab instance in a lxc container and use a shared folder to sync the backups with a remote host.</p><figure class="kg-card kg-image-card"><img src="https://zrh.dev/content/images/2018/09/lxd_container--1-.svg" class="kg-image"></figure><!--kg-card-begin: markdown--><pre><code>lxc launch ubuntu:16.04 gitlab
lxc config device add gitlab backup-share disk path=/data source=/data/gitlab
</code></pre>
<!--kg-card-end: markdown--><h2 id="host-setup">Host Setup</h2><!--kg-card-begin: markdown--><p>To access the gitlab instance with ssh, you have</p>]]></description><link>https://zrh.dev/gitlab-with-lxd/</link><guid isPermaLink="false">5ba1716daa678e037dd34654</guid><category><![CDATA[gitlab]]></category><category><![CDATA[lxc]]></category><category><![CDATA[lxd]]></category><dc:creator><![CDATA[Jan Minder]]></dc:creator><pubDate>Tue, 18 Sep 2018 21:44:07 GMT</pubDate><content:encoded><![CDATA[<p>Run a gitlab instance in a lxc container and use a shared folder to sync the backups with a remote host.</p><figure class="kg-card kg-image-card"><img src="https://zrh.dev/content/images/2018/09/lxd_container--1-.svg" class="kg-image"></figure><!--kg-card-begin: markdown--><pre><code>lxc launch ubuntu:16.04 gitlab
lxc config device add gitlab backup-share disk path=/data source=/data/gitlab
</code></pre>
<!--kg-card-end: markdown--><h2 id="host-setup">Host Setup</h2><!--kg-card-begin: markdown--><p>To access the gitlab instance with ssh, you have to set a static ip to your container.</p>
<p>Open your <code>lxd_dnsmasq.conf</code> file or create it if you don't have one.</p>
<pre><code class="language-bash">sudo vim /etc/default/lxd_dnsmasq.conf
dhcp-host=gitlab,10.0.10.2
</code></pre>
<p>Then restart your lxd bridge to apply the config.</p>
<pre><code>sudo service lxd-bridge stop &amp;&amp; sudo service lxd-bridge start
</code></pre>
<p>Port forwarding for ssh access to the container host:2222 -&gt; 10.0.10.2:22</p>
<pre><code>sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 2222 -j DNAT --to-destination 10.0.10.2:22
</code></pre>
<p>Cleaning ACL on the backup shared directory <code>/your/backup/</code></p>
<pre><code>setfacl -R -b /data/gitlab
</code></pre>
<p>Create <code>git</code> user on the host to map with git user in the container</p>
<pre><code>groupadd -g 100998 git
useradd -u 100998 -g 100998 git
</code></pre>
<p>Setting ACL on the hosts backup directory</p>
<pre><code>setfacl -R -m u:user:100998:rwX,g:100998:rwX /data/gitlab
</code></pre>
<!--kg-card-end: markdown--><h2 id="container-setup">Container Setup</h2><!--kg-card-begin: markdown--><h2 id></h2>
<p>Open a shell on your gitlab container</p>
<pre><code>lxc exec gitlab bash
</code></pre>
<p>Install required packages</p>
<pre><code>apt-get install curl openssh-server ca-certificates postfix
</code></pre>
<p>Add the gitlab repositories to your dependencies</p>
<pre><code>curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash
</code></pre>
<p>Intall and reconfigure gitlab. Don't forget to configure the backup path of your gitlab.</p>
<pre><code>apt-get install gitlab-ce
gitlab-ctl reconfigure
</code></pre>
<p>Edit cronjobs for your backup automation with <code>crontab -e</code></p>
<p>Setup backup crontab [every day at 1am]</p>
<pre><code>0 1 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
</code></pre>
<!--kg-card-end: markdown--><p><strong>Sources</strong></p><ul><li><a href="https://linuxcontainers.org/lxd/getting-started-cli/">https://linuxcontainers.org/lxd/getting-started-cli/</a></li></ul><p></p>]]></content:encoded></item><item><title><![CDATA[LXD Commands]]></title><description><![CDATA[<h2 id="images">Images</h2><!--kg-card-begin: markdown--><h2 id></h2>
<p>List available Ubuntu Images</p>
<pre><code>lxc image list ubuntu:
</code></pre>
<p>List available CentOS Images</p>
<pre><code>lxc image list images | grep centos
</code></pre>
<!--kg-card-end: markdown--><h2 id="container">Container</h2><!--kg-card-begin: markdown--><p>Create CentOS based container</p>
<pre><code>lxc launch images:centos/7/amd64 conainer-name
</code></pre>
<p>Create Ubuntu based container and start</p>
<pre><code>lxc launch ubuntu:16.04 conainer-name
</code></pre>
<p>Creating a Ubuntu container without starting it</p>]]></description><link>https://zrh.dev/lxd-commands/</link><guid isPermaLink="false">5ba16d87aa678e037dd3464c</guid><category><![CDATA[lxd]]></category><category><![CDATA[lxc]]></category><category><![CDATA[conatiner]]></category><dc:creator><![CDATA[Jan Minder]]></dc:creator><pubDate>Tue, 18 Sep 2018 21:27:08 GMT</pubDate><content:encoded><![CDATA[<h2 id="images">Images</h2><!--kg-card-begin: markdown--><h2 id></h2>
<p>List available Ubuntu Images</p>
<pre><code>lxc image list ubuntu:
</code></pre>
<p>List available CentOS Images</p>
<pre><code>lxc image list images | grep centos
</code></pre>
<!--kg-card-end: markdown--><h2 id="container">Container</h2><!--kg-card-begin: markdown--><p>Create CentOS based container</p>
<pre><code>lxc launch images:centos/7/amd64 conainer-name
</code></pre>
<p>Create Ubuntu based container and start</p>
<pre><code>lxc launch ubuntu:16.04 conainer-name
</code></pre>
<p>Creating a Ubuntu container without starting it</p>
<pre><code>lxc init ubuntu:16.04 conainer-name
</code></pre>
<p>List all Conainter</p>
<pre><code>lxc list
</code></pre>
<p>Display Container Infos</p>
<pre><code>lxc info conainer-name
</code></pre>
<p>Start / Stop</p>
<pre><code>lxc start conainer-name
</code></pre>
<p>Bash Access to Container</p>
<pre><code>lxc exec container-name bash
</code></pre>
<!--kg-card-end: markdown--><h2 id="devices">Devices</h2><!--kg-card-begin: markdown--><p>Show Devices</p>
<pre><code>lxc config device show conainer-name
</code></pre>
<p>Add Device</p>
<pre><code>lxc config device add container-name device-name disk path=/container/path source=/host/path
</code></pre>
<p>Remove Device</p>
<pre><code>lxc config device remove conainer-name device-name
</code></pre>
<!--kg-card-end: markdown--><p>Sources</p><ul><li><a href="https://linuxcontainers.org/lxd/getting-started-cli/">https://linuxcontainers.org/lxd/getting-started-cli/</a></li><li><a href="https://blog.ubuntu.com/2016/03/22/lxd-2-0-your-first-lxd-container">https://blog.ubuntu.com/2016/03/22/lxd-2-0-your-first-lxd-container</a></li></ul>]]></content:encoded></item></channel></rss>