<?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 Syed Hassaan Ahmed on Medium]]></title>
        <description><![CDATA[Stories by Syed Hassaan Ahmed on Medium]]></description>
        <link>https://medium.com/@shassaan?source=rss-77e0c79bf559------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-xWFQBVRe_DGUhTuIfHyGw.jpeg</url>
            <title>Stories by Syed Hassaan Ahmed on Medium</title>
            <link>https://medium.com/@shassaan?source=rss-77e0c79bf559------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 20:56:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shassaan/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[Query CSVs in S3 Using Lambda, Glue Crawler & Redshift, No ETL Jobs Required]]></title>
            <link>https://shassaan.medium.com/query-csvs-in-s3-using-lambda-glue-crawler-redshift-no-etl-jobs-required-7231d3f72571?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/7231d3f72571</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[csv]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[parquet]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Sun, 13 Apr 2025 10:07:27 GMT</pubDate>
            <atom:updated>2025-04-13T10:13:03.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0L1eMvUb2HqlNYBg" /></figure><p>Want to query CSVs stored in S3 without setting up a complex ETL pipeline?</p><p>Here’s a lightweight, serverless way to do it, using just: Here’s a cleaner architecture:</p><pre>CSV → S3 → Lambda (Parquet) → Glue Crawler → Redshift External Table</pre><h3>Step-by-Step Guide</h3><h3>✅ Step 1: Drop CSV Files into S3</h3><p>Upload your raw .csv files to a logical folder like:</p><pre>aws s3 cp sales_date.csv s3://your-bucket/raw-data/sales/2025/04/13/sales_data.csv</pre><p>This will trigger a Lambda function to process it automatically.</p><h3>⚙️ Step 2: Use Lambda to Convert CSV to Parquet</h3><p>Set up a Lambda function triggered by an <strong>S3 PUT event</strong>.</p><p>It reads the CSV file, converts it to <strong>Parquet</strong> (columnar + compressed), and saves it to a new S3 path:</p><pre>s3://your-bucket/processed-data/sales/</pre><p>Sample lambda code</p><pre>import boto3, io<br>import pandas as pd<br>import pyarrow as pa<br>import pyarrow.parquet as pq<br><br>def lambda_handler(event, context):<br>    s3 = boto3.client(&#39;s3&#39;)<br>    bucket = event[&#39;Records&#39;][0][&#39;s3&#39;][&#39;bucket&#39;][&#39;name&#39;]<br>    key = event[&#39;Records&#39;][0][&#39;s3&#39;][&#39;object&#39;][&#39;key&#39;]<br>    <br>    obj = s3.get_object(Bucket=bucket, Key=key)<br>    df = pd.read_csv(obj[&#39;Body&#39;])<br>    <br>    table = pa.Table.from_pandas(df)<br>    out_buffer = io.BytesIO()<br>    pq.write_table(table, out_buffer)<br>    <br>    target_key = key.replace(&quot;raw-data&quot;, &quot;processed-data&quot;).replace(&quot;.csv&quot;, &quot;.parquet&quot;)<br>    s3.put_object(Bucket=bucket, Key=target_key, Body=out_buffer.getvalue())</pre><h3>🔍 Step 3: Crawl Processed Parquet with Glue</h3><p>Now, use <strong>AWS Glue Crawler</strong> to:</p><ul><li>Point to s3://your-bucket/processed-data/sales/</li><li>Infer schema from the Parquet files</li><li>Save table metadata to a <strong>Glue Data Catalog</strong> database</li></ul><p>This allows Redshift to discover and use the table later.</p><h3>🧠 Step 4: Connect Redshift to Glue Catalog</h3><p>In Redshift Query Editor:</p><pre>CREATE EXTERNAL SCHEMA ext_sales<br>FROM DATA CATALOG<br>DATABASE &#39;your-db-name&#39;<br>IAM_ROLE &#39;arn:aws:iam::your-account:role/RedshiftRole&#39;<br>REGION &#39;your-region&#39;;</pre><h3>📊 Step 5: Query Data in Redshift</h3><p>Your CSV (now Parquet) is ready to query:</p><pre>SELECT * FROM ext_sales.sales_data<br>WHERE total_amount &gt; 1000;</pre><h3>🎯 Why This Architecture Works</h3><ul><li>🧠 No Glue jobs or pipelines to maintain</li><li>⚡ Serverless and cost-effective</li><li>📉 Parquet makes querying faster + cheaper</li><li>🧩 Easy to plug into analytics tools via Redshift</li></ul><h3>✅ Perfect For</h3><ul><li>Internal analytics teams</li><li>Real-time S3-to-SQL workflows</li><li>Anyone looking to skip the heavy ETL layer</li></ul><p>This pattern is minimal, elegant, and battle-tested. Whether you’re processing sales data, logs, or reports, turning raw CSVs into Redshift-queryable Parquet is just a Lambda away.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7231d3f72571" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trigger Multiple Lambda Functions from the same S3 Bucket with Object Key]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://shassaan.medium.com/trigger-multiple-lambda-functions-from-the-same-s3-bucket-with-object-key-da2081efb9cc?source=rss-77e0c79bf559------2"><img src="https://cdn-images-1.medium.com/max/2600/1*nJeWVrq5eAaAY4Gqif6ldQ.png" width="2746"></a></p><p class="medium-feed-snippet">Amazon EventBridge serves as a versatile event bus service that facilitates seamless integration between AWS services, custom applications&#x2026;</p><p class="medium-feed-link"><a href="https://shassaan.medium.com/trigger-multiple-lambda-functions-from-the-same-s3-bucket-with-object-key-da2081efb9cc?source=rss-77e0c79bf559------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://shassaan.medium.com/trigger-multiple-lambda-functions-from-the-same-s3-bucket-with-object-key-da2081efb9cc?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/da2081efb9cc</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[objects]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[s3]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Wed, 27 Sep 2023 16:30:38 GMT</pubDate>
            <atom:updated>2023-09-27T16:30:38.376Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Building Backend OAuth 2.0 App for JWT Assertions]]></title>
            <link>https://medium.com/onebyte-llc/building-backend-oauth-2-0-app-for-jwt-assertions-acf1af784920?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/acf1af784920</guid>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[epic]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[fhir]]></category>
            <category><![CDATA[smart]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Mon, 12 Sep 2022 09:33:51 GMT</pubDate>
            <atom:updated>2022-09-12T09:34:06.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*FloeRgxFaNwi1dN5.png" /></figure><p>In <a href="https://oauth.net/2/">OAuth 2.0 </a>there is a way for backend services to authenticate with servers known as JWT assertions. In this protocol, we need to send a JWT to auth server to get back another JWT to be used for authorization/authentication of the subsequent requests of different server resources. These types of protocols are implemented on backend services that serve more sensitive data like health records, financial data, etc.</p><p>For this specific implementation, we usually follow the below-mentioned steps:</p><p><strong>Registering your backend app on Auth server and getting the client ID</strong></p><p>When you register your app on Auth server, you will be assigned a client to which you will need to send in your assertion token when requesting an access token grant.</p><p><strong>Generate public/private key pairs for signing your JWT</strong></p><p>You can use these commands for getting public/private keys:</p><pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout rsa_private.pem \\n -out rsa_cert.pem -subj &quot;/CN=unused&quot;</pre><p><strong>Build JWT</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9nYEUHt5ifkOKrz1TDiog.png" /></figure><p>This code snap above shows how a JWT should be built. I am using C# to build a JWT and signing it with the private key we generated in a previous step.</p><p><strong>JWT Breakdown</strong></p><p>While building the JWT you should keep in mind a few things</p><p>1. JWT expiry should not be more than 4 minutes.</p><p>2. It should have a unique Jti claim.</p><p><strong>Header</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RcSIG4lS-nOKzctHWN6sA.png" /></figure><p>Your header will look like this it contains the algorithm your auth server using and a key ID which will be the identifier of your public for Auth server to verify your JWT signature.</p><p><strong>Payload</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtK7UZy95cIIkw5mIKDmYQ.png" /></figure><p>This is your payload in which <strong>iss</strong>, <strong>sub</strong> is the client ID of your app registered on Auth server. <strong>nbf</strong> is the JWT usage time which should be before 30 milliseconds of the JWT issue time, <strong>exp</strong> is expiry which should not be more than 4 minutes, and <strong>aud</strong> is the exact URL you are using for auth grant from the server.</p><p><strong>Signature</strong></p><p>You will sign your JWT using the private key you generated earlier with your server’s supported algorithm, for example, some use sha256. In this case, we are using rsasha384.</p><p><strong>Providing access to your public key</strong></p><p>Now that you have built your JWT and want to send this to Auth server to get an access token, the server needs to verify your JWT signature and for verification, your server needs to access your public key. Remember not to share the private key with servers as more tokens can be signed using a private key but from the public key you can only verify the signature and cannot sign a new JWT.</p><p>We have two ways to give the public key to the server.</p><p>1. The simplest way is to simply upload your public key to the server.</p><p>2. Expose your public key as JSON Web Key on some URL like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qrjAbXRj8x3-pXJEGHbdUw.png" /></figure><p>This is the format of a JWK (JSON Web Key) and you can provide this URL to the Auth server so whenever they need to verify your JWT they can call this URL to fetch your keys and match using the <strong>kid</strong> which you provided in the header of your JWT to verify the signature. Remember the signature verification will only be down using the <strong>n (Modulus of your public key) </strong>property of this object.<br>This can be calculated using this formula</p><pre>Base64.encode(rsa_public_cert.GetModulus().ToString())</pre><p>When everything is ready, you can send your request to Auth server for an access grant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*5MRYLcdvldkGAgfCeS4Usg.png" /></figure><p>I hope you liked the read. Let me know about your feedback and if you run into any issues, you can always reach out to me.</p><p>Possible errors could be you might mess up with the JWT expiry time or <strong>jti</strong> claim.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acf1af784920" width="1" height="1" alt=""><hr><p><a href="https://medium.com/onebyte-llc/building-backend-oauth-2-0-app-for-jwt-assertions-acf1af784920">Building Backend OAuth 2.0 App for JWT Assertions</a> was originally published in <a href="https://medium.com/onebyte-llc">OneByte</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Executing Long-Running Jobs with AWS Lambda Functions]]></title>
            <link>https://medium.com/onebyte-llc/executing-long-running-jobs-with-aws-lambda-functions-60ac0bcd33d9?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/60ac0bcd33d9</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[jobs]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Fri, 20 May 2022 07:32:52 GMT</pubDate>
            <atom:updated>2022-05-20T07:32:52.920Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gClw-BVc7Z-Tmi0o.jpg" /></figure><p><a href="https://aws.amazon.com/lambda/">AWS</a> Lambda is an event-driven,<a href="https://aws.amazon.com/serverless/"> serverless</a> computing platform that executes your code in response to events. Serverless support more or less almost all use cases, But one thing that still requires some thinking and finding a way to do is using lambda for executing the long-running tasks.</p><p>For example, we want to migrate old data from one data storage like (S3, google drive, one drive, etc ) to other data sources like SQL Server, Postgres, Elasticsearch, or DynamoDB this is an example of a long-running task that can end up running for 30 to 40 days.</p><p>We have many other options for this purpose which include running a dockerize service on ECS or EC2 or we can have a system CTL on Linux instance or windows service on windows instance, These options are good like running an ECS task is always good practice but this technique will help you in a case where you don’t have much cost flexibility and you want this task done in a much cheaper way in terms of money. Lambdas are in general cheaper when it comes to the cost but they have some limitations which we need to handle if we want this workflow to work.</p><p>Our task is to increase the lambda execution timeout which is right now 15 minutes and the bad news is that we cannot increase the timeout beyond 15 minutes. So for this purpose, we need to implement a technique in which we need to launch a new lambda function when 15 minutes is about to reach and continue from the state where we will left let’s say we are moving from point A to D but the timeout is about to happen when we reached at C so we will re-launch our lambda from there and will make sure that this time we are starting from C point, not A.</p><p>Let’s get practical, So how are we going to achieve this by using an AWS <a href="https://docs.aws.amazon.com/step-functions/index.html">state machine</a>.<br>State machines help us manage complex workflows we need to provide a state machine definition when creating a state machine in the AWS cloud and we can start multiple executions of that state machine whenever we want also we can check the state machine execution progress.</p><p>We will check the remaining execution time left in our lambda function through the object present in lambdaContext called remaining time. We are checking it for less than 3 minutes to be on the safe side. If this condition full fills we start a new execution of the state machine with our current state and this thing goes on until our workflow is finished.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*lXpesOkSWcFjqqYP" /></figure><p>Here is the code example in C# where we restarted our state machine by keeping track of the remaining time of lambda execution and the most important thing is remembering our current state for the subsequent execution because we don’t want to execute the same logic again and again and stuck in the infinite loop.</p><p>Hope you got that and enjoyed the read.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60ac0bcd33d9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/onebyte-llc/executing-long-running-jobs-with-aws-lambda-functions-60ac0bcd33d9">Executing Long-Running Jobs with AWS Lambda Functions</a> was originally published in <a href="https://medium.com/onebyte-llc">OneByte</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sleep function in JavaScript]]></title>
            <link>https://shassaan.medium.com/sleep-function-in-javascript-855b0898fb6f?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/855b0898fb6f</guid>
            <category><![CDATA[sleep]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[threads]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Sun, 02 Jan 2022 14:34:29 GMT</pubDate>
            <atom:updated>2022-01-02T14:34:29.686Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes during debugging of a loading spinner on the frontend or to test the app behavior by adding delay in a certain function of the application, we need a sleep function just like in multithreaded languages like Java and C#Thread.Sleep(milliseconds).</p><p>I found a way to achieve this here in JS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*nwvBGsl9srPlUGB_N2Jh0Q.png" /></figure><p>It will delay the execution for 10000 milliseconds(10 secs) between these two print statements.</p><p>thanks 🙌.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=855b0898fb6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finding an Unknown value at a certain point in a 2D plane using Lagrange Interpolation.]]></title>
            <link>https://levelup.gitconnected.com/finding-an-unknown-value-at-a-certain-point-in-a-2d-plane-using-lagrange-interpolation-3bba69479bc?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bba69479bc</guid>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Wed, 20 Oct 2021 05:15:32 GMT</pubDate>
            <atom:updated>2021-10-20T15:08:07.974Z</atom:updated>
            <content:encoded><![CDATA[<h4>Theory</h4><p>Suppose you have owned a business and you are selling products for three years and you also have all your sales history for every month, You want to predict how many sales you will get in next year’s fifth month.</p><p>For this purpose, we can interpolate all your previous history by months and get the required result.</p><p><a href="https://en.wikipedia.org/wiki/Joseph-Louis_Lagrange"><strong>Joseph-Louis Lagrange</strong></a><strong> </strong>an Italian mathematician discovered a method to find a function value and certain data points in a linear function using previous values.</p><p>So I wrote a function in C++ that could end up giving you a value on your point of interest by providing this function the previous data points.</p><p>Check this out:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3dcaac5524a4aab316bf7ca4f58937a0/href">https://medium.com/media/3dcaac5524a4aab316bf7ca4f58937a0/href</a></iframe><p>Try this code and let me know about any issues you face.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bba69479bc" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/finding-an-unknown-value-at-a-certain-point-in-a-2d-plane-using-lagrange-interpolation-3bba69479bc">Finding an Unknown value at a certain point in a 2D plane using Lagrange Interpolation.</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentication and authorization using Cognito in asp.NET]]></title>
            <link>https://medium.com/onebyte-llc/authentication-and-authorization-using-cognito-in-asp-net-7bdedf176f8c?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bdedf176f8c</guid>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[cognito]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Mon, 04 Oct 2021 09:23:29 GMT</pubDate>
            <atom:updated>2021-10-08T10:11:21.439Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GxVUjBJFyoPtkxC3.png" /></figure><h3>Background</h3><p>We had a problem that we wanted to authenticate our bunch of services using one source like whenever the user wants to access any of your services he/she will get an access grant from our Auth service and will be able to access all services. We solved this using <a href="https://aws.amazon.com/cognito/">AWS Cognito</a>. Let see how we were able to crack the problem.<br>In this example, I will be using C# and .NET 5.</p><h3>Setup</h3><p>We will achieve this by first creating a user pool using the AWS console.</p><ol><li>Provide the name of your pool.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzIaKsGeiOdmw3H3fltx4A.png" /></figure><p>2. Click on review defaults and it will set up the pool using default settings and you can update according to your requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vhMLMfKwDEap-N7wgd71vQ.png" /></figure><p>Now that your pool is created so let us add an app client to integrate our application with this pool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v7dtBPCLup-eSMPpa-NyFQ.png" /></figure><p>you need to provide a name to the app client and make sure all the checks are according to what you are seeing in the image.</p><p>Create a simple asp.net core web API project and install these packages</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-o_TwW6tdxubCHXlbTCWQ.png" /></figure><p>In your appsettings.json</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HcZmBf29OIZBQrl8vCHIyQ.jpeg" /></figure><p>You can get UserPoold in the General Settings tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FNpyTRLY10qoVeMAwRekpg.png" /></figure><p>and AppClientId and AppClientSecret from AppClients Tab.<br><strong>Note</strong> : AppClientId and UserPoolClientId is same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2837cB-tmd6F_yZt_NqYUg.png" /></figure><p>Now you need to configure Cognito identity in the ConfigureServices method inside Startup.cs class</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*jN5XnKrMKMEypOq5onpI4Q.png" /></figure><p>Now let&#39;s start implementing login functionality using</p><p>You need to get these services through DI to implement authentication flows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QbPtR5LEKnpnjY5c0w05xg.png" /></figure><p><strong>Login User</strong></p><p>This is how you can get access and refresh tokens from Cognito. The first time when the user is created with a temporary password on the first login use has to update the password to get the access tokens. It returns a challenge that a new password is required. So we can check using that challenge and prompt use to update the temporary password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o8Rjqj5Py3gfCkH70MOtmw.png" /></figure><p><strong>Update Temporary password</strong></p><p>To update temporary passwords we respond to that challenge and pass a new password with any required attributes you specified during the creation of UserPool in the AWS console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bsyueFoHCG6HlHzoZi_bng.png" /></figure><p><strong>Integrating backend API<br></strong>Integration of backend API to validate the access token generated from Cognito and grant access to that API if this is passed.<br>Basically what we do is we check for the valid issuer and expiry of the token by using Cognito authority.</p><p>First, you need to configure Authentication Service in Startup.cs class in ConfigureServces method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rqv8Aqr01wwkwm6WHbR8DA.png" /></figure><p>Afterwards, you can use the Authorize attribute on your endpoints to accept requests that are authenticated using AWS Cognito</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tog1ba3nIP7UyESejj_20Q.png" /></figure><p><strong>Conclusion</strong></p><p>In Addition, you can also implement forgot password and refresh token flows using AWS Cognito refer to this <a href="https://github.com/aws/aws-aspnet-cognito-identity-provider/">documentation</a>.<br>If you have any suggestions or any confusion do send me feedback I can help you out in that regard.<br>thanks 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bdedf176f8c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/onebyte-llc/authentication-and-authorization-using-cognito-in-asp-net-7bdedf176f8c">Authentication and authorization using Cognito in asp.NET</a> was originally published in <a href="https://medium.com/onebyte-llc">OneByte</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guide to become a full-stack engineer]]></title>
            <link>https://medium.com/onebyte-llc/guide-to-become-a-full-stack-engineer-73b32c0c3f0a?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/73b32c0c3f0a</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[guide]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <category><![CDATA[aspnet]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Sat, 10 Apr 2021 08:31:51 GMT</pubDate>
            <atom:updated>2021-04-20T11:28:41.590Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cnYLUZU3wunJTeWX.jpg" /></figure><p>Here is the complete guide for you to become a <strong>full-stack engineer</strong>. In the industry, there is been a huge demand for full-stack engineers. Full-stack engineers are those who work on frontend, backend, databases, and sometimes on infrastructure as well. But right now it&#39;s not like the jack of all trades but in this field, engineers have deep knowledge of every aspect of the complete technology stack. As the tech is evolving day by day so it is becoming easy for engineers to think for solutions rather than caring about how they will implement that.</p><p>First of all, create a <strong>GitHub account </strong>if you don&#39;t have one and learn about <a href="https://www.youtube.com/watch?v=BCQHnlnPusY&amp;list=PLozRqGzj97d02YjR5JVqDwN2K0cAiT7VK"><strong>GIT and GitHub</strong></a><strong>.</strong></p><p>make sure all the practice you do is on Github with proper commits frequencies and messages, this will help in <strong>showing your code to employers to get internships and jobs</strong>.</p><h4>Step # 1 (HTML and CSS)</h4><ol><li>Learn the basic syntax of<a href="https://www.w3schools.com/html/default.asp"><strong> HTML</strong></a><strong> 5</strong>.</li><li>Learn<a href="https://www.w3schools.com/html/html5_semantic_elements.asp"> <strong>semantics</strong></a> of HTML tags.</li><li>Learn about HTML tag<a href="https://www.tutorialrepublic.com/html-tutorial/html-attributes.php#:~:text=Attributes%20define%20additional%20characteristics%20or,be%20enclosed%20in%20quotation%20marks."> <strong>attributes</strong></a>.</li><li>Learn the basic syntax of<a href="https://www.w3schools.com/css/default.asp"> <strong>CSS</strong></a> (Inline vs External vs Internal).</li><li>Learn about CSS<a href="https://www.w3schools.com/cssref/css_selectors.asp"> <strong>selectors</strong></a>.</li><li>Learn CSS<a href="https://www.w3schools.com/css/css3_flexbox.asp"> <strong>Flexbox</strong></a> and<a href="https://www.w3schools.com/css/css_grid.asp"> <strong>Grid</strong></a>.</li></ol><p>Try developing this project using your above knowledge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*36VsqU4niQY0HHEN.png" /></figure><p>7. Learn about <a href="https://getbootstrap.com/"><strong>bootstrap</strong></a></p><p>and create the same page using bootstrap and compare the development effort involved.</p><p>If you were able to develop this thing using HTML, CSS, and bootstrap then congratulations now on you can design web pages for anyone just keep practicing and improvising plus <strong>search for problems online and solve them using HTML, CSS, and bootstrap.</strong></p><h4>Step # 2 (JavaScript)</h4><ol><li>Get Basic Knowledge of how<a href="https://medium.com/@ramsunvtech/behind-browser-basics-part-1-b733e9f3c0e6"> <strong>browsers</strong></a> work.</li><li>Learn what is<a href="https://www.youtube.com/watch?v=PkZNo7MFNFg&amp;t=1s"> <strong>JavaScript</strong></a>?</li><li>Learn what is<a href="https://www.json.org/json-en.html"> <strong>JSON</strong></a>?</li><li>Learn about<a href="https://www.youtube.com/watch?v=uxf0--uiX0I"> <strong>consuming</strong></a><strong> REST API</strong> in JavaScript.</li><li>Create a browser application in JavaScript to <strong>Create, Read, Update and Delete </strong>GitHub Gists. (<a href="https://docs.github.com/en/rest/reference/gists">reference</a>).</li><li>Learn<a href="https://reactjs.org/tutorial/tutorial.html"> <strong>ReactJs</strong></a>.(create the same application in ReactJs).</li><li>Now you have completed the frontend if you have completed all steps above you can call yourself a frontend engineer and <strong>start applying for frontend jobs.</strong></li></ol><p><strong>Step # 3 (DataBases)</strong></p><p>Now in this step, I want you to learn some <strong>databases</strong>.</p><ol><li>Learn what is a<a href="https://www.youtube.com/watch?v=UsBJ9l5tajA"> <strong>database</strong></a>?</li><li>Learn<a href="https://www.youtube.com/watch?v=HXV3zeQKqGY"> <strong>SQL</strong></a>.</li><li>Learn<a href="https://www.youtube.com/watch?v=uD3p_rZPBUQ"> <strong>no SQL</strong></a></li><li>Learn<a href="https://www.youtube.com/watch?v=pWbMrx5rVBE"> <strong>MongoDB</strong></a></li></ol><p>Create a database for an organization to manage their employees’ attendance in SQL as well as NoSQL<br>if you were able to design a database for this requirement then you are good to go to the next step.</p><p><strong>Step # 4 (Backend)</strong></p><p>In previous steps you learned about frontend and database now to connect both these you need a strong codebase that will be running on some server so this codebase is basically referred to as the backend of any application.</p><p>to create a backend of any application you need to know any backend language of your interest and choice there are many good technologies that you can opt for like <strong>nodejs, python, ruby, Golang, scala, C#, F#.</strong></p><p>As I said all of them are great technologies but for this guide, I will go for one which is of interest and that is <strong>C</strong><a href="https://docs.microsoft.com/en-us/dotnet/csharp/"><strong>#</strong></a><strong> on </strong><a href="https://dotnet.microsoft.com/"><strong>.NET 5</strong></a>.</p><ol><li>Learn about<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP"> <strong>HTTP</strong></a>.</li><li>Learn the basic<a href="https://www.youtube.com/watch?v=LUv20QxXjfw"> <strong>syntax</strong></a> of C#.</li><li>Learn what is<a href="https://www.youtube.com/watch?v=s7wmiS2mSXY"> <strong>API</strong></a> in general.</li><li>Learn what is<a href="https://www.smashingmagazine.com/2018/01/understanding-using-rest-api/"> <strong>REST API</strong></a><strong>.</strong></li><li>Learn how<a href="https://www.youtube.com/watch?v=j8Yxff6L_po"> <strong>authentication</strong></a> works on the backend.</li><li>Learn about<a href="https://www.youtube.com/watch?v=dHQ-I7kr_SY"> <strong>ORMs</strong></a>.</li><li>Learn<a href="https://www.youtube.com/watch?v=sWJayOop4k8"> <strong>asp.net API</strong></a> development.</li><li>Learn Entity Framework Core (both code first and DB first).</li><li>Learn about<a href="https://www.youtube.com/watch?v=Lh82WlOvyQk"> <strong>asp.net identity and JWT</strong></a>.</li></ol><p>Create a <strong>Social media web ap</strong>p with features</p><p>Users <strong>(sign-in/signup</strong>) (using JWT and identity).</p><p>Manage users’ profiles.</p><p>Newsfeed.</p><p>Add friend</p><p>Post, like, comment and share.</p><p>all the API endpoints should be <strong>secure</strong>.</p><p><strong>Step # 5 (DevOps basics)</strong></p><ol><li>Learn Basic<a href="https://maker.pro/linux/tutorial/basic-linux-commands-for-beginners"> <strong>Linux Commands</strong></a></li><li>Learn what is<a href="https://www.forcepoint.com/cyber-edu/firewall"> <strong>firewall</strong></a>?.</li><li>Learn any scripting language like<a href="https://www.youtube.com/watch?v=_uQrJ0TkZlc"> <strong>Python</strong></a>, Go, etc</li><li>Learn what is<a href="https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_web_server"> <strong>web serve</strong>r</a>?</li><li>Learn what is<a href="https://www.cloudflare.com/learning/cloud/what-is-the-cloud/"> <strong>cloud</strong></a><strong> </strong>and what are some famous<a href="https://www.c-sharpcorner.com/article/top-10-cloud-service-providers/"> <strong>cloud providers</strong></a>?</li><li>Learn what is<a href="https://www.vmware.com/topics/glossary/content/virtual-machine"> <strong>VM</strong></a><strong> </strong>(Virtual Machine)?</li><li>Learn what are<a href="https://www.docker.com/resources/what-container#:~:text=A%20container%20is%20a%20standard,one%20computing%20environment%20to%20another.&amp;text=Available%20for%20both%20Linux%20and,same%2C%20regardless%20of%20the%20infrastructure."> <strong>containers</strong></a>?</li><li>Learn<a href="https://www.youtube.com/watch?v=pTFZFxd4hOI"> <strong>Docker</strong></a>.</li><li>Choose any from the above famous cloud providers (my recommendation would be AWS)</li><li>Learn how you can create a VM in that cloud with Linux?</li><li>So for final step you need to deploy complete application you developed in previous step in this VM.</li></ol><p>Deploy frontend which is reactjs using PM2 separately on port 8080.</p><p>Dockerize backend API and deploy it using docker.</p><p>This is only the guide you have to learn yourself no one will help you in learning but they can provide you the direction of learning so this the direction to become a full-stack engineer and this knowledge is not enough also you will learn many other things along with this.</p><p>hope this guide will help you learn something let me know in the comments if any help required regarding any step.</p><p>Share this article in your circle so that anyone can take advantage of this guide.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73b32c0c3f0a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/onebyte-llc/guide-to-become-a-full-stack-engineer-73b32c0c3f0a">Guide to become a full-stack engineer</a> was originally published in <a href="https://medium.com/onebyte-llc">OneByte</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing wildcard string search in LINQ C#.]]></title>
            <link>https://shassaan.medium.com/implementing-wildcard-string-search-in-linq-c-809af3193ef1?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/809af3193ef1</guid>
            <category><![CDATA[wildcard]]></category>
            <category><![CDATA[linq]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[string]]></category>
            <category><![CDATA[like]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Wed, 17 Mar 2021 17:45:37 GMT</pubDate>
            <atom:updated>2021-03-17T17:45:37.578Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*5twZSEo2JgSikkmV.png" /></figure><p>Currently, we don&#39;t have any implementation of <a href="https://apus.libanswers.com/faq/2235">wildcard</a> searching in LINQ C#.<br>But we can do this through a little trick, where you convert your wildcard search string into a regex and match that regex with data on which you want to perform a search.</p><p>Have a look at this piece of code here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MdhGzYo498oydx5IftXBaA.png" /></figure><p>Here we want to search strings from the list which have <strong>a </strong>at start and<strong> b </strong>in<strong> </strong>end and any of the characters can come in between. This is the one case, you can perform a search of any case that comes to your mind.</p><p>thanks hoping that was helpful for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=809af3193ef1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless 101]]></title>
            <link>https://medium.com/onebyte-llc/serverless-101-d3c677dbbe1b?source=rss-77e0c79bf559------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3c677dbbe1b</guid>
            <category><![CDATA[functions-as-a-service]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Syed Hassaan Ahmed]]></dc:creator>
            <pubDate>Thu, 25 Feb 2021 12:20:44 GMT</pubDate>
            <atom:updated>2021-02-25T12:20:44.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*JAjoxVqRpsyP0oY3.jpg" /></figure><h3>Serverless !== No Server</h3><p>So the first point that I would like to mention is that serverless less does not mean that there are no servers, What that means is you as a Developer or I do not have to care about servers behind the scene there will most likely always be servers. Your code has to run somewhere the only difference is we don&#39;t have to worry about maintaining a server, deploying a server, scaling a server</p><p>All these things are taken away from you so you don&#39;t have to worry about servers and focus on writing code.</p><h3>Awesomeness</h3><p>The part that I found beautiful about serverless is its ability to autoscale if let&#39;s say 10 people are using your app on daily basis and all of sudden your app goes up on Twitter and now 20,000 people are using it no problem everything will just work fine.<br>As more requests surge in their your functions will pop from left to right and handle all of them for you and you will only get charged for the calls that actually happened. This is another thing that is beautiful about serverless is that it is effective in terms of your money.</p><h3>Example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DnCEJbY_8IrYh7Wg" /></figure><p>In the above figure, you can see we have a <a href="https://aws.amazon.com/kinesis/">Kinesis</a> stream in which lambdas are triggering on basis of the number of <a href="https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html">shards</a> this is the best scenario where the autoscaling can be observed like if there are <strong>n</strong> number of shards in the stream the lambdas would autoscale to <strong>n</strong> instances in no time.</p><p>if we go more deeply into a shard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/0*n7Z9thWySzzA1ETL" /></figure><p>Now you can see the same lambda function with multiple instances are invoked on the same shard at the same time and these executions are based on the batch size of records we defined while configuring the trigger so every execution will pick a single batch i.e. 2 in this case.</p><h3>Comparison with other execution models</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*w4dcVDxk1KDbkyIW" /></figure><p>let&#39;s go through a scenario</p><p>For example, with a <a href="https://microservices.io/patterns/monolithic.html"><strong>Monolithic</strong></a><strong> architecture</strong>, a single faulty service can bring down the entire application, but <a href="https://microservices.io/patterns/microservices.html"><strong>Microservices</strong></a><strong> architecture</strong> has emerged as a way to break the Monolithic applications into smaller services, allowing each service to run in its own container so they are treated as an independent component. All this brings several benefits, such as being prepared for scaling by component and being more robust to face possible failures.</p><p>Going a bit further, <strong>Serverless architecture</strong> breaks an application into even smaller pieces than those that Microservices architectures can do, making it more granular and achieving the level of functions and events. We are changing from something big (<strong>Monolithic</strong>) to something small (<strong>Microservices</strong>), and then, to something even smaller (<strong>Serverless</strong>).</p><p>In terms of efficiency of scaling, the advantage of switching from Monolithic to Microservices is the same we get from moving from Microservices to Serverless (functions). In Microservices, you scale a whole service instead of just a small piece of code where the bottleneck is. That is why Serverless is much more cost-effective than others. Serverless architecture not only economizes the physical infrastructure but also helps to reduce operations aspects allowing developers to focus on business logic instead of infrastructure.</p><p>Serverless includes concurrent asynchronous workloads, scaling requirements, stateless, unpredictable traffic, ephemeral, and highly dynamic. It is important to understand how Serverless works in order to choose the best available Serverless frameworks and use them in the most accurate way.</p><p>I hope you enjoyed the read.</p><p>Please provide feedback regarding improvements or mention what you like about it.</p><p>thanks and regards</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3c677dbbe1b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/onebyte-llc/serverless-101-d3c677dbbe1b">Serverless 101</a> was originally published in <a href="https://medium.com/onebyte-llc">OneByte</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>