<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Xabi on Medium]]></title>
        <description><![CDATA[Stories by Xabi on Medium]]></description>
        <link>https://medium.com/@xezpeleta?source=rss-df06969499c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*UETp6kffjvpQ9Fqt.jpeg</url>
            <title>Stories by Xabi on Medium</title>
            <link>https://medium.com/@xezpeleta?source=rss-df06969499c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:51:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@xezpeleta/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploy from Github/Gitlab to server using  Webhook]]></title>
            <link>https://medium.com/the-sysadmin/deploy-from-github-gitlab-to-server-using-webhook-d1cb6496368f?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1cb6496368f</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[web-server]]></category>
            <category><![CDATA[webhooks]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Mon, 26 Oct 2020 21:40:50 GMT</pubDate>
            <atom:updated>2020-10-27T09:02:14.043Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>Deploy from Github/Gitlab to server using Webhook</h3><p>The team working on a web project asked me to deploy their Github repository to our web server. Every commit pushed to the repository must be immediately sent to the server. How would you do that?</p><p>Using <strong>Webhook</strong>, I can set up a hook that runs a redeploy script in my staging server whenever somebody pushes changes to the project.</p><blockquote><a href="https://github.com/adnanh/webhook/">Webhook</a> is a lightweight configurable tool written in Go, that allows you to easily create HTTP endpoints (hooks) on your server, which you can use to execute configured commands. You can also pass data from the HTTP request (such as headers, payload or query variables) to your commands. <a href="https://github.com/adnanh/webhook">webhook</a> also allows you to specify rules which have to be satisfied in order for the hook to be triggered.</blockquote><h3>Installation</h3><p>Are you using Debian or Ubuntu? Then just type:</p><pre>$ apt install webhook</pre><h3>Configuration</h3><p>We need to generate a JSON configuration file. For instance:</p><pre>[<br>  {<br>    &quot;id&quot;: &quot;<strong><em>mydomain-redeploy</em></strong>&quot;,<br>    &quot;execute-command&quot;: &quot;<strong><em>/var/www/mydomain.com/redeploy-webhook.sh</em></strong>&quot;,<br>    &quot;command-working-directory&quot;: &quot;<strong><em>/var/www/mydomain.com/html</em></strong>&quot;,<br>    &quot;trigger-rule&quot;:<br>    {<br>      &quot;match&quot;:<br>      {<br>        &quot;type&quot;: &quot;payload-hash-sha1&quot;,<br>        &quot;secret&quot;: &quot;<strong><em>mysecret</em></strong>&quot;,<br>        &quot;parameter&quot;:<br>        {<br>          &quot;source&quot;: &quot;header&quot;,<br>          &quot;name&quot;: &quot;X-Hub-Signature&quot;<br>        }<br>      }<br>    },<br>  }<br>]</pre><p>In the above example I’m just checking that the secret is correct. We will set up this password later in our Github webhook. We could add more conditions or rules. You can find more configuration file <a href="https://github.com/adnanh/webhook/blob/master/docs/Hook-Examples.md">examples</a> to work with Bitbucket or Gitlab.</p><p>Save it as <strong><em>/etc/webhook.conf</em></strong> and try to execute it manually:</p><pre>$ webhook -hooks /etc/webhook.conf -verbose</pre><p>By default it will listen in port <strong><em>tcp/9000</em></strong>.</p><p>If it returns the message “<strong><em>address already in use</em></strong>”, keep in mind Ubuntu installation package configures a SystemD script, so you may stop the service before run it manually:</p><pre>$ systemctl stop webhook</pre><h3>Git script</h3><p>This is the easy step. First you need to download/<strong>clone the code</strong> to your webroot directory. Then there are several ways to keep it updated. For instance, you could run the following script:</p><pre>#!/usr/bin/env bash</pre><pre>git fetch --all<br>git checkout --force &quot;origin/main&quot;</pre><p>Keep in mind you may <a href="https://docs.github.com/en/enterprise-server@2.20/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account">create SSH keys and add it to the repository</a>.</p><h3>Github configuration</h3><p>Go to your repository <strong><em>Settings — Webhooks — Add webhook:</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lEGBiu4wZLfX0LjPWXeESg.png" /></figure><p>You’d probably want to set up the secret “<em>mysecret</em>” as it’s the only rule we specified in our hook.</p><p>After saving the webhook, Github will <a href="https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/about-webhooks#ping-event">PING</a> your webhook URL. You will see the log message in webhook command verbose output:</p><pre>[webhook] 2018/02/05 11:56:01 [5d6294] finished handling ping</pre><p>Now, if you push any change, Github will call your webhook URL, and Webhook will call your deploy script, keeping your files always synchronized. It requires only 2–3 seconds to complete this workflow!</p><h3>Webhook with HTTPS</h3><p>Webhook will use HTTP by default. It’s really easy to set up HTTPS:</p><p>Don’t you have your certificates yet? Use Certbot to retrieve them.</p><pre>certbot certonly --webroot -w /var/www/mydomain.com/html/ -d mydomain.com</pre><p>Now you can run Webhook with HTTPS enabled using the following options:</p><pre><strong>webhook -hooks</strong> <em>/etc/webhook.conf</em> <strong>-secure</strong> <strong>-cert</strong> <em>/etc/letsencrypt/live/mydomain.com/fullchain.pem</em> <strong>-key</strong> <em>/etc/letsencrypt/live/mydomain.com/privkey.pem</em> <strong>-verbose</strong></pre><p>If you need more parameters, you can check the following list: <a href="https://github.com/adnanh/webhook/blob/master/docs/Webhook-Parameters.md">https://github.com/adnanh/webhook/blob/master/docs/Webhook-Parameters.md</a></p><h3>Systemd script</h3><p>Ubuntu’s Webhook package will set it up a Systemd service script and it will run it at startup.</p><p>If you want to change the script, for instance to enable HTTPS as mentioned above, you need to adapt the following file:</p><p><strong><em>/etc/systemd/system/multi-user.target.wants/webhook.service</em></strong></p><pre>[Unit]<br>Description=Small server for creating HTTP endpoints (hooks)<br>Documentation=<a href="https://github.com/adnanh/webhook/">https://github.com/adnanh/webhook/</a></pre><pre>[Service]<br>ExecStart=/usr/bin/webhook -nopanic -hooks /etc/webhook.conf -secure -cert /etc/letsencrypt/live/mydomain.com/fullchain.pem -key /etc/letsencrypt/live/mydomain.com/privkey.pem</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Do not forget to reload SystemD:</p><pre>$ systemctl daemon-reload</pre><h3>Ready for production</h3><p>Now yes, your Webhook is ready for production:</p><pre>$ systemctl start webhook</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1cb6496368f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/deploy-from-github-gitlab-to-server-using-webhook-d1cb6496368f">Deploy from Github/Gitlab to server using  Webhook</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s upgrade from ACME v1 to v2]]></title>
            <link>https://medium.com/the-sysadmin/lets-upgrade-from-acme-v1-to-v2-3e37fc206982?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e37fc206982</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[certbot]]></category>
            <category><![CDATA[lets-encrypt]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[acme]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Mon, 25 May 2020 09:02:58 GMT</pubDate>
            <atom:updated>2020-05-25T09:05:58.142Z</atom:updated>
            <content:encoded><![CDATA[<p>Once again, a new email from <em>noreply@letsencrypt.org</em>:</p><blockquote>Beginning June 1, 2020, we will stop allowing new domains to validate using <br> the ACMEv1 protocol. You should upgrade to an ACMEv2 compatible client before <br> then, or certificate issuance will fail. For most people, simply upgrading to <br> the latest version of your existing client will suffice. You can view the <br> client list at: <a href="https://letsencrypt.org/docs/client-options/">https://letsencrypt.org/docs/client-options/</a></blockquote><p>Did you also receive the above warning in your inbox? You probably generated your <a href="https://letsencrypt.org/">Let’s Encrypt</a> certificates long time ago, using the (nowadays deprecated) ACMEv1 protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/0*-9YJHeVJyu1ZhIKz.png" /></figure><p>I tried to fix this issue before, upgrading the <strong><em>Certbot</em></strong> client. But apparently it’s already the newest version (in my <em>Ubuntu Xenial 16.04</em>):</p><pre># sudo apt-get install --only-upgrade certbot<br>Reading package lists… Done<br>Building dependency tree <br>Reading state information… Done<br>certbot is already the newest version (0.31.0–1+ubuntu16.04.1+certbot+1).<br>0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.</pre><p>Sadly, it looks that upgrading to an ACMEv2 compatible client is not enough. You also may need to adapt some old configuration files. I’m surprised I didn’t find clear instructions to fix that, so <strong>here is how I solved the issue</strong>:</p><p>First of all, let’s check if there is any domain using the deprecated <em>acme-v01</em> server:</p><pre>sudo grep -R acme-v01 /etc/letsencrypt/renewal</pre><p>In my case, I saw 4-5 domains using the old server URL:</p><pre>server = <a href="https://acme-v01.api.letsencrypt.org/directory">https://acme-v01.api.letsencrypt.org/directory</a></pre><p>The easiest way to update all these configuration files is executing the renew command, adding the special <em>server </em>parameter:</p><pre>certbot renew --apache --agree-tos --force-renewal --server <a href="https://acme-v02.api.letsencrypt.org/directory">https://acme-v02.api.letsencrypt.org/directory</a></pre><p>The above command will renew all your domains using the ACME-v02 server and it will even update the server URL in the renewal configuration files.</p><p>I hope it will help you!!</p><p>References:</p><ul><li><a href="https://community.letsencrypt.org/t/how-to-update-to-acme-v2-with-old-certbot-installation/112065">https://community.letsencrypt.org/t/how-to-update-to-acme-v2-with-old-certbot-installation/112065</a></li><li><a href="https://community.letsencrypt.org/t/upgrading-to-acme-v2/113385/3">https://community.letsencrypt.org/t/upgrading-to-acme-v2/113385/3</a></li><li><a href="https://www.opentechguides.com/how-to/article/certbot/197/update-certbot-ubuntu.html">https://www.opentechguides.com/how-to/article/certbot/197/update-certbot-ubuntu.html</a></li><li><a href="https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578/2">https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578/2</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e37fc206982" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/lets-upgrade-from-acme-v1-to-v2-3e37fc206982">Let’s upgrade from ACME v1 to v2</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dell switch and DHCPDISCOVER]]></title>
            <link>https://medium.com/the-sysadmin/dell-switch-and-dhcpdiscover-9949a579dc7f?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/9949a579dc7f</guid>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Wed, 27 Feb 2019 10:58:58 GMT</pubDate>
            <atom:updated>2019-02-27T10:58:58.859Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently acquired a <strong>DELL EMC N1124T-ON</strong> switch. As always, the first thing I did is to configure the management VLAN and a static IP address. And then check everything was working as expected…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fwp0o7izPvhozgdm53d%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fwp0o7izPvhozgdm53d%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fwp0o7izPvhozgdm53d%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b1133ea5fe428ec0370df15a44ecd45/href">https://medium.com/media/2b1133ea5fe428ec0370df15a44ecd45/href</a></iframe><p>WTF! Even setting up a static IP address, I realized that my DHCP server assigned an IP address for the switch. So I captured the traffic to confirm my suspicions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*_hUMmIi5uB52mdO3PFk2aQ.png" /><figcaption>DHCPDISCOVER messages from the switch every minute</figcaption></figure><p>The DELL switch was sending a DHCPDISCOVER message every minute. Caused by an incorrect configuration?</p><pre>console&gt; <strong>show ip int</strong><br>IP Address..................................... &lt;redacted&gt;<br>Subnet Mask.................................... 255.255.255.0<br>Default Gateway................................ 0.0.0.0<br>IPv6 Prefix is ................................ &lt;redacted&gt;<br>IPv6 Default Gateway........................... none<br>Burned In MAC Address.......................... 4CD9.8FE5.2CF0<br>Configured IPv4 Protocol....................... None<br>Configured IPv6 Protocol....................... None<br>IPv6 AutoConfig Mode........................... Disabled<br>Management VLAN ID............................. 10</pre><p>Everything seems correct to me.</p><p>In case it was caused by a buggy firmware, I upgraded to the last version.</p><pre>console&gt; <strong>show version</strong><br>Machine Description............... Dell EMC Networking Switch<br>System Model ID................... N1124T-ON<br>Machine Type...................... Dell EMC Networking N1124T-ON<br>Serial Number..................... &lt;redacted&gt;<br>Manufacturer...................... 0xbc00<br>...</pre><pre>unit active      backup      current-active next-active<br>---- ----------- ----------- -------------- --------------<br>1    6.4.2.6     6.4.1.4     6.4.2.6        6.4.2.6</pre><p>And finally, after Googling for a while, I’ve found <a href="https://www.dell.com/community/Networking/DHCPDiscover-em-switches-N1524/td-p/5488592">the solution</a> (thanks <em>fcoelho</em>):</p><pre>console&gt; <strong>enable</strong><br>console# <strong>configure</strong><br>console(configure)# <strong>eula-consent support-assist reject</strong></pre><pre>I do not accept the terms of the license agreement. The SupportAssist feature has been deactivated and can no longer be used.<br>To enable SupportAssist configurations, accept the terms of the license agreement by configuring this command &#39;eula-consent support-assist accept&#39;.</pre><pre>console(configure)# <strong>eula-consent hiveagent reject</strong></pre><pre>I do not accept the terms of the license agreement. The HiveAgent feature has been deactivated and can no longer be used.<br>To enable HiveAgent configurations, accept the terms of the license agreement by configuring this command &#39;eula-consent hiveagent accept&#39;.</pre><p><em>SupportAssist</em> transparently collects information about your computer hardware and software, and automatically creates support cases when issues arise. You can find more info <a href="https://www.dell.com/learn/us/en/555/shared-content~solutions~en/documents~supportassist-user-guide.pdf">here</a>.</p><p><em>HiveAgent</em> is used to communicate and allow management of the switch device by a <em>HiveManager</em> software application. You can find more info <a href="https://www.dell.com/support/article/us/en/04/how11862/how-to-enable-or-disable-hiveagent-on-dell-networking-n-series-switch?lang=en">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9949a579dc7f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/dell-switch-and-dhcpdiscover-9949a579dc7f">Dell switch and DHCPDISCOVER</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fortinet eta EdgeRouter arteko tunela]]></title>
            <link>https://xezpeleta.medium.com/fortinet-eta-edgerouter-arteko-tunela-c38df162be21?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c38df162be21</guid>
            <category><![CDATA[edgerouter]]></category>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[fortinet]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Fri, 25 Jan 2019 10:18:15 GMT</pubDate>
            <atom:updated>2019-01-25T12:43:41.807Z</atom:updated>
            <content:encoded><![CDATA[<h4>IPsec tunel bat ezarriko dugu bi gailu hauen artean, bi egoitzen arteko komunikazioa ahalbidetzeko</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*-ZSKl90qZ6s7tc88csS9-Q.png" /><figcaption>Hona hemen lortu nahi dugun azpiegitura eta konfigurazioaren adibidea</figcaption></figure><p>Gure egoitza nagusia eta bulego txiki baten artean konexio finko eta seguru bat izan nahiko genuke. Kasu honetan, VoIP telefono bat <em>Asterisk</em> zentralitarekin komunikatzea da gure helburua.</p><p>Egoitza nagusian <em>Fortinet</em> suhesi bat dugu, eta tunelaren beste aldean <strong><em>Ubiquiti</em></strong> etxeko <strong><em>EdgeRouter X</em></strong> gailu bat erabiliko dugu. Merkea, txikia baina mila aukera eskaintzen dituena. Denetarako balio du!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*99oBFX0AMqiTGLHoyR2ODQ.png" /><figcaption>EdgeRouter X bertsio berezi bat, SFP portuarekin</figcaption></figure><blockquote>Fortinet beharrean <strong>pfSense</strong> suhesi bat baduzue, EdgeRouter X honekin <strong>OpenVPN</strong> motako tunelak ere konfiguratu daitezke.</blockquote><h3>Fortinet: egin beharreko aldaketak</h3><h4>VPN tunela konfiguratu</h4><p><em>[ VPN -&gt; IPsec Wizard ]<br></em>Lehenik eta behin, VPN tunel bat egingo dugu, “<em>custom</em>” motakoa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YM-nV6VgpXZKDV0BsCDlEA.png" /><figcaption>VPN tunela sortzeko laguntzailea</figcaption></figure><p>Jarraian urrutiko egoitzako IP helbidea zehaztu beharko dugu. Ez duzu IP helbide finkorik beste aldean? Kasu honetan, DNS dinamiko bat erabili beharko dugu (jarraitu irakurtzen).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*FLegTLW8Nxj9dnXHKCSn_g.png" /><figcaption>Ziurtatu <strong>IP Address</strong> eta <strong>Interface</strong> eremuak behar bezala konfiguratuak dituzula</figcaption></figure><p>Daturik garrantzitsuena, “<em>Pre-shared Key</em>” delakoa da. Bi gailuen artean elkarbanatu beharko duten pasahitz sendo bat izango da.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*claZa0CgnYHgZ3DaY7aMSQ.png" /></figure><p>Enkriptazioari dagozkion datuak (<em>Phase 1 Proposal, XAUTH…</em>) dauden bezala utzi ditzakegu.</p><p>Azkenik, bertako eta urruneko sareak definitu beharko ditugu. Hau da, tunelaren bitartez elkarrekin komunikatuko ditugun sareak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*U5cQGWK4ZlwPvW1oOaaiFA.png" /><figcaption>Atal hau osatzea ez da ezinbestekoa, baina gutxieneko segurtasun maila bat ezartzeko gomendagarria da. Nork erabili ahal izango du tunela? Geroz eta zehaztasun gehiago, hobe.</figcaption></figure><h4>Sortu beharrezko erregelak</h4><p><em>[ Policy &amp; Objects -&gt; IPv4 Policy ]</em><br>Baimendu lehenik eta behin IPsec trafikoa (<em>udp/500</em> eta <em>udp/4500</em>, <strong><em>IKE</em></strong> bezala ezaguna). Beti bezala, erregela ahalik eta zehatzena egin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*wTLUhTMO6F2GI7_7A0eFww.png" /><figcaption>Sortu VPN tunela ezartzeko beharrezko erregela</figcaption></figure><p>Aurreko erregelak VPN tunela baimenduko du. Orain tunel horretan zehar baimendu beharreko trafikoa zehaztuko duen erregela berri bat sortu beharko dugu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*VXJdYxwOnVsNP-6sS-EDhA.png" /><figcaption>Erregela honek VPN tunela erabiliz datorren trafiko guztia onartzen du. Horrela utziko dugu hasiera batean, dena ondo dabilela konprobatu arte.</figcaption></figure><h4>Sortu beharrezko rutak</h4><p><em>[ Network -&gt; Static routes ]</em><br>Barne sarea eta urrutiko sarearen arteko trafikoa VPN tuneletik bideratu nahi dugu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*zSOCIuFS48nM2ng-ubc2aQ.png" /><figcaption>Ruta estatiko honen bidez, IP sare horretara doazen konexioak VPN tunelaren bidez bideratuko ditugu</figcaption></figure><p>Eta listo, <em>Fortia</em> prest dugu “Miamiko” konexioak onartzeko! :-)</p><h3>EdgeRouter: egin beharreko aldaketak</h3><h4>Sortu VPN tunela</h4><p><em>[ VPN -&gt; IPsec Site-to-Site ]<br></em>Trafiko guztia bideratu nahi badugu, benetan erosoa izango zaigu Firewall / NAT erregelak automatikoki ezarriko dituen aukera aktibatzea.</p><p>Bestalde, gogoratu beste aldean jarri dugun <strong><em>Pre-shared secret</em></strong> bera erabiltzea hemen ere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*ngxiKMqjtmv3EPXe2I2A7A.png" /><figcaption>EdgeRouter X. IPsec Site-to-site</figcaption></figure><p>Kasu honetan <strong>inolako ruta berririk sortu gabe</strong>, berak bideratuko digu trafikoa VPN tunelaren bidez. Beraz, dena prest!</p><h4>Baina nik ez dut IP publiko finko bat!</h4><p>Kasu horretan, DNS dinamiko bat konfiguratu beharko duzu.</p><p><em>[ Services -&gt; DNS -&gt; Dynamic DNS ]</em><br>DNS dinamikoa konfiguratzeko zerbitzu ezberdinak erabili daitezke. Nire kasuan, nire esku dagoen domeinu bat erabili nahi dut eta hortaz <strong><em>Cloudflare</em></strong> zerbitzua aukeratu dut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*7FBDgVsW__cfH647xwo8Vw.png" /><figcaption>Modu honetara azpidomeinu horrek beti urrutiko egoitzako IP publikoa izango du</figcaption></figure><p>Web interfaze bidez konfiguratzea lortzen ez baduzue, <a href="https://help.ubnt.com/hc/en-us/articles/204976324-EdgeRouter-Custom-Dynamic-DNS#1">CLI bidez ere egin liteke</a>.</p><p>Modu honetara, orain bai, <em>Fortinet</em>-eko konfigurazioa aldatu eta <strong><em>Dynamic DNS</em></strong> aukeratu dezakegu.</p><p>[ <em>VPN -&gt; IPsec Tunnels -&gt;Edit</em> ]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*FKfw91pPks268_gEVwHuzw.png" /><figcaption>IPsec VPN tunela, DNS dinamiko bat erabiliz</figcaption></figure><h4>NAT batean atzean nago. Nola lortu IP publikoa?</h4><p>Gerta liteke zuen <em>EdgeRouter</em> hori interneteko operadorearen bestelako router baten atzean kokatuta egotea. Kasu horretan, ziur asko <em>WAN</em> portuan ere IP pribatu bat hartuko du DHCP bidez, eta ondorioz DNS dinamikoa eguneratzean IP pribatu hori ezarriko zaio. Zer egin kasu honetan?</p><p>Kasu honetan bi gauza egin beharko ditugu. IP publikoa detektatu, eta IPsec tunela egiteko portu bideraketa konfiguratu.</p><p><strong>IP publikoa detektatu<br></strong><em>[ Services -&gt; DNS -&gt; Dynamic DNS ]</em><br>DNS dinamikoa konfiguratu dugun atal berdinean, <strong><em>Web</em></strong> eta <strong><em>Web-skip</em></strong> eremuak bete behar ditugu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*vh4KXaB1HlmbiNGy1n6sTA.png" /><figcaption>IP publikoa detektatzeko web zerbitzu asko daude. Nik IPinfo delakoa dut gustokoen!</figcaption></figure><p><strong>Portu bideraketa konfiguratu</strong><br>IPsec konexioak ahalbidetzeko, gure interneteko routerrean hainbat portu bideratu beharko ditugu EdgeRouter gailura:</p><ul><li>udp/500</li><li>udp/4500</li></ul><h4>Konprobatu konexioaren egoera</h4><p>Nola ez, konprobatzeko modurik erangikorrena bi aldeen arteko ping bat egitea da:</p><pre><em># PING telefonora, badabil!!</em><br>$ <strong>ping 192.168.2.100</strong><br>PING 192.168.2.100 (192.168.2.100) 56(84) bytes of data.<br>64 bytes from 192.168.2.100: icmp_seq=1 ttl=64 time=0.632 ms<br>64 bytes from 192.168.2.100: icmp_seq=2 ttl=64 time=0.466 ms</pre><p>Bestalde, <em>Fortinet-</em>en, <strong><em>IPsec Monitor</em></strong> atala erabili dezakegu konexioaren egoera ikusi eta aldatzeko.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Knyh8ftJPE1oLhNitGDAIA.png" /></figure><p><em>EdgeRouter</em>-en aldiz, web interfazeak ez du informazio askorik ematen. Datu gehiago behar baditugu <strong>CLI</strong> bidez egin beharko dugu. Jarraian erabilgarri izan daitezken agindu batzuk,</p><p>VPN tunelaren egoera ikusteko:</p><pre>ubnt@miami:~$ <strong>show vpn ipsec sa</strong><br>peer-66.91.23.98-tunnel-1: #7, ESTABLISHED, IKEv1, 4cfeb724baf1b382:6ab72b7fbd2b913b<br> local ‘192.168.0.102’ @ 192.168.0.102<br> remote ‘66.91.23.98’ @ 66.91.23.98<br> AES_CBC-128/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_2048<br> established 6259s ago, reauth in 21645s<br> peer-66.91.23.98-tunnel-1: #1, INSTALLED, TUNNEL, ESP:AES_CBC-128/HMAC_SHA1_96/MODP_2048<br> installed 1602 ago, rekeying in 1186s, expires in 1998s<br> in cbf842ba, 0 bytes, 0 packets<br> out 9ad4b20e, 0 bytes, 0 packets<br> local 192.168.2.0/24<br> remote 192.168.1.0/24</pre><p>Arazoren bat? Ez da konektatzen? Bota bistazo bat <em>log</em>ari:</p><pre>ubnt@miami:~$ <strong>show vpn log</strong></pre><p>Informazio gehiago behar izanez gero, bota bistazo bat hurrengo webguneari: <a href="https://help.ubnt.com/hc/en-us/articles/216771078-EdgeRouter-Modifying-the-Default-IPsec-Site-to-Site-VPN">https://help.ubnt.com/hc/en-us/articles/216771078-EdgeRouter-Modifying-the-Default-IPsec-Site-to-Site-VPN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c38df162be21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visualize Traefik logs in Kibana]]></title>
            <link>https://medium.com/the-sysadmin/visualize-traefik-logs-in-kibana-c53fb2aac070?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c53fb2aac070</guid>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[filebeat]]></category>
            <category><![CDATA[logstash]]></category>
            <category><![CDATA[traefik]]></category>
            <category><![CDATA[kibana]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Fri, 06 Jul 2018 22:57:27 GMT</pubDate>
            <atom:updated>2018-07-13T11:33:24.372Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>It’s really easy! (when you know how)</h4><p>You’re probably here because you’ve decided to follow the trend of centralized logs. So let’s go straight to the point: do you use <strong><em>Traefik</em></strong> as reverse proxy? In this guide we will configure the <em>ELK</em> stack to collect our <em>Traefik</em> logs!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*N3vpS3woC69rs3VrDKnzgQ.jpeg" /><figcaption>Random log image, found <a href="https://www.dreamstime.com/stock-photos-s-my-log-gopher-coming-out-hole-image36306673">here</a></figcaption></figure><p>First of all, a review of concepts:</p><ul><li><a href="https://traefik.io/"><em>Traefik</em></a>: a “cloud native” reverse proxy / load balancer</li><li><a href="https://www.elastic.co/products/beats/filebeat"><em>Filebeat</em></a>: a lightweight shipper for logs</li><li><a href="https://www.elastic.co/products/logstash"><em>Logstash</em></a><em> </em>(optional): a server-side data processing pipeline that ingests data from a multitude of sources</li><li><a href="https://www.elastic.co/products/elasticsearch"><em>ElasticSearch</em></a>: search and analytics engine, where we store our logs</li><li><a href="https://www.elastic.co/products/kibana"><em>Kibana</em></a>: visualizing platform for the <em>Elasticsearch</em> data</li></ul><p>I’m going to assume you already have your Elastic stack installed and ready to use, so you only need some configuration files to achieve our goal! (am I wrong? then maybe you should follow <a href="https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-ubuntu-16-04">this guide</a>).</p><h4>Configuring Traefik log</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*mGV4cs4rn9-zw3L5ZZr1hw.png" /></figure><p><em>Traefik</em> v1.5 <a href="https://github.com/containous/traefik/pull/2056">added</a> the possibility to use JSON format for the logs.</p><p>That’s great for us, as it makes the log processing much easier!</p><p>—</p><p>You only need to add this section in your “<em>traefik.yml</em>” file:</p><pre><strong># file: /etc/traefik/traefik.yml</strong><br>...</pre><pre>[accessLog]<br>filePath = “/var/log/traefik/access.log.json”<br><strong>format = “json”</strong></pre><pre>...</pre><h4>Configuring Filebeat</h4><p>Now we need to send the logs to <em>Logstash</em>. The easiest way to do that is using <strong><em>Filebeat</em></strong>.</p><p>After following the <a href="https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-installation.html">installation instructions</a>, we need to configure it. Most of the examples out there explain how to send a simple plain-text log file, but we have a JSON file! Shouldn’t it be easier?</p><p>Once again, it’s not really difficult when you know how…</p><pre><strong># file: /etc/filebeat/filebeat.yml</strong><br><br>filebeat.inputs:<br>- type: log<br>  paths:<br>  - /var/log/traefik/*.json<br>  json.keys_under_root: true<br>  json.add_error_key: true<br>  fields_under_root: true<br>  fields:<br>    tags: [&#39;beats&#39;,&#39;json&#39;,&#39;traefik&#39;]</pre><pre>output.logstash:<br>  hosts: [&#39;&lt;elastic-host&gt;:5044&#39;]<br>  ssl.certificate_authorities: [&quot;/etc/filebeat/certs/logstash.crt&quot;]</pre><p>The configuration above will send the processed JSON data to <em>Logstash</em>, so you don’t even need to apply any filter.</p><p>You may define your own tags (they will help you to process the logs later) and edit your logstash host address. Finally, if you have the SSL enabled in your <em>Logstash</em>, don’t forget to copy the certificate and specify the path.</p><blockquote>Note: in Filebeat 6.3 they renamed “prospections” to “inputs”. <a href="https://www.elastic.co/blog/brewing-in-beats-rename-filebeat-prospectors-to-inputs">More info</a></blockquote><h4>Configuring Logstash to ingest the data (optional)</h4><p>We’re almost done. Now we need to configure <strong><em>Logstash</em></strong> to ingest our <em>Filebeat</em> data. If you don’t have any <em>Beats</em> component enabled yet, you can use the following configuration file as template:</p><pre><strong># file: /etc/logstash/conf.d/11_beats.conf</strong><br><br>input {<br>  beats {<br>    port =&gt; 5044<br>    ssl =&gt; true<br>    ssl_certificate =&gt; &quot;/etc/pki/tls/certs/logstash.crt&quot;<br>    ssl_key =&gt; &quot;/etc/pki/tls/private/logstash.key&quot;<br>  }<br>}</pre><pre>output {<br>  if [@metadata][beat] {<br>    elasticsearch {<br>      hosts =&gt; [&quot;<a href="http://localhost:9200/">http://localhost:9200</a>&quot;]<br>      index =&gt; &quot;%{[<a href="http://twitter.com/metadata">@metadata</a>][beat]}-%{[<a href="http://twitter.com/metadata">@metadata</a>][version]}-%{+YYYY.MM.dd}&quot;<br>    }<br>  }<br>}</pre><p>As you can see, it stores our <a href="https://www.elastic.co/products/beats"><em>beats</em></a><em> </em>(files, metrics, etc) in the <em>ElasticSearch</em> service.</p><blockquote>Of course, you can skip this step, sending your JSON directly from <a href="https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html">Filebeat to Elastic</a>.</blockquote><h4>Kibana</h4><p>Let’s check if we obtain all the processed fields from <em>Traefik</em> in <em>Kibana</em>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypkNiJolNznsOlwNMEGMVw.png" /></figure><p>Great! So now we can finally draw a pie chart!!! :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XSOKxeNBxpu8UAravrLaOQ.png" /><figcaption>Data scientists favourite chart</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*NMHT1xhdjj2rO5Gr2OWEvA.png" /><figcaption>Traefik’s “gopher” loves potato and cheese</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c53fb2aac070" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/visualize-traefik-logs-in-kibana-c53fb2aac070">Visualize Traefik logs in Kibana</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Cloud Print on Ubuntu 16.04, in 10 minutes!]]></title>
            <link>https://medium.com/the-sysadmin/google-cloud-print-on-ubuntu-16-04-in-10-minutes-1f0bf97ba9d3?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f0bf97ba9d3</guid>
            <category><![CDATA[google-cloud-print]]></category>
            <category><![CDATA[printers]]></category>
            <category><![CDATA[cup]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Wed, 29 Nov 2017 21:08:04 GMT</pubDate>
            <atom:updated>2017-11-29T21:09:58.107Z</atom:updated>
            <content:encoded><![CDATA[<p>Thanks to <a href="https://www.cups.org/">CUPS</a> and <a href="https://github.com/google/cloud-print-connector">Google Cloud Print Connector</a>, you can share your old printers using <a href="https://www.google.com/cloudprint/">Google Cloud Print</a> (GCP).</p><p><strong>Main benefits</strong></p><ul><li>Print from any device or application (web, mobile, desktop)</li><li>Print using any connection, any network</li><li>Forget drivers</li><li>Share all your printers with a user in a moment</li></ul><p>Let’s start!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J_xzZEXLAMd9cIJHZQg8ug.jpeg" /><figcaption>Print from anywhere (<a href="https://blogs.ntu.edu.sg/blog/2014/07/print-from-anywhere-with-google-cloud-print/">source</a>)</figcaption></figure><pre>$ <strong>apt install google-cloud-print-connector</strong></pre><p>The command above will install <em>GCP-Connector</em> and all required dependencies, included <em>CUPS</em>.</p><h3>CUPS</h3><p>The first thing you need to do is to add and configure your printer(s) in CUPS. The easiest way to do that is to use its web UI, so let’s enable it.</p><pre><strong># Filename: /etc/cups/cupsd.conf<br></strong># Change/add the following lines</pre><pre># Allow to listen in any address<br><strong>Listen *:631</strong></pre><pre># Allow access to the server<br>&lt;Location /&gt;<br>  Order allow,deny<br>  <strong>Allow from all</strong><br>&lt;/Location&gt;</pre><pre>&lt;Location /admin&gt;<br>  Order allow,deny<br>  <strong>Allow from all</strong><br>&lt;/Location&gt;</pre><pre>&lt;Location /admin/conf&gt;<br>  AuthType Default<br>  Require user @SYSTEM<br>  Order allow,deny<br>  <strong>Allow from all</strong><br>&lt;/Location&gt;</pre><pre>&lt;Location /admin/log&gt;<br>  AuthType Default<br>  Require user @SYSTEM<br>  Order allow,deny<br>  <strong>Allow from all</strong><br>&lt;/Location&gt;</pre><pre>...</pre><blockquote>You should probably reverse these changes once you finish configuring your printers in CUPS</blockquote><p>To manage the printers using the CUPS web UI, we will need a user member of group <strong><em>lpadmin</em></strong>. You can use your own user or, if you prefer, you can create a new one:</p><pre>$ <strong>useradd <em>&lt;user&gt;</em> -p <em>&lt;passwd&gt;</em> --groups lpadmin</strong></pre><p>Don’t forget to restart CUPS after the changes:</p><pre>$ <strong>systemctl restart cups</strong></pre><p>So now you should be able to access to web UI using the address <strong><em>https://&lt;host-address&gt;:631/admin/</em></strong> to add and configure your printers.</p><h3>Google Cloud Print connector</h3><p>Once you have CUPS configured and running, you only have to run the following command…</p><pre>$ <strong>gcp-cups-connector</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*MegMWdU8jMht958FqFP6Iw.jpeg" /></figure><p>…which will start a service to share your printer <strong>locally</strong>. In other words, any computer with Chrome on your network will be able to detect the new printer automatically.</p><p><em>“What? Locally? I thought this shit was about clouds!”</em></p><p>In that case you will need to configure it before. Let’s create a configuration file with the following command:</p><pre>$ <strong>gcp-cups-connector-util init</strong></pre><p>It will ask you the following questions:</p><ul><li><em>Enable local printing? </em><strong><em>y</em></strong></li><li><em>Enable cloud printing? </em><strong><em>y</em></strong></li><li><em>Retain the user OAuth? </em><strong><em>y</em></strong></li><li><em>User or group email to share with? </em><strong><em>&lt;your-address@your-gsuite-domain&gt;</em></strong></li><li><em>Proxy name? </em><strong><em>&lt;whatever&gt;</em></strong></li></ul><p>Once you answer all the questions, it will send you to a URL where you have to introduce a code.</p><p>Finally, start the connector with your custom configuration:</p><pre>$ <strong>gcp-cups-connector -config-filename gcp-cups-connector.config.json</strong></pre><p>That’s all!</p><ul><li>Check your printer(s) status: <a href="https://www.google.com/cloudprint#printers">https://www.google.com/cloudprint#printers</a></li><li>Different ways to print from your devices: <a href="https://www.google.com/cloudprint/learn/apps/">https://www.google.com/cloudprint/learn/apps/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f0bf97ba9d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/google-cloud-print-on-ubuntu-16-04-in-10-minutes-1f0bf97ba9d3">Google Cloud Print on Ubuntu 16.04, in 10 minutes!</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing Windows machines with Ansible]]></title>
            <link>https://medium.com/the-sysadmin/managing-windows-machines-with-ansible-60395445069f?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/60395445069f</guid>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[powershell]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Tue, 29 Nov 2016 15:22:52 GMT</pubDate>
            <atom:updated>2016-11-29T17:47:16.630Z</atom:updated>
            <content:encoded><![CDATA[<h4>An alternative way to configure Windows computers remotelly without an Active Directory</h4><p>Starting in version 1.7, <a href="https://www.ansible.com/">Ansible</a> contains support for managing Windows machines. This guide describes the steps you need to follow to set it up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*kaJKbMLyEhn0InIFWrh_8w.png" /><figcaption>Ansible makes Windows automating easier (<a href="https://www.ansible.com/blog/ansible-windows-features">source</a>)</figcaption></figure><h3>Windows preparation</h3><p>In order for Ansible to manage your windows machines, you will have to enable and configure PowerShell remoting. Fortunately, there is a quick way to do that.</p><p>In your Windows machine, open a command prompt as Administrator and run the following command:</p><pre>@powershell -NoProfile -ExecutionPolicy Bypass -Command &quot;iex ((new-object net.webclient).DownloadString(&#39;https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1&#39;))&quot;</pre><p><strong><em>Note</em></strong>: <em>Kaspersky Endpoint Security 10 uses its own firewall. You might change the configuration manually to allow WinRM incoming connections (TCP/5986)</em></p><h3>Ansible control machine</h3><p>Reminder: you must have a Linux Control Machine. There is no way to do that from a Windows host.</p><h4>Instructions</h4><p>You need to create the following directories/files structure:</p><pre><strong>windows/<br>├── group_vars/<br>│   └── windows.yml<br>└── hosts</strong></pre><p><strong><em>hosts</em> file<br></strong>Add your Windows hosts to the inventory:</p><pre># file: hosts<br>[windows]<br>192.168.1.10<br>192.168.1.11</pre><p>Under the group_vars directory, add the following file named windows.yml, where <em>my_user/my_pass</em> are the credentials you will use to log in the Windows computers:</p><pre># file: group_vars/windows.yml<br><br>ansible_user: <strong>my_user</strong><br>ansible_password: <strong>my_pass</strong><br>ansible_port: 5986<br>ansible_connection: winrm<br># The following is necessary for Python 2.7.9+ when using default WinRM self-signed certificates:<br>ansible_winrm_server_cert_validation: ignore</pre><p>That’s all. Now you can test it using the <a href="http://docs.ansible.com/ansible/win_ping_module.html">win_ping module</a>:</p><pre>$ <strong>ansible windows -i hosts -m win_ping</strong><br>192.168.1.10 | SUCCESS =&gt; {<br>    &quot;changed&quot;: false,<br>    &quot;ping&quot;: &quot;pong&quot;<br>}</pre><h3>More examples</h3><p>Gather facts using <a href="http://docs.ansible.com/ansible/setup_module.html">setup module</a>:</p><pre>$ <strong>ansible windows -i hosts -m setup</strong><br>...</pre><p>Installing Firefox with <a href="http://docs.ansible.com/ansible/win_chocolatey_module.html"><strong>Chocolatey</strong></a>:</p><pre>$ <strong>ansible-playbook windows -i hosts playbook-install-firefox.yml</strong></pre><pre># file: playbook-install-firefox.yml<br>---<br>- name: test chocolatey with ansible<br>  hosts: all<br>  tasks:<br>    - name: Install Firefox<br>      win_chocolatey:<br>        name: firefox<br>        state: present</pre><p>And finally, a funny one! Speak messages and play sounds using <a href="http://docs.ansible.com/ansible/win_say_module.html">win_say module</a>:</p><pre><strong>ansible windows -i hosts -m win_say -a &quot;msg=&#39;Hi! This is a demo&#39; start_sound_path=&#39;C:\\windows\\media\\ding.wav&#39; speech_speed=2&quot;</strong></pre><p>Do you want more? <a href="http://docs.ansible.com/ansible/list_of_windows_modules.html">Check available Windows modules</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60395445069f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/managing-windows-machines-with-ansible-60395445069f">Managing Windows machines with Ansible</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Back up your Google Drive files from Linux]]></title>
            <link>https://medium.com/the-sysadmin/back-up-your-google-drive-files-from-linux-fcb68b234607?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcb68b234607</guid>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Tue, 01 Dec 2015 13:41:31 GMT</pubDate>
            <atom:updated>2015-12-01T16:07:03.188Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*ycl4i2SOMlBnIRBRHrVviA.jpeg" /><figcaption>Image by <a href="http://es.engadget.com/2012/04/25/google-drive-tendra-version-linux-en-algun-momento/">Engadget</a></figcaption></figure><h4>Scenario</h4><p>Can we really trust Google? <strong>Users and companies are using Google Drive to store all their files on the cloud </strong>more and more, without any other copy of their data. Is that secure?</p><p>This is a very controversial topic and is not the aim of this post to talk about that practice. Instead, I’d like to share a <strong>solution to download all our Google Drive data</strong> to our local computer or server.</p><p>Yes, I know; we can do that easily using the Drive client. But <strong>how to do that from Linux?</strong> And how to automatize also the <strong>backup of our Google Docs &amp; Spreadsheets</strong>?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJKe7oPyLt0YSuZBAPL4aw.jpeg" /><figcaption>photo by <a href="https://www.flickr.com/photos/yukop/6965117070">Yuko Honda</a></figcaption></figure><h4>Solution</h4><p>Currently there is not any official Drive client for Linux. Instead, there are a lot of alternatives on <a href="https://github.com/">GitHub</a>.</p><p>My favorite one is <a href="https://github.com/odeke-em/drive/"><strong>Drive</strong></a> (very original name), which is very similar to <strong>git </strong>on its syntax. It was initially developed by <a href="https://medium.com/u/1737b4e67578">@rakyll</a> and currently there is a very active fork maintained by <a href="https://medium.com/u/a00ff5652708">@Emmanuel T Odeke</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mP1oil_zgOoxfphqygkGKQ.png" /><figcaption>odeke-em/drive project screenshot</figcaption></figure><h4>Installation</h4><p>Fortunately, the installation is quite easy on <a href="https://github.com/odeke-em/drive/blob/master/platform_packages.md#ubuntu-or-ubuntu-based-distros">Ubuntu based distributions</a>:</p><pre>$ sudo add-apt-repository ppa:twodopeshaggy/drive<br>$ sudo apt-get update<br>$ <strong>sudo apt-get install drive</strong></pre><p>Alternatively, you also can get the <strong>latest code from Github</strong>, but remember that you need Go 1.3.x or higher. In order to do this on Ubuntu 14.04 I suggest you to <a href="https://golang.org/dl/">download the binary package</a> and to follow these instructions.</p><pre><em># Download and install Go</em><br>$ cd /tmp<br>$ wget <a href="https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz">https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz</a><br>$ tar -C /usr/local -xzf go1.5.1.linux-amd64.tar.gz</pre><pre><em># Set the environment variables on you ~/.bashrc</em><br>export GOROOT=/usr/local/go<br>export GOPATH=$HOME/go-workspace<br>export PATH=$PATH:$GOROOT/bin:$GOPATH/bin<br>$ mkdir ~/go-workspace</pre><pre>$ sudo apt-get install git<br>$ <strong>go get -u github.com/odeke-em/drive/cmd/drive</strong></pre><pre># If you follow these steps, you should use `<em>drive-google</em>` command instead of `<em>drive</em>`</pre><h4>Configuration</h4><p>Finally, we have to initialize the Drive directory, where we’ll store our files:</p><pre>$ mkdir ~/gdrive<br>$ cd ~/gdrive<br>$ drive init</pre><pre>Visit this URL to get an authorization code <a href="https://accounts.google.com/o/oauth2/auth?access_type">https://accounts.google.com/o/oauth2/auth?access_type=offline&amp;client_id=fsd3j2g2ff2g2gg2g2...</a><br>Paste authorization code:</pre><p>Once we accept the request, we will have an authorization code that we have to paste in the console. Our credentials will be stored on<em> “.gd/credentials.json”</em></p><h4>Some examples</h4><p>So now yes, we can start using drive:</p><pre><em># List the contents</em><br>$ drive list</pre><pre><em># Download the contents</em><br>$ drive pull</pre><pre><em># Upload our files</em><br>$ drive push</pre><pre><em># More commands and help</em><br>$ drive help</pre><pre>...</pre><h4>Backup files</h4><p>One of the most interesting features of this project is that we can export Google Docs and Spreadsheets to odt/doc/xls/… format.</p><pre>$ <strong>drive pull -export odt,xls -no-prompt -verbose test</strong><br><em>Resolving...<br>+ /test<br>+ /test/file3<br>+ /test/file2<br>+ /test/file1<br>Addition count 4<br>Pull::Started /test/file3 <br>Pull::Started /test <br>Pull::Started /test/file2 <br>Pull::Started /test/file1 <br>Pull::Done /test <br>Pull::Done /test/file3 <br>Exported &#39;/home/myuser/gdrive/test/file2&#39; to &#39;/home/myuser/gdrive/test/file2_exports/file2.xls&#39;<br>Exported &#39;/home/myuser/gdrive/test/file1&#39; to &#39;/home/myuser/gdrive/test/file1_exports/file1.odt&#39;<br>Pull::Done /test/file2 <br>Pull::Done /test/file1</em></pre><p><em>Note: this feature was recently improved. I recommend you to use the latest version from GitHub or to wait for 0.3.4 version release.</em></p><p>As you can see, it exports the files under <em>filename_exports</em><strong><em> </em></strong>directory by default.</p><p>We can change that behavior adding <strong><em>-exports-dir</em></strong> parameter to the command or, still better, adding it to the <strong>.<em>driverc</em> </strong>configuration file:</p><pre><em># File: .driverc</em></pre><pre>exports-dir=/home/myuser/gdrive-exports</pre><p>If you don’t change the exports directory, you should avoid the synchronization of the exported documents using the <strong><em>.driveignore</em></strong> file:</p><pre><em># File: .driveignore</em></pre><pre>_exports$</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*JwP8OPjHmbmDmzx0riJ6ag.png" /><figcaption>Image by <a href="https://www.flickr.com/photos/sitemarca/6964804588">Site Marca</a></figcaption></figure><h4>Conclusion</h4><p>Using <a href="https://github.com/odeke-em/drive/"><strong>Drive</strong></a> project and <strong>Cron</strong>, we can easily automatize the backup of our Google Drive files from Linux. If we need more and better backups, we always can save these files to <a href="https://github.com/elkarbackup/elkarbackup">Elkarbackup</a> / <a href="http://rsnapshot.org/">Rsnapshot</a> periodically :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcb68b234607" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/back-up-your-google-drive-files-from-linux-fcb68b234607">Back up your Google Drive files from Linux</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Montar una web segura y confiable gracias a Letsencrypt]]></title>
            <link>https://medium.com/the-sysadmin/montar-una-web-segura-y-confiable-gracias-a-letsencrypt-5d169ac33b74?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d169ac33b74</guid>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[web-hosting]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Wed, 04 Nov 2015 16:52:11 GMT</pubDate>
            <atom:updated>2016-11-29T17:52:04.701Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>ACTUALIZACIÓN: este artículo ha quedado desfasado tras la finalización de la fase BETA de Let’s Encrypt. Si quieres obtener certificados seguros para tu servidor, sigue las instrucciones de <a href="https://certbot.eff.org/">Certbot</a></blockquote><p>Gracias a <a href="https://letsencrypt.org/">Letsencrypt</a> ya es posible obtener certificados SSL, confiables para los principales navegadores, de forma sencilla y gratuita. A continuación explico cómo usarlo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*ySewBFrhqq5yW59XRQypqg.png" /></figure><h4>Participar en el programa BETA</h4><p>De momento está en fase BETA. Si queremos disponer de certificados firmados por la entidad certificadora de <strong>Let’s Encrypt</strong>, antes de nada deberemos solicitar entrar en el programa BETA:</p><p><a href="https://docs.google.com/forms/d/15Ucm4A20y2rf9gySCTXD6yoLG6Tba7AwYgglV7CKHmM/viewform?c=0&amp;w=1">Formulario para participar en el programa BETA</a></p><p>En mi caso, tras unas 2–3 semanas, me han contestado que aceptaban mis dominios. Es importante solicitar todos los dominios que necesites desde el inicio. Sino, tendrás que volver a rellenar la solicitud (y volver a esperar).</p><h4>Descargar el cliente de Letsencrypt</h4><p>Tras recibir la confirmación, lo primero que hay que hacer es descargarse el cliente, el cual nos ayudará a generar nuestros certificados. Este proceso hay que realizarlo en el mismo servidor donde tenemos nuestra web.</p><pre># <em>Si no lo tenemos instalado, instalaremos Git</em><br><strong>apt-get install git</strong></pre><pre># <em>Después descargaremos el cliente en /opt/letsencrypt</em><br><strong>cd /opt/</strong><br><strong>git clone https://github.com/letsencrypt/letsencrypt</strong><br><strong>cd letsencrypt</strong></pre><pre># <em>Comprobar que funciona correctamente (no te asustes; la primera vez instala todas las dependencias necesarias)</em><br><strong>./letsencrypt-auto --help</strong></pre><h4>Obtener los certificados</h4><p>El cliente de Let’s Encrypt está preparado para obtener los certificados y configurar automáticamente nuestro servidor web (Apache/Nginx), de forma que el proceso sea lo más sencillo posible para el usuario.</p><p><strong>Atención</strong>: si el <strong>Apache</strong> o cualquier otro servicio que escuche en el puerto 80/TCP está ejecutándose, tendrás que pararlo momentáneamente hasta terminar el proceso.</p><p>Proceso <strong>automático</strong>:</p><pre># <em>Obtener e instalar el certificado en tu web</em><br><strong>./letsencrypt-auto \<br>    --server https://acme-v01.api.letsencrypt.org/directory</strong></pre><pre><em>Nota: en el email que nos envían al aceptarnos en la fase Beta, nos indican que hay que incluir el argumento --server API URL. Supongo que tras la fase BETA se podrá omitir.</em></pre><p>En mi caso, al ser un sistema en producción y con múltiples virtual hosts configurados en Apache, he preferido realizar el proceso de forma manual (que no es nada complicado).</p><p>Proceso <strong>manual</strong>:</p><pre># <em>Generamos el certificado para nuestra web</em><br><strong>./letsencrypt-auto --agree-dev-preview --server https://acme-v01.api.letsencrypt.org/directory certonly</strong></pre><p>El script nos preguntará por un email de contacto y el dominio de nuestra página web. Nos dejará los certificados en el siguiente path:</p><p><strong>/etc/letsencrypt/live/domain.com/</strong></p><p>Si entramos en el directorio, veremos estos ficheros:</p><pre><strong>cert.pem</strong>       # <em>Certificado de servidor</em><br><strong>chain.pem</strong>      # <em>Certificados necesarios para el navegador</em><br><strong>privkey.pem</strong>    # <em>Llave privada (¡no compartir!)<br></em>fullchain.pem  # <em>Todos los certificados</em></pre><p>Los tres primeros los utilizaremos en la configuración de Apache. Suponiendo que ya tenemos montado nuestro sitio seguro en Apache con certificados autofirmados, tendremos que utilizar esta configuración para cambiar a nuestros certificados confiables:</p><pre># SSL<br>SSLEngine on<br><strong>SSLCertificateFile      /etc/letsencrypt/live/domain.com/cert.pem<br>SSLCertificateKeyFile   /etc/letsencrypt/live/domain.com/privkey.pem<br>SSLCertificateChainFile</strong> <strong>/etc/letsencrypt/live/domain.com/chain.pem</strong></pre><pre>BrowserMatch &quot;MSIE [2-6]&quot; \<br>                nokeepalive ssl-unclean-shutdown \<br>                downgrade-1.0 force-response-1.0<br># MSIE 7 and newer should be able to use keepalive<br>BrowserMatch &quot;MSIE [17-9]&quot; ssl-unclean-shutdown</pre><p>Tras reiniciar el servicio de Apache, nuestro sitio web seguro debería estar en marcha. Compruébalo accediendo a <a href="https://dominio.com/">https://dominio.com</a> con tu navegador favorito, o mejor aún, utilizando un <a href="https://www.ssllabs.com/ssltest/index.html">test de servidor SSL</a>.</p><p>Si en el test observas que tu certificado es confiable, pero te sugiere mejorar la configuración de tu servidor seguro, no olvides <a href="https://www.linode.com/docs/security/security-patches/disabling-sslv3-for-poodle">desactivar SSLv3</a> o seguir las <a href="https://community.qualys.com/blogs/securitylabs/2013/08/05/configuring-apache-nginx-and-openssl-for-forward-secrecy">recomendaciones de Security Labs</a>.</p><p><strong><em>Actualización</em></strong><em>: he tenido que incluir la directiva </em><strong>SSLCertificateChainFile </strong><em>con el </em><strong><em>chain.pem</em></strong><em> para que funcione bien en mi configuración</em></p><h4>Referencias</h4><p><a href="https://letsencrypt.readthedocs.org/en/latest/using.html">https://letsencrypt.readthedocs.org/en/latest/using.html</a><br><a href="https://community.letsencrypt.org/">https://community.letsencrypt.org</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d169ac33b74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/montar-una-web-segura-y-confiable-gracias-a-letsencrypt-5d169ac33b74">Montar una web segura y confiable gracias a Letsencrypt</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proxmox and “unable to copy ssh id” error]]></title>
            <link>https://medium.com/the-sysadmin/proxmox-and-unable-to-copy-ssh-id-error-b9d8d0e09958?source=rss-df06969499c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9d8d0e09958</guid>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[proxmox]]></category>
            <dc:creator><![CDATA[Xabi]]></dc:creator>
            <pubDate>Tue, 06 Oct 2015 19:18:58 GMT</pubDate>
            <atom:updated>2015-12-01T17:23:54.160Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*yMYoDweOEdRVnSP7TlDf_A.png" /></figure><p>I have a Proxmox cluster with 2 nodes:</p><pre><strong>root@proxone:~# clustat</strong><br>Cluster Status for mycluster @ Tue Oct 6 20:45:16 2015<br>Member Status: Quorate<br>Member Name ID Status<br>— — — — — — — — — —<br>proxtwo 2 Online<br>proxone 1 Online, Local</pre><p>Everything looks good, with no apparent quorum problem:</p><pre><strong>root@proxone:~# pvecm status</strong><br>Version: 6.2.0<br>Config Version: 8<br>Cluster Name: mycluster<br>Cluster Id: 7035<br>Cluster Member: Yes<br>Cluster Generation: 6900<br>Membership state: Cluster-Member<br>Nodes: 2<br>Expected votes: 2<br>Total votes: 2<br>Node votes: 1<br>Quorum: 2<br>Active subsystems: 5<br>Flags:<br>Ports Bound: 0<br>Node name: proxone<br>Node ID: 1</pre><pre><strong>root@proxone:~# pvecm nodes</strong><br>Node Sts Inc Joined Name<br>1 M 6900 2015–10–06 14:40:20 proxone<br>2 M 6892 2015–10–06 14:33:36 proxtwo</pre><p>But when I try to add a new node to the cluster, I have the following error:</p><pre><strong>root@proxthree:~# pvecm add proxone.domain.com</strong><br>root@proxone.domain.com’s password:<br>unable to copy ssh ID</pre><p>Hmm, let’s try to do that manually:</p><pre><strong>root@proxthree:~# ssh-copy-id root@proxone.domain.com</strong><br>root@proxone.domain.com’s password:<br>cat: write error: Permission denied</pre><p>Definitely something is wrong here. <a href="http://forum.proxmox.com/threads/19693-Can-t-add-second-node-to-cluster-quot-unable-to-copy-ssh-ID-quot">People with similar problem</a> confirm my first suspicion. The <strong>reason must be a quorum problem</strong>; but I can see my cluster quorum is ok. What can I do?</p><h3>SOLUTION</h3><p>Restart cman &amp; pve-cluster daemons in the two cluster nodes:</p><pre><strong>service restart cman<br>service pve-cluster restart</strong></pre><p>And now, everything works ok. Don’t ask why :S</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9d8d0e09958" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-sysadmin/proxmox-and-unable-to-copy-ssh-id-error-b9d8d0e09958">Proxmox and “unable to copy ssh id” error</a> was originally published in <a href="https://medium.com/the-sysadmin">The Sysadmin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>