<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: codegabru</title>
    <description>The latest articles on DEV Community by codegabru (@codegabru).</description>
    <link>https://dev.to/codegabru</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F220619%2Fd0a09f0e-cfd2-414b-bf5e-e13256c00403.png</url>
      <title>DEV Community: codegabru</title>
      <link>https://dev.to/codegabru</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codegabru"/>
    <language>en</language>
    <item>
      <title>Using Python 3 with Poetry</title>
      <dc:creator>codegabru</dc:creator>
      <pubDate>Sat, 02 May 2020 10:36:41 +0000</pubDate>
      <link>https://dev.to/codegabru/using-python-3-with-poetry-2kpp</link>
      <guid>https://dev.to/codegabru/using-python-3-with-poetry-2kpp</guid>
      <description>&lt;p&gt;This was originally posted on my &lt;a href="https://www.codegabru.com/using-python-3-with-poetry-ck9phmvuu02i4hjs1vz5vyg2a"&gt;Hashnode blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Install Poetry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The only problem is that for some reason Poetry doesn’t use Python version 3 by default for any project that you create using it and it doesn't run virtual environment shell using Python 3 even if the min required version of python is set to &lt;code&gt;3.x&lt;/code&gt; for the project.  See &lt;a href="https://github.com/python-poetry/poetry/issues/721"&gt;issue&lt;/a&gt; for more details.&lt;/p&gt;

&lt;p&gt;A quick, safe &lt;em&gt;and&lt;/em&gt; dirty (because you will have to do this every time you update Poetry version) way to fix this is given below.&lt;/p&gt;

&lt;p&gt;Open  &lt;code&gt;~/.poetry/bin/poetry&lt;/code&gt;  in editor of your choice. I’ll use nano :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano ~/.poetry/bin/poetry
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Top line of the file will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/env python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Update it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/env python3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now Poetry should work as expected i.e run virtual environment shell using Python 3 etc. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: I think this will probably break things when you set min required version of Python to &lt;code&gt;2.x&lt;/code&gt; for your project. I have not tested this for Python 2. Python 2 has been deprecated anyway. Let me know in the comments if there is a better way to do it. &lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>python</category>
      <category>poetry</category>
    </item>
    <item>
      <title>How do big companies effectively store and serve video (over a CDN) - I don't get the math</title>
      <dc:creator>codegabru</dc:creator>
      <pubDate>Tue, 28 Apr 2020 14:42:02 +0000</pubDate>
      <link>https://dev.to/codegabru/how-do-big-companies-effectively-store-and-serve-video-over-a-cdn-i-don-t-get-the-math-2moh</link>
      <guid>https://dev.to/codegabru/how-do-big-companies-effectively-store-and-serve-video-over-a-cdn-i-don-t-get-the-math-2moh</guid>
      <description>&lt;p&gt;I am building a course hosting website - I want my users to be able to upload videos which their students will stream. This is how I plan to do it but I don't get the math behind this. I'm surely missing something.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How do I store the video? - AFAIK rn I can use the cheapest object storage anything like S3, GCP etc. = &lt;strong&gt;$0.005/GB&lt;/strong&gt; being the cheapest option.&lt;/li&gt;
&lt;li&gt;How do I serve those videos? AFAIK rn I can use a CDN that will cache the videos on the edge and serve it to the students = ~ &lt;strong&gt;0.05/GB&lt;/strong&gt; being the cheapest option.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now let's suppose a teacher uploads a 30 min 1080p video that 10000 students will watch.&lt;/p&gt;

&lt;p&gt;Size of vid ~ 1.5GB &lt;br&gt;
Object storage cost = 0.0075&lt;/p&gt;

&lt;p&gt;As 10k students will watch it - then data that will go through the CDN = 15000GB&lt;/p&gt;

&lt;p&gt;At that 0.05/GB the CDN pricing will be - 15000GB x 0.05/GB = $750&lt;/p&gt;

&lt;p&gt;This is unaffordable, obviously, for anyone hosting and serving the video. &lt;/p&gt;

&lt;p&gt;There is definitely something that I'm missing here (almost ready to feel dumb after this is solved). Or is this how much it actually costs?&lt;/p&gt;

&lt;p&gt;UPDATE: &lt;a href="https://cloudflare.com/products/cloudflare-stream"&gt;Cloudflare Stream&lt;/a&gt; seems to cut the price to $350 for our case. Still pretty expensive. &lt;/p&gt;

</description>
      <category>help</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
