<?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"><channel><title><![CDATA[Blog2me]]></title><description><![CDATA[Random words]]></description><link>https://blog2me.netlify.com</link><generator>GatsbyJS</generator><lastBuildDate>Sun, 18 Jul 2021 23:32:55 GMT</lastBuildDate><item><title><![CDATA[Simple images as radio buttons with tailwindcss 2.2.x]]></title><description><![CDATA[How to use the new peer utility class to disguise radio-buttons with images]]></description><link>https://blog2me.netlify.comimg-radio-btn</link><guid isPermaLink="false">https://blog2me.netlify.comimg-radio-btn</guid><pubDate>Sun, 18 Jul 2021 23:07:03 GMT</pubDate><content:encoded>&lt;p&gt;Example: &lt;a href=&quot;https://play.tailwindcss.com/N5UxhWwTKN&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://play.tailwindcss.com/N5UxhWwTKN&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Tailwind CSS v2.2 introduced the peer utility class that allows us to target sibling elements and style them based on the ‘peer’ element state.&lt;/p&gt;
&lt;p&gt;This feature is only available in Just-in-Time mode, so please remember to add &lt;code class=&quot;language-text&quot;&gt;mode: &amp;#39;jit&amp;#39;&lt;/code&gt; in your &lt;code class=&quot;language-text&quot;&gt;tailwind.config.js&lt;/code&gt; file&lt;/p&gt;
&lt;p&gt;With this utility we can change a label style based on the radio button input ‘checked’ state, as long they are direct siblings in the HTML.&lt;/p&gt;
&lt;p&gt;We need to add the ‘peer’ class to the element that will change its state, and then the peer and the desired pseudo-class selector for that state, in this case we will use &lt;code class=&quot;language-text&quot;&gt;peer-checked&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&amp;lt;form&amp;gt;
  &amp;lt;label for=&amp;quot;option_1&amp;quot;&amp;gt;
    &amp;lt;input type=&amp;quot;radio&amp;quot; id=&amp;quot;option_1&amp;quot; class=&amp;quot;peer&amp;quot;&amp;gt;
    &amp;lt;span class=&amp;quot;peer-checked:border-green peer-checked:border-4&amp;quot;&amp;gt;...&amp;lt;/span&amp;gt;
  &amp;lt;/label&amp;gt;

  &amp;lt;label for=&amp;quot;option_2&amp;quot;&amp;gt;
    &amp;lt;input type=&amp;quot;radio&amp;quot; id=&amp;quot;option_2&amp;quot; class=&amp;quot;peer&amp;quot;&amp;gt;
    &amp;lt;span class=&amp;quot;peer-checked:border-green peer-checked:border-4&amp;quot;&amp;gt;...&amp;lt;/span&amp;gt;
  &amp;lt;/label&amp;gt;
&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this example, the label will get a green border when the radio button is selected. You can do the same with checkboxes or other elements, and with almost all pseudo-classes available.&lt;/p&gt;
&lt;p&gt;Now the only step missing to create a radio button disguised as an image, its to add the utility class ‘hidden’ to the input element, and add an image in the span element in the example, or just add the &lt;img&gt; tag as a sibling to the input element and add the classes to that element.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&amp;lt;div class=&amp;quot;flex space-x-4&amp;quot;&amp;gt;
  &amp;lt;label for=&amp;quot;opt1&amp;quot; &amp;gt;
    &amp;lt;input type=&amp;quot;radio&amp;quot; id=&amp;quot;opt1&amp;quot; name=&amp;quot;test&amp;quot; class=&amp;quot;peer hidden&amp;quot; /&amp;gt;
    &amp;lt;img src=&amp;quot;http://placehold.it/200x200&amp;quot; alt=&amp;quot;&amp;quot; class=&amp;quot;peer-checked:border-green-500 peer-checked:border-4&amp;quot; /&amp;gt;
  &amp;lt;/label&amp;gt;

  &amp;lt;label for=&amp;quot;opt2&amp;quot; &amp;gt;
    &amp;lt;input type=&amp;quot;radio&amp;quot; id=&amp;quot;opt2&amp;quot; name=&amp;quot;test&amp;quot; class=&amp;quot;peer hidden&amp;quot; /&amp;gt; 
    &amp;lt;img src=&amp;quot;http://placehold.it/200x200&amp;quot; alt=&amp;quot;&amp;quot; class=&amp;quot;peer-checked:border-green-500 peer-checked:border-4&amp;quot; /&amp;gt;
  &amp;lt;/label&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;https://play.tailwindcss.com/N5UxhWwTKN&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://play.tailwindcss.com/N5UxhWwTKN&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to prevent brute-force ssh attacks with fail2ban]]></title><description><![CDATA[If you are experiencing a brute-force ssh attack (people or robots trying different combinations of username and password to log into remote servers), you probably want to implement a fail2ban strategy to prevent them to keep trying.
Here is a really quick and easy guide on how to get it ready in your ubuntu AWS ec2 instance.]]></description><link>https://blog2me.netlify.comfail2ban-ec2-ssh</link><guid isPermaLink="false">https://blog2me.netlify.comfail2ban-ec2-ssh</guid><pubDate>Wed, 14 Jul 2021 22:36:51 GMT</pubDate><content:encoded>&lt;p&gt;If you are experiencing a brute-force ssh attack (people or robots trying different combinations of username and password to log into remote servers), you probably want to implement a fail2ban strategy to prevent them to keep trying.&lt;/p&gt;
&lt;p&gt;Before writing about fail2ban, if you are using AWS, I will highly suggest checking your Network ACLs. If possible, whitelist the IPs that can use the ssh port in your server. Sadly we have dynamic IP’s here in Argentina and it’s going to be really tedious to go and whitelist my IP every time it changes, especially when you could need to access multiple servers a day.&lt;/p&gt;
&lt;h2 id=&quot;fail2ban&quot;&gt;&lt;a href=&quot;#fail2ban&quot; aria-label=&quot;fail2ban permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Fail2ban&lt;/h2&gt;
&lt;p&gt;I won’t go too deep on all that you can do with this software, but if you are interested in read more about it in their &lt;a href=&quot;https://github.com/fail2ban/fail2ban/wiki&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;github wiki&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We will use it for blocking IPs to keep trying to access via ssh after N number of attempts.&lt;/p&gt;
&lt;p&gt;First you need to install the package, my server uses ubuntu so we run:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo apt-get install fail2ban&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now to configure you need to create a &lt;code class=&quot;language-text&quot;&gt;jail.local&lt;/code&gt; file in the folder at &lt;code class=&quot;language-text&quot;&gt;/etc/fail2ban/&lt;/code&gt;. You can read the default configuration from  &lt;code class=&quot;language-text&quot;&gt;/etc/fail2ban/jail.conf&lt;/code&gt;. Let’s create that file:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo touch /etc/fail2ban/jail.local&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Since we are only going to use the ssh module, we just need these lines in the file:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;[sshd]
maxretry = 5
bantime=10800&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Feel free to change those values as it better fits your usage.&lt;/p&gt;
&lt;p&gt;Now we just need to restart the fail2ban service and we are ready to go:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo systemctl restart fail2ban.service&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now your server will reject connections via ssh if they fail to access more than 5 times in a row. Great!&lt;/p&gt;
&lt;p&gt;If you want to check the status of fail2ban, check how many fail attempts happened and how many IPs are banned at some point in time you can run &lt;code class=&quot;language-text&quot;&gt;fail2ban-client status sshd&lt;/code&gt; and it will display something like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Status for the jail: sshd\
|- Filter\
|  |- Currently failed:	1\
|  |- Total failed:	75\
|  `- File list:	/var/log/auth.log\
`- Actions\
|- Currently banned:	2\
|- Total banned:	6\
`- Banned IP list:	161.35.80.11 186.159.10.210&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;troubleshoot&quot;&gt;&lt;a href=&quot;#troubleshoot&quot; aria-label=&quot;troubleshoot permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Troubleshoot&lt;/h2&gt;
&lt;p&gt;fail2ban adds rules in iptables program from your linux distro. I had issues while trying to execute iptables —list, to check how those rules where applied after configuring fail2ban in one of my staging servers:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;modprobe: ERROR: could not insert &amp;#39;ip_tables&amp;#39;: Cannot allocate memoryiptables v1.4.21: can&amp;#39;t initialize iptables table `filter&amp;#39;:
Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In a previous post I commented about linux images taking too much space in your inodes disk space (&lt;code class=&quot;language-text&quot;&gt;df -i&lt;/code&gt; returning 99%+ in &lt;code class=&quot;language-text&quot;&gt;/dev/xvda1&lt;/code&gt;). The solution, if applied incorrectly like I did, may corrupt the execution of iptables commands. In short, try to don’t delete the image that you are currently using. To check which version to keep check the output of &lt;code class=&quot;language-text&quot;&gt;uname -r&lt;/code&gt; in your server terminal.&lt;br&gt;
&lt;br&gt;
Thankfully, we can easily re-install that linux image by using that output too:&lt;br&gt;
&lt;code class=&quot;language-text&quot;&gt;sudo apt-get install linux-image-$(uname -r)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That should reinstall the iptables program. I read that some people needed to run &lt;code class=&quot;language-text&quot;&gt;sudo apt-get full-upgrade&lt;/code&gt; and then reinstall the linux image.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Rails env setup, Apple Silicon (M1) troubleshooting]]></title><description><![CDATA[A quick collection of workarounds that I had to do to be able to setup one of my rails environments on apple silicon (big sur) on a MacBook m1.]]></description><link>https://blog2me.netlify.comruby-m1</link><guid isPermaLink="false">https://blog2me.netlify.comruby-m1</guid><pubDate>Sat, 19 Jun 2021 21:51:38 GMT</pubDate><content:encoded>&lt;p&gt;I was setting up my dev environment for a rails 5 app that runs with ruby 2.4.x and a good mix of gems.&lt;/p&gt;
&lt;p&gt;The gems ffi, pg, mysql2, mimemagic and sassc needed some extra steps besides the regular bundle install, here’s what I did:&lt;/p&gt;
&lt;h2 id=&quot;postgres&quot;&gt;&lt;a href=&quot;#postgres&quot; aria-label=&quot;postgres permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Postgres&lt;/h2&gt;
&lt;p&gt;Use brew to install postgres, its actually easier than using Postgres.app&lt;/p&gt;
&lt;h2 id=&quot;ffi-1918&quot;&gt;&lt;a href=&quot;#ffi-1918&quot; aria-label=&quot;ffi 1918 permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;ffi 1.9.18&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;brew install libffi&lt;/li&gt;
&lt;li&gt;type this in a terminal to set them as env variables
&lt;code class=&quot;language-text&quot;&gt;export LDFLAGS=&amp;quot;-L/opt/homebrew/opt/libffi/lib&amp;quot;
export CPPFLAGS=&amp;quot;-I/opt/homebrew/opt/libffi/include&amp;quot;
export PKG_CONFIG_PATH=&amp;quot;/opt/homebrew/opt/libffi/lib/pkgconfig&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;run the install with this cflags
&lt;code class=&quot;language-text&quot;&gt;gem install ffi -v &amp;#39;1.9.18&amp;#39; -- --with-cflags=&amp;quot;-Wno-error=implicit-function-declaration&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;mysql2&quot;&gt;&lt;a href=&quot;#mysql2&quot; aria-label=&quot;mysql2 permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;mysql2&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Install mysql, openssl and zstd&lt;/li&gt;
&lt;li&gt;brew install mysql&lt;/li&gt;
&lt;li&gt;brew install openssl&lt;/li&gt;
&lt;li&gt;brew install zstd&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then use this flags on the gem installation:
&lt;br&gt;
&lt;code class=&quot;language-text&quot;&gt;gem install mysql2  -v &amp;#39;0.5.2&amp;#39; -- --with-opt-dir=&amp;quot;$(brew --prefix openssl)&amp;quot; --with-ldflags=-L/opt/homebrew/Cellar/zstd/1.5.0/lib&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you need the path for zstd lib because its different than mine, you can find it like this
&lt;code class=&quot;language-text&quot;&gt;ls -la $(which zstd)&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&quot;mimemagic&quot;&gt;&lt;a href=&quot;#mimemagic&quot; aria-label=&quot;mimemagic permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;mimemagic&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt; brew install shared-mime-info
 gem install mimemagic -v &amp;#39;0.3.10&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;sassc&quot;&gt;&lt;a href=&quot;#sassc&quot; aria-label=&quot;sassc permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;sassc&lt;/h2&gt;
&lt;p&gt;In this case I just updated the gem because they solved the issue in newer versions.
&lt;code class=&quot;language-text&quot;&gt;bundle update sassc&lt;/code&gt;
It installed without issues using v2.4.0&lt;/p&gt;
&lt;h2 id=&quot;miniracer&quot;&gt;&lt;a href=&quot;#miniracer&quot; aria-label=&quot;miniracer permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;miniracer&lt;/h2&gt;
&lt;p&gt;While trying to run rake tasks, mini_racer throw some errors.:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;dyld: lazy symbol binding failed: Symbol not found: __ZN2v82V813InitializeICUEPKc  Referenced from: /Users/&amp;lt;user&amp;gt;/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/mini_racer-0.2.6/lib/mini_racer_extension.bundle&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;br&gt;
They addressed those issues on newer versions, so again, just updating the gem does the trick:&lt;br&gt;
&lt;code class=&quot;language-text&quot;&gt;bundle update mini_racer&lt;/code&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Tips for Teaching (WIP)]]></title><description><![CDATA[This article is a draft/work in progress. I will be updating it while I figure out more strategies and teaching/learning schemes for my students.]]></description><link>https://blog2me.netlify.comtips-for-teaching</link><guid isPermaLink="false">https://blog2me.netlify.comtips-for-teaching</guid><pubDate>Mon, 16 Nov 2020 00:09:27 GMT</pubDate><content:encoded>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Set clear expectations.&lt;/strong&gt; Provide a clear summary/syllabus beforehand, make it easy to understand, and encourage them to do research on those topics before lessons. It’s easier to learn when you prepared your mindset for it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Value failure while learning&lt;/strong&gt;.  Move fast and break things. The fear of failure often slows down the learning process, let them know that bugs and errors are a good way to learn from them. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use real-world process&lt;/strong&gt;. Use github repos for the assignments, pull request, and code reviews for evaluations (and evaluate with pass/no-pass instead of scores)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allow them to copy-paste, but encourage learning through it.&lt;/strong&gt; Teach them how to find answers on stack overflow, github, or by reading blog articles. Allow them to implement them while learning to do so.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use best practices&lt;/strong&gt;. Don’t use placeholders for coding examples like foo/bar, and teach them how to look for best practices by themselves.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discourage memorization&lt;/strong&gt;. Usually, students came with the idea of learning everything by memory. Teach them that what they need to learn is how to solve problems, not the actual implementation. Let them know that in real jobs they will be able to use all type of resources, so they don’t feel the need to memorize entire APIs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Show them how to learn something that you don’t know.&lt;/strong&gt; Be the example of how to research something that you don’t know yet and how to use it in a real scenario.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Write the lessons in text, you can use them later as blog articles or as text complement to other resources.&lt;br&gt;
From the text version, you can later transform that into visual resentations, videos, or podcasts.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Staying up to date, engineering blogs to avoid tech FOMO]]></title><description><![CDATA[How do I keep up to date with the latest dev and tech news (and avoid closing myself to just my stack)]]></description><link>https://blog2me.netlify.comstaying-up-to-date</link><guid isPermaLink="false">https://blog2me.netlify.comstaying-up-to-date</guid><pubDate>Sun, 15 Nov 2020 23:31:39 GMT</pubDate><content:encoded>&lt;p&gt;These 3 sources are a great companion for a morning coffee before starting the routine. No scoped to any specific language/dev stack.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://engineeringblogs.xyz/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://engineeringblogs.xyz/ &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://dev.to/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://dev.to/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://daily.dev/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://daily.dev/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My current approach is to have daily.dev extension (curated dev posts on chrome/edge new tab), read every morning the titles of engineering blogs, and be subscribed to dev.to mailing list.&lt;/p&gt;
&lt;p&gt;In addition to this, I’m also subscribed to some weekly newsletters for the languages/stacks that I’m &lt;br&gt;
ed in:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://rubyweekly.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://rubyweekly.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://javascriptweekly.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://javascriptweekly.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://frontendfoc.us/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://frontendfoc.us/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://react.statuscode.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://react.statuscode.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://mobiledevweekly.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://mobiledevweekly.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br&gt;
To avoid procastination, I only commit between 30 or 40 minutes in the morning for this, and if I want/need to read more, I leave those important articles opened in tabs for later (after lunch or after finishing my daily routine)&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Solving disk space issues at EC2 AWS Linux instances]]></title><description><![CDATA[A common issue that I faced on small AWS instances, and a quick easy fix for it (aka: inodes 100%)]]></description><link>https://blog2me.netlify.comaws-disk-space-issue</link><guid isPermaLink="false">https://blog2me.netlify.comaws-disk-space-issue</guid><pubDate>Thu, 20 Aug 2020 20:52:08 GMT</pubDate><content:encoded>&lt;p&gt;More often than not (sadly) I struggle with the next error message at my amazon aws instances:&lt;br&gt;
&lt;code class=&quot;language-text&quot;&gt;unable to create &amp;#39;/something/something.tmp&amp;#39;: No space left on device&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So, disk space issue… probably big log files that needs to be wiped or something like that? not always that easy.&lt;/p&gt;
&lt;h2 id=&quot;how-to-diagnose-the-issue&quot;&gt;&lt;a href=&quot;#how-to-diagnose-the-issue&quot; aria-label=&quot;how to diagnose the issue permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;How to diagnose the issue&lt;/h2&gt;
&lt;p&gt;When I ran &lt;code class=&quot;language-text&quot;&gt;df -H&lt;/code&gt; the output says that I still have some space left, so what is it?&lt;/p&gt;
&lt;p&gt;Well, is possible that is the inodes allocation. Run &lt;code class=&quot;language-text&quot;&gt;df -i&lt;/code&gt; to check them out.
If you find that you are at 100% or close to it, you need to get rid of them.&lt;/p&gt;
&lt;h2 id=&quot;how-to-locate-the-files-to-remove&quot;&gt;&lt;a href=&quot;#how-to-locate-the-files-to-remove&quot; aria-label=&quot;how to locate the files to remove permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;How to locate the files to remove&lt;/h2&gt;
&lt;p&gt;Where are they at? You can try to run this script (that doesnt needs to create a tmp file for it, since we dont have space left for that)&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;cd /
sudo find . -xdev -type f | cut -d &amp;quot;/&amp;quot; -f 2 | sort | uniq -c | sort -n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;common-cause-linux-headers-inodes&quot;&gt;&lt;a href=&quot;#common-cause-linux-headers-inodes&quot; aria-label=&quot;common cause linux headers inodes permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Common cause: linux-headers inodes&lt;/h2&gt;
&lt;p&gt;But, you can save some time if you first try for the most common source of this issue… &lt;strong&gt;old linux-headers&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;They are located at /usr/src/ folder, just run a &lt;code class=&quot;language-text&quot;&gt;ll&lt;/code&gt; and delete some to recover some inodes space (you wont be able to purge them using apt-get if you are at 100% disk usage). &lt;strong&gt;Don’t delete them all&lt;/strong&gt; they are used by linux, just get rid of some old versions that may be lingering there.&lt;/p&gt;
&lt;p&gt;So, for example, run:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;sudo rm -rf  linux-headers-4.4.0-130/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then you can try to purge some of them using &lt;code class=&quot;language-text&quot;&gt;sudo apg-get -f autoremove&lt;/code&gt; (and then manually remove old ones that weren’t removed that way)&lt;/p&gt;
&lt;h2 id=&quot;tldr&quot;&gt;&lt;a href=&quot;#tldr&quot; aria-label=&quot;tldr permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;TLDR;&lt;/h2&gt;
&lt;p&gt;Check if the issue are the inodes by running &lt;code class=&quot;language-text&quot;&gt;df -i&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If its at 100% or close to it, try removing old linux-headers to recover some space. Don’t go crazy on this step, try removing only 1 of the oldest images and then run &lt;code class=&quot;language-text&quot;&gt;sudo apt-get -f autoremove&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;They are located at &lt;code class=&quot;language-text&quot;&gt;/usr/src/&lt;/code&gt; folder (you can remove them with &lt;code class=&quot;language-text&quot;&gt;rm -rf&lt;/code&gt;)&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Ruby on windows, a week later]]></title><description><![CDATA[A collection of "gotchas" after a week of playing with ruby on windows instead of my regular macOS env]]></description><link>https://blog2me.netlify.comruby-o-windows-2</link><guid isPermaLink="false">https://blog2me.netlify.comruby-o-windows-2</guid><pubDate>Sun, 10 May 2020 23:22:47 GMT</pubDate><content:encoded>&lt;p&gt;A few days ago I wrote about how to get started on ruby using just windows (no WSL2). And so far it was a good experience, but with a few gotchas when I tried to get a client project working on the env.&lt;/p&gt;
&lt;h2 id=&quot;no-rvm-or-rbenv&quot;&gt;&lt;a href=&quot;#no-rvm-or-rbenv&quot; aria-label=&quot;no rvm or rbenv permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;No RVM or rbenv&lt;/h2&gt;
&lt;p&gt;Those tools are specific for linux/macos, but don’t worry, the solution provided for windows works excellent: &lt;a href=&quot;https://bitbucket.org/jonforums/uru/src/master/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Let me introduce you to URU&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you installed ruby following &lt;a href=&quot;https://blog2me.netlify.app/ror-on-windows&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;my last post&lt;/a&gt;, you only need to add it bin path to uru.&lt;/p&gt;
&lt;p&gt;To install uru you can just download the binary and add it to a folder that is already in your PATH env (so you can start using the cli in your terminal), or &lt;a href=&quot;https://bitbucket.org/jonforums/uru/wiki/Scoop&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;install it through scoop&lt;/a&gt;: &lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;scoop install https://bitbucket.org/jonforums/uru/downloads/uru.json&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then you can add your existent ruby version to it with this command:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;uru admin add C:\Ruby24-x64\bin&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then to install other ruby versions just download the installer from &lt;a href=&quot;https://rubyinstaller.org/downloads/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://rubyinstaller.org/downloads/&lt;/a&gt;, while installing make sure that you don’t overwrite any other stuff and that it just installs in a different folder. After you are done just run &lt;code class=&quot;language-text&quot;&gt;uru admin add &amp;lt;the_other_ruby_version_bin_path&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you want to save disk space by re-using the devkit through different ruby versions, &lt;a href=&quot;https://github.com/oneclick/rubyinstaller2/wiki/FAQ#user-content-shared-devkit&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;follow this guide&lt;/a&gt;. After that just install ruby versions without the devkit, they will fallback automatically to use it from the shared parent folder.&lt;/p&gt;
&lt;p&gt;You can check your available ruby versions with &lt;code class=&quot;language-text&quot;&gt;uru ls&lt;/code&gt; and change to a different one using the names listed from that command, like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;$ uru &lt;span class=&quot;token function&quot;&gt;ls&lt;/span&gt;
    224p230     &lt;span class=&quot;token builtin class-name&quot;&gt;:&lt;/span&gt; ruby &lt;span class=&quot;token number&quot;&gt;2.2&lt;/span&gt;.4p230 &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2015&lt;/span&gt;-12-16 revision &lt;span class=&quot;token number&quot;&gt;53155&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;x64-mingw32&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    2410p364    &lt;span class=&quot;token builtin class-name&quot;&gt;:&lt;/span&gt; ruby &lt;span class=&quot;token number&quot;&gt;2.4&lt;/span&gt;.10p364 &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2020&lt;/span&gt;-03-31 revision &lt;span class=&quot;token number&quot;&gt;67879&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;x64-mingw32&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    266p146     &lt;span class=&quot;token builtin class-name&quot;&gt;:&lt;/span&gt; ruby &lt;span class=&quot;token number&quot;&gt;2.6&lt;/span&gt;.6p146 &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2020&lt;/span&gt;-03-31 revision &lt;span class=&quot;token number&quot;&gt;67876&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;x64-mingw32&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

$ uru 2410p364
---&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; Now using ruby &lt;span class=&quot;token number&quot;&gt;2.4&lt;/span&gt;.10p364 tagged as &lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;2410p364&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;&lt;/span&gt;

$ ruby --version
ruby &lt;span class=&quot;token number&quot;&gt;2.4&lt;/span&gt;.10p364 &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2020&lt;/span&gt;-03-31 revision &lt;span class=&quot;token number&quot;&gt;67879&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;x64-mingw32&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Gemsets will be scoped to those ruby versions. You can manage different gemsets for that ruby version using &lt;code class=&quot;language-text&quot;&gt;uru admin gemset init your_gemset_name&lt;/code&gt; in your specific project folder.&lt;/p&gt;
&lt;h2 id=&quot;openssl-rubygems-and-bundler&quot;&gt;&lt;a href=&quot;#openssl-rubygems-and-bundler&quot; aria-label=&quot;openssl rubygems and bundler permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;OpenSSL, rubygems and bundler&lt;/h2&gt;
&lt;p&gt;This seems to be a popular one, and a easy one to fix tho. In my project I have something like this in my gemfile:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;git_source&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;:github&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;repo_name&lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;
  repo_name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token delimiter tag&quot;&gt;#{&lt;/span&gt;repo_name&lt;span class=&quot;token delimiter tag&quot;&gt;}&lt;/span&gt;&lt;/span&gt;/&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token delimiter tag&quot;&gt;#{&lt;/span&gt;repo_name&lt;span class=&quot;token delimiter tag&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;unless&lt;/span&gt; repo_name&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;include&lt;span class=&quot;token operator&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token string&quot;&gt;&quot;https://github.com/&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token delimiter tag&quot;&gt;#{&lt;/span&gt;repo_name&lt;span class=&quot;token delimiter tag&quot;&gt;}&lt;/span&gt;&lt;/span&gt;.git&quot;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;end&lt;/span&gt;

gem &lt;span class=&quot;token string&quot;&gt;&apos;some_gems_from_github&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; github&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&apos;/usr/repo&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; branch&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&apos;master&apos;&lt;/span&gt;

source &lt;span class=&quot;token string&quot;&gt;&apos;https://rails-assets.org&apos;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;do&lt;/span&gt;
  gem &lt;span class=&quot;token string&quot;&gt;&apos;rails-assets-tether&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&apos;&gt;= 1.3.3&apos;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The issue here, at least in fresh installations, will be related to https and openssl.
It will complain about the certificates while trying to fetch from these sources.&lt;/p&gt;
&lt;p&gt;I highly suggest to use &lt;a href=&quot;https://chocolatey.org/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Chocolatey&lt;/a&gt; and &lt;a href=&quot;https://scoop.sh/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Scoop&lt;/a&gt; to install this kind of stuff. In this case, we need OpenSSL: &lt;code class=&quot;language-text&quot;&gt;choco install openssl&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If the error persists even after installing openssl (and restarting your terminal) you can try with regular http sources, or go with a better long term solution: fix your certificates.&lt;/p&gt;
&lt;p&gt;In unix systems we usually have rvm or rbenv, and at least with rvm you have a script ready that fixes the rubygems certificates for you if the problem arises. In windows you will need to do that manually, but there is a really good step by step guide: &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://bundler.io/v2.0/guides/rubygems_tls_ssl_troubleshooting_guide.html#automated-ssl-check&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://bundler.io/v2.0/guides/rubygems_tls_ssl_troubleshooting_guide.html#automated-ssl-check&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The step that actually did the trick for me is to download the cacert.pem file in my ruby directory, and set a SSL&lt;em&gt;CERT&lt;/em&gt;FILE env variable with the path to it.&lt;/p&gt;
&lt;h2 id=&quot;puma&quot;&gt;&lt;a href=&quot;#puma&quot; aria-label=&quot;puma permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Puma&lt;/h2&gt;
&lt;p&gt;So we had multiple workers and daemonized setup for development in this project, and neither of those options are available for windows.&lt;/p&gt;
&lt;p&gt;This step is simple, just change your puma config to run normally with 1 worker for windows. Rubygems actually has a helper to check for windows os locally with &lt;code class=&quot;language-text&quot;&gt;Gem.win_platform?&lt;/code&gt;, so you can have a different puma setup for windows.&lt;/p&gt;
&lt;h2 id=&quot;activeadmin-and-method-calls-without-parenthesis&quot;&gt;&lt;a href=&quot;#activeadmin-and-method-calls-without-parenthesis&quot; aria-label=&quot;activeadmin and method calls without parenthesis permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;ActiveAdmin and method calls without parenthesis&lt;/h2&gt;
&lt;p&gt;Is a common practice in ActiveAdmin to write stuff like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;#syntax error on windows, unexpected &amp;#39;{&amp;#39;
scope :completed { |scope| scope.where(completed: true) }&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And I still can’t figure out if the error belongs to the version of ruby that I’m using on this windows machine or to something else related with ActiveAdmin dsl… but it expects to have the explicit parenthesis on that scope method call, like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;#This works fine on windows
scope(:completed) { |scope| scope.where(completed: true) }&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;linux-paths&quot;&gt;&lt;a href=&quot;#linux-paths&quot; aria-label=&quot;linux paths permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Linux paths&lt;/h2&gt;
&lt;p&gt;This last one is obvious, but if you have a gem that requires something from linux systems (like custom loggers and stuff like that), they won’t work. You can bypass them using again the &lt;code class=&quot;language-text&quot;&gt;Gem.win_platform?&lt;/code&gt; helper in their initializers or even in the Gemfile:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;gem &amp;#39;i_use_linux_paths&amp;#39; unless Gem.win_platform?&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;final-thoughts&quot;&gt;&lt;a href=&quot;#final-thoughts&quot; aria-label=&quot;final thoughts permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Final thoughts&lt;/h2&gt;
&lt;p&gt;Like I said in the first post, this is not intended to replace your unix development environment, and it shouldn’t since your code is 99% sure going to run in some kind of linux distro when you deploy it to production.&lt;/p&gt;
&lt;p&gt;Still, is really handy to be able to do some quick maintenance work without having to jump into my macbook for it. The problems that I listed here were specific to this project, which only knew unix until this week (and its 3 years old). I expect to find different issues in different projects, and I plan to document them here if they pop up in the future.&lt;/p&gt;
&lt;p&gt;Lastly, if you start a fresh new app in windows &lt;/p&gt;</content:encoded></item><item><title><![CDATA[Ruby on Rails on Windows (and without wsl2)]]></title><description><![CDATA[After several iterations on wsl2, different configurations and workarounds, I decided to move to a just windows approach, which surprisingly works wonders]]></description><link>https://blog2me.netlify.comror-on-windows</link><guid isPermaLink="false">https://blog2me.netlify.comror-on-windows</guid><pubDate>Thu, 07 May 2020 00:37:04 GMT</pubDate><content:encoded>&lt;p&gt;Don’t get me wrong, I still think that working on a Unix based system is the best way to go for this server development environments since I’m almost sure that the code will be running in some Linux distro at production.&lt;/p&gt;
&lt;p&gt;But being able to play with code in my windows pc is still helpful! Sometimes you just want to throw some code and play with it at that moment, and switching OS/computers may now be suitable always.&lt;/p&gt;
&lt;p&gt;And if you want to teach someone to code, it’s going to be way painless to the newcomers to just stick with their OS (and for my students that is windows 99% of the time)&lt;/p&gt;
&lt;p&gt;Development with rails on windows in 2020 is surprisingly easy, way faster than it was in the past, and the setup experience (with the LTS versions) is smooth.&lt;/p&gt;
&lt;h2 id=&quot;how-to---first-steps&quot;&gt;&lt;a href=&quot;#how-to---first-steps&quot; aria-label=&quot;how to   first steps permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;How to - First steps&lt;/h2&gt;
&lt;p&gt;First, you will need to install some dependencies to get started with your development environment.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download a good text editor like &lt;a href=&quot;https://code.visualstudio.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;VS Code&lt;/a&gt; or &lt;a href=&quot;https://www.sublimetext.com/3&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Sublime Text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download and install &lt;a href=&quot;https://git-scm.com/download/win&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;git for windows&lt;/a&gt;. You will be using the git bash terminal from it! while installing stick with the default options.&lt;/li&gt;
&lt;li&gt;Download and install &lt;a href=&quot;http://nodejs.org/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;node.js for windows&lt;/a&gt; (in the last step of the installer you can opt-in to install some extra dependencies like chocolatey and python, 3 birds in one shot)&lt;/li&gt;
&lt;li&gt;Download and install &lt;a href=&quot;https://classic.yarnpkg.com/en/docs/install/#windows-stable&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;yarn&lt;/a&gt; which is the package manager for javascript that Rails is using nowadays.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now we are ready to start with the ruby magic!&lt;/p&gt;
&lt;p&gt;Download version &lt;a href=&quot;https://rubyinstaller.org/downloads/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Ruby+Devkit 2.6.6-1 (x64)&lt;/a&gt; from RubyInstaller. &lt;strong&gt;Don’t download a newer version&lt;/strong&gt; unless it is in bold fonts and with an arrow on the left of the name. The version with those indicators is the stable one, and for windows, you &lt;strong&gt;need&lt;/strong&gt; maximum compatibility. A newer version may work, but some gems are still not updated for windows+latest ruby version (like nokogiri, at the time of the writing).&lt;/p&gt;
&lt;p&gt;While installing, click next and stick with the defaults. The last step will start a bash console where you are prompted to select one of the 3 options. Since this is your first installation, press 1 and then Enter &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/oubn6uR.png&quot;&gt;&lt;/p&gt;
&lt;p&gt;Now let’s install rails 6 like you always do: &lt;code class=&quot;language-text&quot;&gt;gem install rails&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And that’s it!&lt;/p&gt;
&lt;p&gt;Just a few gems may depend on libraries that don’t play nice with windows all the time, so it’s not a perfect solution, but for my day to day use cases, it works excellent! (and there’s a lot of support from the community at StackOverflow and relatives GitHub issues)&lt;/p&gt;
&lt;p&gt;Hack a nice day.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Learn react native by example]]></title><description><![CDATA[A series of videos that you can use to learn React native and the workflow to transform a sketch/adobe xd design into code.]]></description><link>https://blog2me.netlify.comdribble2react</link><guid isPermaLink="false">https://blog2me.netlify.comdribble2react</guid><pubDate>Tue, 05 May 2020 21:42:43 GMT</pubDate><content:encoded>&lt;p&gt;I’ve been watching the youtube series based on this github repo &lt;a href=&quot;https://github.com/react-ui-kit/dribbble2react&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://github.com/react-ui-kit/dribbble2react&lt;/a&gt; and they are pure gold content.&lt;/p&gt;
&lt;p&gt;You will be able to see how a react dev goes from a Sketch/Adobe XD design to a live react native application.&lt;/p&gt;
&lt;p&gt;The repository contains the final code for each project, as well the links to the design files/posts at dribble.&lt;/p&gt;
&lt;p&gt;Bonus track: another amazing source to learn react from videos is &lt;a href=&quot;https://designcode.io/&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;https://designcode.io/&lt;/a&gt; but the difference is that you will need to invest in a subscription first (still completely worth it!)&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Twitch IRC event message layout (sub example)]]></title><description><![CDATA[Twitch event message example from IRC msgs]]></description><link>https://blog2me.netlify.comtwitch-irc-events-messages</link><guid isPermaLink="false">https://blog2me.netlify.comtwitch-irc-events-messages</guid><pubDate>Tue, 05 May 2020 21:11:37 GMT</pubDate><content:encoded>&lt;p&gt;Here is an example of the message string (with breakpoints to read it easier) received from twitch irc chat when a user subscribes to a channel.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt; @badge-info=subscriber/0
 badges=moderator/1,subscriber/0,premium/1
 color=#2226B2
 display-name=burago18
 emotes=
 flags=
 id=229ecd51-1ec2-4dda-ae43-6ac4058a25a3
 login=burago18
 mod=1
 msg-id=sub
 msg-param-cumulative-months=1
 msg-param-months=0
 msg-param-should-share-streak=0
 msg-param-sub-plan-name=Channel\sSubscription\s(yourchannel)
 msg-param-sub-plan=1000
 room-id=36476430
 subscriber=1
 system-msg=burago18\ssubscribed\sat\sTier\s1.
 tmi-sent-ts=1574904233310
 user-id=44812924
 user-type=mod :tmi.twitch.tv USERNOTICE #yourchannel&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Useful information to parse from there are the msg-param-* parts, where you can get the subscription level selected, how many months and other stuff that they use to display the event in the chat properly.&lt;/p&gt;
&lt;p&gt;I’m using this to display notifications in a html5 canvas, which is rendered over the video stream in OBS, and also for a loyalty points system within a chat bot for that channel.&lt;/p&gt;
&lt;p&gt;Similar to this layout theres one for twitch points, twitch bits, raids, and other events with a custom style in the chat.&lt;/p&gt;
&lt;p&gt;I will post the example in a future post, I would like to document how I solved many features requested for chatbots, loyalty systems, discord integration, etc.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Nginx per-site configuration]]></title><description><![CDATA[A quick reminder on how sites-available and sites-enabled configurations work on Nginx and how to properly update them.]]></description><link>https://blog2me.netlify.comnginx-per-site-conf</link><guid isPermaLink="false">https://blog2me.netlify.comnginx-per-site-conf</guid><pubDate>Mon, 04 May 2020 14:48:44 GMT</pubDate><content:encoded>&lt;p&gt;Somehow I wasn’t able to find this old mechanic in the documentations and within the first page of google results while looking for it for a memory refresh, so here we go with a rustic explanation, mostly for myself&lt;/p&gt;
&lt;p&gt;There is a modular way to write nginx.conf blocks (http location config blocks for example), in a per-site fashion (similar approach as using  ‘a2ensite’ and ‘a2dissite’ in apache)&lt;/p&gt;
&lt;p&gt;This is helpful to keep an easy to maintain conf file when you have multiple sites/domains/subdomains configurations in the same server.&lt;/p&gt;
&lt;h2 id=&quot;quick-how-to&quot;&gt;&lt;a href=&quot;#quick-how-to&quot; aria-label=&quot;quick how to permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Quick how to&lt;/h2&gt;
&lt;p&gt;Change the site config at &lt;code class=&quot;language-text&quot;&gt;/sites-available/&lt;/code&gt; and then make sure that the symlink to that file exists at &lt;code class=&quot;language-text&quot;&gt;/sites-enabled/&lt;/code&gt;, if it doesn’t create it with &lt;code class=&quot;language-text&quot;&gt;ln -s&lt;/code&gt;, example:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;ln -s /etc/nginx/sites-available/mysite-production /etc/nginx/sites-enabled/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then restart nginx&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot;&gt;&lt;a href=&quot;#how-it-works&quot; aria-label=&quot;how it works permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;How it works&lt;/h2&gt;
&lt;p&gt;Nginx consists of modules which are controlled by directives specified in the configuration file that you can usually find at &lt;code class=&quot;language-text&quot;&gt;/etc/nginx/nginx.conf\&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A way to load the per-site configuration is having this at the bottom in that file:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;location @mysite_production {
  include /etc/nginx/conf.d/*.conf;
  include /etc/nginx/sites-enabled/*;
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;so it will include the configuration from the files found in that folder there, which are actually symlinks to the ones at /sites-available folder, more about that next.&lt;/p&gt;
&lt;h2 id=&quot;how-to-update-them&quot;&gt;&lt;a href=&quot;#how-to-update-them&quot; aria-label=&quot;how to update them permalink&quot; class=&quot;anchor&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;How to update them&lt;/h2&gt;
&lt;p&gt;The way that you can opt-in which one to include in the live configuration is adding or removing symlinks from &lt;code class=&quot;language-text&quot;&gt;/sites-available/&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;/sites-enabled/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you update the config file located at &lt;code class=&quot;language-text&quot;&gt;/sites-available/mysite-production&lt;/code&gt; it will be included in the main nginx configuration only if the symlink exists in the &lt;code class=&quot;language-text&quot;&gt;/sites-enabled/&lt;/code&gt; folder. Changes will be reflected at sites-enabled since the symlink just links to the original file from sites-available&lt;/p&gt;
&lt;p&gt;That way you can serve multiple configurations, and enable/disable them to quickly test stuff or to scope per-site or even per-environment configurations.&lt;/p&gt;
&lt;p&gt;To create a symlink you can write something like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;ln -s /etc/nginx/sites-available/mysite-production /etc/nginx/sites-enabled/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And to remove it just go with the old rm or unlink command, pointing to the symlink path.&lt;/p&gt;
&lt;p&gt;After that make sure to restart nginx to pick up the config changes &lt;code class=&quot;language-text&quot;&gt;sudo service nginx restart&lt;/code&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Hello world]]></title><description><![CDATA[The ultimate original post, right? But how are you not going to publish a hello world post to start a new app? (a blog in this case)]]></description><link>https://blog2me.netlify.com/posts/hello-world/</link><guid isPermaLink="false">https://blog2me.netlify.com/posts/hello-world/</guid><pubDate>Wed, 28 Aug 2019 13:28:14 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;The ultimate original post, right? But how are you not going to publish a hello world post to start a new app? (a blog in this case)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, hello random person on the internet! I’m not planning to promote myself as a product with this blog, I’m here just to satisfy my thirst for sharing and writing.&lt;/p&gt;
&lt;p&gt;You are welcome to share your thoughts too, say hello, and if you have time, point me out errors! (that will be super helpful, since I decided to write this in English, which is not my main language nor even I studied it)&lt;/p&gt;
&lt;p&gt;Upcoming posts ideas: what I’ve been doing/coding, lifestyles app experimentation, some teaching stuff, and whatever else that hits my mind.&lt;/p&gt;
&lt;p&gt;Thanks for reading!&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;blog.start();&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content:encoded></item></channel></rss>