<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SysAdmin | Luis Cacho</title><link>https://luiscachog.io/tag/sysadmin/</link><atom:link href="https://luiscachog.io/tag/sysadmin/index.xml" rel="self" type="application/rss+xml"/><description>SysAdmin</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Fri, 23 Jun 2023 00:00:00 +0000</lastBuildDate><image><url>https://luiscachog.io/media/icon_hu4fa4dbbaafd6f1b45a88958b9b4a0dd0_11007_512x512_fill_lanczos_center_3.png</url><title>SysAdmin</title><link>https://luiscachog.io/tag/sysadmin/</link></image><item><title>cURL to a specific target hostname</title><link>https://luiscachog.io/garden/curl-target-hostname/</link><pubDate>Fri, 23 Jun 2023 00:00:00 +0000</pubDate><guid>https://luiscachog.io/garden/curl-target-hostname/</guid><description>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Mockup command&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">curl -kv -H &lt;span class="s2">&amp;#34;Host: &amp;lt;target hostname&amp;gt;&amp;#34;&lt;/span> &amp;lt;protocol&amp;gt;://&amp;lt;server ip address&amp;gt;:&amp;lt;port&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Example command&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">curl -kv -H &lt;span class="s2">&amp;#34;Host: myapp.apps.example.com&amp;#34;&lt;/span> https://152.10.10.1:443
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Fix a borg lock issue</title><link>https://luiscachog.io/garden/borg-break-lock-issue/</link><pubDate>Fri, 23 Jun 2023 00:00:00 +0000</pubDate><guid>https://luiscachog.io/garden/borg-break-lock-issue/</guid><description>&lt;p>When you get the error:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Example command&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># ERROR output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">borg info ssh://asdbqw55@a3rbqwrx.repo.borg.com/./repo
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Enter passphrase &lt;span class="k">for&lt;/span> key ssh://asdbqw55@a3rbqwrx.repo.borg.com/./repo:
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Failed to create/acquire the lock /Users/lcacho/.cache/borg/34961807af9e356640e09e9973ef4664598ee6706e4c2bccc4b2770c15e09d2b/lock.exclusive &lt;span class="o">(&lt;/span>timeout&lt;span class="o">)&lt;/span>.
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Fix&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">borg break-lock ssh://asdbqw55@a3rbqwrx.repo.borg.com/./repo
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>References:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> Borg Break Lock&lt;/li>
&lt;/ul>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>&lt;a href="https://borgbackup.readthedocs.io/en/stable/usage/lock.html#borg-break-lock" target="_blank" rel="noopener">https://borgbackup.readthedocs.io/en/stable/usage/lock.html#borg-break-lock&lt;/a>&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Python Alternatives in RHEL based OS</title><link>https://luiscachog.io/garden/python-alternatives-in-rhel/</link><pubDate>Thu, 22 Jun 2023 00:00:00 +0000</pubDate><guid>https://luiscachog.io/garden/python-alternatives-in-rhel/</guid><description>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># To configure the unversioned `python` command to Python 3.11&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">alternatives --set python /usr/bin/python3.11
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># To configure the unversioned `python` command to Python 2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">alternatives --set python /usr/bin/python2
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>References:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>Configure python on RHEL8&lt;/li>
&lt;/ul>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>&lt;a href="https://access.redhat.com/solutions/5380941" target="_blank" rel="noopener">https://access.redhat.com/solutions/5380941&lt;/a>&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Change the field separator in awk</title><link>https://luiscachog.io/garden/awk-field-separator/</link><pubDate>Thu, 19 Aug 2021 00:00:00 +0000</pubDate><guid>https://luiscachog.io/garden/awk-field-separator/</guid><description>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">awk -F &lt;span class="s2">&amp;#34;:&amp;#34;&lt;/span> &lt;span class="s1">&amp;#39;{print $1}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># or if you want to do it programatically&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">awk &lt;span class="s1">&amp;#39;BEGIN { FS=&amp;#34;:&amp;#34; } { print $1 }&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># or you can also use a regular expression as a field separator.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># The following will print &amp;#34;bar&amp;#34; by using a regular expression to set the number &amp;#34;10&amp;#34; as a separator.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">echo&lt;/span> &lt;span class="s2">&amp;#34;foo 10 bar&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> awk -F&lt;span class="s1">&amp;#39;[0-9][0-9]&amp;#39;&lt;/span> &lt;span class="s1">&amp;#39;{print $2}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>MySQL Database Size</title><link>https://luiscachog.io/garden/mysql-database-size/</link><pubDate>Fri, 06 Aug 2021 00:00:00 +0000</pubDate><guid>https://luiscachog.io/garden/mysql-database-size/</guid><description>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-mysql" data-lang="mysql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">SELECT&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">table_schema&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;Database&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nf">ROUND&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nf">SUM&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">data_length&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">index_length&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">/&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">1024&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">/&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">1024&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">AS&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;Size (MB)&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">FROM&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">information_schema&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kp">TABLES&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">GROUP&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">BY&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">table_schema&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>AIX Tunning commands</title><link>https://luiscachog.io/garden/aix-tunning/</link><pubDate>Sun, 01 Aug 2021 00:00:00 +0000</pubDate><guid>https://luiscachog.io/garden/aix-tunning/</guid><description>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">no -a &amp;gt; no.txt
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">vmo -L &amp;gt; vmo.txt
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">ioo -L &amp;gt; ioo.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>My journey to become CKA and CKAD</title><link>https://luiscachog.io/my-journey-to-become-cka-and-ckad/</link><pubDate>Thu, 26 Nov 2020 00:00:00 +0000</pubDate><guid>https://luiscachog.io/my-journey-to-become-cka-and-ckad/</guid><description>&lt;p>Hi, people that read me!&lt;/p>
&lt;p>I usually don&amp;rsquo;t write about my achievements. Still, I&amp;rsquo;m proud of what I did, and in this post I want to share my journey to that back in July I passed two essential certifications for me,
the CKA (Certified Kubernetes Administrator) and the CKAD (Certified Kubernetes Application Developer).
Those certs are important to me because one of my professional goals is to apply all my knowledge as an SRE (Site Reliabilty Engineer),
so I&amp;rsquo;m putting all my effort to get trained and gain experience as I believe that Kubernetes is and will continue to be widely used by the industry I want to be part of that.&lt;/p>
&lt;p>I put a lot of hours/practice on my study lately, but my journey started probably 3 years ago, or even more time (don&amp;rsquo;t remember exacly).
Still, I remember that I become interested when I was talking with my friends &lt;a href="https://twitter.com/yazpik" target="_blank" rel="noopener">@yazpik&lt;/a> and &lt;a href="https://twitter.com/tonyskapunk" target="_blank" rel="noopener">@tonyskapunk&lt;/a>
about the new stuff that is comming on tech, by that time they were running a &lt;a href="https://www.meetup.com/Kubernetes-San-Antonio/" target="_blank" rel="noopener">Kubernetes Meetup&lt;/a>
at the &lt;a href="https://rackspace.com" target="_blank" rel="noopener">Castle&lt;/a> and I started to assist to each meetup.&lt;/p>
&lt;p>Being honest, at the begginning, I barely understand all the concepts and projects that the speakers were talking about but once I started to get involved reading blog posts,
practicing (Yeah I did the &lt;a href="https://github.com/kelseyhightower/kubernetes-the-hard-way" target="_blank" rel="noopener">&amp;lsquo;Kubernetes the Hard way&amp;rsquo;&lt;/a> on &lt;a href="https://kubernetes.io/docs/tasks/tools/install-minikube/" target="_blank" rel="noopener">minikube&lt;/a>),
also began to follow and test other exciting projects like &lt;a href="https://rancher.com/" target="_blank" rel="noopener">Rancher&lt;/a>.
So after a while, I started to understand better what the speaker was trying to communicate.
And that helps me a lot to understand not only the basics but some good projects that work in conjunction with Kubernetes.&lt;/p>
&lt;p>With all the meetings that were held on Rackspace I get involved and I wanted to keep learning more so,
I decided to assist to &lt;a href="https://events19.linuxfoundation.org/events/kubecon-cloudnativecon-north-america-2018/" target="_blank" rel="noopener">Kubecon North America 2018&lt;/a> that was held on Seattle,
and I like to think that this set of conferences opened my mind for all the Kubernetes environment,
and I feel that I need to keep learning even more about this awesome technology, that keeps me motivated to get my certifications too,
in a nutshell I feel inspired about the conferences, the comunity, everything and I want to be part of it.&lt;/p>
&lt;p>Talking about community, in that kubecon I met with some Latin-American friends that were interested in Kubernetes like
&lt;a href="https://twitter.com/domix" target="_blank" rel="noopener">@domix&lt;/a>, &lt;a href="https://twitter.com/_marKox" target="_blank" rel="noopener">@marKox&lt;/a>,both from México, and &lt;a href="https://twitter.com/EdduMelendez" target="_blank" rel="noopener">@EdduMelendez&lt;/a> from Peru,
that from their trenches they are trying to grow the Kubernetes community on Spanish.&lt;/p>
&lt;figure id="figure-kubecon-2018">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Mexicanos in Kubecon 2018"
src="https://luiscachog.io/media/posts/my-journey-to-become-a-cka-and-ckad/kubecon-2018.gif"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Mexicanos in Kubecon 2018
&lt;/figcaption>&lt;/figure>
&lt;p>But returning to my certifications path, after a while I decided that I will have the certs by the end on this year, so back in March I get more serious studying and purchased the excellent course
&lt;a href="https://kodekloud.com/courses/certified-kubernetes-administrator-cka/" target="_blank" rel="noopener">Certified Kubernetes Administrator (CKA) with Practice Tests&lt;/a> a course by
&lt;a href="https://twitter.com/mmumshad" target="_blank" rel="noopener">Mumshad Mannambeth&lt;/a> that I highly recommend to reinforce the theory and also,
becasue includes exercises similar to the exam that you can practice.&lt;/p>
&lt;p>Once I feelt confident in me and my knowledge I get my coupon to present the CKA exam, and I passed!&lt;/p>
&lt;figure id="figure-cka-cert">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="My CKA Certification" srcset="
/media/posts/my-journey-to-become-a-cka-and-ckad/cka_hu0f32465aeb1b84b477b34e639cca04fc_5358425_d9b14c1de3eff13616047bd87d1eaa9e.webp 400w,
/media/posts/my-journey-to-become-a-cka-and-ckad/cka_hu0f32465aeb1b84b477b34e639cca04fc_5358425_1d053af47cb5d7f80e5481ce9b01cdbc.webp 760w,
/media/posts/my-journey-to-become-a-cka-and-ckad/cka_hu0f32465aeb1b84b477b34e639cca04fc_5358425_1200x1200_fit_q90_h2_lanczos_3.webp 1200w"
src="https://luiscachog.io/media/posts/my-journey-to-become-a-cka-and-ckad/cka_hu0f32465aeb1b84b477b34e639cca04fc_5358425_d9b14c1de3eff13616047bd87d1eaa9e.webp"
width="760"
height="587"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
My CKA Certification
&lt;/figcaption>&lt;/figure>
&lt;p>I need tell you, it wasn&amp;rsquo;t easy, mostly because you need to be careful with the time/value of the questions and you need to weigh to reach the passing score, for this exam it was 74%.&lt;/p>
&lt;p>Of course after I get the CKA certitification, I was super happy but on my train of thoughts, I keep thinking that I can use the CKA study as leverage to get the CKAD.&lt;/p>
&lt;p>I already have the fundamentals of a CKA and just need some extra study to complement the CKAD curriculum, so I got commited (my wife too),
and right away I got my CKAD exam coupon and I scheduled the test 2 weeks appart after I decided to get the cert
(That&amp;rsquo;s 3 weeks appart after I took the CKA exam).&lt;/p>
&lt;p>My approach works, I passed the CKAD certification!&lt;/p>
&lt;figure id="figure-ckad-cert">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="My CKAD Certification" srcset="
/media/posts/my-journey-to-become-a-cka-and-ckad/ckad_hu65ed50906ed16f3f565df85d46351117_5396439_83eca461f641ce40130efa967122fba7.webp 400w,
/media/posts/my-journey-to-become-a-cka-and-ckad/ckad_hu65ed50906ed16f3f565df85d46351117_5396439_cd6e3a6afba04723f90ddae290c0ab1d.webp 760w,
/media/posts/my-journey-to-become-a-cka-and-ckad/ckad_hu65ed50906ed16f3f565df85d46351117_5396439_1200x1200_fit_q90_h2_lanczos_3.webp 1200w"
src="https://luiscachog.io/media/posts/my-journey-to-become-a-cka-and-ckad/ckad_hu65ed50906ed16f3f565df85d46351117_5396439_83eca461f641ce40130efa967122fba7.webp"
width="760"
height="587"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
My CKAD Certification
&lt;/figcaption>&lt;/figure>
&lt;p>Now that I&amp;rsquo;m certified on Kubernetes I will look to be more involved in Cloud Native initiatives on my company,
to apply the knowledge that I already have on current or new projects, and as always keep learning!&lt;/p></description></item><item><title>Backing Up a Ruckus Switch Config</title><link>https://luiscachog.io/backing-up-ruckus-config/</link><pubDate>Sat, 21 Nov 2020 00:00:00 +0000</pubDate><guid>https://luiscachog.io/backing-up-ruckus-config/</guid><description>&lt;p>I want to do some changes on my home network to improve the performance, so I will implement VLANs on my network.
But before I do that I want to document how to perform a backup of my Ruckus ICX 7150 Switch.&lt;/p>
&lt;p>In a &lt;a href="https://luiscachog.io/configure-ruckus-switch/">past post&lt;/a> I mentioned how to enable ssh and web cofiguration on the Ruckus switch,
so my first attemtp was to download the configuration file from the web interface but unfortunately it is not possible to do it, there is not an option for that.
What I did is go to the &lt;a href="http://docs.ruckuswireless.com/fastiron/hardware/icx7150-installguide/GUID-25306120-376C-44B2-BAE7-3D969EC889A3.html" target="_blank" rel="noopener">documentation&lt;/a>
and found the &lt;code>copy&lt;/code> command but I need a &lt;a href="https://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol" target="_blank" rel="noopener">TFTP server&lt;/a> to be able to download the backup file.&lt;/p>
&lt;p>Let&amp;rsquo;s start!&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Install a TFTP server - This is easy will depend on your Operative System, for my is an ArchLinux laptop.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">yay -Sy atftp
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The configuration file for atftp is &lt;code>/etc/conf.d/atftpd&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Next step, is login on your Ruckus switch and perform the copy command:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">ssh &amp;lt;USER&amp;gt;@&amp;lt;SWITCH-IP&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">copy running-config tftp &amp;lt;TFTP-SERVER-IP&amp;gt; myconfig.cfg
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">#In my case is:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">ssh ruckus@192.168.50.5
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">copy running-config tftp 192.168.50.4 myconfig.cfg
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Verify that the file is on your TFTP server, by default, the configured directory for atftp is &lt;code>/srv/atftp/&lt;/code> so you should go that location and verify that the generated file is created.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">cd&lt;/span> /srv/atftp
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">ls -la
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;/ol>
&lt;p>That&amp;rsquo;s all, you can restore your switch configuration if needed.&lt;/p>
&lt;p>Bye!&lt;/p></description></item><item><title>Gestion de History</title><link>https://luiscachog.io/gestion-de-history/</link><pubDate>Tue, 03 Dec 2019 00:00:00 +0000</pubDate><guid>https://luiscachog.io/gestion-de-history/</guid><description>&lt;details class="toc-inpage d-print-none " open>
&lt;summary class="font-weight-bold">Table of Contents&lt;/summary>
&lt;nav id="TableOfContents">
&lt;ul>
&lt;li>&lt;a href="#mostrar-la-fecha-y-hora-de-cuando-escribimos-comandos">Mostrar la fecha y hora de cuando escribimos comandos&lt;/a>&lt;/li>
&lt;li>&lt;a href="#control-del-tamaño-del-archivo-de-logs-histórico">Control del tamaño del archivo de logs histórico&lt;/a>
&lt;ul>
&lt;li>&lt;a href="#control-de-duplicados-en-el-histórico">Control de duplicados en el histórico&lt;/a>&lt;/li>
&lt;li>&lt;a href="#path-para-guardar-el-archivo-de-logs-histórico">Path para guardar el archivo de logs histórico&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/nav>
&lt;/details>
&lt;p>El archivo de logs histórico (history) tiene varias opciones que podemos cambiar para tener un mejor control del mismo.
Aquí vamos a ver algunas opciones para el control y gestión del fichero del log histórico (history).&lt;/p>
&lt;h2 id="mostrar-la-fecha-y-hora-de-cuando-escribimos-comandos">Mostrar la fecha y hora de cuando escribimos comandos&lt;/h2>
&lt;p>Para mostrar la fecha y hora en el formato que requieras puedes agregas las lineas siguientes:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">export&lt;/span> &lt;span class="nv">HISTTIMEFORMAT&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s1">&amp;#39;- %F %T - &amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="control-del-tamaño-del-archivo-de-logs-histórico">Control del tamaño del archivo de logs histórico&lt;/h2>
&lt;p>Tenemos dos variables de entorno para ello, &lt;em>HISTSIZE&lt;/em> y &lt;em>HISTFILESIZE&lt;/em>, que indican el tamaño del fichero, por ejemplo:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">HISTSIZE&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">1000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">HISTFILESIZE&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">1000&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Con esto hacemos que el tamaño máximo del fichero de logs histórico sea de 1000 comandos o líneas.&lt;/p>
&lt;div class="alert alert-note">
&lt;div>
&lt;p>Si ponemos el tamaño de la variable &lt;em>HISTSIZE&lt;/em> a &lt;strong>cero&lt;/strong> hacemos que no se guarde nada en el archivo de logs histórico&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">export&lt;/span> &lt;span class="nv">HISTSIZE&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">0&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/div>
&lt;/div>
&lt;h3 id="control-de-duplicados-en-el-histórico">Control de duplicados en el histórico&lt;/h3>
&lt;p>En el log histórico se van guardando &lt;strong>TODOS&lt;/strong> los comandos que se van introduciendo aunque repitamos 20 veces el mismo comando, se guardará 20 veces, lo cual es en ocasiones una perdida de espacio.
Por lo que podemos usar la variable &lt;em>HISTCONTROL&lt;/em> para hacer 2 cosas:&lt;/p>
&lt;ul>
&lt;li>Eliminar los duplicados consecutivos con &lt;em>ignoredups&lt;/em>.&lt;/li>
&lt;li>Eliminar los duplicados sean o no consecutivos con &lt;em>erasedups&lt;/em>.&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">HISTCONTROL&lt;/span>&lt;span class="o">=&lt;/span>ignoredups
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">HISTCONTROL&lt;/span>&lt;span class="o">=&lt;/span>erasedups
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="path-para-guardar-el-archivo-de-logs-histórico">Path para guardar el archivo de logs histórico&lt;/h3>
&lt;p>Por defecto el histórico se guarda en &lt;code>~/.bash_history&lt;/code> pero podemos indicar donde guardarlo con la variable &lt;em>HISTFILE&lt;/em>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">HISTFILE&lt;/span>&lt;span class="o">=&lt;/span>~/.bitacora.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Un truco muy bueno cuando en un mismo servidor entran varios administradores que se pasan a root y poder controlar y guardar que hace cada uno es:
Guardar un archivo de logs histórico por cada uno de ellos.
Lo puedes hacer de la siguiente forma:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">HISTSIZE&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">5000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">HISTFILESIZE&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">5000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">HISTFILE&lt;/span>&lt;span class="o">=&lt;/span>/root/.bash_hist-&lt;span class="k">$(&lt;/span>who am i &lt;span class="p">|&lt;/span> awk &lt;span class="s1">&amp;#39;{print $1}&amp;#39;&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="nb">exit&lt;/span>&lt;span class="k">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Con esto se guardará en el home de del usuario root un archivo de logs histórico por cada uno de los usuarios que se hayan pasado a root.
El tamaño se puede ampliar o reducir a gusto. También podemos poner que ignore duplicados.&lt;/p>
&lt;p>Todas estas variables debemos ponerlas en un archivo donde se activen al arranque que puede ser &lt;code>~/.bashrc&lt;/code>.&lt;/p>
&lt;p>Espero les sea útilidad.&lt;/p>
&lt;p>&amp;#x1f604;&lt;/p></description></item><item><title>Docker Login the Right Way</title><link>https://luiscachog.io/docker-login-the-right-way/</link><pubDate>Wed, 15 May 2019 00:00:00 +0000</pubDate><guid>https://luiscachog.io/docker-login-the-right-way/</guid><description>&lt;details class="toc-inpage d-print-none " open>
&lt;summary class="font-weight-bold">Table of Contents&lt;/summary>
&lt;nav id="TableOfContents">
&lt;ul>
&lt;li>&lt;a href="#credential-store">Credential Store&lt;/a>&lt;/li>
&lt;li>&lt;a href="#docker-credential-helpers">Docker Credential Helpers&lt;/a>&lt;/li>
&lt;li>&lt;a href="#docker-credential-secret-service">docker-credential-secret service&lt;/a>&lt;/li>
&lt;/ul>
&lt;/nav>
&lt;/details>
&lt;h1 id="docker-login-the-right-way">Docker Login the right Way&lt;/h1>
&lt;p>Hi again!&lt;/p>
&lt;p>It is been a while since I wrote something here, as always, there is no much time for a hobby.&lt;/p>
&lt;p>I&amp;rsquo;ve been working for a while with docker, not a production level, but for some applications that I use at work.
And since the &lt;a href="https://www.zdnet.com/article/docker-hub-hack-exposed-data-of-190000-users/" target="_blank" rel="noopener">Docker Hub Data breach&lt;/a>
I put more atention on the security of my data/credentials, so I investigate a little about and found this official
repository &lt;a href="https://github.com/docker/docker-credential-helpers/" target="_blank" rel="noopener">https://github.com/docker/docker-credential-helpers/&lt;/a> from Docker where are the supported credential helpers.&lt;/p>
&lt;h2 id="credential-store">Credential Store&lt;/h2>
&lt;p>Docker keeps our credentials saved on a JSON file located on &lt;code>~/.docker/config.json&lt;/code>,
but unfortunatelly credentials are just encrypted on base64,
here is an &lt;a href="https://fosdem.org/2019/schedule/event/base64_not_encryption/" target="_blank" rel="noopener">articule/video&lt;/a> where there is an explanation for the why it is a bad idea to just use base64 encryption.&lt;/p>
&lt;p>The following is a diagram on how a plain text storage works:&lt;/p>
&lt;figure id="figure-docker-plain-text-storage">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Plain Text Storage" srcset="
/media/posts/docker-login-the-right-way/DockerPlainTextCredentials_hu371181661409e61f690ceccfb695d5d5_82530_0db582c8916ffc5cd1b1225c42276838.webp 400w,
/media/posts/docker-login-the-right-way/DockerPlainTextCredentials_hu371181661409e61f690ceccfb695d5d5_82530_b27b4b3bd220158c0d85a61a2d4ae88b.webp 760w,
/media/posts/docker-login-the-right-way/DockerPlainTextCredentials_hu371181661409e61f690ceccfb695d5d5_82530_1200x1200_fit_q90_h2_lanczos_3.webp 1200w"
src="https://luiscachog.io/media/posts/docker-login-the-right-way/DockerPlainTextCredentials_hu371181661409e61f690ceccfb695d5d5_82530_0db582c8916ffc5cd1b1225c42276838.webp"
width="760"
height="570"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Plain Text Storage
&lt;/figcaption>&lt;/figure>
&lt;p>Here is an example on how &lt;code>~/.docker/config.json&lt;/code> looks like when is using plain text credentials:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">cat ~/.docker/config.json
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;auths&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;https://index.docker.io/v1/&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;auth&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;azRjaDA6c3VwZXJzZWNyZXRwYXNzd29yZAo=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>,
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;quay.io&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;auth&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;azRjaDA6c3VwZXJzZWNyZXRwYXNzd29yZAo=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>,
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;HttpHeaders&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;User-Agent&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;Docker-Client/18.09.6 (linux)&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>After a successful &lt;code>docker login&lt;/code> command,
Docker stores a base64 encoded string from the concatenation of the username, a colon, and the password and associates this string to the registry the user is logging into:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">$ &lt;span class="nb">echo&lt;/span> &lt;span class="nv">azRjaDA6c3VwZXJzZWNyZXRwYXNzd29yZAo&lt;/span>&lt;span class="o">=&lt;/span> &lt;span class="p">|&lt;/span> base64 -d -
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">luiscachog:supersecretpassword
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>A &lt;code>docker logout&lt;/code> command removes the entry from the JSON file for the given registry:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">$ docker &lt;span class="nb">logout&lt;/span> quay.io
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Remove login credentials &lt;span class="k">for&lt;/span> quay.io
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ cat ~/.docker/config.json
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;auths&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;https://index.docker.io/v1/&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;auth&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;azRjaDA6c3VwZXJzZWNyZXRwYXNzd29yZAo=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>,
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;HttpHeaders&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;User-Agent&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;Docker-Client/18.09.6 (linux)&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="docker-credential-helpers">Docker Credential Helpers&lt;/h2>
&lt;p>Since docker version &lt;code>1.11&lt;/code> implements support from an external credential store for registry authentication.
That means we can use a native keychain of the OS. Using an external store is more secure than storing on a &amp;ldquo;plain text&amp;rdquo; Docker configuration file.&lt;/p>
&lt;figure id="figure-docker-secure-storage">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Secure Storage" srcset="
/media/posts/docker-login-the-right-way/DockerSecureCredentials_huadaed0eecd0771dd576c62f4a77f8685_87803_dfab2c86655b67a2dd7b453f742b7daa.webp 400w,
/media/posts/docker-login-the-right-way/DockerSecureCredentials_huadaed0eecd0771dd576c62f4a77f8685_87803_67d1fdd1b117feb8b3cab43352b4a5be.webp 760w,
/media/posts/docker-login-the-right-way/DockerSecureCredentials_huadaed0eecd0771dd576c62f4a77f8685_87803_1200x1200_fit_q90_h2_lanczos_3.webp 1200w"
src="https://luiscachog.io/media/posts/docker-login-the-right-way/DockerSecureCredentials_huadaed0eecd0771dd576c62f4a77f8685_87803_dfab2c86655b67a2dd7b453f742b7daa.webp"
width="760"
height="543"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Secure Storage
&lt;/figcaption>&lt;/figure>
&lt;p>In order to use a external credential store, we need a program to interact with.&lt;/p>
&lt;p>The actual list of &amp;ldquo;official&amp;rdquo; Docker Credential Helper is:&lt;/p>
&lt;ol>
&lt;li>docker-credential-osxkeychain: Provides a helper to use the OS X keychain as credentials store.&lt;/li>
&lt;li>docker-credential-secretservice: Provides a helper to use the D-Bus secret service as credentials store.&lt;/li>
&lt;li>docker-credential-wincred: Provides a helper to use Windows credentials manager as store.&lt;/li>
&lt;li>docker-credential-pass: Provides a helper to use pass as credentials store.&lt;/li>
&lt;/ol>
&lt;h2 id="docker-credential-secret-service">docker-credential-secret service&lt;/h2>
&lt;p>On this post we will explore the docker-credential-secretservice and how to configure it.&lt;/p>
&lt;ol>
&lt;li>
&lt;p>We need to download and install the helper.
You can find the lastest release on &lt;a href="https://github.com/docker/docker-credential-helpers/releases" target="_blank" rel="noopener">https://github.com/docker/docker-credential-helpers/releases&lt;/a>.
Download it, extract it and make it executable.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">wget https://github.com/docker/docker-credential-helpers/releases/download/v0.6.2/docker-credential-secretservice-v0.6.2-amd64.tar.gz
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">tar -xf docker-credential-secretservice-v0.6.2-amd64.tar.gz
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">chmod +x docker-credential-secretservice
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo mv docker-credential-secretservice /usr/local/bin/
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Then, we need to specify the credential store in the file &lt;code>~/.docker/config.json&lt;/code> to tell docker to use it.
The value must be the one after the prefix &lt;code>docker-credential-&lt;/code>. In this case:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;credsStore&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;secretservice&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>To facilite the configuration and do not make mistakes, you can run:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">sed -i &lt;span class="s1">&amp;#39;0,/{/s/{/{\n\t&amp;#34;credsStore&amp;#34;: &amp;#34;secretservice&amp;#34;,/&amp;#39;&lt;/span> ~/.docker/config.json
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;/ol>
&lt;p>From now we are uning an external store, so if you are currently logged in, you must run &lt;code>docker logout&lt;/code> to remove the credentials from the file and run &lt;code>docker login&lt;/code> tostart using the new ones.&lt;/p>
&lt;p>Let me know how this works for you.&lt;/p>
&lt;p>&lt;strong>References:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Docker Credential Helpers repository&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/li>
&lt;li>Docker Credential Store Documentation&lt;sup id="fnref:2">&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref">2&lt;/a>&lt;/sup>&lt;/li>
&lt;li>Slides about this topic &lt;sup id="fnref:3">&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref">3&lt;/a>&lt;/sup>&lt;/li>
&lt;/ul>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>&lt;a href="https://github.com/docker/docker-credential-helpers" target="_blank" rel="noopener">Docker Credential Helpers&lt;/a>&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;li id="fn:2">
&lt;p>&lt;a href="https://docs.docker.com/engine/reference/commandline/login/#credentials-store" target="_blank" rel="noopener">docker cli documentation&lt;/a>&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;li id="fn:3">
&lt;p>&lt;a href="https://www.slideshare.net/DavidYeung22/can-we-stop-saving-docker-credentials-in-plain-text-now" target="_blank" rel="noopener">Stop saving credential tokens in text files&lt;/a>&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Bulk Delete Rackspace Cloud Files data via API</title><link>https://luiscachog.io/bulk-delete-cloud-files-api/</link><pubDate>Wed, 13 Feb 2019 00:00:00 +0000</pubDate><guid>https://luiscachog.io/bulk-delete-cloud-files-api/</guid><description>&lt;p>Sometimes it is necessary to delete all the content of the Cloud Files containers, however, the API does not have a proper method to delete the data and the containers on the same API call.
Also, accoring to the documentation, you can only delete &lt;strong>empty&lt;/strong> containers.&lt;/p>
&lt;p>So, in cases where you need to delete the &lt;strong>data and the containers&lt;/strong> at the same time, you should follow the next steps:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Download &lt;a href="https://github.com/cloudnull/turbolift" target="_blank" rel="noopener">Turbolift&lt;/a>, I know it is an old tool.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">git clone https://github.com/cloudnull/turbolift
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">cd&lt;/span> turbolift
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>In order to get and isolated installation, we are going to create a Python Virtual Environment (virtualenv)&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">mkvirtualenv turbolift
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">workon turbolift
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Install the tool&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">pip install turbolift
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Now, prior to start to play with the API calls, we need to grab some data to authenticate with the API:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Variable&lt;/th>
&lt;th>Definition&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>USERNAME&lt;/td>
&lt;td>This is the Rackspace Public Cloud username&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>APIKEY&lt;/td>
&lt;td>This is your API-KEY&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>REGION&lt;/td>
&lt;td>This is the Region where the Cloud Files are located (dfw, ord, iad, lon, hkg)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>TOKEN&lt;/td>
&lt;td>The TOKEN is generated after you get authenticated&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ENDPOINT&lt;/td>
&lt;td>This ENDPOINT is given also after you get authenticated&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/li>
&lt;li>
&lt;p>Next step, we are going to use &lt;a href="https://curl.haxx.se/" target="_blank" rel="noopener">cURL&lt;/a>, to perform all the API calls:&lt;/p>
&lt;ul>
&lt;li>First of all, get the TOKEN:&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">USERNAME&lt;/span>&lt;span class="o">=&lt;/span>YOUR-USERNAME
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">APIKEY&lt;/span>&lt;span class="o">=&lt;/span>YOUR-APIKEY
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">TOKEN&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="k">$(&lt;/span>curl -s -XPOST https://identity.api.rackspacecloud.com/v2.0/tokens &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d&lt;span class="s1">&amp;#39;{&amp;#34;auth&amp;#34;:{&amp;#34;RAX-KSKEY:apiKeyCredentials&amp;#34;:{&amp;#34;username&amp;#34;:&amp;#34;&amp;#39;&lt;/span>&lt;span class="nv">$USERNAME&lt;/span>&lt;span class="s1">&amp;#39;&amp;#34;,&amp;#34;apiKey&amp;#34;:&amp;#34;&amp;#39;&lt;/span>&lt;span class="nv">$APIKEY&lt;/span>&lt;span class="s1">&amp;#39;&amp;#34;}}}&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -H&lt;span class="s2">&amp;#34;Content-type:application/json&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.access.token.id&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> tr -d &lt;span class="s2">&amp;#34;\&amp;#34;&amp;#34;&lt;/span>&lt;span class="k">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Next step, get the ENDPOINT:&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nv">ENDPOINT&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="k">$(&lt;/span>curl -s -XPOST https://identity.api.rackspacecloud.com/v2.0/tokens &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d&lt;span class="s1">&amp;#39;{&amp;#34;auth&amp;#34;:{&amp;#34;RAX-KSKEY:apiKeyCredentials&amp;#34;:{&amp;#34;username&amp;#34;:&amp;#34;&amp;#39;&lt;/span>&lt;span class="nv">$CL_USERNAME&lt;/span>&lt;span class="s1">&amp;#39;&amp;#34;,&amp;#34;apiKey&amp;#34;:&amp;#34;&amp;#39;&lt;/span>&lt;span class="nv">$APIKEY&lt;/span>&lt;span class="s1">&amp;#39;&amp;#34;}}}&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -H&lt;span class="s2">&amp;#34;Content-type:application/json&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.access.serviceCatalog[] | select((.name==&amp;#34;cloudFiles&amp;#34;) or (.name==&amp;#34;cloudFilesCDN&amp;#34;)) | {name} + .
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> endpoints[] | .publicURL&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> tr -d &lt;span class="s2">&amp;#34;\&amp;#34;&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> grep -v cdn &lt;span class="p">|&lt;/span> grep -i &lt;span class="nv">$REGION&lt;/span>&lt;span class="k">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In this case we are skipping all te CDN endpoints, but you can add them if is necessary.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>With all the collected data, next step is use turbolift to delete the Cloud Files container and their data. To do it, I use a for-loop:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="k">for&lt;/span> i in &lt;span class="k">$(&lt;/span>curl -s -H &lt;span class="s2">&amp;#34;X-Auth-Token: &lt;/span>&lt;span class="nv">$TOKEN&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="nv">$ENDPOINT&lt;/span>&lt;span class="k">)&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="k">do&lt;/span> turbolift -u &lt;span class="nv">$USERNAME&lt;/span> -a &lt;span class="nv">$APIKEY&lt;/span> --os-rax-auth &lt;span class="nv">$REGION&lt;/span> delete -c &lt;span class="nv">$i&lt;/span> &lt;span class="p">;&lt;/span> &lt;span class="k">done&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;/ol>
&lt;p>Now, you have all the Data and Cloud Files containers deleted on one region.&lt;/p>
&lt;p>&amp;#x1f604;&lt;/p></description></item><item><title>Configure SSH on a Ruckus Switch</title><link>https://luiscachog.io/configure-ruckus-switch/</link><pubDate>Tue, 20 Nov 2018 00:00:00 +0000</pubDate><guid>https://luiscachog.io/configure-ruckus-switch/</guid><description>&lt;p>I just have a Ruckus ICX 7150 Switch on my home and I&amp;rsquo;m trying to get access under ssh and web, to easy configuration and security instead of use telnet.
So, I logged in using telnet and then run the following commands to configure a username/password and begin to receive petitions over port 22(ssh) and port 443(https).
Let&amp;rsquo;s begin!&lt;/p>
&lt;ol>
&lt;li>
&lt;p>We will connect via telnet to the switch.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">telnet SWITCH_IP
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Once we are on the Switch CLI as a optional step, we can configure an IP on the switch.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">device&amp;gt; &lt;span class="nb">enable&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">device# configure terminal
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">device&lt;span class="o">(&lt;/span>config&lt;span class="o">)&lt;/span>&lt;span class="c1"># ip address IP_ADDRESS/CIDR&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">device&lt;span class="o">(&lt;/span>config&lt;span class="o">)&lt;/span>&lt;span class="c1"># ip default-gateway IP_GATEWAY&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Now, the next steps are for generate a SSL certificate, a username/password, activate password to login and enable thw web access and ssh access.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">device&lt;span class="o">(&lt;/span>config&lt;span class="o">)&lt;/span>&lt;span class="c1"># crypto-ssl certificate generate&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">device&lt;span class="o">(&lt;/span>config&lt;span class="o">)&lt;/span>&lt;span class="c1"># username USERNAME password PASSWORD&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">device&lt;span class="o">(&lt;/span>config&lt;span class="o">)&lt;/span>&lt;span class="c1"># aaa authentication login default local&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">device&lt;span class="o">(&lt;/span>config&lt;span class="o">)&lt;/span>&lt;span class="c1"># aaa authentication web-server default local&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>It may take several minutes to generate the certificate key. After that, save the configuration.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">device&lt;span class="o">(&lt;/span>config&lt;span class="o">)&lt;/span>&lt;span class="c1"># write memory&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;/ol>
&lt;p>Now you are able to login on your switch using ssh or web.&lt;/p>
&lt;p>&lt;strong>References:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Blog with ruckus commands &lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/li>
&lt;/ul>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>&lt;a href="https://docs.ruckuswireless.com/fastiron/08.0.50/fastiron-08050-commandref/GUID-E60DB55B-5E68-40EC-A999-73C6C071EFF7.html" target="_blank" rel="noopener">Ruckus ICX7150-C12P – Initial Configuration&lt;/a>&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Set a hugo blog on Kubernetes</title><link>https://luiscachog.io/blog-hugo-docker-k8s-quay/</link><pubDate>Mon, 18 Jun 2018 00:00:00 +0000</pubDate><guid>https://luiscachog.io/blog-hugo-docker-k8s-quay/</guid><description>&lt;details class="toc-inpage d-print-none " open>
&lt;summary class="font-weight-bold">Table of Contents&lt;/summary>
&lt;nav id="TableOfContents">
&lt;ul>
&lt;li>&lt;a href="#overview">Overview&lt;/a>
&lt;ul>
&lt;li>&lt;a href="#architecture">Architecture&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;a href="#containerized">Containerized&lt;/a>
&lt;ul>
&lt;li>&lt;a href="#dockerfile">Dockerfile&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/nav>
&lt;/details>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>Since last year I been trying to become an SRE (Site Reliability Engineer), so I been involved with some emerging technologies, like ansible, docker and on this time with kubernetes.&lt;/p>
&lt;p>This time, I will try to explain how I containerized my blog using:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.docker.com/" target="_blank" rel="noopener">Docker&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://kubernetes.io/" target="_blank" rel="noopener">Kubernetes&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://quay.io/" target="_blank" rel="noopener">Quay&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com" target="_blank" rel="noopener">Git&lt;/a>&lt;/li>
&lt;/ul>
&lt;h3 id="architecture">Architecture&lt;/h3>
&lt;p>So, I take some ideas from &lt;a href="https://www.civo.com/learn/using-civo-k3s-service-to-host-your-blog-in-hugo-using-github-actions" target="_blank" rel="noopener">here&lt;/a> and I modify them and adapt the architecture described to my options.&lt;/p>
&lt;p>The principal changes that I made are:&lt;/p>
&lt;ul>
&lt;li>My Kubernetes cluster is running on 2 cloud server on Rackspace Public Cloud&lt;/li>
&lt;li>The container registry that I&amp;rsquo;m using is Quay&lt;/li>
&lt;li>Rackspace Public Cloud does not support a Kubernetes LoadBalancer service automatically,
so I simulate that behavior adding a Cloud Load Balancer manually after the Kubernetes service provide me the port.&lt;/li>
&lt;/ul>
&lt;figure id="figure-blog-hugo-architecture">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Architecture" srcset="
/media/posts/blog-hugo-docker-k8s-quay/architecture_hu8b96b5b52b85b051d387a2869880f3ab_113861_90038fb3c81eb33b4ff587d44167dbfc.webp 400w,
/media/posts/blog-hugo-docker-k8s-quay/architecture_hu8b96b5b52b85b051d387a2869880f3ab_113861_422b03095e3febbbd91dbb98eee4f1ca.webp 760w,
/media/posts/blog-hugo-docker-k8s-quay/architecture_hu8b96b5b52b85b051d387a2869880f3ab_113861_1200x1200_fit_q90_h2_lanczos_3.webp 1200w"
src="https://luiscachog.io/media/posts/blog-hugo-docker-k8s-quay/architecture_hu8b96b5b52b85b051d387a2869880f3ab_113861_90038fb3c81eb33b4ff587d44167dbfc.webp"
width="760"
height="486"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Architecture
&lt;/figcaption>&lt;/figure>
&lt;h2 id="containerized">Containerized&lt;/h2>
&lt;p>I use &lt;a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo&lt;/a> to deploy my blog, I used to do it as mentioned on &lt;a href="https://luiscachog.io/deployment-hugo-site-git-hooks/" target="_blank" rel="noopener">this&lt;/a> previous post (In Spanish).&lt;/p>
&lt;p>Now, as a part of containerize the blog it make sense to me to create two stages as described &lt;a href="https://www.civo.com/learn/using-civo-k3s-service-to-host-your-blog-in-hugo-using-github-actions" target="_blank" rel="noopener">here&lt;/a>:&lt;/p>
&lt;ul>
&lt;li>The first stage is a defined build environment containing all required build tools (hugo, pygments) and the source of the website (Git repository).&lt;/li>
&lt;li>The second stage is the build artifact (HTML and assets), from the first stage and a webserver to serve the artifact over HTTP.&lt;/li>
&lt;/ul>
&lt;h3 id="dockerfile">Dockerfile&lt;/h3>
&lt;p>Here is the Dockerfile that containerize the blog:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">FROM ubuntu:latest as STAGEONE
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># install hugo&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">ENV &lt;span class="nv">HUGO_VERSION&lt;/span>&lt;span class="o">=&lt;/span>0.41
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">ADD https://github.com/gohugoio/hugo/releases/download/v&lt;span class="si">${&lt;/span>&lt;span class="nv">HUGO_VERSION&lt;/span>&lt;span class="si">}&lt;/span>/hugo_&lt;span class="si">${&lt;/span>&lt;span class="nv">HUGO_VERSION&lt;/span>&lt;span class="si">}&lt;/span>_Linux-64bit.tar.gz /tmp/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">RUN tar -xf /tmp/hugo_&lt;span class="si">${&lt;/span>&lt;span class="nv">HUGO_VERSION&lt;/span>&lt;span class="si">}&lt;/span>_Linux-64bit.tar.gz -C /usr/local/bin/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># install syntax highlighting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">RUN apt-get update
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">RUN apt-get install -y python3-pygments
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># build site&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">COPY &lt;span class="nb">source&lt;/span> /source
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">RUN hugo --source&lt;span class="o">=&lt;/span>/source/ --destination&lt;span class="o">=&lt;/span>/public/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">FROM nginx:stable-alpine
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">RUN apk --update add curl bash
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">RUN rm /etc/nginx/conf.d/default.conf
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">COPY modules/nginx.luiscachog.io.conf /etc/nginx/conf.d/luiscachog.io.conf
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">COPY --from&lt;span class="o">=&lt;/span>STAGEONE /public/ /usr/share/nginx/html/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">EXPOSE &lt;span class="m">80&lt;/span> &lt;span class="m">443&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">MAINTAINER Luis Cacho &amp;lt;luiscachog@gmail.com&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="first-stage">First Stage&lt;/h4>
&lt;ul>
&lt;li>Fetch the lastest Ubuntu image and name as &lt;strong>STAGEONE&lt;/strong>&lt;/li>
&lt;li>Install the last available &lt;strong>hugo&lt;/strong> version from source.&lt;/li>
&lt;li>Install &lt;strong>pygments&lt;/strong> library to use it for highlighting.&lt;/li>
&lt;li>Build the site with &lt;strong>hugo&lt;/strong> and the output is set on &lt;strong>/public&lt;/strong> as a build artifact.&lt;/li>
&lt;/ul>
&lt;h4 id="second-stage">Second Stage&lt;/h4>
&lt;ul>
&lt;li>Fetch the lastest stable nginx alpine image.&lt;/li>
&lt;li>Update the image and install some utilities.&lt;/li>
&lt;li>Delete the &lt;strong>default&lt;/strong> nginx configuration file.&lt;/li>
&lt;li>Copy the configuration files needed from the repository root directory.&lt;/li>
&lt;li>Copy the build artifact &lt;strong>/public&lt;/strong> from the previous stage (&lt;strong>STAGEONE&lt;/strong>)&lt;/li>
&lt;/ul></description></item><item><title>My First Contribution to OpenStack project</title><link>https://luiscachog.io/my-first-contribution-to-openstack/</link><pubDate>Thu, 15 Mar 2018 00:00:00 +0000</pubDate><guid>https://luiscachog.io/my-first-contribution-to-openstack/</guid><description>&lt;p>I been working since last year using &lt;a href="https://www.ansible.com/" target="_blank" rel="noopener">Ansible&lt;/a> for fun and to trying to get prepared to become a DevOps, so I found an excelent OpenStack project called &lt;a href="https://github.com/openstack/ara" target="_blank" rel="noopener">ARA Records Ansible&lt;/a>.&lt;/p>
&lt;figure id="figure-ansible-logo">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Ansible Logo" srcset="
/media/posts/my-first-contribution-to-openstack/Ansible-Logo_hub884469535c087589ce6d86f0418926d_8020_e8654a6c9737fb6cf9a9d6a845d8f829.webp 400w,
/media/posts/my-first-contribution-to-openstack/Ansible-Logo_hub884469535c087589ce6d86f0418926d_8020_34c2626c3a799dab177de63acc44cc35.webp 760w,
/media/posts/my-first-contribution-to-openstack/Ansible-Logo_hub884469535c087589ce6d86f0418926d_8020_1200x1200_fit_q90_h2_lanczos_3.webp 1200w"
src="https://luiscachog.io/media/posts/my-first-contribution-to-openstack/Ansible-Logo_hub884469535c087589ce6d86f0418926d_8020_e8654a6c9737fb6cf9a9d6a845d8f829.webp"
width="760"
height="760"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Ansible Logo
&lt;/figcaption>&lt;/figure>
&lt;figure id="figure-ara-logo">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="ARA Logo" srcset="
/media/posts/my-first-contribution-to-openstack/ARA-Logo_hu17e4256629a5c6ba45baa8e753225cf6_37253_b02dfcb5baf4780ab653a7834a9e4c0a.webp 400w,
/media/posts/my-first-contribution-to-openstack/ARA-Logo_hu17e4256629a5c6ba45baa8e753225cf6_37253_303171032104318092c9459674593e15.webp 760w,
/media/posts/my-first-contribution-to-openstack/ARA-Logo_hu17e4256629a5c6ba45baa8e753225cf6_37253_1200x1200_fit_q90_h2_lanczos_3.webp 1200w"
src="https://luiscachog.io/media/posts/my-first-contribution-to-openstack/ARA-Logo_hu17e4256629a5c6ba45baa8e753225cf6_37253_b02dfcb5baf4780ab653a7834a9e4c0a.webp"
width="760"
height="556"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
ARA Logo
&lt;/figcaption>&lt;/figure>
&lt;p>Basically it is a project from the OpenStack community that makes it easier to understand and troubleshoot your Ansible roles and playbooks.
If you want more information, please refer to the &lt;a href="http://ara.readthedocs.io/en/latest/" target="_blank" rel="noopener">Documentation Page&lt;/a>.&lt;/p>
&lt;p>Anyhow, I just found a little bug on the Ansible Role to install ARA &lt;a href="https://opendev.org/recordsansible/ansible-role-ara" target="_blank" rel="noopener">ansible-role-ara&lt;/a> on Debian based distros and just send the patch to fix it.&lt;/p>
&lt;p>Here is the link to my &lt;a href="https://opendev.org/recordsansible/ansible-role-ara/commit/3e194e169070213c0bcfd007c97222ce318c6556" target="_blank" rel="noopener">contribution&lt;/a>.&lt;/p>
&lt;p>And, as I am proud of my first commit on a big project here is the screenshot too:&lt;/p>
&lt;figure id="figure-first-openstack-contrib">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="My First OpenStack Contribution" srcset="
/media/posts/my-first-contribution-to-openstack/OpenStack-Contribution_hue50cae8c9a4f3ce2cc82fba8663fd3f2_54865_0af5728d9b6f3d8f558a246cb97b792f.webp 400w,
/media/posts/my-first-contribution-to-openstack/OpenStack-Contribution_hue50cae8c9a4f3ce2cc82fba8663fd3f2_54865_6aa243ac01ede5843567d9273ddd14a0.webp 760w,
/media/posts/my-first-contribution-to-openstack/OpenStack-Contribution_hue50cae8c9a4f3ce2cc82fba8663fd3f2_54865_1200x1200_fit_q90_h2_lanczos_3.webp 1200w"
src="https://luiscachog.io/media/posts/my-first-contribution-to-openstack/OpenStack-Contribution_hue50cae8c9a4f3ce2cc82fba8663fd3f2_54865_0af5728d9b6f3d8f558a246cb97b792f.webp"
width="748"
height="699"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
My First OpenStack Contribution
&lt;/figcaption>&lt;/figure>
&lt;p>I feel happy and motivated to still learn about this Open-Source project and a lot more.&lt;/p>
&lt;p>&amp;#x1f604;&lt;/p></description></item><item><title>Improve WD MyCloud performance</title><link>https://luiscachog.io/improve-wd-mycloud-performance/</link><pubDate>Fri, 16 Feb 2018 00:00:00 +0000</pubDate><guid>https://luiscachog.io/improve-wd-mycloud-performance/</guid><description>&lt;p>I&amp;rsquo;ve just noticed that my NAS a &lt;a href="https://www.westerndigital.com/products/network-attached-storage/wd-my-cloud-expert-series-ex2-ultra#WDBVBZ0040JCH-NESN" target="_blank" rel="noopener">Western Digital My Cloud EX2&lt;/a> is going slower,
so I decided to investigate about what can I do to improve its performance.&lt;/p>
&lt;p>I assume that you already configure ssh on your NAS device.
If is not configured you can follow the next instructions: &lt;a href="https://support-en.wd.com/app/answers/detailweb/a_id/12861" target="_blank" rel="noopener">https://support-en.wd.com/app/answers/detailweb/a_id/12861&lt;/a>&lt;/p>
&lt;h2 id="stop-indexing-services">Stop Indexing Services&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">/etc/init.d/wdmcserver stop
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">/etc/init.d/wdphotodbmerger stop
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>To do it forever, you should create the cronjob as:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">crontab -e
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>And add the following lines:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">@reboot /bin/sh /etc/init.d/wdmcserverd stop
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">@reboot /bin/sh /etc/init.d/wdphotodbmerger stop
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>References:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Western Digital knowledge base link&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/li>
&lt;/ul>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>&lt;a href="https://support-en.wd.com/app/answers/detailweb/a_id/12861" target="_blank" rel="noopener">How to enable SSH (Secure Shell) on a My Cloud EX2 device&lt;/a>&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item></channel></rss>