<?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[Jhordy's blog]]></title><description><![CDATA[Hi, I'm Jhordy Gavinchu, a Software Engineer with a deep passion for Web Development especially for Frontend Technologies.]]></description><link>https://blog.jhordyess.com</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 10:29:30 GMT</lastBuildDate><atom:link href="https://blog.jhordyess.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Exploring CSS Units: A Comprehensive Reference Guide]]></title><description><![CDATA[CSS units play a crucial role in web development, allowing developers to control the size, positioning, and layout of website elements. While there are several variants available, such as pixels (px), percentage (%), em, rem, or viewport units; it's ...]]></description><link>https://blog.jhordyess.com/exploring-css-units-a-comprehensive-reference-guide</link><guid isPermaLink="true">https://blog.jhordyess.com/exploring-css-units-a-comprehensive-reference-guide</guid><category><![CDATA[css units]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Responsive Web Design]]></category><dc:creator><![CDATA[Jhordy Gavinchu]]></dc:creator><pubDate>Tue, 17 Oct 2023 04:00:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/l3N9Q27zULw/upload/df892a62b1add99f1fd624a1629de78d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>CSS units play a crucial role in web development, allowing developers to control the size, positioning, and layout of website elements. While there are several variants available, such as pixels (px), percentage (%), em, rem, or viewport units; it's important to note that the list of CSS units is extensive.</p>
<p>In this article, we will simplify the vast world of CSS units by dividing them into two key categories: absolute and relative. As we explore these categories, you'll find an invaluable reference that helps you choose the most suitable unit for a specific design requirement.</p>
<h1 id="heading-absolute-units">"Absolute" Units</h1>
<p>Absolute units are fixed and do not change their values. The most commonly used ones are pixels and points. Here's a quick reference table:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Unit</td><td>Name</td><td>Equivalent</td></tr>
</thead>
<tbody>
<tr>
<td><code>cm</code></td><td>Centimeters</td><td>2.54 cm = 1 in</td></tr>
<tr>
<td><code>mm</code></td><td>Millimeters</td><td>10 mm = 1 cm</td></tr>
<tr>
<td><code>q</code></td><td>Quarter-millimeters</td><td>40 Q = 1 cm</td></tr>
<tr>
<td><code>in</code></td><td>Inches</td><td>1 in = 2.54 cm = 96 px</td></tr>
<tr>
<td><code>pc</code></td><td>Picas</td><td>6 pc = 1 in</td></tr>
<tr>
<td><code>pt</code></td><td>Points</td><td>72 pt = 1 in</td></tr>
<tr>
<td><code>px</code></td><td>Pixels</td><td>96 px = 1 in</td></tr>
</tbody>
</table>
</div><p>Using the conversion values provided in the table, you can easily convert between these units. For example, to convert 12px to centimeters (cm), you can use the following calculation:</p>
<p>$${\color{orange}12}\cancel {px}\times\frac{1\cancel{in}}{{\color{orange}96}\cancel {px}}\times\frac{\color{orange}2.54\color{green}cm}{1\cancel{in}}=12\div96\times2.54=0.3175cm$$</p><p>It's worth noting that certain "absolute" units may not be strictly absolute in today's web development context. For instance, if you create a div with a height of "1in" and measure it on the screen(with a simple ruler), you'll find that it's not precisely 1 inch. Despite an interesting <a target="_blank" href="https://www.smashingmagazine.com/2021/07/css-absolute-units/">historical background</a>, it's unusual today to use any "absolute" units beyond pixels (px).</p>
<p>Additionally, I have created a web project at <a target="_blank" href="https://jhordyess.github.io/css-units/">https://jhordyess.github.io/css-units/</a> that allows you to convert between these absolute units and provides an option for precise conversions using the diagonal length of a screen.</p>
<h1 id="heading-relative-units">Relative Units</h1>
<p>Relative units, on the other hand, are designed to adapt to their parent. They provide flexibility and responsiveness, making it easier to create websites that adjust to different screen sizes and resolutions.</p>
<p>One commonly used relative unit is the percentage (%). It allows elements to be sized relative to their parent containers.</p>
<p>Another significant relative unit is <code>fr</code>. The flexible unit/fraction is used in conjunction with flex or grid elements.</p>
<p>However, there are 3 main categories of relative units: font-relative units, viewport units, and container query units, let's explore them.</p>
<h2 id="heading-font-relative-units">Font-Relative Units</h2>
<p>CSS provides several font-relative units that are based on specific font properties. Here's their reference table:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Unit</td><td>Relative to</td></tr>
</thead>
<tbody>
<tr>
<td><code>em</code></td><td>The inherited <code>font-size</code>.</td></tr>
<tr>
<td><code>ex</code></td><td>The height of the letter "x" in the inherited font</td></tr>
<tr>
<td><code>cap</code></td><td>The height of a capital Latin letter in the inherited font.</td></tr>
<tr>
<td><code>ch</code></td><td>The <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Glossary/Advance_measure">advance measure</a> of the character “0” in the inherited font.</td></tr>
<tr>
<td><code>ic</code></td><td>The <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Glossary/Advance_measure">advance measure</a> of the water ideograph "水" in the inherited font.</td></tr>
<tr>
<td><code>lh</code></td><td>The inherited <code>line-height</code>.</td></tr>
</tbody>
</table>
</div><p>Additionally, you can make these font-relative units relative to the <strong>root element</strong> of your HTML, here are the units relative to the root element:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Unit</td><td>Relative to</td></tr>
</thead>
<tbody>
<tr>
<td><code>rem</code></td><td>The <code>font-size</code> of the root element (default: <code>16px</code>).</td></tr>
<tr>
<td><code>rex</code></td><td>The height of the letter "x" in the root element.</td></tr>
<tr>
<td><code>rcap</code></td><td>The height of a capital Latin letter in the root element.</td></tr>
<tr>
<td><code>rch</code></td><td>The <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Glossary/Advance_measure">advance measure</a> of the character "0" in the root element.</td></tr>
<tr>
<td><code>ric</code></td><td>The <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Glossary/Advance_measure">advance measure</a> of the water ideograph "水" in the root element.</td></tr>
<tr>
<td><code>rlh</code></td><td>The <code>line-height</code> of the root element (default: <code>1.2</code>, <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#normal">in most cases</a>).</td></tr>
</tbody>
</table>
</div><div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">The root element of a web page is <code>&lt;html&gt;</code>, so by customizing the values of the <code>&lt;html&gt;</code> element, the above relative values can be changed.</div>
</div>

<h2 id="heading-viewport-units">Viewport Units</h2>
<p>Viewport units are particularly useful when the sizing needs to be relative to the browser size or viewport itself. Here are the available viewport units:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Unit</td><td>Name</td><td>Relative to</td></tr>
</thead>
<tbody>
<tr>
<td><code>vw</code></td><td>Viewport width</td><td>The viewport width.</td></tr>
<tr>
<td><code>vh</code></td><td>Viewport height</td><td>The viewport height.</td></tr>
<tr>
<td><code>vi</code></td><td>Viewport inline</td><td>The <code>vw</code> in a horizontal(default) <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode">writing mode</a> and <code>vh</code> in a vertical writing mode.</td></tr>
<tr>
<td><code>vb</code></td><td>Viewport block</td><td>The <code>vh</code> in a horizontal(default) <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode">writing mode</a> and <code>vw</code> in a vertical writing mode.</td></tr>
<tr>
<td><code>vmin</code></td><td>Viewport minimum</td><td>The minimum between <code>vw</code> and <code>vh</code>.</td></tr>
<tr>
<td><code>vmax</code></td><td>Viewport maximum</td><td>The maximum between <code>vw</code> and <code>vh</code>.</td></tr>
</tbody>
</table>
</div><div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Note that the terms "inline" and "block" are part of the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flow_layout/Block_and_inline_layout_in_normal_flow">flow layout</a> and can also be applied to <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values">logical properties</a> in CSS.</div>
</div>

<p>Viewport units have two variants: the <strong>small</strong> and <strong>large</strong> viewport units. These are primarily used to support mobile browsers where the visibility of <em>dynamic toolbars</em> can alter the viewport size. Additionally, there exists a <strong>dynamic</strong> viewport that dynamically changes between the small and large viewport based on the visibility of the <em>dynamic toolbar</em>.</p>
<p>To differentiate between these viewports, you can use the prefixes "s", "l", and "d" as necessary. The prefixes indicate the desired viewport size. Here's a table illustrating the usage:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Unit</td><td>Small</td><td>Large</td><td>Dynamic</td></tr>
</thead>
<tbody>
<tr>
<td><code>vw</code></td><td><code>svw</code></td><td><code>lvw</code></td><td><code>dvw</code></td></tr>
<tr>
<td><code>vh</code></td><td><code>svh</code></td><td><code>lvh</code></td><td><code>dvh</code></td></tr>
<tr>
<td><code>vi</code></td><td><code>svi</code></td><td><code>lvi</code></td><td><code>dvi</code></td></tr>
<tr>
<td><code>vb</code></td><td><code>svb</code></td><td><code>lvb</code></td><td><code>dvb</code></td></tr>
<tr>
<td><code>vmin</code></td><td><code>svmin</code></td><td><code>lvmin</code></td><td><code>dvmin</code></td></tr>
<tr>
<td><code>vmax</code></td><td><code>svmax</code></td><td><code>lvmax</code></td><td><code>dvmax</code></td></tr>
</tbody>
</table>
</div><h2 id="heading-container-query-units">Container query units</h2>
<p>These units are used specifically within <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries">container queries</a>. Container queries allow you to apply styles based on the size of an element. They are an alternative to <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries">media queries</a>. Similar to viewport units, there are six container query units, corresponding to the viewport units. Here's the list of container query units:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Unit</td><td>Relative to</td></tr>
</thead>
<tbody>
<tr>
<td><code>cqw</code></td><td>The width of the query container.</td></tr>
<tr>
<td><code>cqh</code></td><td>The height of the query container.</td></tr>
<tr>
<td><code>cqi</code></td><td>The <code>cqw</code> in a horizontal(default) <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode">writing mode</a> and <code>cqh</code> in a vertical writing mode.</td></tr>
<tr>
<td><code>cqb</code></td><td>The <code>cqh</code> in a horizontal(default) <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode">writing mode</a> and <code>cqw</code> in a vertical writing mode.</td></tr>
<tr>
<td><code>cqmin</code></td><td>The minimum between <code>cqw</code> and <code>cqh</code>.</td></tr>
<tr>
<td><code>cqmax</code></td><td>The maximum between <code>cqw</code> and <code>cqh</code>.</td></tr>
</tbody>
</table>
</div><h1 id="heading-outro">Outro</h1>
<p>Finally! We've explored the extensive range of CSS units, from the traditional 'absolute' units to the relative units including font-relative units, viewport units, and container query units.</p>
<p>By using the right unit for each scenario, you can have better control. Feel free to try out different CSS units and let your imagination run wild with your amazing web projects!</p>
<p><img src="https://media.giphy.com/media/54r0JH1JY6VPi/giphy.gif" alt class="image--center mx-auto" /></p>
<h2 id="heading-useful-links">Useful Links</h2>
<ul>
<li><p><a target="_blank" href="https://www.w3.org/TR/css-values-4/#lengths">https://www.w3.org/TR/css-values-4/#lengths</a></p>
</li>
<li><p><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/length">https://developer.mozilla.org/en-US/docs/Web/CSS/length</a></p>
</li>
<li><p><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units">https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units</a></p>
</li>
<li><p><a target="_blank" href="https://web.dev/articles/viewport-units">https://web.dev/articles/viewport-units</a></p>
</li>
<li><p><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries">https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries</a></p>
</li>
</ul>
<div class="hn-embed-widget" id="saltenha"></div>]]></content:encoded></item><item><title><![CDATA[Web Design for Mobile: Adding Custom Devices in Firefox]]></title><description><![CDATA[One of the key best practices in developing websites is to consider mobile devices as the primary platform, given the increased usage of smartphones for internet browsing. This tutorial focuses on adding custom devices in Firefox for testing your web...]]></description><link>https://blog.jhordyess.com/web-design-for-mobile-adding-custom-devices-in-firefox</link><guid isPermaLink="true">https://blog.jhordyess.com/web-design-for-mobile-adding-custom-devices-in-firefox</guid><category><![CDATA[Responsive Web Design]]></category><category><![CDATA[Firefox]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[dev tools]]></category><dc:creator><![CDATA[Jhordy Gavinchu]]></dc:creator><pubDate>Wed, 11 Oct 2023 04:00:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/89xuP-XmyrA/upload/53ce92eef46140530b1c46e85e1f19e2.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One of the key best practices in developing websites is to consider mobile devices as the primary platform, given the increased usage of smartphones for internet browsing. This tutorial focuses on adding custom devices in Firefox for testing your websites across different screen sizes. The concepts of logical resolution and pixel ratio play a crucial role in this process so we also explain a basic theory too.</p>
<h1 id="heading-responsive-web-design-essentials">Responsive Web Design Essentials</h1>
<p>Responsive web design involves designing web pages that can adapt to different devices such as smartphones, tablets, and desktop computers. By utilizing CSS techniques like flexible layouts, fluid images, and media queries, web developers can customize the content and design based on the user's device and screen size.</p>
<h1 id="heading-understanding-resolutions-and-pixel-ratios">Understanding Resolutions and Pixel Ratios</h1>
<p>When purchasing a new phone, it's common to consider the display resolution before purchasing but this resolution is different from the resolution that we use for designing and developing webpages.</p>
<p>There are <strong>two types of resolutions</strong> in the context of display resolutions and web design, <strong>physical resolution</strong>, and <strong>logical resolution</strong>.</p>
<ul>
<li><p>Physical resolution (also known as native resolution or device resolution) refers to the number of pixels on the display, representing the hardware capability. For instance, the Samsung Galaxy S23+ has a physical resolution of 1080x2340 pixels.</p>
</li>
<li><p>Logical resolution (also known as CSS resolution, viewport, or effective resolution) indicates the resolution used by the operating system or graphics driver to render on the screen. It is usually lower than the physical resolution. For the Samsung Galaxy S23+, the logical resolution is 360x780 pixels.</p>
</li>
</ul>
<p>Calculating the logical resolution for a device involves using the <strong>pixel ratio</strong> (scale factor or density display). We can determine the logical resolution by dividing the physical resolution by the pixel ratio.</p>
<p>For the Samsung Galaxy S23+ with a pixel ratio of 3, the width of 1080 pixels becomes 360 pixels, and the height of 2340 pixels becomes 780 pixels. So, as you can see, the logical resolution can be calculated, only using the pixel ratio.</p>
<h1 id="heading-finding-phone-resolutions-and-pixel-ratios">Finding phone resolutions and pixel ratios</h1>
<p>While some phone and display brands may not provide the pixel ratio, I have prepared three methods to obtain this information:</p>
<h3 id="heading-using-the-phone-itself">Using the phone itself</h3>
<p>Visit the website <a target="_blank" href="https://www.mydevice.io">www.mydevice.io</a> from the desired phone to view the pixel ratio, viewport, and other valuable data. Notice that the viewport term is most commonly used when referring to the logical resolution.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">This method is possible when we have access to the desired phone.</div>
</div>

<h3 id="heading-searching-online">Searching online</h3>
<p>Utilize search engines to find websites that list devices alongside their viewports. For instance "Samsung Galaxy S23+ viewport". I regularly use: <a target="_blank" href="https://yesviz.com/mobiles.php">https://yesviz.com/mobiles.php</a> and <a target="_blank" href="https://viewportsizer.com/devices/">https://viewportsizer.com/devices/</a></p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">This method helps us to find the device information from the most popular devices.</div>
</div>

<h3 id="heading-self-calculation">Self-calculation</h3>
<p>In cases where you don't have access to precise device information, you can still make estimations with the display's PPI(pixels per inch) A helpful tool can be found at <a target="_blank" href="https://jhordyess.github.io/viewport-calculator/">jhordyess.github.io/viewport-calculator</a> simply input the device resolution and its PPI to get your calculations.</p>
<p>Another approach is to divide the PPI by 150, as Boris Smus recommends in his article on <a target="_blank" href="http://web.dev/high-dpi/#calculating-the-device-pixel-ratio">web.dev/high-dpi/</a>. For instance, if you have a device with 350 PPI, this method will give you a pixel ratio of 2.3.</p>
<p>$${350\over150} = 2.\overline{3}$$</p><div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">Note that these methods provide approximate values for the pixel ratio.</div>
</div>

<h1 id="heading-browser-dev-tools-overview">Browser Dev Tools Overview</h1>
<p>Web browsers like Firefox and Chrome offer powerful developer tools that simplify the design and testing of websites. These built-in tools allow developers to inspect and manipulate HTML, CSS, and JavaScript code in real-time, facilitating the optimization process. One of these features is device emulation.</p>
<p>To initiate device emulation in Firefox:</p>
<ol>
<li><p>Open the webpage you want to test.</p>
</li>
<li><p>Press <code>F12</code> to open the dev tools panel.</p>
</li>
<li><p>Click the "Responsive Design Mode" button.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696959784740/e8189492-e36f-4dfa-89e4-124fcebea5cb.png" alt class="image--center mx-auto" /></p>
<p>Now we have access to other useful features for responsive design, for example: device selector, internet throttling, or taking screenshots.</p>
<ul>
<li><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696963104424/22dc671e-cfa3-490e-b2d2-60918d71d77d.png" alt class="image--center mx-auto" /></li>
</ul>
<h1 id="heading-adding-custom-devices-in-firefox">Adding Custom Devices in Firefox</h1>
<p>Firefox's developer tools provide a method for adding custom devices to emulate specific mobile phones. By following these steps:</p>
<ol>
<li><p>From the previous steps, click the device selector button, followed by the "Edit list" option at the end of the drop-down menu, and a new panel called "Device Settings" will open.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696963846528/ef450197-82f8-4d7c-8e1a-29f9046ee1d5.png" alt class="image--center mx-auto" /></p>
<p> From here, you can add custom devices by clicking the "Add Custom Device" button. Input the relevant data, such as the device name, size, or pixel ratio. Here is an example for Samsung A30 based on: <a target="_blank" href="https://yesviz.com/devices/samsung-a30/">https://yesviz.com/devices/samsung-a30/</a></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696964749153/3be89e13-7cf6-434c-848f-35da91fabc7d.png" alt class="image--center mx-auto" /></p>
 <div data-node-type="callout">
 <div data-node-type="callout-emoji">☝</div>
 <div data-node-type="callout-text">An empty user agent string might suffice for design purposes, but in certain situations, it could become a necessity 🤔.</div>
 </div>
</li>
<li><p>Finally, saving the new device will allow you to select it from the device selector.</p>
</li>
</ol>
<p>Furthermore, you can choose whether to display or conceal default devices, and you also can modify or remove custom devices to suit your specific needs within the "Device Settings" section.</p>
<h1 id="heading-outro">Outro</h1>
<p>In this tutorial, we covered how to add custom devices in Firefox and explored the concepts of physical and logical resolutions, as well as pixel ratios.</p>
<p>By using the browser's dedicated developer tools, web designers can effectively test and optimize their websites for an optimal user experience across various screen sizes.</p>
<p><img src="https://media.giphy.com/media/nlJgJxq8kn2mL0frKt/giphy.gif" alt class="image--center mx-auto" /></p>
<h3 id="heading-useful-extra-links">Useful Extra Links:</h3>
<ul>
<li><p><a target="_blank" href="https://firefox-source-docs.mozilla.org/devtools-user/responsive_design_mode/">https://firefox-source-docs.mozilla.org/devtools-user/responsive_design_mode/</a></p>
</li>
<li><p><a target="_blank" href="https://cloudinary.com/glossary/device-pixel-ratio">https://cloudinary.com/glossary/device-pixel-ratio</a></p>
</li>
<li><p><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Viewport_concepts">https://developer.mozilla.org/en-US/docs/Web/CSS/Viewport_concepts</a></p>
</li>
<li><p><a target="_blank" href="https://yesviz.com/article.php">https://yesviz.com/article.php</a></p>
</li>
</ul>
<div class="hn-embed-widget" id="saltenha"></div>]]></content:encoded></item><item><title><![CDATA[Sass & Vite: A Guide for Your Next Workflow]]></title><description><![CDATA[Updated on: March 2025

In this tutorial, I will guide you through the process of creating a Vite project that leverages the power of Sass for efficient and streamlined styling. Vite is a fast-build tool designed to enhance development speed, while S...]]></description><link>https://blog.jhordyess.com/sass-vite-a-guide-for-your-next-workflow</link><guid isPermaLink="true">https://blog.jhordyess.com/sass-vite-a-guide-for-your-next-workflow</guid><category><![CDATA[vite]]></category><category><![CDATA[Sass]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[Jhordy Gavinchu]]></dc:creator><pubDate>Fri, 18 Aug 2023 19:34:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/_yMciiStJyY/upload/bb512a1782781910b26f3b4d927bd0fe.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Updated on: March 2025</p>
</blockquote>
<p>In this tutorial, I will guide you through the process of creating a Vite project that leverages the power of <a target="_blank" href="https://sass-lang.com/">Sass</a> for efficient and streamlined styling. Vite is a fast-build tool designed to enhance development speed, while Sass is a CSS preprocessor that offers a range of powerful features. By integrating Sass into your <a target="_blank" href="https://vitejs.dev/">Vite</a> project, you can optimize your CSS workflow and boost your productivity.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before we begin, ensure that the following are installed on your system:</p>
<ul>
<li><p><a target="_blank" href="https://nodejs.org/">Node.js</a> (along with either yarn or npm)</p>
</li>
<li><p><a target="_blank" href="https://code.visualstudio.com/">Visual Studio Code</a> (optional)</p>
</li>
<li><p>A shell (also known as a command line interface), such as Bash or PowerShell.</p>
</li>
</ul>
<h1 id="heading-what-is-vite">What is Vite</h1>
<p>Vite is a versatile package build tool that offers multiple templates for different frameworks and programming languages. The templates available include Vanilla, Vue.js, React, Preact, Lit, Svelte, Solid, and Qwik with JavaScript or TypeScript.</p>
<h2 id="heading-step-1-initialize-a-vite-project">Step 1: Initialize a Vite Project</h2>
<h3 id="heading-assistant-way">Assistant way</h3>
<p>Open your command line interface and run the following command:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># With yarn</span>
yarn create vite

<span class="hljs-comment"># With npm</span>
npm create vite@latest
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">The console will prompt you to install the '<code>create-vite</code>' package if you haven't already. If you're using <strong>Yarn</strong>, it will self-install; however, if you're using <strong>npm</strong>, it will ask for your confirmation before proceeding.</div>
</div>

<p>Follow the assistant's prompts and provide the project name, select the Vanilla framework, and choose the JavaScript variant.</p>
<h3 id="heading-rapid-way">Rapid way</h3>
<p>To create a project swiftly, run the following command:</p>
<pre><code class="lang-bash">yarn create vite sass-app --template vanilla

<span class="hljs-comment"># With npm from 7+</span>
npm create vite@latest sass-app -- --template vanilla
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">👀</div>
<div data-node-type="callout-text">Please be aware that the project name is set as '<code>sass-app</code>'. Feel free to replace it with your preferred name, but ensure you're cautious throughout the subsequent steps, as I'll continue to refer to the project as '<code>sass-app</code>'.</div>
</div>

<h2 id="heading-step-2-open-the-project">Step 2: Open the Project</h2>
<p>Navigate to your project directory using the command line:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> sass-app
</code></pre>
<p>You can also open the project directly in VSCode with the following command:</p>
<pre><code class="lang-bash">code sass-app
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">If you're using VSCode, you have the option to utilize the integrated terminal for the upcoming steps.</div>
</div>

<h2 id="heading-step-3-install-dependencies-and-run"><strong>Step 3:</strong> Install Dependencies and Run</h2>
<p>So when you view the project, you can advise the following project structure:</p>
<pre><code class="lang-markdown">sass-app/
├── public/
│   ├── vite.svg
├── src/
│   ├── counter.js
│   ├── javascript.svg
│   ├── main.js
│   ├── style.css
├── .gitignore
├── index.html
├── package.json
</code></pre>
<p>Now install the necessary dependencies by running:</p>
<pre><code class="lang-bash">yarn install

<span class="hljs-comment"># With npm</span>
npm i
</code></pre>
<p>After installing the dependencies, start the project and view it in your browser with the command:</p>
<pre><code class="lang-bash">yarn dev

<span class="hljs-comment"># With npm</span>
npm run dev
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">The console will display pertinent information, including the URL for local development, which might appear as <strong>http://localhost:5173</strong>.</div>
</div>

<p>For the next steps, we need to remove unnecessary files from the template. Delete the files marked with "❌" and empty the files marked with "🔄".</p>
<pre><code class="lang-markdown">sass-app/
├── public/
│   ├── vite.svg ❌
├── src/
│   ├── counter.js ❌
│   ├── javascript.svg ❌
│   ├── main.js 🔄
│   ├── style.css
├── .gitignore
├── index.html 🔄
├── package.json
</code></pre>
<p>Use the following bash command:</p>
<pre><code class="lang-bash">rm public/vite.svg src/counter.js src/javascript.svg \
  &amp;&amp; <span class="hljs-built_in">echo</span> <span class="hljs-string">""</span> &gt; index.html &amp;&amp; <span class="hljs-built_in">echo</span> <span class="hljs-string">""</span> &gt; src/main.js
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">If you prefer, you can also employ a visual file manager for this task, or simply use Visual Studio Code.</div>
</div>

<h2 id="heading-step-4-configure-sass"><strong>Step 4: Configure Sass</strong></h2>
<p>Vite supports CSS preprocessors like Sass. Begin by installing Sass as a project developer dependency:</p>
<pre><code class="lang-bash">yarn add sass -D

<span class="hljs-comment"># With npm</span>
npm i sass -D
</code></pre>
<p>Next, you have two options:</p>
<ul>
<li><p>Change the file extension of <code>style.css</code> to <code>style.scss</code> (or <code>style.sass</code>) and remove all its contents.</p>
</li>
<li><p>Delete the <code>style.css</code> file and create a new file named <code>style.scss</code> (or <code>style.sass</code>).</p>
</li>
</ul>
<p>You can execute the following bash commands for either option:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># First option</span>
mv src/style.css src/style.scss &amp;&amp; <span class="hljs-built_in">echo</span> <span class="hljs-string">""</span> &gt; src/style.scss

<span class="hljs-comment"># Second option</span>
rm src/style.css &amp;&amp; touch src/style.scss
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">If you prefer, you can also employ a visual file manager for this task, or simply use Visual Studio Code.</div>
</div>

<h2 id="heading-step-5-add-sass-rules">Step 5: Add Sass rules</h2>
<p>Inside <code>src/style.scss</code>, create the Sass rules according to your requirements. For example:</p>
<pre><code class="lang-scss"><span class="hljs-comment">// src/style.scss</span>

<span class="hljs-keyword">@use</span> <span class="hljs-string">"sass:color"</span>;

<span class="hljs-variable">$primary-color</span>: <span class="hljs-number">#aa866a</span>;
<span class="hljs-variable">$secondary-color</span>: <span class="hljs-number">#40646c</span>;
<span class="hljs-variable">$text-color</span>: <span class="hljs-number">#fff</span>;

<span class="hljs-selector-class">.container</span> {
  <span class="hljs-attribute">width</span>: <span class="hljs-number">80%</span>;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span> auto;
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">20px</span>;
  <span class="hljs-attribute">background-color</span>: color.scale(<span class="hljs-variable">$primary-color</span>, <span class="hljs-variable">$lightness</span>: <span class="hljs-number">20%</span>);

  <span class="hljs-selector-tag">h1</span> {
    <span class="hljs-attribute">color</span>: <span class="hljs-variable">$secondary-color</span>;
  }

  <span class="hljs-selector-tag">p</span> {
    <span class="hljs-attribute">color</span>: <span class="hljs-variable">$text-color</span>;
  }
}
</code></pre>
<p>In <code>index.html</code>, create the HTML structure for your project. For example:</p>
<pre><code class="lang-xml"><span class="hljs-comment">&lt;!-- index.html --&gt;</span>

<span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>Sass Project<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"main.js"</span> <span class="hljs-attr">defer</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">main</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Hello, Sass!<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This is a simple example of using Sass with HTML.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">main</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">The most important part of this HTML code is the script tag, which is required to import sass code</div>
</div>

<p>In <code>src/main.js</code>, import the <code>style.scss</code> file to include your Sass code:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// src/main.js</span>

<span class="hljs-keyword">import</span> <span class="hljs-string">'./style.scss'</span>
</code></pre>
<h2 id="heading-run-your-vite-project"><strong>Run Your Vite Project</strong></h2>
<p>Now that your project is set up with Sass, use the following command to run it:</p>
<pre><code class="lang-bash">yarn dev

<span class="hljs-comment"># With npm</span>
npm run dev
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">The console provides essential information, including the local development URL, such as <a target="_blank" href="http://localhost:5173/">http://localhost:5173/</a>.</div>
</div>

<h2 id="heading-outro"><strong>Outro</strong></h2>
<p>Congratulations! You have successfully created a Vite project with Sass integration. By combining the speed and efficiency of Vite with the powerful features of Sass, you can enhance your CSS workflow and build stunning web applications. Feel free to explore more of Vite's capabilities and experiment with your Sass styles.</p>
<h2 id="heading-bonus"><strong>Bonus ⭐</strong></h2>
<p>The code is now available on GitHub as a <a target="_blank" href="https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template#creating-a-repository-from-a-template">template repository</a>. You can clone it and use it as a starting point for your projects. <a target="_blank" href="https://github.com/jhordyess/vanilla-sass-boilerplate">Check it out here</a>.</p>
<h3 id="heading-useful-extra-links">Useful Extra Links:</h3>
<ul>
<li><p><a target="_blank" href="https://vitejs.dev">https://vitejs.dev</a></p>
</li>
<li><p><a target="_blank" href="https://sass-lang.com">https://sass-lang.com</a></p>
</li>
</ul>
<div class="hn-embed-widget" id="saltenha"></div>]]></content:encoded></item><item><title><![CDATA[Programación remota con Raspberry Pi]]></title><description><![CDATA[Las minicomputadoras de la serie Raspberry Pi, en sus diferentes modelos, permiten acceder a una computadora de bajo costo. Además, a través de los pines GPIO, es posible interactuar con dispositivos de hardware similares a un microcontrolador.
Siend...]]></description><link>https://blog.jhordyess.com/programacion-remota-con-raspberry-pi</link><guid isPermaLink="true">https://blog.jhordyess.com/programacion-remota-con-raspberry-pi</guid><category><![CDATA[Raspberry Pi]]></category><category><![CDATA[ssh]]></category><category><![CDATA[VS Code]]></category><category><![CDATA[spanish]]></category><dc:creator><![CDATA[Jhordy Gavinchu]]></dc:creator><pubDate>Tue, 07 Feb 2023 00:52:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/9wWX_jwDHeM/upload/173a68bd6a166e5ae79f2a3a6880106b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Las minicomputadoras de la serie Raspberry Pi, en sus diferentes modelos, permiten acceder a una computadora de bajo costo. Además, a través de los pines GPIO, es posible interactuar con dispositivos de hardware similares a un microcontrolador.</p>
<p>Siendo Raspberry Pi una computadora, podemos utilizarlo como un servidor y acceder de forma remota a través del protocolo SSH. También podemos programarlo usando Visual Studio Code.</p>
<p>En este post, explicaré cómo configurar un PC con Ubuntu y VSCode, conectado a través de una red Wi-Fi, para autenticarnos en un Raspberry Pi y programarlo de forma remota utilizando el protocolo SSH.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675642216796/30421ee0-31a0-4bed-b313-4c010f227d41.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-que-es-ssh-secure-shell">¿Qué es SSH (Secure Shell)?</h1>
<ul>
<li><p>SSH es el nombre de un protocolo y el programa que lo implementa.</p>
</li>
<li><p>Permite iniciar sesión de forma segura y remota a través de una red.</p>
</li>
<li><p>Principalmente usado en servidores para una administración remota.</p>
</li>
<li><p>Pertenece a la capa de aplicación de los modelos OSI y TCP/IP.</p>
</li>
<li><p>De forma estándar usa el puerto 22.</p>
</li>
<li><p>Considerado el reemplazo de Telnet.</p>
</li>
</ul>
<h1 id="heading-funcionamiento-de-llaves-publicas-y-privadas">Funcionamiento de llaves públicas y privadas</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675727356270/36245140-2fa0-43c8-b90e-e39912422284.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-configurar-rpi">Configurar RPi</h1>
<p>Para configurar el Raspberry Pi, primero debemos habilitar el servidor SSH. Luego, crearemos un nuevo usuario con su respectiva contraseña y lo añadiremos a los grupos <code>gpio</code> y <code>sudo</code>.</p>
<p>Antes de comenzar la configuración, es importante asegurarse de tener una contraseña segura para el usuario predeterminado del Raspberry Pi. Esto se puede hacer a través de <code>Inicio &gt; Preferencias &gt; Configuración de Raspberry Pi &gt; Sistema &gt; Cambiar clave</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675728791205/bb8458b0-948e-4ab8-bcf5-7d6182ca6083.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-habilitar-ssh">Habilitar SSH</h2>
<p>Existen dos formas comunes de habilitar SSH en el Raspberry Pi: mediante el asistente de configuración o mediante la consola.</p>
<h3 id="heading-mediante-asistente-de-configuracion">Mediante asistente de configuración</h3>
<p><code>Inicio &gt; Preferencias &gt; Configuración de Raspberry Pi &gt; Interfaces &gt; SSH</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675719142928/6ee9f455-4292-4ee1-8136-81e60cd4a4fd.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-mediante-consola">Mediante consola</h3>
<pre><code class="lang-bash">sudo raspi-config
</code></pre>
<p>Luego, seleccionar <code>Interface Options ⏎ SSH ⏎ &lt;Yes&gt; ⏎</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675719529322/00c51045-3ae0-4049-9fec-43ace2ed6f38.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-configurar-nuevo-usuario">Configurar nuevo usuario</h2>
<p>A continuación, crearemos un nuevo usuario con su respectiva contraseña y lo añadiremos a los grupos <code>gpio</code> y <code>sudo</code>.</p>
<h3 id="heading-crear-usuario">Crear usuario</h3>
<pre><code class="lang-bash">sudo adduser juan-remoto
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">Para nuestro ejemplo el nuevo usuario se llamará <code>juan-remoto</code>, puedes escoger cualquier, pero en los siguientes pasos seguire refiriendome al usuario como <code>juan-remoto</code>.</div>
</div>

<p>Observaciones:</p>
<ul>
<li><p>Se solicitará la contraseña de superusuario.</p>
</li>
<li><p>Luego, se pedirá crear una contraseña para el nuevo usuario.</p>
</li>
<li><p>También se solicitará información adicional del usuario, como el nombre completo o el número de habitación🤷. Esta información puede dejarse en blanco presionando "enter".</p>
</li>
<li><p>Finalmente, se confirmará la información ingresada escribiendo "Y" y presionando "enter".</p>
</li>
</ul>
<h3 id="heading-anadir-a-grupos">Añadir a grupos</h3>
<pre><code class="lang-bash">sudo usermod -aG gpio,sudo juan-remoto
</code></pre>
<p>Observaciones:</p>
<ul>
<li><p>El usuario será agregado al grupo <code>gpio</code> para acceder a los pines de forma remota.</p>
</li>
<li><p>El usuario también será agregado al grupo <code>sudo</code> para ejecutar comandos con permisos de superusuario.</p>
</li>
</ul>
<h2 id="heading-cual-es-mi-ip">¿Cuál es mi IP?</h2>
<p>Para conectarse de forma remota, es necesario conocer la IP del Raspberry Pi. Esto podemos hacerlo con el siguiente comando:</p>
<pre><code class="lang-bash">hostname -I
</code></pre>
<p>Observaciones:</p>
<ul>
<li><p>En una red de área local (red doméstica), la IP podría comenzar con <code>192.168.x.x</code>.</p>
</li>
<li><p>Es importante recordar esta IP, ya que será necesaria más adelante.</p>
</li>
</ul>
<h1 id="heading-configurar-pc">Configurar PC</h1>
<p>En primer lugar, es necesario generar un par de llaves pública y privada, y añadir la llave pública al SSH Agent. Luego, copiar la llave pública en el Raspberry Pi.</p>
<h2 id="heading-generar-par-de-llaves-ssh">Generar par de llaves SSH</h2>
<pre><code class="lang-bash">ssh-keygen -t ed25519 -f ~/.ssh/rpi
</code></pre>
<p>Observaciones:</p>
<ul>
<li><p>Usamos el algoritmo <code>Ed25519</code>, el más recomendado en la actualidad.</p>
</li>
<li><p>El par de llaves se llamará <code>rpi</code> y se ubicará en <code>~/.ssh</code>.</p>
</li>
<li><p>El nombre puede ser modificado según sea necesario, pero en este ejemplo se utilizó <code>rpi</code> para identificarlo fácilmente.</p>
</li>
<li><p>Es recomendado crear una <code>passphrase</code>, las mejores contraseñas tienen 20 caracteres entre letras mayúsculas, minúsculas, números, y al menos un caracter especial.</p>
</li>
</ul>
<h2 id="heading-anadir-la-llave-privada-a-ssh-agent">Añadir la llave privada a SSH Agent</h2>
<pre><code class="lang-bash">ssh-add ~/.ssh/rpi
</code></pre>
<p>Observaciones:</p>
<ul>
<li><p>Debemos respetar la dirección y el nombre con donde se generaron las llaves.</p>
</li>
<li><p>Si estableciste una <code>passphrase</code> se solicitará introducirla.</p>
</li>
</ul>
<h2 id="heading-copiar-la-llave-publica-a-rpi">Copiar la llave pública a RPi</h2>
<pre><code class="lang-bash">ssh-copy-id -i ~/.ssh/rpi.pub juan-remoto@192.168.x.x
</code></pre>
<p>Observaciones:</p>
<ul>
<li><p>Se indica la ruta de la llave pública, entre el par de llaves creados es el que tiene la extension <code>pub</code>.</p>
</li>
<li><p>También se indica el usuario, en este caso <code>juan-remoto</code>.</p>
</li>
<li><p>La IP debe ser reemplazada por la IP del Raspberry Pi.</p>
</li>
<li><p>Se solicitará la contraseña del usuario <code>juan-remoto</code> que fue creado anteriormente.</p>
</li>
</ul>
<h1 id="heading-configurar-vs-code">Configurar VS Code</h1>
<p><a target="_blank" href="https://code.visualstudio.com/">Visual Studio Code</a> es un editor de código libre que facilita la programación en varios lenguajes. En esta ocasión, lo configuraremos para programar y controlar el GPIO de un Raspberry Pi de forma remota utilizando el protocolo SSH.</p>
<h2 id="heading-instalar-la-extension-remote-sshhttpsmarketplacevisualstudiocomitemsitemnamems-vscode-remoteremote-ssh">Instalar la extensión <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh">Remote - SSH</a></h2>
<pre><code class="lang-bash">code --install-extension ms-vscode-remote.remote-ssh
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☝</div>
<div data-node-type="callout-text">Instalaremos la extension mediante un comando, pero sientete libre de instalarlo directamente en VSCode.</div>
</div>

<h2 id="heading-configurar-la-conexion-ssh">Configurar la conexion SSH</h2>
<p>Ahora crearemos el archivo de configuración utilizando cualquier editor de texto, como "nano" o "vim". En este ejemplo, utilizaremos "gedit":</p>
<pre><code class="lang-bash">gedit ~/.ssh/config
</code></pre>
<p>Dentro del archivo, agregaremos la siguiente configuración, reemplazando la IP y el nombre de usuario:</p>
<pre><code class="lang-plaintext">Host rpi-remoto
  HostName 192.168.x.x
  User juan-remoto
</code></pre>
<p>Guardar y cerrar el archivo.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">La IP del Raspberry Pi puede cambiar si el router se reinicia o por cualquier otro motivo. Si esto ocurre, será necesario actualizar la IP en este archivo.</div>
</div>

<h2 id="heading-acceso-desde-vs-code">Acceso desde VS Code</h2>
<p>Abre VS Code y accede al Raspberry Pi.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675725903327/79bd1f6a-e40f-4b2b-a3ff-fbe9eedf0160.png" alt class="image--center mx-auto" /></p>
<p>Si se estableció una <code>passphrase</code> al generar las llaves, será necesario introducirla.</p>
<p>Espera hasta que se establezca la conexión y luego puedes probar ejecutando algún comando, por ejemplo:</p>
<pre><code class="lang-bash">pinout
</code></pre>
<p>Obteniendo por ejemplo:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675726958186/919ba16c-6e00-40ef-ab96-53137293ec97.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-outro">Outro</h1>
<p>En este post, aprendimos cómo utilizar el protocolo SSH para acceder de forma remota a un Raspberry Pi utilizando Visual Studio Code.</p>
<ul>
<li><p>Primero, habilitamos el servicio SSH en el Raspberry Pi y creamos un nuevo usuario con los permisos necesarios.</p>
</li>
<li><p>Después, generamos un par de llaves SSH y copiamos la llave pública en el Raspberry Pi para establecer una conexión segura.</p>
</li>
<li><p>Finalmente, configuramos Visual Studio Code para conectarnos al Raspberry Pi y utilizarlo de forma remota.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675729255906/2eddc808-cfa8-4677-a2e1-c9ecd42bcc57.gif" alt class="image--center mx-auto" /></p>
</li>
</ul>
<p>De esta manera, podemos programar un Raspberry Pi de forma remota para proyectos avanzados y ambiciosos. Además, con el protocolo SSH, podemos acceder de forma segura desde cualquier parte del mundo.</p>
<p>Espero que este post haya sido útil y que te haya ayudado a empezar a trabajar con la Raspberry Pi y Visual Studio Code.</p>
<h1 id="heading-enlaces">Enlaces</h1>
<p><a target="_blank" href="https://code.visualstudio.com/docs/remote/ssh">https://code.visualstudio.com/docs/remote/ssh</a></p>
<p><a target="_blank" href="https://www.raspberrypi.com/documentation/computers/remote-access.html">https://www.raspberrypi.com/documentation/computers/remote-access.html</a></p>
<p><a target="_blank" href="https://www.ssh.com/academy/ssh/keygen">https://www.ssh.com/academy/ssh/keygen</a></p>
<p><a target="_blank" href="https://es.wikipedia.org/wiki/Secure_Shell">https://es.wikipedia.org/wiki/Secure_Shell</a></p>
<div class="hn-embed-widget" id="saltenha-bo"></div>]]></content:encoded></item></channel></rss>