<?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 lev on Medium]]></title>
        <description><![CDATA[Stories by lev on Medium]]></description>
        <link>https://medium.com/@levsoroka?source=rss-2fbed45c3913------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WLip2bQOHK2OTB91lIGC9g.jpeg</url>
            <title>Stories by lev on Medium</title>
            <link>https://medium.com/@levsoroka?source=rss-2fbed45c3913------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:43:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@levsoroka/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[AWS Console is ReactJs]]></title>
            <link>https://medium.com/@levsoroka/aws-console-is-reactjs-97eaddfd8f54?source=rss-2fbed45c3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/97eaddfd8f54</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[lev]]></dc:creator>
            <pubDate>Thu, 29 Sep 2022 04:07:58 GMT</pubDate>
            <atom:updated>2022-09-29T04:10:01.451Z</atom:updated>
            <content:encoded><![CDATA[<p>I think that says a lot of how far ReactJS has come.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0OVrH6qbtooVBNxfRs9Wg.png" /></figure><p>Think about it!. AWS Console is complex to say the least. Shear amount of components, data points and DOM updates is mind blowing.</p><p>Kudos to AWS Front-End team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ANyNgw-S4NbLIZrhtT_pQ.png" /></figure><p>One thing that catches my interest is <a href="https://reactjs.org/docs/context.html">Context</a>. Seeing this utilized to pass objects (vs passing props over and over) only validates and shows how far ReactJS has come to improve upon such pain points. Or the fact that not just simple “To-do” like Apps are using ReactJS and hence pushing React to be better.</p><p>Let me know what you think in comments below.</p><p>Many may say AWS could not have picked Angular since that is maintained by competition (Google). That is fine, AWS could have picked VUE?</p><p>AWS may have written their own framework. But they did not do that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97eaddfd8f54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contact Form in NextJs via API Route]]></title>
            <link>https://medium.com/@levsoroka/contact-form-in-nextjs-via-api-route-3057ba510f33?source=rss-2fbed45c3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/3057ba510f33</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[lev]]></dc:creator>
            <pubDate>Sun, 23 Jan 2022 21:09:57 GMT</pubDate>
            <atom:updated>2022-01-23T21:09:57.393Z</atom:updated>
            <content:encoded><![CDATA[<p>NextJs is great for building static websites. It is simple and fast.</p><p>However, with API Routes you can do much more than just a static website. With API Routes, you can create API endpoints to retrieve or post data for the application or website that you are building.</p><p>In this example, I am going to show how to use API routes to do a simple contact form that is going to send out email via third party service. In other words once endpoint is hit it will send out a post to third party API to send an email. In this case I will use AWS Simple Email Service</p><p>As with any open form you don’t want any malicious request filling out the form so I have added <a href="https://medium.com/@levsoroka/google-recaptcha-v3-on-a-form-that-posts-to-nextjs-api-route-89b57f22be7">Google Recaptcha in this article</a></p><p>Here is basic email notification with <a href="https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/ses-examples-sending-email.html">AWS Simple Email Service via NodeJS</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c7b497deaa2d11d8eaf4e905623d145/href">https://medium.com/media/8c7b497deaa2d11d8eaf4e905623d145/href</a></iframe><p>I am going to wrap this inside of a promise so that if completed successfully I can send successful response back to the UI.</p><p>In order for above send email function to work you will need to assign appropriate access for it to work. There are multiple ways of doing this.</p><p>Easy way of doing this is to create a simple policy that you can attach to a programmatic user.</p><p>In AWS IAM create a policy that looks like this</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;VisualEditor0&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;ses:SendEmail&quot;,<br>                &quot;ses:SendRawEmail&quot;<br>            ],<br>            &quot;Resource&quot;: &quot;*&quot;<br>        }<br>    ]<br>}</pre><p>Second step is to create a user with a programmatic access and assign above policy to this user. Once user is created be sure to retrieve access key and secret key and store those values into environmental variable so that they are safe.</p><p>Now we have email promise triggered after successful reCaptcha validation</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f7beda93f1684ee139d619d09d9de9e/href">https://medium.com/media/9f7beda93f1684ee139d619d09d9de9e/href</a></iframe><p>And here is actual Front-end Form Component</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a22e49caef34d58669f0582f7a4e0b7/href">https://medium.com/media/7a22e49caef34d58669f0582f7a4e0b7/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3057ba510f33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google reCaptcha V3 on a form that posts to NextJs API Route.]]></title>
            <link>https://medium.com/@levsoroka/google-recaptcha-v3-on-a-form-that-posts-to-nextjs-api-route-89b57f22be7e?source=rss-2fbed45c3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/89b57f22be7e</guid>
            <category><![CDATA[forms]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[recaptcha]]></category>
            <dc:creator><![CDATA[lev]]></dc:creator>
            <pubDate>Sat, 22 Jan 2022 17:48:08 GMT</pubDate>
            <atom:updated>2022-01-22T17:48:08.102Z</atom:updated>
            <content:encoded><![CDATA[<h4>Here is simple implementation of a captcha on a form within NextJs App</h4><p><strong>Goal</strong> was to block any malicious traffic making request to NextJs API Route. Which in turn would perform some action such as send notification via email or similar.</p><p>First off you will need to sign up for Google Recaptcha and obtain site key and secret key <a href="https://www.google.com/recaptcha/admin/create">https://www.google.com/recaptcha/admin/create</a>. Make sure to select V3. Which is the newer reCaptcha option that does not require users to check off a box, but runs in the background and grades each request as malicious or valid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*M26WuQTLWsSqfJJ83pJYJw.png" /></figure><p>First here is one way to embed <a href="https://developers.google.com/recaptcha/docs/v3">Google reCaptcha V3</a> script on your NextJs app/single page site. Using <a href="https://nextjs.org/docs/basic-features/script">next/script component</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b0b1c699dfd65b514ddb0704b972166/href">https://medium.com/media/2b0b1c699dfd65b514ddb0704b972166/href</a></iframe><p>Don’t forget to replace <strong>reCAPTCHA_site_key</strong> with your own key</p><p>Now we can add google code to handle actual verification.</p><p>Lets fetch token from Google once form is submitted and if successful send that over to our <a href="https://nextjs.org/docs/api-routes/introduction">NextJs API Route</a> via Post for further processing.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d59cc98fc762fbf5c08ff3e6dae92a0c/href">https://medium.com/media/d59cc98fc762fbf5c08ff3e6dae92a0c/href</a></iframe><p>Above you will see new submit handler called <strong>handleSubmit()</strong> which includes <strong>grecaptcha.ready()</strong> which calls Google API with your site key to get temporary token. That token is later passed inside of a promise via fetch to your NextJs API Route, in this case we have <strong>/api/contactRoute</strong></p><p>Now here is a look at the actual API Route that listens for POST requests.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fa714cd95518e518bf220c6a3ed776a/href">https://medium.com/media/2fa714cd95518e518bf220c6a3ed776a/href</a></iframe><p>Above handler sends another request to Google that verifies token received initially with the secret key. In order for the handler to work properly please be sure to add secret key to your environment as a Variable. If you are hosting on <a href="https://vercel.com/docs/concepts/projects/environment-variables">Vercel</a>, that is super easy to do via admin UI. In the above example I have my env variable as process.env.<strong>GOOGLE_RECAPTCHA_KEY</strong></p><p>It is important to keep this key hidden from public. Hence we are using environment variable.</p><p>If response from google comes back as true that means request is valid and passed google bot vs human verification.</p><p>You can read more on the verification process here <a href="https://developers.google.com/recaptcha/docs/verify">https://developers.google.com/recaptcha/docs/verify</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89b57f22be7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Node.js via NVM inside of a Docker Container that is based on Amazon Linux 2 or others]]></title>
            <link>https://medium.com/@levsoroka/installing-node-js-via-nvm-inside-of-a-docker-container-that-is-based-on-amazon-linux-2-or-others-6e59c7dac5?source=rss-2fbed45c3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e59c7dac5</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[lev]]></dc:creator>
            <pubDate>Mon, 23 Aug 2021 03:42:02 GMT</pubDate>
            <atom:updated>2021-08-26T13:49:39.205Z</atom:updated>
            <content:encoded><![CDATA[<p>While it may be easy nowadays to install and run Node.js there are some caveats while attempting to install NVM inside of a Docker container that is not based Node image</p><p>For example here is how your Dockerfile could try to download and install Node.js via NVM. Note below will not install latest version of Node.js</p><pre>FROM amazonlinux:latest</pre><pre>RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash</pre><pre>RUN . ~/.nvm/nvm.sh &amp;&amp; nvm install node</pre><p>Above run commands are based on install instructions from NVM <a href="https://github.com/nvm-sh/nvm">https://github.com/nvm-sh/nvm</a>. Which wont work when you are building your docker container, because there is no active path being exported so that it can be used within the same session, in order to run <strong>nvm install node</strong>.</p><p>NMV package does complain like so when attempting to export path to the package:</p><pre>=&gt; Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.</pre><pre>=&gt; Create one of them and run this script again</pre><p><strong>However there is an easy fix to this, in Dockerfile you can create necessary profile so that it can be used by the nvm script to export the path</strong></p><pre>RUN touch ~/.bashrc &amp;&amp; chmod +x ~/.bashrc</pre><pre>RUN curl -o- <a href="https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh">https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh</a> | bash</pre><pre>RUN . ~/.nvm/nvm.sh &amp;&amp; source ~/.bashrc &amp;&amp; nvm install node</pre><p>First run instruction will create and open up .bashrc file for later use.</p><p>Last run instruction will pull in changes from .bashrc file and install latest Node.js</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e59c7dac5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IOs 14 Easter Egg Back Tap]]></title>
            <link>https://medium.com/@levsoroka/ios-14-easter-egg-back-tap-c768f607d40d?source=rss-2fbed45c3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/c768f607d40d</guid>
            <category><![CDATA[features]]></category>
            <category><![CDATA[ios-14]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[iphone]]></category>
            <dc:creator><![CDATA[lev]]></dc:creator>
            <pubDate>Sat, 14 Nov 2020 03:01:14 GMT</pubDate>
            <atom:updated>2020-11-14T03:01:40.921Z</atom:updated>
            <content:encoded><![CDATA[<h3>iOS 14 Easter Egg Back Tap</h3><p>Apple recently released a software update for iPhones along with the new iPhone 12 announcement, which included a hidden feature, that you may not be aware of.</p><p>If you go thru settings you will see this new item called Back Tap in Settings -&gt; Accessibility -&gt; Touch -&gt; Back tap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*wC-vPnGaDjkyRJiVpJ7rFw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*j-uJZCxOeUWyMix-C0uLCg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*TL2NE3-qt5g1atxYzr4aFg@2x.jpeg" /></figure><p>This particular setting allows you to perform and action on Double Tap and/or Triple Tap on the back of your phone.</p><p>Yes iPhone did not magically receive a new button on the back of the phone with IOs 14, but instead, it seems that sensors inside the phone can recognize tapping on the back of the phone.</p><p>While some of the options available out of the box are okay. For example, you can choose to mute, take a screenshot, lock screen, trigger Siri, and others, there is a way to do even <strong>more customization with Shortcuts App</strong>.</p><p><a href="https://apps.apple.com/us/app/shortcuts/id1462947752">‎Shortcuts</a></p><p>In Shortcuts App you can define new shortcuts and select those from the list inside of Double or Triple Back Tap Settings, once populated</p><p>In the Shortcuts app you have access to a world of possibilities really. You can trigger various actions in Apps, or execute a variety of functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*R_5G2SolmmGjUqUPa_9JNw@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*O-1rG46-cc2S6VEE0G6zpg@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*dZ6F0mRM4b9kYkvYvGLG_g@2x.jpeg" /></figure><p>Here are some quick suggestion of actions that you may like</p><p>By tapping you can</p><p>1. <strong>Toggle Flashlight</strong>. The first thing that comes to mind. Hence not the most useful.</p><p>2. <strong>Launch Specific App</strong>. Launch your favorite app with a double back tap.</p><p>3. <strong>Control Your Smart Home</strong>. This may be particularly useful action as you can quickly set a scene. For example before going to sleep you can double tap to turn off the lights.</p><p>4. <strong>Shazam</strong>. Most useful in my opinion. Since it allows you to open up shazam and start Shazaming a tune that is playing on TV for example without missing it while you search for the APP Icon.</p><p>Besides these 4 suggestions, there are tons of other options.</p><p><strong>Conclusion.</strong></p><p>While back tap is a nice future, I have used it for some time now and I have to say it is not always accurate in sensing taps. Especially when there is a case on it. But nonetheless cool.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c768f607d40d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting to EnterpriseVPN Gateway from Ubuntu 20.04]]></title>
            <link>https://medium.com/@levsoroka/connecting-to-enterprisevpn-gateway-from-ubuntu-20-04-d386c20bce87?source=rss-2fbed45c3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/d386c20bce87</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[anyconnect]]></category>
            <category><![CDATA[ubuntu-20-04]]></category>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[enterprise]]></category>
            <dc:creator><![CDATA[lev]]></dc:creator>
            <pubDate>Wed, 14 Oct 2020 05:26:26 GMT</pubDate>
            <atom:updated>2021-01-28T18:58:45.644Z</atom:updated>
            <content:encoded><![CDATA[<p>Installing the Cisco AnyConnect VPN Client on Ubuntu/Linux platform is painful. Especially if you need Multi-Factor Authentication.</p><p>So here is an alternative tool.</p><p><a href="http://www.infradead.org/openconnect/">OpenConnect</a> addresses some of the issues found in proprietary software. And it is easy to install since OpenConnect SSL VPN client is included with Ubuntu repositories by default.</p><pre>sudo apt-get update<br>sudo apt-get install openconnect</pre><p>Now we can connect via CLI</p><pre>sudo openconnect -u user vpn.example.com</pre><p>Make sure to replace user with your actual VPN username, and replace vpn.example.com with actual VPN gateway host</p><p>Upon entering you should be prompted for your Ubuntu user password. That is because of sudo, which is needed to make network changes</p><p>If POST connection is successful you will see Connected to HTTPS on vpn.example.com</p><p>At this point, you will be prompted for your <strong>VPN User Password</strong>.</p><p>And if Multi-Factor Authentication is enabled you will see a <strong>second Password prompt </strong>in which you can enter a code or phrase (to have a push to your authentication app).</p><p><strong>Now you are connected to the VPN. Which is good.</strong></p><p>However, if we are running Ubuntu Desktop we can take this a step further with a GUI interface. So that we don&#39;t need to hog a terminal window, or enter credentials every time.</p><pre>sudo apt-get install network-manager-openconnect-gnome</pre><p>Now we have a gnome interface to establish a VPN connection for us. In network settings, we will find a new option under Add VPN</p><figure><img alt="Openconnect VPN Client As New Option on Add VPN Screen" src="https://cdn-images-1.medium.com/max/1014/1*GZOgHTpGr7HKQjwMia2e0w.png" /><figcaption>Newly Added Option Multi-protocol VPN client (Openconnect)</figcaption></figure><p>Select the first option and add your VPN connection Name, fill out your gateway host and other configs as needed</p><figure><img alt="Openconnect VPN Client Identity Screen" src="https://cdn-images-1.medium.com/max/702/1*SER8pliVZHUb2l0L-XqgGg.png" /><figcaption>Openconnect Identity Settings</figcaption></figure><p>Hit add and now we are able to re-use this connection</p><figure><img alt="Ubuntu Menu Screen, VPN Connect" src="https://cdn-images-1.medium.com/max/406/1*6BWsSrhe0mlcLsTQxmbbuw.png" /><figcaption>Connect to VPN</figcaption></figure><p>Once you hit connect OpenConnect will establish a connection with the server and GNOME interface will store your credentials in <a href="https://help.gnome.org/users/seahorse/stable/">Passwords and Keys</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d386c20bce87" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>