teleren/devto huggingface dataset:
Injecting Machine Learning Model into AWS Lambda for Accelerated Inference Performance
Tags: docker, machinelearning, ai
Published: 2023-03-26 06:23:17

In my p[revious article](https://dev.to/grhaonan/cost-efficient-scalable-yolov5-model-inference-in-production-more-than-just-aws-lambda-19el), we introduced a cost-effective inference architecture that successfully handles approximately one million inferences per month in our live production environment.


![Image by author, previous logic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ekqtjqcl0rfsr349o623.jpg)

Previous logic:
1. Upon receiving an inference request, Lambda will load the specified model, which is mounted on the Amazon Elastic File System (EFS).

2. In the event that loading the model from EFS fails, the system will resort to fetching the model from Amazon S3 as a backup solution (Alternative 1)

One challenge associated with this solution is that during a scale-up scenario, when a large number of concurrent Lambda functions are invoked, they all attempt to load models from EFS simultaneously. This surge in demand can quickly exhaust the reserved bandwidth (throughput), leading to numerous inference timeouts.


![Image by author, high lambda error rate due to timeout](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0dbyrjnhrckewvluh95d.png)

Solution 1 (Not recommended):
While increasing the provisioned throughput may seem like a straightforward solution, this can prove to be costly and is therefore not recommended.

Solution 2 (Recommended):


![Image by author, new logic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8z01yn43mo140p1z8lx.jpg)

1. Injecting the model into the base image used by Lambda allows each inference to load the model from 'local', resulting in reduced inference latency and cost savings on EFS. If this approach fails, the following backup solutions are in place:

2. Loading the model from EFS (Backup Solution 1)

3. Loading the model from S3 if EFS loading fails (Backup Solution 2)

Results:

Upon implementing the model injection, there is a notable reduction in both EFS throughput and Lambda inference duration, resulting in decreased costs and improved performance.

![Image by author, EFS throughput before implementation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vu36ej80ssv3r4ordeaf.png)

![Image by author, lambda duration before implementation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9nw1ikijplckb0r0776w.png)

![Image by author, lambda duration after implementation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ohmlz08blq1gd26w2pn.png)
Beyond Coding : The DevOps Tasks I do as a web dev.
Tags: webdev, programming, devops, productivity
Published: 2023-03-26 06:21:12

##1. Using `SSH` collaboration across `Dev Tools`.

- As a developer, you may have found yourself needing to verify code changes or perform hotfixes on production servers. **Visual Studio Code's SSH** extension allows you to directly connect to remote folders, simplifying the debugging process and . You can navigate through systems as if you're on the server itself, without interfaces or multiple logins. _(NeoVim is also good alternative if you know the shortcuts)_

- Connect to SQL servers behind a bastion host with ease using DBeaver and local tunneling. [Here's how you can do it.](https://dev.to/shrihari/dbeaver-ssh-bastion-host-google-authenticator-how-to-connect-lph)


- Controlling workflow with Git CLI and SSH. I started on command line then moved to Github Desktop and then back to CLI .I had inconsistencies with fetch and getting latest commits.

##2. Going through server logs.
Getting to know the linux commands really comes handy when gazing. The combinations of `less` and `grep` brings great deal of analytics and easy problem solving.

Commands I use regularly.
`less` - view file contents page by page with navigation
`tail` - view the end of a file or live stream of log data
`cat` - view a file
`grep` - search for a specific pattern in a file

I also set up `oh-my-zsh` that covers most of the terminal enhancements one could have.

##3. Using docker for local setups
Streamlining my local development process has never been easier since I started using `Docker` - now I can effortlessly set up `MySQL`, `MongoDB`, and even the operating system, without the hassle of configuring each service individually on my machine.

_Peace 🕊_

---

If you are here it means you may have found this blog helpful. Just follow me @shrihari which will motivate to write more. You can make a [Buttermilk 🥛](https://www.buymeacoffee.com/shriharimohan). Small support comes a long way!

Subscribe If you want to receive these blogs in your mail from @[Medium](https://medium.com/@shriharimohan) for free!

## Try Our new product for free!
[DocsAI](https://docsai.app/) - Create AI support agents with your documents in the most affordable price, starts at **0$**. Don't need a bot , but need ai help on your docs just upload and start chating !

Using for a company ? [Check out our pricing](https://docsai.app/pricing) Just contact me for personalized pricing !

![docsAi](https://firebasestorage.googleapis.com/v0/b/shrihari-personal-storage.appspot.com/o/banner-docs-jpeg.jpeg?alt=media&token=45c47666-de2a-4e02-8881-beb6e43ce581)

## More things from me
{% embed https://dev.to/shrihari/how-i-built-a-chrome-extension-that-finds-ghost-css-ghost-css-detector-4aj0 %}

{% embed https://dev.to/shrihari/two-things-that-make-my-terminal-experience-awesome-in-mac-3eie %}

{% embed https://dev.to/shrihari/angular-ng-templates-crafting-reusable-templates-with-ease-2dap %}
BlockChain and its future possibilities.
Tags: futur, blockchain, beginners, career
Published: 2023-03-26 06:16:14

## Decentralization: 
Blockchain technology allows for decentralized networks where there is no need for a central authority to verify transactions or maintain records. This could revolutionize the way we think about traditional systems of governance, finance, and even identity management.

## Transparency: 
The use of blockchain technology can provide a high level of transparency in transactions. This can be particularly useful in supply chain management, voting systems, and any situation where trust is critical. This transparency can also help to reduce fraud and corruption.

## Smart Contracts: 
Smart contracts are self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. This could revolutionize the way we think about traditional legal contracts, as it could eliminate the need for intermediaries, such as lawyers.

## Interoperability: 
As blockchain technology continues to mature, it is likely that different blockchain networks will become more interoperable. This could lead to the creation of new decentralized applications that span multiple blockchains, opening up new possibilities for innovation and collaboration.

## Cryptocurrencies: 
While cryptocurrencies have been around for over a decade, there is still much room for growth and innovation in this space. As blockchain technology continues to evolve, it is likely that we will see new cryptocurrencies emerge, along with new ways to use them. This could lead to new ways of fundraising, investment, and financial management.
Javascript Dictionary: globalThis
Tags: javascript, typescript, programming, webdev
Published: 2023-03-26 06:10:34


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4s5vfhtlrnp4jk5tm57e.jpg)







**globalThis** 



Is a  built-in object introduced in ECMAScript 2020 that provides a standard way to access the global object across different environments , such as browser and Node.js. This object allows developers to write code that is more portable and works consistently across different environments.

Previously, different JavaScript environments had different ways to access the global object, such as window in browsers and global in Node.js. The globalThis object serves as a universal way to access the global object , making it easier to write code that can run in different environments without having to modify it.

Polyfills are available for older environments that do not support globalThis, and TypeScript 3.4 introduced support for type-checking globalThis.

Overall, globalThis is an important addition to the JavaScript language that helps to improve the consistency and portability of JavaScript code across different environments.


```
if (typeof globalThis === 'object') {
  // globalThis is defined in the current environment
  globalThis.myVar = 'Hello world';
} else {
  // globalThis is not defined, falling back to other methods
  if (typeof window === 'object') {
    window.myVar = 'Hello world';
  } else if (typeof self === 'object') {
    self.myVar = 'Hello world';
  } else if (typeof global === 'object') {
    global.myVar = 'Hello world';
  }
}

console.log(myVar); // Outputs 'Hello world' in any environment
```

This code checks if the 

```
globalThis
```
 property is defined in the current environment, and if it is, sets a variable called myVar on it. If globalThis is not defined, the code falls back to other methods to set the variable on the global object. Finally, the code outputs the value of myVar to the console, which should be 'Hello world' in any environment.
Roadmap to become a DevOps Engineer
Tags: webdev, beginners, tutorial, enginee
Published: 2023-03-26 04:57:13

[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/Wt3Shn9Afo8/0.jpg)](http://www.youtube.com/watch?v=Wt3Shn9Afo8)

A DevOps engineer is responsible for leading and coordinating the activities of different teams to create and maintain a company's software. The term 'DevOps' is a portmanteau of "development operations" and is a practice that aims at automating all steps of software construction.

A DevOps engineer's end goal is to shorten the software development cycle, increase the frequency of updates, and allow for more dependable releases
Install chocolatey in Windows 10/11
Tags: webdev, beginners, tutorial, chocolatey
Published: 2023-03-26 04:49:50

[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/_L9HA2bpI38/0.jpg)](http://www.youtube.com/watch?v=_L9HA2bpI38)



Learn the simple commands to install the Chocolatey package manager on Windows 11 using Terminal or PowerShell.

One big reason behind the immense popularity of the Windows operating system is the abundance of applications across a broad range of genres. But as we all know there isn’t one place for all Windows apps, as it is for Android, macOS, or Linux distributions. However, the situation has improved quite a bit with several platforms and a bundle of applications through a single installer, but such solutions are far from the perfect world. Microsoft is planning to fix the problem by bringing an overhaul in the Microsoft Store on Windows 11, but we are yet to find out how that works.
How to install VirtualBox
Tags: webdev, beginners, tutorial, virtualbox
Published: 2023-03-26 04:39:41

[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/mxRDAdqYh9c/0.jpg)](http://www.youtube.com/watch?v=mxRDAdqYh9c)

This wikiHow teaches you how to install and use the VirtualBox application on your Windows, Mac, or Linux computer. VirtualBox is a program which emulates a second computer, allowing you to install and use operating systems (e.g., Windows 7) on VirtualBox without having to change your computer's actual operating system.
File Types In Linux
Tags: webdev, beginners, tutorial, linux
Published: 2023-03-26 04:34:02

[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/4Kw82ad73a8/0.jpg)](http://www.youtube.com/watch?v=4Kw82ad73a8)



In Linux, everything is considered as a file. In UNIX, seven standard file types are regular, directory, symbolic link, FIFO special, block special, character special, and socket. In Linux/UNIX, we have to deal with different file types to manage them efficiently.

In Linux/UNIX, Files are mainly categorized into 3 parts:

Regular Files
Directory Files
Special Files
The easiest way to find out file type in any operating system is by looking at its extension such as .txt, .sh, .py, etc. If the file doesn’t have an extension then in Linux we can use file utility.  In this article, we will demonstrate file command examples to determine a file type in Linux.
Linux File Permissions
Tags: webdev, beginners, tutorial, linuxfile
Published: 2023-03-26 04:29:02

[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/SSIh0FywdLw/0.jpg)](http://www.youtube.com/watch?v=SSIh0FywdLw)

Introduction
When you execute an “ls” command, you are not given any information about the security of the files, because by default “ls” only lists the names of files. You can get more information by using an “option” with the “ls” command. All options start with a ‘-‘. For example, to execute “ls” with the “long listing” option, you would type ls -l 

When you do so, each file will be listed on a separate line in long format. There is an example in the window below.
Vim Text Editor in Linux
Tags: webdev, beginners, tutorial, linux
Published: 2023-03-26 04:25:20

[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/fDY2f-6yPQY/0.jpg)](http://www.youtube.com/watch?v=fDY2f-6yPQY)

Vim is an advanced and highly configurable text editor built to enable efficient text editing. Vim text editor is developed by Bram Moolenaar. It supports most file types and vim editor is also known as a programmer’s editor. We can use its plugin based on our needs
Making of Among Us in Discord - DEVBLOG 6 - Start Screen DONE...kinda? (3/3)
Tags: 100daysofcode, python, discord, gamedev
Published: 2023-03-26 04:01:50

{% embed https://twitter.com/MrStiK101/status/1639836499133726722?s=20 %}

Heya, this is Mr.StiK.
[Mr.StiK's intro Dialogue counter: 7]

So, just like the tweet above and the counter joke just above (XD), I made a counter system in the bot.

Basically I don't have hopes of editing that dang embed message... so, I found a perfect solution...


Yes, you may can understand I'm in a grave situation of coding till 1:20 AM, and I'm fed of it.

discord.py server was... unaware... of my 'problem',  so I need to find my own solution... and I did it, I coded it all by myself~

No, seriously, thanks to CHATGPT for fixing my error in the code.

And it's not in the tweet, but I just added players list on the message too (actually while typing... seriously). Here's the image of it: 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rolebxo5im3mgjmpas75.png)
 Now, it's code time! Here's the promised code:

```
player_count = None
# Now actual stuff...
class StartButton(discord.ui.View):
    def __init__(self):
        super().__init__()
        self.value = None

    @discord.ui.button(label='Join Game', style=discord.ButtonStyle.grey)
    async def start_button(self, interaction: discord.Interaction, button: discord.ui.Button):
        if interaction.user.name in players:
            await interaction.response.send_message('You already joined the game', ephemeral=True)
        else:
            players.append(interaction.user.name)
            await interaction.response.send_message("You've successfully joined the GAME!!!", ephemeral=True)
        print(players)
        await player_count.edit(content="Total count of players is `"+ str(len(players)) + '` And Players are: `' + str(players) + '`')
        self.value = True

@bot.command()
async def start(ctx):
    global player_count
    players.clear()
    lobby_admin = ctx.author.name
    players.append(ctx.author.name)
    start_view = StartButton()
    print(players)
    await ctx.send(embed=start_embed, view=start_view)
    player_count = await ctx.send("Total count of players is `"+ str(len(players)) + '` And Players are: `' + str(players) + '`')


```

As you can see, `player_count` (which is the message of player counting because for editing message purpose) is assigned as None. This is because if we're assigning it on start command (`async def start()`) we can't use it for editing while interaction, who's code is on top. So, I already assigned a variable like that BEFORE that. And that solution worked...

Unfortunately, I can't see the change CHATGPT made, because... I don't know where it is. It looks like the same code!

And the player counting thing took a bit of basic python knowledge (heh. 😏). For more on the rest of the code, see DEVBLOG 4.

So, yeah, that's it.

Toodles.
Days_15 All About the Loop
Published: 2023-03-26 03:54:06

While Loop
A while loop allows your code to repeat itself based on a condition you set.

It is similar to an if statement in that you ask a question, and as long as the answer is true, the computer will repeatedly run the code.

```
# All About the Loop
#
#26 MARCH 2023

class looping():
  def __init__(self,counter,exit,text):
    self.counter = counter
    self.exit = exit
    self.text = text

  def methode(self):
    while self.counter < 10:
      print(self.counter)
      self.counter +=1
  def methode2(self):
    while self.exit != "yes":
      print("🥳")
      self.exit = input("exit?: ")
  def methode3(self):
    while self.text !="yes":
      self.text = input("What animal do you wont? ")
      if self.text =="cow":
        print("a cow goes moo")
        self.text = input("Do you want to exit: ")
      elif self.text =="lemur":
        print("Lemur goes awooga")
        self.text = input("Do you want to exit: ")
      else:
        self.text = input("Are you worng, Do you want to exit: ")
     
def call():
  testing = looping(1,"","")
  testing.methode()
  testing.methode2()
  testing.methode3()
call()

```
Infinite Loop
You have to be really careful that you don't accidentally invoke an infinite loop! This is where the computer will loop code until the end of time. Without a break. Forever. 😭

Fix an infinite loop by adding:
  variable +=1
This is just saying "count to 10 by 1 each time." to make the loop end.

Don't forget, if your condition is a > then you might need to -=. This will subtract from the variable instead of adding to it.
Typescript: 5 Resources To Become A Pro
Published: 2023-03-26 03:51:38

---
title: Typescript: 5 Resources To Become A Pro
published: true
description: Make sure to bookmark these
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-03-26 02:57 +0000
---


![Image Five by Johnny Caspari](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/462ydnn5a27epsepwqdw.jpg)

> Photo by [Johnny Caspari](https://unsplash.com/@jonnysplsh)


## 1. Learn TypeScript in 5 minutes 

Don’t have hours to look through documentations ? 

Check this quick guide that will get you up to speed on Typescript!


**Link** 👉 [Learn TypeScript in 5 minutes](https://www.freecodecamp.org/news/learn-typescript-in-5-minutes-13eda868daeb/)


## 2. Learn TypeScript – The Ultimate Beginners Guide

[Learn TypeScript – The Ultimate Beginners Guide](https://www.freecodecamp.org/news/learn-typescript-beginners-guide/)

## 3. Typescript handbook

A lot of references, and comprehensive guide to the language (syntax, features and best practices).


**Link** 👉 [Typescript handbook](https://www.typescriptlang.org/docs/handbook/intro.html)

## 4. TypeScript Deep Dive

A very comprehensive deep dive into Typescript with practical examples.

Tips, Tricks, best practices and more.

Be sure to check it out!

**Link** 👉 [TypeScript Deep Dive](https://basarat.gitbook.io/typescript/)

## 5. React + Typescript cheatsheet

A lot of great information about using Typescript.

It’s a very comprehensive cheatsheet with a lot of example.

I refer to it a lot.

It’s a must have in your bookmark! (Especially if you use React)

**Link** 👉 [React + Typescript cheatsheet](https://github.com/typescript-cheatsheets/react)

That’s all.

Be sure to bookmark this, and if you found this article helpful, please share it with someone you know!
Just getting started.
Published: 2023-03-26 02:35:43

Hey,
My name is Patrick and I'm new to this realm of technology.
I've never written my first script but I'm taking a course that will teach me everything I need to know. I'm excited, honestly. The course hasn't started yet but I've already learned many things. I've read a few posts going over the definitions of terms like HTML and GUI. I've always been face to face with these elements of the computer and the web but being able to have context behind what they represent is an eye opener.
One of the more interesting facts that I've learned has to be Linux being the primary Operating System for servers. Apparently 96% of servers are using this OS to get the job done, that's really cool! I've been curious about how servers operate and have never seen or used Linux as an operating system so I'm curious on how to engage with it. I read that it's very flexible in terms of customization, so it's understandable why user's would find it to be useful!
I can't wait to discover more!
Deploy React.js application on Render
Tags: react, github
Published: 2023-03-26 02:30:33

React.js is a popular JavaScript library for building user interfaces, and Render is a cloud platform for deploying and managing applications.

In this article, I will show you the steps required to deploy a React.js application on Render.

**Step 1: Create a Render Account.**
- First, you will need to create an account on Render.
- You can sign up for a free account at [Render](https://render.com/signup).
- Once you have signed up, you will be taken to the Render dashboard.

**Step 2: Create a New Web Service.**
- To deploy a React.js application on Render, you will need to create a new web service.
- Click on the “New Web Service” button on the Render dashboard, and then select “Static Site” from the list of options.

**Step 3: Connect to Your GitHub Repository.**
- Next, you will need to connect your GitHub repository to your Render account.
- This will allow you to deploy your React.js application directly from your GitHub repository.
- To do this, select “GitHub” as the deployment method, and then select the repository and branch that you want to deploy.

**Step 4: Configure the Build Settings.**
- After you have connected your GitHub repository, you will need to configure the build settings for your React.js application.
- Render supports a wide range of build tools and frameworks, including Create React App.
- If you are using Create React App, you can simply enter “npm run build” as the build command, and “build” as the build directory.

**Step 5: Deploy Your React.js Application.**
- Once you have configured the build settings, you can deploy your React.js application by clicking on the “Create Web Service” button.
- Render will automatically build and deploy your application, and you can then access it by clicking on the URL provided on the Render dashboard.

**In conclusion**, deploying a React.js application on Render is a straightforward process that can be completed in just a few simple steps.
By following the steps outlined in this article, you can quickly and easily deploy your React.js application on Render and take advantage of its powerful cloud hosting and management features.

You can find & contact me on [LinkedIn](https://www.linkedin.com/in/ahmed0saber/), [GitHub](https://github.com/ahmed0saber), and [Facebook](https://www.facebook.com/profile.php?id=100004875915808), and here is [my portfolio](https://ahmed0saber.onrender.com/) for more details about me.