<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dean Ruina on Medium]]></title>
        <description><![CDATA[Stories by Dean Ruina on Medium]]></description>
        <link>https://medium.com/@ruinadd?source=rss-de83f353c49b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vpqUpZ3-2pshJf_jfeLxOg.jpeg</url>
            <title>Stories by Dean Ruina on Medium</title>
            <link>https://medium.com/@ruinadd?source=rss-de83f353c49b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 13:49:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ruinadd/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Timberjack: A Time-Based Logger for Go]]></title>
            <link>https://medium.com/@ruinadd/timberjack-a-time-based-logger-for-go-1cf3c075126b?source=rss-de83f353c49b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cf3c075126b</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[logging]]></category>
            <dc:creator><![CDATA[Dean Ruina]]></dc:creator>
            <pubDate>Fri, 02 May 2025 09:15:26 GMT</pubDate>
            <atom:updated>2025-09-19T06:18:59.560Z</atom:updated>
            <content:encoded><![CDATA[<h3>Timberjack: Time- and Size-Based Log Rotation for Go</h3><p>A small enhancement to Lumberjack that adds interval- and clock-based rotation, optional gzip/zstd compression, and flexible backup naming.</p><p>If you’re using Go in production, chances are you’ve relied on <a href="https://github.com/natefinch/lumberjack">Lumberjack</a> — a small, stable package for log file rotation based on size.<br>But what if you want to rotate logs <strong>hourly, daily</strong>, <strong>weekly</strong> or at <strong>specific times based on the system clock?</strong><br>That’s why I forked it and created <strong>Timberjack</strong>.</p><p><a href="https://github.com/DeRuina/timberjack">GitHub - DeRuina/timberjack: Timberjack is a Go log rolling library with support for size-based, time-based, and manual rotation.</a></p><h3>What is Timberjack?</h3><p><strong>Timberjack</strong> is a minimal fork of the popular <a href="https://github.com/natefinch/lumberjack">lumberjack</a> logging package — with one goal:</p><blockquote><strong>Add time-based log rotation, including precise minute-based scheduling</strong>, <em>without changing anything else.</em></blockquote><p>Use it as an io.WriteCloser anywhere you’d use Lumberjack, then opt into:</p><ul><li>rotation every N minutes/hours/days (RotationInterval)</li><li>rotation at exact times like &quot;00:00&quot; or &quot;12:00&quot; (RotateAt)</li><li>rotation on specific minute marks of every hour (RotateAtMinutes)</li><li>size-based rotation, as before (MaxSize)</li><li>optional <strong>gzip</strong> or <strong>zstd</strong> compression</li><li>customizable backup filename layout</li></ul><h4>Quick Start</h4><pre>import (<br>    &quot;log&quot;<br>    &quot;time&quot;<br><br>    &quot;github.com/DeRuina/timberjack&quot;<br>)<br><br>func main() {<br>    lj := &amp;timberjack.Logger{<br>        Filename:         &quot;/var/log/myapp/app.log&quot;,<br>        MaxSize:          500,                // MB<br>        MaxBackups:       7,                  // keep 7 rotation timestamps (newest first)<br>        MaxAge:           30,                 // days<br>        LocalTime:        true,               // timestamps in local time (default: UTC)<br>        RotationInterval: 24 * time.Hour,     // rotate daily (interval-based)<br>        RotateAt:         []string{&quot;00:00&quot;},  // also rotate exactly at midnight<br>        RotateAtMinutes:  []int{0, 15, 30},   // and at HH:00, HH:15, HH:30<br>        Compression:      &quot;zstd&quot;,             // &quot;none&quot; | &quot;gzip&quot; | &quot;zstd&quot; (legacy Compress bool still supported)<br>        BackupTimeFormat: &quot;2006-01-02T15-04-05.000&quot;,<br>        AppendTimeAfterExt: false,            // false: app-&lt;ts&gt;-&lt;reason&gt;.log | true: app.log-&lt;ts&gt;-&lt;reason&gt;<br>    }<br><br>    // Optional: validate your custom time format once during setup<br>    _ = lj.ValidateBackupTimeFormat()<br><br>    log.SetOutput(lj)<br>    defer lj.Close()<br><br>    log.Println(&quot;hello world&quot;)<br>}</pre><h4>Manual rotation (+ tagging)</h4><pre>// Tag the backup with a reason (e.g. for deploys)<br>_ = lj.RotateWithReason(&quot;deploy-2025-09-19&quot;)<br>// Or legacy behavior:<br>// _ = lj.Rotate()</pre><h3>How it rotates?</h3><ul><li><strong>size-based</strong>: if a write would exceed MaxSize, rotate with reason &quot;size&quot;.</li><li><strong>Interval-based</strong> (RotationInterval): if elapsed since last rotation ≥ interval, rotate with reason &quot;time&quot;.</li><li><strong>Clock-based</strong> (RotateAt, RotateAtMinutes): at the exact marks (aligned to second 0), rotate with reason &quot;time&quot;.</li><li><strong>Manual</strong>: Rotate()/RotateWithReason().</li></ul><p>Backups are named:</p><ul><li>Default: &lt;name&gt;-&lt;timestamp&gt;-&lt;reason&gt;&lt;ext&gt; → app-2025-09-19T00-00-00.000-time.log</li><li>After-ext: &lt;name&gt;&lt;ext&gt;-&lt;timestamp&gt;-&lt;reason&gt; → app.log-2025-09-19T00-00-00.000-time</li><li>If compression is enabled: suffix .gz or .zst.</li></ul><h3>Why I Made This</h3><p>Most Go logging libraries only rotate by size. But I’ve often needed logs to rotate hourly, or at specific clock times like midnight, without depending on file size. Timberjack gives you that flexibility — with minimal friction.</p><h3>Install and Use</h3><p>Install via:</p><pre>go get github.com/DeRuina/timberjack</pre><p>Import:</p><pre>import &quot;github.com/DeRuina/timberjack&quot;</pre><p>Use just like Lumberjack — it implements the same io.WriteCloser interface.</p><h3>Notes &amp; Caveats</h3><ul><li><strong>Single process</strong>: Timberjack assumes only one process writes to a given target file.</li><li><strong>Closed logger writes</strong>: writing after Close() does a one-off open/write/close so you don’t lose logs, but no rotation/schedulers are restarted.</li><li><strong>Time zones</strong>: set LocalTime: true to format timestamps in local time; default is UTC.</li></ul><h3>Source and Feedback</h3><ul><li>GitHub: <a href="https://github.com/DeRuina/timberjack">https://github.com/DeRuina/timberjack</a></li><li>GoDoc: <a href="https://pkg.go.dev/github.com/DeRuina/timberjack">https://pkg.go.dev/github.com/DeRuina/timberjack</a></li><li>License: MIT</li></ul><p>I kept it simple on purpose — no extra complexity, no breaking changes.</p><p>If time-based rotation is something you’ve needed, I hope this helps. Feedback and contributions are welcome!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2VxWLGbVzz9HP-g--iX2Q.png" /><figcaption>timberjack</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cf3c075126b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure: How to Create a Virtual Machine and Deploy a Web Server]]></title>
            <link>https://medium.com/@ruinadd/azure-how-to-create-a-virtual-machine-and-deploy-a-web-server-5335faad66f7?source=rss-de83f353c49b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5335faad66f7</guid>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[bastion]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[web-server]]></category>
            <dc:creator><![CDATA[Dean Ruina]]></dc:creator>
            <pubDate>Fri, 10 May 2024 05:45:41 GMT</pubDate>
            <atom:updated>2024-05-10T05:45:41.102Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will be a step-by-step video walkthrough. It’s the first of many Azure projects and guides I’m planning to write, explore, and share with you. All of the other projects can be found in my GitHub repository.</p><p><a href="https://github.com/DeRuina/AzureProjects">GitHub - DeRuina/AzureProjects: A comprehensive repository of Azure projects, showcasing a wide range of Azure services and features. Each project includes detailed instructions and best practices for cloud computing, aiming to provide a practical learning experience for anyone interested in Azure.</a></p><p>Through my work with Azure’s services, I plan to document my learnings and share them with others who are also interested in mastering Azure.</p><h3>Project Introduction</h3><p>In this Guided Project, we will create a <a href="#6ac2">Virtual Machine</a> in Azure to deploy a web server, specifically a <a href="#f943">Nextcloud server</a>. Instead of using just the presets, we will explore how the basic architecture of Azure works, by creating a Virtual Machine, connecting it to a subnet, protected by inbound and outbound rules thanks to <a href="#347a">Network Security Groups</a>, in a <a href="#d086">Virtual Network</a>. We’ll use <a href="#9912">Bastion</a> to connect to the machine via SSH, without exposing an external port to the Internet, and then installing a simple Nextcloud server and make the Virtual Machine available by opening a public IP and a DNS label.</p><h3>Prerequisites</h3><h4>Microsoft Azure Account</h4><p>Microsoft Azure offers a free account option that allows users to explore and use some of the Azure services for free. This account is ideal for those who want to test Azure services and features before committing to a paid plan. The free account comes with a $200 credit that you can use to try out Azure services for 30 days. Once the credit is exhausted, you can continue using the free services with some limitations. Here is a <a href="https://medium.com/@mashiyathussain2/how-to-create-microsoft-azure-account-2a9f37025374">signup guide</a> if you need one.</p><h3>Step 1: Creating a Resource Group</h3><h4>What is a Resource Group?</h4><p>In Azure, a <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal">resource group</a> is a container that holds related Azure resources, such as virtual machines, databases, and web apps. It helps you organize and manage these resources together, making it easier to handle tasks like deployment, access control, and cost tracking. Think of it as a folder that keeps everything for a specific project or purpose neatly organized.</p><h4>Creating a Resource Group</h4><p>Now that we know what a resource group is let’s begin by creating one that will allow us to group all of our resources into a Logical group. I named it RG-VMP (Resource Group — Virtual Machine Project) but you can name it however you want.</p><ul><li>Choose your own region. In short, selecting the appropriate region when creating a resource group in Azure is essential for optimizing performance, ensuring compliance, managing costs, and enhancing resilience and availability for your applications and services.</li></ul><p>Follow the video walkthrough:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAJWP_qLIo1NkT_4P9z7xA.gif" /><figcaption>Creating a Resource Group</figcaption></figure><h3>Step 2: Creating a Virtual Network and a Subnet</h3><h4>What is a Virtual Network?</h4><p>In Azure, a <a href="https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview">Virtual Network (VNet)</a> is like a private network in the cloud. It lets you securely connect and isolate your Azure resources, such as virtual machines and databases. You can organize resources into subnets, control traffic flow, and connect to other networks. It’s essential for building secure and scalable architectures in Azure.</p><h4>Creating a Virtual Network and a Subnet</h4><p>Next, we are going to create a Virtual Network and a subnet inside our resource group. Again you can name them however you want, I named the Virtual Network: VNET-VMP and the Subnet: SNET-VMP (you can probably already guess what the initials stands for). I changed the IP address space to be 172.10.0.0/16, and created the subnet to be 172.10.1.0/24. You can alter this as well.</p><ul><li>Make sure you select the correct Resource Group if you created other groups and the correct region again.</li><li>At the end of the video, you can see the diagram of our network which will grow as we continue with the project.</li></ul><p>Follow the video walkthrough:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*bvgRLepoGU5vraDaz6errw.gif" /><figcaption>Creating a Virtual Network and a Subnet</figcaption></figure><h3>Step 3: Protecting the subnet using a Network Security Group</h3><h4>What is a Network Security Group?</h4><p>In Azure, a <a href="https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview">Network Security Group (NSG)</a> is like a virtual firewall. It filters inbound and outbound traffic to and from Azure resources based on the rules you define. It helps secure your network by controlling access and preventing unauthorized traffic.</p><h4>Protecting the subnet using a Network Security Group</h4><p>Now we will create a Network Security Group and add it to our subnet. I named it NSG-VMP. Azure already created some inbound and outbound rules for us. Specifically, we can see that all ports and protocols are open, inbound and outbound, inside the Virtual Network. it can receive the data from Azure’s Load Balancer*, and you can send any data to the Internet. Everything else is denied by default, which means that nothing can enter the Virtual Network by default.</p><ul><li>Azure’s Load Balancer distributes incoming network traffic across multiple virtual machines or instances to ensure applications remain available, reliable, and responsive. It helps prevent overloads, improves performance, and maintains high availability by directing traffic to healthy instances.</li><li>You can see our network diagram has been updated.</li></ul><p>Follow the video walkthrough:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*5yonWO4-WOGcAfe09wrB9Q.gif" /><figcaption>Protecting the subnet using a Network Security Group</figcaption></figure><h3>Step 4: Deploying Bastion to connect to our Virtual Machine</h3><h4>What is Bastion?</h4><p>In Azure, <a href="https://azure.microsoft.com/en-us/products/azure-bastion">Bastion</a> is a service that provides secure and seamless Remote Desktop Protocol (RDP) and Secure Shell (SSH) access to virtual machines (VMs) directly from the Azure portal, without the need for public IP addresses or VPN connections.</p><h4>Deploying Bastion to connect to our Virtual Machine</h4><p>We are going to create a Bastion instance to connect to our future Virtual Machine. In order to use Bastion to connect to our Virtual Machine, we need to create a subnet for it first and it must be named AzureBastionSubnet. For the address range, we can use 172.10.0.0/24 as suggested.</p><p>Now that we have a subnet we can create a Bastion instance. I named it BASTION-VMP. In the “Virtual Network” section choose the Virtual Network we created and the subnet we created for Bastion.</p><ul><li>Change the “Public IP address name” to something that will be easier to remember, we will need it later. I changed mine to be BASTION-VMP-ip.</li><li>Our network diagram was updated again.</li></ul><p>Follow the video walkthrough:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*1qdHk7pH4L2vrpFdeCwL0g.gif" /><figcaption>Deploying Bastion to connect to our Virtual Machine</figcaption></figure><h3>Step 5: Creating an Ubuntu Server Virtual Machine</h3><h4>What is a Virtual Machine?</h4><p>In Azure, a <a href="https://azure.microsoft.com/en-us/products/virtual-machines">Virtual Machine (VM)</a> is a scalable computing resource that runs an operating system and applications in the cloud. It’s essentially a software emulation of a physical computer, allowing you to create and use computing resources on demand without having to manage physical hardware.</p><h4>Creating an Ubuntu Server Virtual Machine</h4><p>Now finally, we will create the Virtual Machine. I chose the Ubuntu Server 22.04 LTS Virtual Machine and named it VM-VMP. We will leave the availability option and zone as the default — zone 1*. We’ll change the size to be B1*. Name the username however you want I named it dean. Azure tells us that it will generate a new key pair<br>for us. I made the name slightly clearer and called it VM-VMP_SSHkey. In “Public inbound ports” click None*. For the OS disk size, we can leave the premium SSD with 30 gigabytes of space, which is the default. In Networking change the “Public IP” to None*. Finally, make sure to download the new private key pair.</p><ul><li>Availability options in Azure VMs, like Availability Sets and Availability Zones, ensure your applications stay online even during failures or maintenance. Availability Sets group VMs to spread risk, while Availability Zones distribute VMs across physically separate data centers for added resilience. These features help keep your services running smoothly and minimize downtime. Zone 1 is simply the designation for the first zone within a region.</li><li>In Azure, the VM size B1 is a basic and low-cost option suitable for lightweight workloads that need occasional bursts of processing power. It’s ideal for simple tasks like small websites or testing environments.</li><li>We don’t want this SSH port to be available over the Internet, since we’re going to connect to our Virtual Machine inside our Virtual Network using Bastion, which is an internal Azure service. So let’s click on “None” as the “Public inbound ports”.</li><li>Azure tells us that it wants to create a public IP, but since we don’t want it, we want to do it manually later, let’s click on “None”.</li></ul><p>Follow the video walkthroughs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*JJnkmDwIpx8RuZFwOqQoPw.gif" /><figcaption>Creating an Ubuntu Server Virtual Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*06EiPXuhfqiaT1lMFuWoDw.gif" /><figcaption>Creating an Ubuntu Server Virtual Machine</figcaption></figure><h3>Step 6: Installing Nextcloud by connecting via SSH using Bastion</h3><h4>What is Nextcloud?</h4><p><a href="https://nextcloud.com/">Nextcloud</a> is a suite of client-server software for creating and using file hosting services. Nextcloud provides functionality similar to Dropbox, Office 365 or Google Drive when used with integrated office suites Collabora Online or OnlyOffice. It can be hosted in the cloud or on-premises.</p><h4>Installing Nextcloud by connecting via SSH using Bastion</h4><p>So let’s connect to our Virtual Machine by clicking on “Connect” as you can see in the video and then choosing “Connect via Bastion”. In “Authentication Type” we will choose “SSH Private Key from Local File” — What we downloaded in the last step. Fill in your Username, and choose the file you downloaded.</p><p>We are now connected to our Virtual Machine using SSH via Bastion. Now let’s install Nextcloud by typing the following command sudo snap install nextcloud. Next, we&#39;ll create a simple administrative account with the following command sudo nextcloud.manual-install &lt;username&gt; &lt;password&gt;. I chose admin and dean just for the project. Make sure you choose a strong password if you plan to use it for real purposes. Lastly, we will run the command sudo nextcloud.enable-https self-signed , and then exit and we close the connection.</p><p>Follow the video walkthroughs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*0aoYnCFGiV44KNKg8NGinQ.gif" /><figcaption>Installing Nextcloud by connecting via SSH using Bastion</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*5VuUGRTmMPJyWcBtwNjjfg.gif" /><figcaption>Installing Nextcloud by connecting via SSH using Bastion</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*xZIzWSpmfdfI6r6x0UWD3Q.gif" /><figcaption>Installing Nextcloud by connecting via SSH using Bastion</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*ZBpzY-V9PqBEtHwb-tyxUA.gif" /><figcaption>Installing Nextcloud by connecting via SSH using Bastion</figcaption></figure><h3>Step 7: Publishing an IP</h3><p>We will create a public IP by going to the “IP configurations” and adding a public IP to our “ipconfig1”. I named it VMIP-VMP. Make sure the SKU is on standard and then we’ll save the configuration.</p><p>As you can see in the second video we now have a public IP. If we try to copy it and open it in a new browser we will see it’s not working (due to bad video recording you can’t see it on my video but you can try it yourself and see you get an error). It’s not working because we didn’t add a rule to allow inbound HTTPS traffic in our Network Security Group.</p><p>Follow the video walkthroughs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*LOmD0MqbHQgViWO94KFxyw.gif" /><figcaption>Publishing an IP</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*unrxSp8oeghsaYQhza9JIw.gif" /><figcaption>Publishing an IP</figcaption></figure><h3>Step 8: Adding an Inbound Port Rule</h3><p>In our “Networking” tab we will press on “Add inbound port rule” for “Source” and “Destination” We will choose “IP Addresses”, the destination IP will be the default (our Virtual Network IP) and our source IP will be our own IP. You can go to www.whatsmyip.com and copy your IP address from there and paste it into the &quot;Source IP&quot;. In &quot;Service&quot; we will choose &quot;HTTPS&quot; and give it a name. I named it HTTPS-VMP.</p><p>Now that the rule has been created, let’s go and copy the public address again. Go to a browser and then write https://&lt;ip address&gt; changing the IP address to yours and press Enter. Nextcloud is now responding as you can see in the image below, however, it tells us that we are accessing through an untrusted domain.</p><p>Follow the video walkthrough:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*bWwGcbTd2vJyR3qETbC1kA.gif" /><figcaption>Adding an Inbound Port Rule</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CHdw74TaLbp6OHTQ.jpg" /></figure><h3>Step 9: Creating a DNS label</h3><p>Now if we go to our public IP address page through our diagram under the “Settings” we will press on “Configuration”. We will now see “DNS name label (optional)” and there we will set the DNS we want. I again named it just dean for this project. All we have to do after is press save. The last thing we need to do is to connect to our Virtual Machine in the same way we did before through SSH via Bastion and add the following command sudo nextcloud.occ config:system:set trusted_domains 1 --value=&lt;DNS name&gt;. Change the DNS name with your own one (You can see at the beginning of the second video where you can find yours).</p><p>And that’s it! Now just go to a browser and type your DNS. mine was https://dean.northeurope.cloudapp.azure.com, yours will be different. Press Enter. Log in with your credentials if you remember mine were &quot;admin&quot; and &quot;dean&quot; and there you have it - a Nextcloud instance running. A Web Server running on your Virtual Machine (as you can see in the last 2 pictures).</p><p>Follow the video walkthrough:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*SSZGlElb8goPGSNFABAGhQ.gif" /><figcaption>Creating a DNS label</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*tI3gaOsFUkn2awKMpCaULw.gif" /><figcaption>Creating a DNS label</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GaP2ifdqeAndXicw.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1ml-OUKaShdv9Yxv.png" /></figure><h3>Step 10: If You’re Not Using It — DELETE IT! IT COSTS MONEY!</h3><p>If you followed my walkthrough just to try Azure for experimental reasons or to learn and develop your skills make sure you remember to delete the Virtual Machine and Bastion at the end of your use because they cost you money on a pay as you use premise. You get 200$ credits when you sign up for a free Azure account. Keep them, you can use them later and I will create more walkthroughs for other Azure projects so you can use them there. I deleted everything so that for my next project I would start from scratch.</p><h3>Conclusion</h3><p>I learned a lot doing this project and I’m sure that so did you if you followed along. I’m just starting with Azure and I plan to keep exploring and working on new things, learning by doing more projects which I’ll create walkthroughs after I master them myself. I’ll add all the projects to my GitHub repository I mentioned at the beginning of the article so you can learn new stuff with me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5335faad66f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is Cloud Engineering? Cloud Computing? IaaS, PaaS, SaaS? — Explained To You Like You’re 5]]></title>
            <link>https://medium.com/@ruinadd/what-is-cloud-engineering-cloud-computing-iaas-paas-saas-explained-to-you-like-youre-5-fe6409998a2a?source=rss-de83f353c49b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe6409998a2a</guid>
            <category><![CDATA[cloud-engineering]]></category>
            <category><![CDATA[iaas]]></category>
            <category><![CDATA[paas]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[Dean Ruina]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 08:30:09 GMT</pubDate>
            <atom:updated>2024-04-04T08:30:09.611Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Is Cloud Engineering? Cloud Computing? IaaS, PaaS, SaaS ? — Explained To You Like You’re 5</h3><h4>Why complicate things when you can explain them simple? Every definition is also explained in a way your inner kid can understand.</h4><p>Have you ever heard of Cloud Computing and wondered what it is? Have you ever heard of Cloud Engineering but you don’t understand what is the cloud and how can you engineer it? Ever heard of IaaS (Infrastructure as a Service), PaaS (Platform as a Service), SaaS (Software as a Service) and always wanted to know what they are? <br><strong>•</strong> Yes, great you’re in the right article, follow along.<br><strong>• </strong>No, even better, time to learn something new. Let’s begin!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*uTRlSiC5J1TmTWNTFsovfw.jpeg" /><figcaption>Read on and learn something new</figcaption></figure><h3>What is Cloud Computing?</h3><p>Simply put, cloud computing is the delivery of computing services — including servers, storage, databases, networking, software, analytics, and intelligence — over the internet (“the cloud”) to offer faster innovation, flexible resources, and economies of scale. You typically pay only for cloud services you use, helping you lower your operating costs, run your infrastructure more efficiently, and scale as your business needs change.</p><p><strong>Still confused? So was I! So let me explain it to you in an even simpler way:</strong></p><p>Think of cloud computing like renting a car instead of buying one. When you rent a car, you get to use it for however long you need without worrying about owning it or maintaining it. Similarly, with cloud computing, you&#39;re essentially renting computing services like servers, storage, databases, and software over the internet instead of owning and managing them yourself. Just like how renting a car offers flexibility and cost savings compared to buying one, cloud computing provides faster innovation, flexible resources, and cost savings for businesses. You only pay for the specific computing services you use, which can help you lower operating costs and efficiently manage your technology infrastructure. Plus, if your business grows or changes, you can easily scale up or down your cloud services to meet your needs without having to invest in new hardware or software.</p><p><strong>Please explain this to me like I’m 5! Really? Ok:</strong></p><p>Imagine you have a magical toy box at your friend’s house. This toy box has all sorts of toys like cars, dolls, and puzzles. Whenever you want to play with a toy, you just ask your friend, and they bring it to you. You don’t have to keep all the toys in your room or take care of them because your friend does that for you. Plus, you only have to pay your friend for the toys you play with, so you get to have fun without worrying about storing or buying them all yourself. That’s pretty much how cloud computing works — it’s like having a toy box full of computer stuff on the internet that you can use whenever you need it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*B1sULmWexNroAJfG-Zv78Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qeIFTXfmwX-iAcqKp4ATUQ.jpeg" /><figcaption>Visualization of Cloud Computing &amp; A picture to make it look cool</figcaption></figure><h3>Types of Cloud Computing</h3><p>There are 4 main different types of Cloud Computing:</p><h4>Public Cloud</h4><p>Public Clouds are owned and operated by third-party cloud service providers, which deliver computing resources like servers and storage over the internet. With a public cloud, all hardware, software, and other supporting infrastructure is owned and managed by the cloud provider. You access these services and manage your account using a web browser.<br>The main 3 public cloud providers are <a href="https://azure.microsoft.com/en-us">Microsoft Azure</a>, <a href="https://aws.amazon.com/">Amazon Web Services (AWS), </a>and <a href="https://cloud.google.com/">Google Cloud Platform</a>.</p><h4>Private Cloud</h4><p>A private cloud refers to cloud computing resources used exclusively by a single business or organization. A private cloud can be physically located on the company’s onsite data center. Some companies also pay third-party service providers to host their private cloud. A private cloud is one in which the services and infrastructure are maintained on a private network.</p><h4>Hybrid Cloud</h4><p>A hybrid cloud combines public and private clouds, bound together by technology that allows data and applications to be shared between them. By allowing data and applications to move between private and public clouds, a hybrid cloud gives your business greater flexibility and more deployment options and helps optimize your existing infrastructure, security, and compliance.</p><h4>Multi-Cloud</h4><p>A multi-cloud is a cloud computing strategy where an organization uses services from multiple cloud providers. Instead of relying solely on one cloud provider, they spread their workloads across several different cloud platforms. For example, a company might use Amazon Web Services (AWS) for certain services like storage and Microsoft Azure for others like machine learning tools. The idea is to leverage the strengths of each cloud provider, such as specific features, pricing models, or geographical locations, to optimize performance, cost, and reliability.</p><p><strong>Again you’re mumbling something, take me back to the toy box:</strong></p><ul><li><strong>Public Cloud</strong>: Imagine if your friend opens up the toy box to the entire neighborhood. Everyone can come and borrow toys whenever they want. In this scenario, the toy box represents the cloud provider’s infrastructure, and the neighborhood represents the public internet. Anyone can access the toys (computing resources) stored in the cloud and use them for various purposes.</li><li><strong>Private Cloud</strong>: Now, let’s say your friend decides to keep the toy box locked up and only allows specific friends or family members to borrow toys. This is similar to a private cloud, where computing resources are dedicated to a single organization and aren’t shared with others. The organization has full control over who can access the resources, just like your friend controls who can borrow toys from the locked toy box.</li><li><strong>Hybrid Cloud</strong>: Next, imagine if your friend decides to keep some toys in the toy box at their house and stores others in your toy box at home. Sometimes, you play with toys from your friend’s house, and other times, you play with toys from your own toy box. This represents a hybrid cloud, where an organization uses a combination of public and private cloud resources.</li><li><strong>Multi-Cloud</strong>: Finally, let’s say you have multiple friends, each with their own magical toy box. Sometimes, you borrow toys from one friend and other times, you borrow toys from another friend. This is similar to a multi-cloud strategy, where an organization uses services from multiple cloud providers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*g4y1ZWKAJZ7yu5QqVS7eAQ.png" /><figcaption>Nice Illustration</figcaption></figure><h3>What is Cloud Engineering and what does a Cloud Engineer do?</h3><p>Cloud engineering involves designing, building, and managing cloud-based systems and infrastructure. Cloud engineers are responsible for tasks such as architecting cloud solutions, deploying cloud services, automating processes, integrating systems, ensuring security, optimizing performance, and enabling scalability. In essence, they leverage engineering principles to create and maintain efficient and reliable cloud computing environments tailored to the needs of organizations.</p><p><strong>Going back to our 5-year-old’s toy box:</strong></p><p>Cloud engineering is like being the master toy builder and organizer. It’s your job to design the toy box, decide what toys to put in it and make sure everything runs smoothly. You figure out how to organize the toys well, make ways to get them fast, and create systems to know who’s using them.<br>In short, a cloud engineer is like the master builder and caretaker of the magical toy box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*ZW4dKW8RQjENifoK3d7yEg.jpeg" /><figcaption>You’re the master builder</figcaption></figure><h3>Types of cloud services: IaaS, PaaS, and SaaS</h3><h4>IaaS (Infrastructure as a Service)</h4><p>The most basic category of cloud computing services. With infrastructure as a service, you rent IT infrastructure — servers and virtual machines (VMs), storage, networks, and operating systems — from a cloud provider on a pay-as-you-go basis.</p><h4>PaaS (Platform as a Service)</h4><p>Platform as a service refers to cloud computing services that supply an on-demand environment for developing, testing, delivering, and managing software applications. PaaS is designed to make it easier for developers to quickly create web or mobile apps, without worrying about setting up or managing the underlying infrastructure of servers, storage, network, and databases needed for development.</p><h4>SaaS (Software as a Service)</h4><p>Software as a service (SaaS) is a method for delivering software applications over the internet, on-demand, and typically on a subscription basis. With SaaS, cloud providers host and manage the software application and underlying infrastructure, and handle any maintenance, like software upgrades and security patching. Users connect to the application over the internet, usually with a web browser on their phone, tablet, or PC.</p><p><strong>Because we’re 5 and we’re already bored with the toy box we need some other explanations to keep us concentrated here:</strong></p><ul><li><strong>IaaS (Infrastructure as a Service):</strong> Think of it like renting all the different types of building blocks you need to build something cool. You don’t need to worry about where the blocks come from or how they work together, you just pick the ones you want and use them. When you’re done playing, you give them back, and you only pay for the time you used them.</li><li><strong>PaaS (Platform as a Service):</strong> This is like having a magic table where you can build amazing things without needing to know exactly how the table works. You just tell the table what you want to build, and it gives you all the tools and instructions you need to make it happen. You don’t have to worry about getting the materials or setting everything up, you just focus on creating something awesome.</li><li><strong>SaaS (Software as a Service):</strong> Imagine you have a magical book that can do all sorts of fun activities, like painting pictures, solving puzzles, or even telling stories. You don’t need to keep the book at home because it’s always available to you wherever you go. Whenever you want to do something fun, you just open the book and start playing. You don’t have to worry about how the activities work or fixing any problems that come up because the book takes care of everything for you. You just enjoy using the activities whenever you want, as long as you have the book with you or access to it through magic (internet).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*tnsa_IDHDJe7N6z3cZm0Lg.png" /><figcaption>SaaS built on PaaS built on IaaS</figcaption></figure><h3>Conclusion</h3><p>I hope the 5-year-old kid inside of you learned a lot and now understands more about cloud computing and cloud engineering. I plan to continue writing cloud Engineering related articles and how-to guides as both you and I explore this broad expanding field.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe6409998a2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Philosophers 42 Guide— “The Dining Philosophers Problem”]]></title>
            <link>https://medium.com/@ruinadd/philosophers-42-guide-the-dining-philosophers-problem-893a24bc0fe2?source=rss-de83f353c49b------2</link>
            <guid isPermaLink="false">https://medium.com/p/893a24bc0fe2</guid>
            <category><![CDATA[multithreading]]></category>
            <category><![CDATA[42-network]]></category>
            <category><![CDATA[42-coding-school]]></category>
            <category><![CDATA[c-programming]]></category>
            <category><![CDATA[dining-philosophers]]></category>
            <dc:creator><![CDATA[Dean Ruina]]></dc:creator>
            <pubDate>Mon, 21 Aug 2023 06:53:59 GMT</pubDate>
            <atom:updated>2023-08-21T06:53:59.584Z</atom:updated>
            <content:encoded><![CDATA[<h4>The famous “Dining Philosophers Problem” explained/walkthrough — 42 cursus project</h4><p>Here is my philosophers repository for refrence. I’ll explain here the general idea of my solution. If you’re interested in seeing my code you can check it here:</p><p><a href="https://github.com/DeRuina/philosophers">GitHub - DeRuina/philosophers: Philosophers 42 Explained/Walkthrough. The Dining Philosophers Problem guide</a></p><h3>The Dining Philosophers Problem</h3><p><a href="https://en.wikipedia.org/wiki/Dining_philosophers_problem">The dining philosophers problem</a> is a famous problem in computer science used to illustrate common issues in <a href="https://en.wikipedia.org/wiki/Concurrency_(computer_science)">concurrent programming</a>. The problem was originally formulated in 1965 by <a href="https://en.wikipedia.org/wiki/Edsger_W._Dijkstra">Edsger Dijkstra</a>, and is stated as follows:</p><blockquote>X amount of philosophers sit at a round table with bowls of food.<br> Forks are placed in front of each philosopher.<br> There are as many forks as philosophers.<br> All day the philosophers take turns eating, sleeping, and thinking.<br> A philosopher must have two forks in order to eat, and each fork<br> may only be used by one philosopher at a time. At any time a<br> philosopher can pick up or set down a fork,<br> but cannot start eating until picking up both forks.<br> The philosophers alternatively eat, sleep, or think.<br> While they are eating, they are not thinking nor sleeping,<br> while thinking, they are not eating nor sleeping,<br> and, of course, while sleeping, they are not eating nor thinking.</blockquote><p>Let me start by explaining the general idea. First of all, we have to imagine a round table, X num of philosophers sitting around it and each of them brings a fork and places it in front of them. At this point we know that a philosopher can do three things: eat, sleep, or think, but in order to eat he has to pick two forks (the one in front of him and another one to his right or to his left, in my solution he picks the one to his right, both work — different implementation). Let’s use a picture to have a more concrete idea of what we are talking about:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdI7qwsNa05IkyiMXlAmPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*Dz1rW93w8LBqRpKneo_Ftw.gif" /><figcaption>The number of forks is equal to the number of philosophers</figcaption></figure><p>Let’s say there are 5 philosophers sitting at the table. Philosopher 1 wants to eat, so he picks the fork in front of him and the one to his right (the one in front of philosopher 5), at this point, we notice that philosopher 2 can’t eat nor does philospher 5, since philosopher 1 picked the fork in front of him and in front of philisopher 5. this might seem a little obvious but keep in mind this situation because the main problem of this project is how to organize the eating action of the philosophers. Probably the first solution that came to your mind is to simply make the odd and even philos eat separately, well we are not going to do that, it’s too hard coded and we would lose the meaning of the project, philos have to organize by themselves. We will be using <a href="https://en.wikipedia.org/wiki/Thread_(computing)">threads</a> and implement a <a href="https://en.wikipedia.org/wiki/Multithreading_(computer_architecture)">multithreading solution</a>. I’m attaching the <a href="https://cdn.intra.42.fr/pdf/pdf/96340/en.subject.pdf">project subject</a> as well so you could understand completely what is needed.</p><p>In order to understand the solution you’ll needs to understand the concept of threads first, here are some good videos I recommend you watch:</p><ul><li><a href="https://www.youtube.com/watch?v=LOfGJcVnvAk">General introduction to threads</a></li><li><a href="https://www.youtube.com/watch?v=ldJ8WGZVXZk">Introduction to threads with code examples</a></li><li><a href="https://www.youtube.com/watch?v=d9s_d28yJq0&amp;list=PLfqABt5AS4FmuQf70psXrsMLEDQXNkLq2">Short introduction to threads (pthreads)</a> **</li><li>* Code Vault covers all the knowledge you need for this project/problem in this playlist</li></ul><h3>Data Races (Race Conditions) — What Are They?</h3><p>Data races are a common problem in multithreaded programming. Data races occur when multiple tasks or threads access a shared resource without sufficient protections, leading to undefined or unpredictable behavior.</p><ul><li>two or more threads concurrently accessing a location of memory</li><li>one of them is a write</li><li>one of them is unsynchronized</li></ul><p>In simpler words a race condition can happen when 2 or more threads are trying to access and modify the same variable at the same time, it can lead to an error in the final value of the variable, it doesn’t mean it will for sure happen though. For an example let’s think of a function that deposits the amount you insert to your bank account, If we use multithreading and use 2 threads and want to deposit 300 using the first thread and 200 using the second you will think our bank account will have a total of 500, but that’s not particularly the case, let’s see it in code:</p><pre>#include &lt;unistd.h&gt;<br>#include &lt;stdio.h&gt;<br>#include &lt;pthread.h&gt;<br><br>// the initial balance is 0<br>int balance = 0;<br><br>// write the new balance (after as simulated 1/4 second delay)<br>void write_balance(int new_balance)<br>{<br>  usleep(250000);<br>  balance = new_balance;<br>}<br><br>// returns the balance (after a simulated 1/4 seond delay)<br>int read_balance()<br>{<br>  usleep(250000);<br>  return balance;<br>}<br><br>// carry out a deposit<br>void* deposit(void *amount)<br>{<br>  // retrieve the bank balance<br>  int account_balance = read_balance();<br><br>  // make the update locally<br>  account_balance += *((int *) amount);<br><br>  // write the new bank balance<br>  write_balance(account_balance);<br><br>  return NULL;<br>}<br><br>int main()<br>{<br>  // output the balance before the deposits<br>  int before = read_balance();<br>  printf(&quot;Before: %d\n&quot;, before);<br><br>  // we&#39;ll create two threads to conduct a deposit using the deposit function<br>  pthread_t thread1;<br>  pthread_t thread2;<br><br>  // the deposit amounts... the correct total afterwards should be 500<br>  int deposit1 = 300;<br>  int deposit2 = 200;<br><br>  // create threads to run the deposit function with these deposit amounts<br>  pthread_create(&amp;thread1, NULL, deposit, (void*) &amp;deposit1);<br>  pthread_create(&amp;thread2, NULL, deposit, (void*) &amp;deposit2);<br><br>  // join the threads<br>  pthread_join(thread1, NULL);<br>  pthread_join(thread2, NULL);<br><br>  // output the balance after the deposits<br>  int after = read_balance();<br>  printf(&quot;After: %d\n&quot;, after);<br><br>  return 0;<br>}</pre><p>You would think if you run this code that the balance will be 500 but the output we get is actually 200, now, why is that? Here is a visualization of the above program’s execution:</p><pre>Thread #1             Thread #2              Bank Balance<br><br>Read Balance  &lt;----------------------------------- 0<br>balance = 0<br>                      Read Balance  &lt;------------- 0<br>                      balance = 0<br><br>Deposit +300<br>balance = 300<br>                      Deposit +200<br>                      balance = 200<br><br>Write Balance  ----------------------------------&gt; 300<br>balance = 300<br>                      Write Balance  ------------&gt; 200<br>                      balance = 200</pre><p>When the two deposit functions run at the same time, they both read the balance which is 0, they both deposit the amount inserted and change the balance variable locally, but when they write it to the variable itself, they overwrite each other. thread #1 writes 300 first but thread #2 writes as well and changes the variable to 200. How can we solve this? easily we just need to attach a lock, let me introduce you to mutex.</p><ul><li><a href="https://www.youtube.com/watch?v=FY9livorrJI&amp;list=PLfqABt5AS4FmuQf70psXrsMLEDQXNkLq2&amp;index=3">What are Race Conditions?</a> — Great explanation down to the Assembly level</li><li><a href="https://www.youtube.com/watch?v=K1aoimUYTK8">Race Conditions Explained With An Example</a></li></ul><h3>Mutex</h3><p>Now that we know what is a race condition let’s see what is the solution. Imagine a lock that protects a block of code and it can be only executed by the lock owner until he unlocks the lock. Taking the previous example we can avoid the overwrite by adding a lock in the deposit function. if thread #1 reaches the lock thread #2 will just have to wait until thread #1 is done executing the code and reaches the unlock, only then thread #2 will enter and execute himself.</p><pre>#include &lt;unistd.h&gt;<br>#include &lt;stdio.h&gt;<br>#include &lt;pthread.h&gt;<br><br>// the initial balance is 0<br>int balance = 0;<br><br>// write the new balance (after as simulated 1/4 second delay)<br>void write_balance(int new_balance)<br>{<br>  usleep(250000);<br>  balance = new_balance;<br>}<br><br>// returns the balance (after a simulated 1/4 seond delay)<br>int read_balance()<br>{<br>  usleep(250000);<br>  return balance;<br>}<br><br>// carry out a deposit<br>void* deposit(void *amount)<br>{<br>  // lock the mutex<br>  pthread_mutex_lock(&amp;mutex);<br><br>  // retrieve the bank balance<br>  int account_balance = read_balance();<br><br>  // make the update locally<br>  account_balance += *((int *) amount);<br><br>  // write the new bank balance<br>  write_balance(account_balance);<br><br>  // unlock to make the critical section available to other threads<br>  pthread_mutex_unlock(&amp;mutex);<br><br>  return NULL;<br>}<br><br>int main()<br>{<br>  // mutex variable<br>  pthread_mutex_t mutex;<br><br>  // output the balance before the deposits<br>  int before = read_balance();<br>  printf(&quot;Before: %d\n&quot;, before);<br><br>  // we&#39;ll create two threads to conduct a deposit using the deposit function<br>  pthread_t thread1;<br>  pthread_t thread2;<br><br>  // initialize the mutex<br>  pthread_mutex_init(&amp;mutex, NULL);<br><br>  // the deposit amounts... the correct total afterwards should be 500<br>  int deposit1 = 300;<br>  int deposit2 = 200;<br><br>  // create threads to run the deposit function with these deposit amounts<br>  pthread_create(&amp;thread1, NULL, deposit, (void*) &amp;deposit1);<br>  pthread_create(&amp;thread2, NULL, deposit, (void*) &amp;deposit2);<br><br>  // join the threads<br>  pthread_join(thread1, NULL);<br>  pthread_join(thread2, NULL);<br><br>   // destroy the mutex<br>  pthread_mutex_destroy(&amp;mutex);<br><br>  // output the balance after the deposits<br>  int after = read_balance();<br>  printf(&quot;After: %d\n&quot;, after);<br><br>  return 0;<br>}</pre><p>You have surely noticed that we initialize and destroy the mutex, and you have to do that every time you want to use a mutex (destroy it after you finished using it) otherwise it won’t work.</p><p>Here is another visualization with the locks:</p><pre>Thread #1             Thread #2              Bank Balance<br><br>                       **  LOCK  **<br><br>  WAIT @ LOCK          Read Balance  &lt;------------- 0<br>      |                balance = 0<br>      |<br>      |                Deposit +200<br>      |                balance  = 200<br>      |<br>      |                Write Balance  ------------&gt; 200<br>      |                balance = 200<br>      |<br>  LOCK FREE            ** UNLOCK **<br><br>  **  LOCK  **<br><br>  Read Balance  &lt;----------------------------------- 200<br>  balance = 0<br><br>  Deposit +300<br>  balance = 500<br><br>  Write Balance  ----------------------------------&gt; 500<br>  balance = 500<br><br>  ** UNLOCK **</pre><ul><li><a href="https://www.youtube.com/watch?v=oq29KUy29iQ&amp;list=PLfqABt5AS4FmuQf70psXrsMLEDQXNkLq2&amp;index=4">What is a mutex in C? (pthread_mutex)</a></li><li><a href="https://www.youtube.com/watch?v=raLCgPK-Igc&amp;t=424s">Mutex Introduction (pthreads)</a></li></ul><h3>Step By Step Guide/Walkthrough</h3><h4>First Step: Checking Valid Input</h4><p>The first thing we need to do before we even start initializing anything is to check the program input. The program will receive 4 or 5 arguments so the first thing should be to throw an error if we receive more or less. Let’s analyze the input we will receive: 5 800 200 200 7</p><ul><li>5 — The number of philosophers</li><li>800 — The time a philosopher will die if he doesn’t eat</li><li>200 — The time it takes a philosopher to eat</li><li>200 — The time it takes a philosopher to sleep</li><li>7 — Number of times all the philosophers need to eat before terminating the program **</li></ul><p>** optional argument</p><p>Basically, all we need to do is to check that the input contains only numbers, they should all be bigger than 0 except the number of meals each philo needs to eat (edge case). In the evaluation form, it says we should not test with more than 200 philos so you can set the limit not to be more than 200.</p><h4>Second Step: Structures</h4><p>In order for you to understand the way I approached and solved this project I’ll share with you the structures I made. Because each philosopher needs to be a thread and all the data needs to pass to the routine functions, structures are the best option. I created 2 structures, The program structure which holds all of the philosophers (in an array), 3 mutex, and one dead_flag, and the philo structure where we have all of the general data, 3 mutex pointers that point to the mutex in the program structure, 2 mutex pointers for the forks, and on dead pointer which points to the dead flag in the program structure.</p><pre>typedef struct s_philo<br>{<br>	pthread_t		thread;<br>	int				id;<br>	int				eating;<br>	int				meals_eaten;<br>	size_t			last_meal;<br>	size_t			time_to_die;<br>	size_t			time_to_eat;<br>	size_t			time_to_sleep;<br>	size_t			start_time;<br>	int				num_of_philos;<br>	int				num_times_to_eat;<br>	int				*dead;<br>	pthread_mutex_t	*r_fork;<br>	pthread_mutex_t	*l_fork;<br>	pthread_mutex_t	*write_lock;<br>	pthread_mutex_t	*dead_lock;<br>	pthread_mutex_t	*meal_lock;<br>}					t_philo;<br><br>typedef struct s_program<br>{<br>	int				dead_flag;<br>	pthread_mutex_t	dead_lock;<br>	pthread_mutex_t	meal_lock;<br>	pthread_mutex_t	write_lock;<br>	t_philo			*philos;<br>}					t_program;</pre><h4>Third Step: Initialization</h4><p>Because we know the maximum amount of philosophers our program can be tested with (200) and I wanted to avoid dealing with leaks, freeing, and allocating, and mainly because I wanted the performance to be faster I decided to keep all the memory on the stack and not on the heap by initializing a philo structure array, a mutex array for the forks and the program structure all in the main. From there I initialize the program variables, initialize all the mutexes for the mutex fork array, and lastly the philosophers — input variables and point the pointers to all the mutexes and the dead_flag.</p><h4>Fourth Step: Thread Creation, Philo Routine, And Monitor</h4><p>Now we need to create the threads and join them. We will create as many threads as philosophers we have, each philo needs to be a thread and we will create an extra thread (I called it observer) which will monitor everything. Each philo thread will run the philo routine function and the observer will run the monitor function.</p><p><strong>Philo Routine()</strong></p><p>The routine will be the function executed over and over by the philos, Basically ,I created a loop that will break as soon as the dead flag is 1, in other words as soon as a philo is dead. Remember:</p><blockquote>The philosophers alternatively eat, sleep, or think. While they are eating, they are not thinking nor sleeping, while thinking, they are not eating nor sleeping, and, of course, while sleeping, they are not eating nor thinking.</blockquote><p>So in our loop, they will eat, sleep and think. Let’s start with the easiest one when they think we just need to print a message “X is thinking” (X is the philo number), When they sleep we need to make them sleep the length of the input inserted by the user using our ft_usleep (described in the bottom of this page) and then print the message “X is sleeping”. Now to the eating part, We will lock the right fork first using pthread_mutex_lock and print the message, and do the same with the left fork. Then he will eat using ft_usleep again and only then he will drop the forks by unlocking the locks, before that we change some variables that give our monitor indications but that’s the general idea.</p><p><strong>Monitor()</strong></p><p>This thread will be running and monitoring the whole program, it has 2 checks in it that run infinitely until a philo dies or they all ate the number of meals they need to (last input argument). Basically, we will check that the time a philo needs to die didn’t surpass the last meal he had and that he is not concurrently eating. If he indeed died we change the dead flag to 1 and that will break the loop in all of the threads. The other check is to see if all the philos finished eating the amount of meals they need to, and if they did we will again change the dead flag to one and break the threads loop.</p><h4>Fifth Step: Destroying All The Mutexes</h4><p>The last step is to Destroy all the mutexes you initialized, otherwise, they won’t work. In this step, we will free all the data we allocated if we chose to allocate it(we didn’t).</p><h3>Utils Functions — Improtant</h3><h4>Sleep Function Delay</h4><p>Different machines perform the sleep function with different accuracy. You can check your machine by running the script in my repo.</p><p><a href="https://github.com/DeRuina/philosophers">GitHub - DeRuina/philosophers: Philosophers 42 Explained/Walkthrough. The Dining Philosophers Problem guide</a></p><p>This can help make sure other stuff running on the computer doesn’t interfere with Philosopher’s timings. For this reason, as well we created the ft_usleep function. Run the script by downloading it and:</p><pre>python3 delay_o_meter.py</pre><p>or by running my Makefile with the command:</p><pre>make delay</pre><h4>ft_usleep</h4><pre>// Improved version of sleep function<br>int	ft_usleep(size_t milliseconds)<br>{<br>	size_t	start;<br><br>	start = get_current_time();<br>	while ((get_current_time() - start) &lt; milliseconds)<br>		usleep(500);<br>	return (0);<br>}</pre><h4>get_current_time</h4><pre>// Gets the current time in milliseconds<br><br>size_t	get_current_time(void)<br>{<br>	struct timeval	time;<br><br>	if (gettimeofday(&amp;time, NULL) == -1)<br>		write(2, &quot;gettimeofday() error\n&quot;, 22);<br>	return (time.tv_sec * 1000 + time.tv_usec / 1000);<br>}</pre><p>That’s the general idea and explanation, my repo is linked in the top if you want to see how I did it by code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=893a24bc0fe2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Days in Alta Via 1 with a tent]]></title>
            <link>https://medium.com/@ruinadd/5-days-in-alta-via-1-with-a-tent-d39752aa940?source=rss-de83f353c49b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d39752aa940</guid>
            <category><![CDATA[the-dolomites]]></category>
            <category><![CDATA[hiking]]></category>
            <category><![CDATA[trekking]]></category>
            <category><![CDATA[camping]]></category>
            <category><![CDATA[couples]]></category>
            <dc:creator><![CDATA[Dean Ruina]]></dc:creator>
            <pubDate>Sun, 13 Aug 2023 15:00:29 GMT</pubDate>
            <atom:updated>2023-08-13T15:00:29.488Z</atom:updated>
            <content:encoded><![CDATA[<h4>Alta Via 1 (high road number 1 in Italian) is a very popular trek but not an easy one. Challenging, beautiful, and long, me and Tintti did 60km out of 120km from Lago di Brais to Selva di Cadore with a tent. July 2023. The Dolomites, North of Italy.</h4><h3><strong>Background</strong></h3><p>So after accomplishing Karhunkierros (Bears trail) in Lapland, Finland in June, We headed to our next challenge — Alta Via 1 (high road number 1) in The Dolomites, North of Italy.</p><p>Alta Via 1 is one of the most popular treks in Italy, starting in Lake Lago di Brais and finishing in the city of Belluno. 120 kilometers of mountain tops and breathtaking views. The trek itself is a hut-to-hut (Rifugio in Italian) trek, therefore, you don’t need to carry much weight on your back, all your meals can be provided in the Rifugios. Because we chose to do the trek with a tent and we had to carry all of our food and equipment on our backs we chose to only do a part of the trek (the part with the prettiest views). The trek itself is not easy at all, every day you need to climb mountains and descend. The highest elevation point of the trek is 2752m and in general, you climb 6665m throughout the whole trek. There are 4 Alta vias and number 1 is the easiest of them, but indeed it&#39;s not easy at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AOTvSd56l_42qDKWLUwzGg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fBFbOKEBp_ebjLvVQqdiyA.jpeg" /><figcaption>Us excited to begin &amp; A typical view from the tent</figcaption></figure><h3>Season &amp; Weather</h3><p>The recommended season for the trek is from the beginning of July until the end of September. That’s only when the huts are open. The weather is usually warm with an hour or two of thunderstorms in the afternoon. September is the most stable month and the less rainy one. If you do the trek at the beginning of July you might still have some snow in the mountain passes.<br>You can find the <a href="https://www.meteoblue.com/en/weather/week/rifugio-biella_italy_3218640">weather forecast here</a>.</p><h3>Accommodations</h3><p>The trek itself is a rifugio to rifugio (hut to hut). That’s the common way. There are 29 rifugios in different stages and locations, you can divide the trek by yourself however you see fit, the big problem is that it’s such a popular trek that you have to book your stay around December/January already (the winter before), otherwise there won’t be any rooms left. In order to book your stay you need to send an email to each rifugio or call them. You can find the list of the huts and the methods to book your stay by <a href="http://rifugios.net/alta-via-1.html">pressing here</a>. Prices and meal prices will be explained below. There are private rooms and public rooms, rifugio depended. Some are new and renovated and some are really old.</p><p>Because the rifugios are expensive and you must book all of your accommodations half a year before, we’ve decided we’ll sleep in a tent. It gives you the flexibility of walking as long as you want every day and takes the pressure of having to make it on time to the hut for dinner, and then again, as I mentioned before, the main reason is money, especially for a young couple starting their life together.</p><p>I must mention that “Camping” is officially illegal in Italy but the official definition of camping is sleeping in the wild for more than 12 hours or with a bonfire. What is allowed though is to open up a tent from 20:00 until 8:00 if you don’t litter and clean everything before you leave. My advice is to just find a nice spot every night not too close to the trail and there are plenty. We weren’t the only hikers camping and I never heard or read about anyone getting a fine. Simple as it gets — respect and place and leave it clean.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*U_BMEQpvJDNzExwaFo8WCA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*SRHDnfL95art4VQT4r8wNA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*GnacoUFvluJX-YPf4AyVdg.jpeg" /><figcaption>Rifugio Fanes, Rifugio Biella &amp; Rifugio Sennes</figcaption></figure><h3>Maps &amp; Trail Marking</h3><p>The official trail marking is a triangle with the digit 1 inside it. You must take maps or navigation tools with you, there are some different variations of Alta Via 1, and it’s very common to cut/add segways according to your plan, There are some crossings and parts that the markings are confusing and that’s why you must carry a map or have a navigation tool with you. <br>The 3 maps that cover the whole trek are:<br>• TABACCO 03 — Cortina d’Ampezzo Dolomiti Ampezzane.<br>• TABACCO 025 — Dolomiti di Zoldo Cardorine e Agordine.<br>• TABACCO 031 — Pragser Dolomiten Enneberg Dolomiti di Brais Marebbe.</p><p>The maps are available in the towns that are near the beginning of the trek like Villabassa or Dobiacco (that’s where we bought them) or in any hut along the way. You can order the maps online beforehand <a href="https://www.stanfords.co.uk/AdvancedSearch?q=tabacco">from here</a>.</p><p>I personally used the maps and downloaded the <a href="https://www.alltrails.com/trail/italy/south-tyrol/alta-via-1-dolomiti-lago-di-braies-belluno">GPX trail</a> to my phone and used the Outdooractive app to navigate with flight mode. It helps a lot to see where you at and to plan for the next day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iagwv4zhUm2-VARzGQIcGA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*WxmTt2c1f0kt5mC7tdznnw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fVCSTaoW6I_AAca6pzzZLg.jpeg" /><figcaption>The 3 maps, The official trail marking &amp; A common marking with the trail number</figcaption></figure><h3>Prices</h3><p>As I’ve said before, the trek isn’t cheap at all and you need to preorder your stayings. The average price for a night with dinner and breakfast the next morning is around 80–90 Euro per person, private rooms cost even more. The price is differentiates from rifugio to rifugio. We’ve decided to eat our lunches in the rifugios so we planned our sleeping spots according to that.<br>The average price for a couple was around 40 Euro. Including a main dish and a beverage. 1.5L water bottle costs 4.5 Euro, there are sections you cannot refill your bottles so you’ll have to buy.</p><h3>Arrival</h3><p>We took a flight to Vienna, Austria, and took a 4 hours train straight to Innsbruck from the airport. We spent there 2 nights. We rented a car from a private person through an app called Getaround (it’s much cheaper than renting from a company, another similar app is GoMore). We traveled the area for 2 days, bought our gas canister from a store called SPORTLER (they have any kind of camping/trekking equipment you might need), and drove to the north of Italy.</p><p>We slept in a small town called Dobbiaco the night before leaving for the trek in Hotel Tschurtschenthaler, a great guesthouse, with a nice sauna and pool. The owners are super nice they let us park our car for free at the back of the hotel for the whole time we were trekking. The bus stop for the line that takes you to Lake Lago di Brais where the trek starts is located right next to the the hotel.</p><p>We went to gear up with food from CONARD CITY supermarket which is located next to the church of Dobbiaco and also bought the maps for the trek and some lighters from the tobacco store next to it (the only place in Dobbiaco I found the maps), we took the 442 bus schedule from reception and went to sleep.</p><p>We woke up in the morning for a delicious breakfast, we packed our bags and through our other suitcases and gear that we don’t need in the trunk of our car that was parked at the back. We took bus 442 to Lake Lago di Brais at 9:02 from the stop next to the hotel and the bus was completely full. Lake Lago di Brais is where the trek begins and is a very touristy place, many people go there for day hikes or to just spend a few hours on the lake.<br>The tickets are only buyable online or as later was known to me are buyable locally at the station from where the bus leaves which is Dobbiaco, Autostazione. My suggestion is to go from there if you don’t want to stand the whole way, it&#39;s only 10 minutes walk from the hotel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zL0P7-95UnM7VvgnQQje1Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jYIncpwmrPgqlTbT7FkOFw.jpeg" /><figcaption>Had to sit on the floor because it was so packed</figcaption></figure><h3>Day 1 — Lake Lago di Brais until 2 kilometers after Rifugio Biella</h3><ul><li><em>Distance: 11.5 kilometers.</em></li><li><em>Elevation gain: 937 meters.</em></li><li><em>Elevation loss: 120 meters.</em></li><li><em>Path numbers: 1, 6, 6A.</em></li></ul><p>We arrived at Lake Lago di Brais, a mystical bright turquoise water lake. The place was packed with people, it&#39;s a very popular spot in the Dolomites. Here begins our trek, the official starting point. Our bags were fully packed, Tintti carried 15 kilos and I had 21 kilos. There are 2 options, to circle the lake clockwise or anticlockwise, we chose the less crowded way which is clockwise but was longer. We circled the lake until we arrived on the other side where a long, steep uphill was starting (path number 1 on the map). The beginning was the toughest, a few kilometers of steep, gravel rocky road with no tiny drop of shade, after more climbing and some altitude we finally got some shade from trees and the road became more alive with plants all around. The higher we climbed to the more amazing view we had behind us. It was a long climb until we reached the mountain pass. In some parts, you had to hold some iron chains because it was really steep, generally the climb was really tough, especially with the weight on our bags but if you take it slow and have enough breaks you will enjoy it.<br>After reaching the mountain pass there is a bit more climbing to do which is way easier and plain until you reach the top and see Rifugio Biella underneath.</p><p>We descended to the rifugio. Lunch was between 12–15. We arrived right on time, tired and hungry at 14:30. We both had delicious funghi pasta and I had a cold frisky beer. We bought 2 more water bottles because there was nowhere to fill them up. After a good long rest, we continued on path number 6. We walked until we reached the crossings with path 6A and continued on 6A for a kilometer or 2 until we found a nice quiet spot to camp for the night. We made some dinner and went to sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hHEf5-_5gffo1EEZr8k7Tg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQpJH-3mq3NMMil-bsmgaw.jpeg" /><figcaption>Lake Lago di Brais — The official starting point</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KmlYj02z28p-RWGOc6YlPA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkGLZf-866Vq9srFmiO3Zw.jpeg" /><figcaption>Gaining some elevation (path number 1) &amp; Circling the lake</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gsm9YWVQQA347PZn9HwWBQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nST8z_U0la3avrXl6UihnA.jpeg" /><figcaption>The iron chains &amp; A small break to appreciate the amazing view</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERLZGUzqlSCZkXMcrEaNjw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1FAC0GMOX9t8tjpmM2wKxQ.jpeg" /><figcaption>Posing happily at the top &amp; Climbing there</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IqSxfASiDGoR-NX3D7aElg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GMIsc5MFCAH1LQVrxCmW-w.jpeg" /><figcaption>Delicious pasta for lunch &amp; Descending to Rifugio Biella</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fz_plqj7_oTZ9i6MIisFIg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HaeYJ6UztRstTOtnGUHNqw.jpeg" /><figcaption>The nice spot we found for our tent, as you can see not too far from the road, and Rifugio Biella as a tiny dot at the end</figcaption></figure><h3>Day 2 — 2 kilometers after Rifugio Biella until Lake Le de Limo</h3><ul><li><em>Distance: 17 kilometers.</em></li><li><em>Elevation gain: </em>654<em> meters.</em></li><li><em>Elevation loss: </em>908<em> meters.</em></li><li><em>Path numbers: 6, 6A, 7, 11</em></li></ul><p>We woke up at 6:30, made breakfast, gathered our stuff, and continued walking a few kilometers on path number 6 until we reached Rifugio Sennes. We made a small break and ordered a cappuccino. There was a water trough right in front of the rifugio where we refilled our bottles (we asked if it is drinkable beforehand). We continued on path number 7 which was easy and flat until we started descending on paths 7A/7 after a long downhill and some steep zigzagging we arrived exactly on time to Rifugio Pedero right on time for lunch. I had some good homemade ravioli and Tintti order pasta, with a cold beer of course. After the break, we started ascending in a long exhausting uphill, all the elevation we lost we had to climb back again. We had a small coffee break in the middle. It&#39;s important to note that this whole uphill didn’t have any shade so if it’s a hot day like we had you should definitely have a hat and some sunscreen with you. After some hours we arrived to Ucia de Fanes there we did a small break and ordered a cake. We refilled our bottles from the water trough (most of the rifugios have one) and continued on path number 11, it was again an uphill but a short one this time, we continued walking until we reached Lake Le de Limo, a beautiful private lake, we were the only ones there most of the time, we found a nice private spot, went swimming, had some dinner and went to sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k7GDovZd68rDUZpIWKmc_w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDZ0K6UoXutxUvolUEpm1A.jpeg" /><figcaption>Reaching Rifugio Sennes &amp; The start of our day</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RecRTVh512N2LuVpgkuSqQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swGd210xV6hvxdKFx5tK8A.jpeg" /><figcaption>Beautiful Tintti and views &amp; Our cappuccino break</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTuN1WlWD05TagghazlxCQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5dKxe6s62wJoXNzsLaplzg.jpeg" /><figcaption>Continued walking after lunch &amp; Our lunch in Rifugio Pedero</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLXzdi3o1tpkY-ZUNfWAlA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21m7RUFX_oykMBVUhk6DkA.jpeg" /><figcaption>Never getting tired of these amazing views</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdt-eSOBAfcKLWD_iDct7g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fyb03seJmTWfo2EAtPGa9g.jpeg" /><figcaption>Almost at the end of the ascend — happy &amp; Coffee break</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IOpkSktsK8g4Yk_JOSDCTg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nKGpwbfadRnJ27nVbmdDIw.jpeg" /><figcaption>The spot we found for the tent &amp; Beautiful Lake Le de Limo</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qfQVkwp7xV0toXEt8he9g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ss3ohtN43q09Wn0V6wraw.jpeg" /><figcaption>Us planning tomorrow &amp; Making dinner</figcaption></figure><h3>Day 3 — Lake Le de Limo until Lake Lech de Lagacio</h3><ul><li><em>Distance: 10.5 kilometers.</em></li><li><em>Elevation gain: </em>1086<em> meters.</em></li><li><em>Elevation loss: </em>418<em> meters.</em></li><li><em>Path numbers: 11, 20, 20B.</em></li></ul><p>We woke up at 6:30, folded our stuff, and continued on path number 11 until we reached Utia de Gran Fanes where we ordered coffee and had our breakfast. We refilled our water again from the water trough, it was a beautiful place full of cows and horses. We continued on the same path, a few kilometers of plain easy walking surrounded by cows until we reached the crossings with path 20B, There begins a long uphill ascend until you reach the mountain pass — Forcela di Lech. We had a small break at that top after a long exhausting climb and then continued for the steepest descent of the trek, a long downhill that looks scary but is well maintained. When we started going down a crazy breathtaking view opened up before us, seeing Lake Lech de Lagacio with all the mountains surrounding it in the background. This part and the view we will see tomorrow were the most beautiful views of the trek and one of the prettiest views I&#39;ve seen in my life. After a long downhill we arrived at the lake and decided to sleep here (the flexibility of having a tent). We arrived quite early so we decided we will rest and take it easy because tomorrow we have even more climbing to do. We spent the rest of the day swimming and relaxing. The lake was full of people because everyone has their break there after the long climb and descent, some even come for day hikes. Around 17–18, we and fellow campers were the only people left there. We filtered some water from the lake using our <a href="https://www.youtube.com/watch?v=2YaUTyekj1w">Sawyer Mini</a>, cooked some dinner, and went to sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*edumirJRlPzU8PQ_IUuHCA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAWBKP2Ug9HRdITuIrudWQ.jpeg" /><figcaption>Walking surrounded by cows &amp; The view from the window of <em>Utia de Gran Fanes</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYtTE_8a9Ct_srrEShJQnA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JwbZDVqhJaUH2ejo-WKhIw.jpeg" /><figcaption>The beginning of the climb &amp; The plain walk until the crossings with 20B</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5xJLhOYc8x0seNkZHA2Yw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8CmP4JFH40MwW1ZGMy8Cbw.jpeg" /><figcaption>Halfway to the top, still climbing</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NDpo0STkTr5QOyXJ_GBRlw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6cMFJ8NYp3rYSVLja_G8Zg.jpeg" /><figcaption>The start of the steep descent, breathtaking views of the mountains surrounding the lake. The picture on the right is my favorite picture of the whole trek</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QsfQJ9Xjcygwwdc5AuoiQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mRTRUhlwniLGHZSLlSwz8A.jpeg" /><figcaption>A moment of smiles &amp; Me going down</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uaRTLq8NQ6Xr3dmG6spPw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bMszoF9bPGb6NRxDBpECxQ.jpeg" /><figcaption>Almost reaching Lake Lech de Lagacio &amp; A GoPro selfie</figcaption></figure><h3>Day 4 — Lake Lech de Lagacio until 2 kilometers before Rifugio Averau</h3><ul><li><em>Distance: 9.5 kilometers.</em></li><li><em>Elevation gain: </em>370<em> meters.</em></li><li><em>Elevation loss: </em>700<em> meters.</em></li><li><em>Path numbers: 20, 401, 441.</em></li></ul><p>We woke up at 7 next to the lake, made some breakfast, folded our stuff, and started walking. We continued on path number 20, a long tough climb until the mountain pass — Forc Lagazuoi, we started early so the sun was still hiding behind the mountains and the weather was chilly and nice for a climb. After reaching the pass we took path number 401 which made us climb even more on a snake shape road until we reached Rifugio Lagazuoi. That’s the highest point of the trek, 2752 meters altitude. On the climb up there are some tunnels from World War I, we went through some of them, super cool experience, you must be really careful and have a flashlight with you in some of them. We arrived at the rifugio right on time for lunch and ordered the usual. From the rifugio, you have a breathtaking 360-degree view of mountain tops and valleys, your eyes can’t really grasp what you see. We decided to have to have a shorter day so we took the cablecar down from the rifugio and not the walking path down. From there we crossed the road and started to climb again on path number 441 until we reached Lake Lago di Lemedes where we had a long break. We made some coffee, swam, and filtered more water before continuing to walk. We continued to climb until we reach the midway point, we found a nice private spot with beautiful views to open our tent and finished our day at 16. Last night on the trek, we wanted to take it easy, relax and enjoy nature and grasp the moments as much as we can. We cooked dinner and decided we will wake up for the sunrise for our last morning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wn-fKiPqWkW6fA7L4wtGSA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fDTGg2YrRs8Yf4cw9PG1sw.jpeg" /><figcaption>Starting to climb up &amp; Peeing with a view</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fc024mIj0Q01lJGm6FOLBg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dh9-KgNrCtqUsG-PrcxxcA.jpeg" /><figcaption>Us &amp; Me improvising a hat</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPFCu5UwlleVExZzzEWWQA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WIfXLY45LnkIfRZ3zpjK_w.jpeg" /><figcaption>The views from Rifugio Lagazuoi</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2Set63s_TzjCyBtjWfawg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZoWsEtxISs9s0Rn7La2J7Q.jpeg" /><figcaption>Path 441 after the cable car &amp; Us in Rifugio Lagazuoi</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_kI-Le4HBn5bF5XaneMK4w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMP2HrENLckTgUMpoEuphQ.jpeg" /><figcaption>More peeing with a view &amp; More climbing</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1xAI5c8uwxs_qXLHx4LY4g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNoc8KAHN3vfG59LhWH6rw.jpeg" /><figcaption>The beautiful Lake Lago di Lemedes</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LrfadP5vHhmvaRKK86pT0w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqiJyW4Reff10Lv8uqO-xA.jpeg" /><figcaption>Coffee after swimming &amp; Water Filtering</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65hKhwosDDWOw0YfZHZyjw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fBFbOKEBp_ebjLvVQqdiyA.jpeg" /><figcaption>More climbing &amp; The view from our tent</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pL_s054oRuCEOAa1nQdqfA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAyWSRpQOjtSC1hFrHhkVA.jpeg" /><figcaption>Me &amp; The beautiful Location of our tent</figcaption></figure><h3>Day 5 — 2 kilometers before Rifugio Averau until Selva di Cadore</h3><ul><li><em>Distance: 12 kilometers.</em></li><li><em>Elevation gain: </em>164<em> meters.</em></li><li><em>Elevation loss: </em>1068<em> meters.</em></li><li><em>Path numbers: 441, 452, 436, 462.</em></li></ul><p>We woke up at 5 and we saw the sunrise at 5:30. It was amazing, the sun slowly rose from behind the misty foggy mountains, should have started our morning like this every morning. We made some black coffee and breakfast while being mesmerized by the view, appreciating the crazy nature God created, and enjoying the moment. We gathered our stuff and continued climbing on path number 441 to Rifugio Averau. Steep uphill again but it was still chilly outside so it was a nice climb. We arrived at Rifugio Averau at 8:30, we ordered coffee and a second breakfast (it’s our last day so why not spoil ourselves). The rifugio was on the mountain pass and a beautiful view of the whole valley opened up upon us, we were in clouds high. From there we walked down path number 452 until Passo Giau. Another steep downhill which this time was not well maintained, in a rainy muddy day you must be super slow and careful and I would even suggest taking a different path around. From Passo Giau we continued on path 436 until we arrived at the crossings with path number 462, here officially we diverged from Alta Via 1 in order to get to our destination. We walked down the valley on path 463 until we almost reached down, the path connected to the road that leads to the small town of Selva di Cadore and we hitchhiked from there (took 20 minutes until someone stopped).</p><p>We arrived at Selva di Cadore had our lunch there and took a bus to Belluno where we stayed the night in a cheap B&amp;B. The next day we took buses the whole day all the way back to the hotel in Dobbiaco where we parked our car and continued traveling around with the car for a few more days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*REPkvnccuSz-EMPap7CEIQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cyMerQ6bpCLUh7Jja35A0A.jpeg" /><figcaption>Coffee, breakfast, and enjoying the sunrise</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCDs1oWOMVjK3qAIFX2Ezw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*68Sl4vxqeAU-4yYy_JCb-Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*12-J9kov2lslXLWCApv4Ng.jpeg" /><figcaption>Starting to climb up</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R1NiTogYFxIhprVrZOAHrA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TNyVb4n7W70cxyAhiGqvhw.jpeg" /><figcaption>Almost at the rifugio</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PoGeHgM7sdyda-t_pCcqVw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HrbxDY-j0R0n844T4yOL9w.jpeg" /><figcaption>Happy/Sad it is over &amp; Beauty in a beauty</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-b30Xq2mfJWIbnq66pTrJA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ot8zYd1Mv_kRLlS2PATWYg.jpeg" /><figcaption>A second breakfast at Rifugio Averau &amp; The view from there</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M90FZ_1ThJPQlSm47G21RA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5qhpyh_KoxEHaK_faw0UJA.jpeg" /><figcaption>The end of the downhill to Passo Giau &amp; Officially diverging from Alta Via 1 down the valley</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ms-yCHWRbX2Dc7WNCjJwsQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iC4LIJCVOyQVmP6SG7Rd_g.jpeg" /><figcaption>Going down to Selva di Cadore &amp; On the bus on the way to Belluno</figcaption></figure><h3>Conclusion</h3><p>Alta Via 1 is a fantastic trek, the pictures we took couldn’t even describe the real views we saw with our eyes that never ceased to amaze and surprise us every new day. The trek itself is not easy and the level actually surprised me ( I thought it would be way easier), if you planning this as your first trek I would suggest booking the huts and getting in shape beforehand. I you are experienced do it with a tent, it&#39;s a whole different experience and you can be flexible. Me and Tintti did 2 treks this summer, Karhunkierros in Lapland, Finland, and this one. Those were her first 2 treks, but by what I feel those won’t be the lasts one, we will start a tradition. When you think of it, it all comes down to this — there is nothing better than disconnecting from everything for a few days and just hiking and enjoying the crazy nature God created for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eq7l6HeCza1nVunMTWoD_w.jpeg" /><figcaption>A picture we took while traveling with the car, looks like a postcard in my eyes. The Dolomites, Italy</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d39752aa940" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Karhunkierros — Bears Trail 82 km]]></title>
            <link>https://medium.com/@ruinadd/karhunkierros-bears-trail-82-km-d003eb62f4d?source=rss-de83f353c49b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d003eb62f4d</guid>
            <category><![CDATA[trekking]]></category>
            <category><![CDATA[camping]]></category>
            <category><![CDATA[lapland]]></category>
            <category><![CDATA[hiking]]></category>
            <category><![CDATA[karhunkierros]]></category>
            <dc:creator><![CDATA[Dean Ruina]]></dc:creator>
            <pubDate>Wed, 21 Jun 2023 20:48:56 GMT</pubDate>
            <atom:updated>2023-06-21T20:59:33.013Z</atom:updated>
            <content:encoded><![CDATA[<h3>Karhunkierros — Bears Trail 82 km</h3><h4>Karhunkierros is the most popular hiking trek in Finland. It’s located in Lapland, north of Finland. The trek is beginner-friendly, that’s why we chose it, I’m more experienced, but it was Tintti’s first trek. We hiked it in June 2023, here is our story.</h4><h3><strong><em>background</em></strong></h3><p>Karhunkierros in Lapland, Finland starts in Hautajärvi and ends in Ruka. The length is 82 kilometers from beginning to end and most of it goes through Oulanka National Park. The views change between swamps, different types of forests, mountains, rivers, and bridges. You’re surrounded by beautiful nature the whole walk and you can encounter reindeer, mooses, and all kinds of Nordic forest animals, one animal you won’t encounter as opposed to the name of the trek is bears. The Bears Trail is named after the history of the place. Back in the day, you couldn’t walk in that area without seeing a bear, now the chances are near zero.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1SzfB25KRqf8lSc3lQmmbw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A12wtrY9GkBWwLkivEts9Q.jpeg" /><figcaption>The official sign of the trek and us waiting for the taxi</figcaption></figure><h3>arrival</h3><p>In order to get to the trek you need to, first of all, take a flight to Helsinki (the capital of Finland), and from there you can either take a connection to Kuusamo or you can get there by train and a bus. During the summer there is a shuttle leaving from Kuusamo’s airport going through the city that takes you all the way to Hautajärvi where the trek starts. Click for the <a href="https://www.ruka.fi/en/travelling-to-kuusamo/getting-around/buses">Bus schedule</a>.</p><p>We decided to arrive there by car. We drove to Ruka and spent a night in an Airbnb. We also booked a night in a hotel for when we finish the trek. Ruka is a ski resort in the winter and a city full of attractions and hiking opportunities in the summer. I recommend spending some days there after the trek there is a lot you can do.</p><p>The next morning we parked the car in the hotel’s parking and took a taxi to the beginning of the trek, the ride there takes around 30 minutes and it cost us 95€.<strong> </strong>Someone in the trek told us she hitchhiked but by knowing the Finnish folk you would have to be really patient with that method. The bus from Ruka to the beginning of the trek started its operation only a week after we did the trek so we had to take a cab.</p><h3>Weather (The Sun Doesn’t Set)</h3><p>The recommended season of the trek is from June until mid-October. June, September &amp; October might be really rainy and cold but we were blessed with great weather, it was hot during the day and chilly at night (perfect for a tent &amp; sleeping bag). July and August are more stable but it might still rain (Scandic weather) so I would recommend bringing a raincoat and a rain cover for the bag.</p><p>What is amazing about this trek is that during the summer the sun doesn’t set at all, and you have twilight lighting during the whole night, that&#39;s why you don’t have pressure walking because you can walk as late as you want. When I did this trek the first time 4 years ago I started my first day at 5 PM and finished it at 2 AM. It’s an amazing experience, no need for a flashlight at all. If you are sensitive to light do bring a sleeping mask.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*ciUEmV9gD2DxfGIXDpOjnA.jpeg" /><figcaption>My tent 4 years ago at 2 AM before going to sleep</figcaption></figure><h3>Accommodations &amp; maps</h3><p>You have two options for accommodations, one is using a tent and sleeping wherever you want during the trek (that’s what we did, more flexibility with distance and pace, privacy, and mainly less snoring noises of other travelers) or if you don’t care of snoring noises there are 10 wooden huts that are “first come, first served”. Each hut has a chemical bathroom, a bonfire spot with an unlimited supply of chopped wood (there is an axe so you can chop yourself more) and one of the huts even has a sauna. There are many rest spots as well during the trek where you can cook on a bonfire and have chopped wood ready for you. click for the <a href="https://www.nationalparks.fi/karhunkierros/services">hut list</a>.</p><p>In this trek, you definitely don’t need a map. Every few meters you have a yellow marking on the trees which tells you you’re on the right path and every kilometer you pass you have a sign telling you how many kilometers you’ve passed and how many are still left to go. You can not get lost, best beginner-friendly trek I’ve seen so far. I added a GPX map and the official trek map in the end of this post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*naU1wpZh4gTf5nkNXu56lg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2sQs50z9q3d4uRfDdxkJQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*mQjY3yu-8VT7RNSFw08FXA.jpeg" /><figcaption>The yellow marking and the huts from outside and inside</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*bqqnN7Vueb-sXb8f0C9r7A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Or1m8bYFIQX4YZbnOYRmFg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*aJbn8TkJPDfR7lLtDepR5g.jpeg" /><figcaption>The signs show you how many kilometers you’ve walked and how many are still left</figcaption></figure><h3>water</h3><p>Most of the route goes next to Oulanka River so there is no shortage of water. When I did this trek 4 years ago I just filled the water straight from the river, the water had a bit of off taste but it was all good and drinkable. Obviously, you can boil the water if you&#39;re worried but that’s a longer task. This time we had our Sawyer Mini Filter with us. I recommend this mini water filter to any hiker, it’s so small and easy to carry and by using it you can filter any water and drink them, even swamp water. The water tasted great and it saved us a lot of headaches and planning of refills. It really upgrades your overall experience. I’m attaching a video that explains it to whomever is interested.</p><p><a href="https://www.youtube.com/watch?v=2YaUTyekj1w">https://www.youtube.com/watch?v=2YaUTyekj1w</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*M_P0D9kWwYrTEcO3tiOyMg.jpeg" /><figcaption>Sawyer Mini Water Filter</figcaption></figure><h3>Day 1 — Hautajärvi until 14 kilometer</h3><p>The cab dropped us off in Hautajärvi where the trek begins. We started walking around 1 PM. The first kilometers are really subtle and easy to walk, the views change from forest to swamps (you walk on wooden planks through them, it’s super cool) to open fields. The weather was perfect, a sunny day with some clouds. After 6.5 kilometers we stopped for lunch in Perttumakoski, the spot had a place to make a bonfire, chopped wood, an axe, and even a cooking pot. We cooked rice with Makkara (Finnish sausages) and Pesto on our gas canister. A few kilometers afterward there is this huge beautiful rock in the middle of the river called Rupakivi, a great spot for coffee. We continued walking until we found a nice spot to open our tent, in the middle of the forest with a beautiful view over the river. We cooked dinner and went to sleep. Because Tintti was sick for a long time before we started this trek we decided we take it easy, with no stress of distance and pace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qAjRko1c2ppIJs9TIzxDuw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ptIqnI0NMQ0Rsdk5XEO3PA.jpeg" /><figcaption>The beginning of the Karhunkierros</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFNQGN6fwz0FP3HV2GD7jw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nlFsc_tFXRA57yrOo_R6zw.jpeg" /><figcaption>After finishing the 1st kilometer, 81 more to go, and some swamps</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*-pKlXAcemd0ZeAzMoZRhwA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pNnXuPSqiA1zLeeIfMoQzQ.jpeg" /><figcaption>our lunch break at Perttumakoski</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UCnflD-d6rX7NO3DZeCUfg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Az-CdkPswhLGJOJVtErghg.jpeg" /><figcaption>More swamps and Rupakivi</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OeppYlX96uUCU_Ei5choug.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rM2cGTCMedr5geUbp0FylA.jpeg" /><figcaption>Before going to sleep and one of the bridges we crossed during the day</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*89zPy47AtK_4tiaK-vfhAQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O-_qlPJZlJhKt17Ym9Wliw.jpeg" /><figcaption>Filtering water &amp; goofing around</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GbhevjU9u8J8zbfmNr6Xpw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-1eoA_xgcW4YHhroJ_nAg.jpeg" /><figcaption>A random car wreck and beauty of swamps</figcaption></figure><h3>Day 2 — kilometer 14 until kilometer 29</h3><p>We woke up quite late around 9 AM, again we had no rush. The weather was great, 22 degrees Celsius. We packed all of our stuff and walked 2 kilometers until we stopped next to a beautiful lake and made our breakfast there with some black Turkish coffee. We filtered water again and continued around 9 kilometers walk until we stopped for lunch. During our walk, we passed by two sleeping huts, Puikkokampä and Savilampi, we crossed a lot of bridges and walked through beautiful forests. We stopped for lunch at Runsulampi. It was right next to the river so we swam as well, The water was cold and refreshing. We continued another 5 kilometers walk until we arrived at Oulunka Camping Ground. That is the only area in the trek where you cannot just open a tent wherever and have to pay if you want to. Before we continued finding our sleeping spot we stopped at their kiosk and bought us ice cream which we ate right away and some cold beer and chips to eat with dinner. The kiosk is open until 21 daily. From there we continued another 2 kilometers until we left the camping ground and found ourselves a really sweet spot, a grassy ground next to the river. We cooked dinner, went for another swim, drank some cold beer, and went to sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tdR3HCwBSb1Qv3FGxfJtgQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40hBGEvIYK2AKjtGbvKKeA.jpeg" /><figcaption>Waking up in the morning with beautiful views</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kprr45Wx1xfYEDa4YzPK8g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2m1xegJ4a2eiATpcAshatg.jpeg" /><figcaption>Beautiful lake for breakfast &amp; Tintti filtering more water</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jafyo7FxEcsQfbNZw0srqQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_q3anXpARcZ9uvzBTSW1g.jpeg" /><figcaption>More bridges and forest</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oF__rP_3C9qtbErv1UFPBA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VG7P7X2B4tuacbWouPK69w.jpeg" /><figcaption>Moose poop &amp; Us</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SCfS8g40iBCwLkkUA0N7uw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3jyvc8pM8ANtJWaJthS7HA.jpeg" /><figcaption>Trek views</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yli6lcCNWOtZPGXck_YTiw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*a2hBKVD27DwJrOTu1fwlHQ.jpeg" /><figcaption>Leaving Oulanka Camping Ground &amp; Beautiful Finnish Nature</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TW6l189BXkuYH3lk6VEfkQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*akOuiXQtbAFdWOgAJ6anOg.jpeg" /><figcaption>Beer with dinner &amp; Going to sleep</figcaption></figure><h3>Day 3 — kilometer 29 until kilometer 45</h3><p>We woke up at 8 AM and folded our stuff. The weather was on our side again, 21 degrees Celcius, sunny. We continued and arrived at Oulanka Visitor’s Center, We found out there is a nice small cafe that opens at 10 and decided to wait and have breakfast there. We had some coffee, sandwiches, and delicious korvapuusti (Finnish pastry), they also have a great lunch from 11–15, daily, as we’ve seen on the menu. We filled our water bottles there and continued walking for around 9 kilometers until we stopped for lunch. The views of this day are spectacular, you’re walking next to a cliff where the river is bending underneath it. One spot even reminded us of “Horseshoe Bend” (judge for yourselves), at one point you’re back in the forest and on this day we saw a squirrel, plenty of different types of birds, and multiple reindeer. We ate lunch and rested for a while. We continued walking another 8 kilometers through forests, more swamps, bridges, and some open fields, that was the prettiest day in my opinion. We arrived at Jussinkämpa hut and found a beautiful private spot a few hundred meters ahead. We set up our tent right next to a crystal-clear water lake, cooked dinner, went for a swim (a short one because the water was freezing), and went to sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*afSmLvUBebboBFyAuMeTgg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qpm7FOuBpX10D2yModE4rg.jpeg" /><figcaption>Oulanka “Horseshoe Bend” (looks like it doesn’t?) &amp; Beautiful Tintti with the view</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LuzZ6Abe_uecvstDd0pUfg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J6hIlReh-b50Vw21dh4ciw.jpeg" /><figcaption>36 kilometers done, 46 to go &amp; Beautiful Tintti again</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*OX4RthlOjj-oMrCxTqvSmA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ClVJyVPUOLNrWgNzmeQvsw.jpeg" /><figcaption>More forest pictures &amp; Resting after lunch</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhA3ihkDBQ5A4Q8GbQUE3g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MVTNhytrkhHUzV0F0rKfw.jpeg" /><figcaption>Half done, half to go! &amp; Beautiful crystal-clear water lake</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sftYucsSmuqDr0PP6_YsBA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j0DJFikcWmrd64KVtg_FsA.jpeg" /><figcaption>Strong water rapids &amp; Us</figcaption></figure><h3>Day 4 – kilometer 45 until kilometer 60</h3><p>We woke up at 7 AM, packed our stuff, had some breakfast, and started walking. We started in the forest again, crossed some swamps and after some kilometers we started walking right on the edge of the river which was beautiful, surrounded by small mountains. We crossed some beautiful bridges with strong currents running underneath. Around the 55 kilometers Karhunkierros (bears trail) is merging together with Pieni Karhunkierros (small bears trail), it’s a small day hike length of 12 kilometers usually done by families and kids and that’s why those combined kilometers are packed with more hikers. During our trek so far we only encountered a few fellow travelers but once we got to the merge we saw a lot of people all walking comfortably while we have our weight on us. It didn’t bother us though. We had lunch and then continued to the 60th kilometer. This was the prettiest day in Tintti’s opinion. There was one of the exit options from the trail. Before we started the trek we decided we won’t do all of it because we were both sick before it, and had a wedding to attend 2 days after (Tintti had a long coughing virus and was on antibiotics for a sinus infection, she surprised me with her capabilities but more on that later). We exited in Juuma and called the same taxi to take us back to Ruka where the trek ends. The last day we missed will be my own experience from 4 years ago when I did this trek solo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HTp_In9NTyls4jDSvcK2mA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSshWmsUzz8DHL_y9Zi8qQ.jpeg" /><figcaption>Lunch break &amp; One of the most beautiful bridges of the trek</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFDEtqmHooSP89G8v_TuAA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKBVqdZHVMWLlknF5UyqMA.jpeg" /><figcaption>Me posing</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j0GS1SPJX3aBJQE39SHC8Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2CvZokkFK-B4a4JbI7XOA.jpeg" /><figcaption>Tintti posing &amp; The beautiful couple again</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZeB7Z3zamaHzcRZKymcqXg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTbEkZw1DLswLP5VL9YhYA.jpeg" /><figcaption>Me 4 years ago &amp; Tintti now in June</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y5mHtBvIF3kZrSCCY5ZqRw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1i0kVNxDXTitNDOPLa5KHg.jpeg" /><figcaption>Swamps &amp; Rivers</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQIMF0-NtVm9W3n-3j_7PA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jF5lGjoQlS3Asv06AW2kqA.jpeg" /><figcaption>The walk next to the river and some open fields</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-fCMfwGm9WZiZclU3wGrYg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unvDyZ4fJ6m9CPhHMp850w.jpeg" /><figcaption>Waiting for the taxi, exhausted and satisfied &amp; Beautiful Finnish forest</figcaption></figure><h3>day 5 — kilometer 60 until kilometer 82</h3><p>This part of the story is what I experienced 4 years ago when I did this part of the trek. I did the whole trek back then in 3 days so this was my last day. The night before I camped next to Silastupa hut. I woke up early because it was the last day and because this is the hardest day of the trek because you gotta climb all the way up to Ruka Ski Resort where the trek ends. Until now the walk was subtle, flat with a bit of uphill and downhill. Most of the day is climbing up and down smaller mountains before reaching the final and tallest one which is basically Ruka. Climbing to Ruka wasn’t that hard compared to other mountains I climbed before but it’s a bit exhausting to finish such a subtle calm trek like that. The views from up there were worth it all though, you can see all of the valleys beneath and kilometers of Finnish Laplandic forest. It was beautiful. You finish the trek at the entrance of Ruka. We checked in to the hotel, went to take a sauna like proper Finnish, and slept comfortably after a few nights in a tent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*apGg-lkWeDFfuq2i6TaU1g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fvN4DzXZ5pUZgEyQwDhsqQ.jpeg" /><figcaption>View from one of the mountains &amp; foresty uphill</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dOk_efegX41socVSdh5fDA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7nIljbrpl2kC5MmjHjQpqA.jpeg" /><figcaption>Beautiful view of Lapland from the mountains</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_flpBpjrBF9mkmPPgai1lg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkXo4QCKFvuxBT2SZRUY_Q.jpeg" /><figcaption>Our breakfast in Scandic Hotel the day after &amp; Some more forest of the last day</figcaption></figure><h3>conclusion</h3><p>It’s a perfect hiking trek for beginners, there is no way to get lost. The route itself is very subtle, and flat, and has unique nature views in it. The end of the trek is a bit tougher but there are a few exit points during the trek and you can exit if you want, just like we did. It was Tintti’s first trek carrying a heavy weight on her back. She carried 13 kilos and I was with 17. I was really impressed and proud of her. No complaints and had a big energetic smile on her face. I think we found a new hobby we’re going to do way more often. Next month we’re going to do Alta Via 1 in The Dolomites of North Italy so this was a great preparation for that one. And yes, we will post a story on that one as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSshWmsUzz8DHL_y9Zi8qQ.jpeg" /><figcaption>My favorite picture of the trek</figcaption></figure><h3>GPX map &amp; official map</h3><ul><li><a href="https://julkaisut.metsa.fi/assets/pdf/lp/Esitteet/oulankafineng.pdf">Karhunkierros official map pdf</a></li><li><a href="https://www.alltrails.com/explore/trail/finland/lapland/karhunkierros?mobileMap=false&amp;ref=sidebar-static-map">GPX map from AllTrails</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d003eb62f4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>