<?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: KP</title>
    <description>The latest articles on DEV Community by KP (@kp).</description>
    <link>https://dev.to/kp</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%2F182103%2Fab07e598-7b3e-4537-b749-d6423b9030e8.jpeg</url>
      <title>DEV Community: KP</title>
      <link>https://dev.to/kp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kp"/>
    <language>en</language>
    <item>
      <title>How to point cname to nginx server that uses reverse-proxy?</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Tue, 07 Jul 2020 20:52:09 +0000</pubDate>
      <link>https://dev.to/kp/how-to-point-cname-to-nginx-server-that-uses-reverse-proxy-i68</link>
      <guid>https://dev.to/kp/how-to-point-cname-to-nginx-server-that-uses-reverse-proxy-i68</guid>
      <description>&lt;p&gt;I've got a server using wildcard subdomains. I'm using nuxtjs, nginx that runs on a reverse proxy on port 3000. Every user should be able to create a subdomain on the site, for example &lt;code&gt;subdomain.learnbot.tk&lt;/code&gt; this will then point to &lt;code&gt;learnbot.tk/school/{subdomain-name}&lt;/code&gt;. Every user should be able to create a cname that points to their own &lt;code&gt;subdomain.learnbot.tk&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But when I create a CNAME record with host as &lt;code&gt;@&lt;/code&gt; and target as &lt;code&gt;subdomain.learnbot.tk&lt;/code&gt; using domain name &lt;code&gt;https://creatorbrandedsite.tk/&lt;/code&gt; it returns 404.&lt;/p&gt;

&lt;p&gt;Here's my conf file for wildcard subdomains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            server {
            listen 80;

            server_name *.learnbot.tk;
            return 301 https://$server_name$request_uri;
        }

        server {
            listen 443 ssl http2 default_server;
            listen [::]:443 ssl http2 default_server;
            #include snippets/ssl-example.com.conf;
            #include snippets/ssl-params.conf;

            ssl_certificate /etc/letsencrypt/live/learnbot.tk/fullchain.pem; # managed by Certbot
            ssl_certificate_key /etc/letsencrypt/live/learnbot.tk/privkey.pem; # managed by Certbot
            include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
            ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

            root /home/subdomain/learnbot.tk/public/current;
            index index.php index.html index.htm index.nginx-debian.html;

            server_name *.learnbot.tk;

            location / {
                proxy_pass http://localhost:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
            }

            location /blog {
                try_files $uri $uri/ /index.php$is_args$args;
            }

            # For Lets Encrypt certbot
            location ~ /.well-known {
                allow all;
            }

            location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            }

            location ~ /\.ht {
                deny all;
            }

            location /favicon.ico { alias /var/www/html/example/favicon.ico; }
            location = /favicon.ico { log_not_found off; access_log off; }
            location = /robots.txt { log_not_found off; access_log off; allow all; }
    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;nuxtjs conf file for main domain&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        server {
        index index.html;
        server_name learnbot.tk www.learnbot.tk;

        location / {
            # WARNING: https in proxy_pass does NOT WORK!! I spent half a day debugging this.
            #proxy_pass https://localhost:4001;
            proxy_pass http://localhost:3000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }


        error_page 404 /custom_404.html;
        location = /custom_404.html {
            root /etc/nginx/sites-available/custom_nginx_error_pages;
            internal;
        }

        listen [::]:443 ssl http2; # managed by Certbot, modified by Kunal to add http2
        listen 443 ssl http2; # managed by Certbot, modified by Kunal to add http2

        #Install SSL certificates and configure https:// on a per-domain-basis by running:
        #sudo certbot --nginx
        #(when prompted, be sure to select the option to set up redirects from http to https and effectively "disable" http)
        ssl_certificate /etc/letsencrypt/live/learnbot.tk/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/learnbot.tk/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    }

    server {
        server_name learnbot.tk;
        if ($host = learnbot.tk) {
            return 301 https://$host$request_uri;
        } # managed by Certbot

        listen 80;
        listen [::]:80;
        return 404; # managed by Certbot
    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Creating a feature tour like that of hey.com</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Mon, 29 Jun 2020 18:16:13 +0000</pubDate>
      <link>https://dev.to/kp/creating-a-feature-tour-like-that-of-hey-com-ce7</link>
      <guid>https://dev.to/kp/creating-a-feature-tour-like-that-of-hey-com-ce7</guid>
      <description>&lt;p&gt;I'm trying to recreate a simple version of the Hey.com feature tour using Nuxt.js (or Vue.js), as you can see &lt;a href="https://hey.com/features"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'm sure there are examples (perhaps even repos) of this out there in either nuxt.js or vue. If you have a tip on how to do this, please leave a comment below!&lt;/p&gt;

</description>
      <category>nuxt</category>
      <category>help</category>
    </item>
    <item>
      <title>Comparing Services for Cheap Cloud Hosting and Storage (Cloud / AWS / S3 / Amazon Cloudfront / ... ???)</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Sat, 09 Nov 2019 22:54:03 +0000</pubDate>
      <link>https://dev.to/kp/comparing-services-for-cheap-cloud-hosting-and-storage-cloud-aws-s3-amazon-cloudfront-3i1g</link>
      <guid>https://dev.to/kp/comparing-services-for-cheap-cloud-hosting-and-storage-cloud-aws-s3-amazon-cloudfront-3i1g</guid>
      <description>&lt;p&gt;Hi Dev.to! 👋👋👋 &lt;/p&gt;

&lt;p&gt;Some questions for all you performance aficionados and AWS / Cloud experts out there.&lt;/p&gt;

&lt;p&gt;I'm looking for a cheap (as close to free as possible) service for:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Hosting AND serving images. These images will be used on a website, in emails, etc. I want to plan for:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;100GB of added storage / month&lt;/li&gt;
&lt;li&gt;100M image views (GET requests) / month&lt;/li&gt;
&lt;li&gt;100K new image uploads (PUT / POST requests) / month&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. CDN / Edge caching - so as to serve requests as fast as possible. Here I am looking to reduce response times and website load times that end-users will experience.
&lt;/h4&gt;

&lt;p&gt;AWS both has an amazing suite of products and at the same time is very difficult to get started with.&lt;a href="https://aws.amazon.com/s3/pricing/"&gt;AWS S3's pricing model&lt;/a&gt; is confusing. I did also play a bit with their &lt;a href="https://calculator.s3.amazonaws.com/index.html"&gt;calculator&lt;/a&gt;, but it's hard to say if I'm entering the numbers in correctly. &lt;/p&gt;




&lt;p&gt;Q1: In the AWS ecosystem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For S3: What is "Storage pricing" vs "Request Pricing"? &lt;/li&gt;
&lt;li&gt;What is S3 Select and how is it different from S3?&lt;/li&gt;
&lt;li&gt;What is S3 Intelligent-Tiering?&lt;/li&gt;
&lt;li&gt;What is S3 Glacier?&lt;/li&gt;
&lt;li&gt;And what about Amazon CloudFront?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Q2: Is AWS the best (and cheapest) available option? What about services like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloudflare&lt;/li&gt;
&lt;li&gt;Cloudinary&lt;/li&gt;
&lt;li&gt;Photon by Jetpack etc?&lt;/li&gt;
&lt;li&gt;Versus using my Linode server itself for hosting and serving images?&lt;/li&gt;
&lt;li&gt;versus the 1000+ other options out there?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thoughts on what service I should be using? Looking for advice from folks that are knowledgeable on the matter. 🙏🙏🙏&lt;/p&gt;

</description>
      <category>explainlikeimfive</category>
      <category>help</category>
      <category>aws</category>
    </item>
    <item>
      <title>How it feels to be a Programmer</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Thu, 24 Oct 2019 00:12:45 +0000</pubDate>
      <link>https://dev.to/kp/how-it-feels-to-be-a-programmer-48jg</link>
      <guid>https://dev.to/kp/how-it-feels-to-be-a-programmer-48jg</guid>
      <description>&lt;p&gt;Found this video on Twitter and I had to share it with the rest of you :)&lt;/p&gt;

&lt;p&gt;You'll have to click to watch the video.&lt;/p&gt;

&lt;p&gt;This is relatable on so many levels. I definitely feel like this most days....anyone else?!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://video.twimg.com/ext_tw_video/1185344653035479040/pu/vid/640x360/uAYeyU2SpiF11nCP.mp4?tag=10" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F30g8kkump3tvntmlx0bi.png" alt="Watch the video"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>funny</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Some awesome beginner-friendly projects for #HacktoberFest</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Fri, 04 Oct 2019 19:30:40 +0000</pubDate>
      <link>https://dev.to/kp/some-awesome-beginner-friendly-projects-for-hacktoberfest-395k</link>
      <guid>https://dev.to/kp/some-awesome-beginner-friendly-projects-for-hacktoberfest-395k</guid>
      <description>&lt;p&gt;Recently came across this awesome repository, and in the spirit of #hacktoberfest, I thought I'd share this with the rest of the DEV community. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/MunGell/awesome-for-beginners"&gt;https://github.com/MunGell/awesome-for-beginners&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As an aside, it would be awesome if we could include &lt;a href="https://github.com/thepracticaldev/dev.to"&gt;dev.to&lt;/a&gt; on this list.&lt;/p&gt;

&lt;p&gt;Happy hacking!&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Designing an API to mash up public and private data</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Fri, 27 Sep 2019 21:19:36 +0000</pubDate>
      <link>https://dev.to/kp/designing-an-api-to-mash-up-public-and-private-data-1p6g</link>
      <guid>https://dev.to/kp/designing-an-api-to-mash-up-public-and-private-data-1p6g</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/58141399/designing-an-api-to-mash-up-public-and-private-data" rel="noopener noreferrer"&gt;
               Designing an API to mash up public and private data
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Sep 27 '19&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 0&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/58141399/designing-an-api-to-mash-up-public-and-private-data" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I have a Laravel application with logged-in users, posts, comments and likes (reactions).&lt;/p&gt;
&lt;p&gt;I am designing an API to return all the data for a post (similar to &lt;a href="https://dev.to/emmawedekind/101-tips-for-being-a-great-programmer-human-36nl" rel="nofollow noreferrer"&gt;this page here&lt;/a&gt; ). As you can see, the currently logged-in user can like / react to the main post, or any…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/58141399/designing-an-api-to-mash-up-public-and-private-data" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>help</category>
      <category>design</category>
    </item>
    <item>
      <title>How to generate random IDs that are not individually unique, but unique across 2 fields (columns) in a MySQL database table?</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Wed, 25 Sep 2019 05:10:34 +0000</pubDate>
      <link>https://dev.to/kp/how-to-generate-random-ids-that-are-not-individually-unique-but-unique-across-2-fields-columns-in-a-mysql-database-table-2dbd</link>
      <guid>https://dev.to/kp/how-to-generate-random-ids-that-are-not-individually-unique-but-unique-across-2-fields-columns-in-a-mysql-database-table-2dbd</guid>
      <description>&lt;p&gt;There already are answered questions on how to generate unique, random alphanumeric strings in MySQL. That is not the question.&lt;/p&gt;

&lt;p&gt;I am trying to generate a 4 character, random alphanumeric string in MySQL such that the COMBINATION of that field and another are unique in MySQL. In other words, given an existing field in the table (userID), I need a 4 character, random alphanumeric string for another field in the same table (commentUID), such that the combined userID+commentUID is unique. Note that commentUID by itself is not necessarily unique - 2 or more users with different userIDs can have the SAME commentUID value.&lt;/p&gt;

&lt;p&gt;Background: I have a users table, and a comments table. I need a unique combination for: the user's username (or ID) and the Unique ID of the comment they leave, so that every comment in the system can be uniquely identified in the URL, while also keeping the comment UIDs (and therefore URLs) as short as possible.&lt;/p&gt;

&lt;p&gt;The unique ID for the comment should be 4 alphanumeric characters, because each user is not likely to leave more than 36^4 = 1.6M comments (36 denotes all possible values from a-z0-9, lowercase only). An example of this is actually dev.to. See &lt;a href="https://dev.to/mindplay/comment/dm5i"&gt;https://dev.to/mindplay/comment/dm5i&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How can I do this as a pure MySQL-only solution, such that the commentID is generated when a new record is inserted into the comments table? If you know how to do this, your thoughts are appreciated.&lt;/p&gt;

</description>
      <category>help</category>
      <category>mysql</category>
      <category>database</category>
      <category>sql</category>
    </item>
    <item>
      <title>Pointers to code for Social auth with Linkedin in Laravel</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Mon, 29 Jul 2019 20:54:53 +0000</pubDate>
      <link>https://dev.to/kp/pointers-to-code-for-social-auth-with-linkedin-in-laravel-4ad9</link>
      <guid>https://dev.to/kp/pointers-to-code-for-social-auth-with-linkedin-in-laravel-4ad9</guid>
      <description>&lt;p&gt;Hey Dev.to! 🚀🚀🚀&lt;/p&gt;

&lt;p&gt;I'm looking for some tips on how to get Social auth with Linkedin working in Laravel. Hope someone with experience with this can point me to a github repo that works, because every repo I've tried is broken in some way and my exploration has led nowhere :(&lt;/p&gt;

&lt;p&gt;I already know Laravel has a Socialite package for social auth: &lt;a href="https://laravel.com/docs/5.8/socialite"&gt;https://laravel.com/docs/5.8/socialite&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this exists:&lt;br&gt;
&lt;a href="https://socialiteproviders.netlify.com/providers/linked-in.html"&gt;https://socialiteproviders.netlify.com/providers/linked-in.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But I have a lot of things on my plate so auth is a huge pain in my rear and I don't want to spend days learning about access keys and oAuth. I'm looking for a simple end-to-end working example for Linkedin login in Laravel, just short of plugging in my Linkedin keys. &lt;/p&gt;

&lt;p&gt;Thank you for any tips 🙏🙏🙏&lt;/p&gt;

</description>
      <category>help</category>
      <category>laravel</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How to implement Auth using Laravel &amp; Nuxt.js (framework for Vue.js)</title>
      <dc:creator>KP</dc:creator>
      <pubDate>Fri, 19 Jul 2019 18:04:28 +0000</pubDate>
      <link>https://dev.to/kp/nuxt-js-framework-for-vue-js-gkg</link>
      <guid>https://dev.to/kp/nuxt-js-framework-for-vue-js-gkg</guid>
      <description>&lt;p&gt;I am trying to implement Authentication for a Nuxtjs + Laravel app. &lt;br&gt;
I would like my app to allow register + login with email and social (google, facebook, linkedin and twitter).&lt;/p&gt;

&lt;p&gt;What is the best way to approach this? Should the auth happen in the back-end (Laravel) via Nuxt making API calls to the back-end? Are there other approaches? Pros and cons? Pointers to github repos are appreciated! I love to copy-and-paste :D&lt;/p&gt;

&lt;p&gt;PS. Also I've heard about JWT but don't understand how it's any better than regular auth.&lt;/p&gt;

</description>
      <category>help</category>
      <category>vue</category>
      <category>nuxt</category>
    </item>
  </channel>
</rss>
