teleren/devto huggingface dataset:
Generative AI for Everyone on AWS
Tags: chatgpt, openai, aws, ai
Published: 2023-07-25 03:45:47

---
title: Generative AI for Everyone on AWS
marp: true
paginate: true
theme: uncover
header: Generative AI for Everyone on AWS
footer: By Manjunatha Sai Uppu
backgroundColor: #088F8F
backgroundImage:
backgroundPosition: left
backgroundRepeat:
backgroundSize:
color: black
---

**Vote of Thanks**
Thanks to Ayyanar Jeyakrishnan for provididing this content at The Meetup

---

**Path to GenAI**

we came from descriptive analytics and then to predictive analytics and thne to word embeddings
and then we have generative ai now.

---

**Let's Understand Basics**
A word is tokenized first and then embedded as a vector and then we can apply the alogrithms that we want to apply like semantic search or clustering.

---

Foundation Models that are available on AWS Sagemaker to jumpstart for self managed access.

### Publicaly available

- Stability AI
- Alexa
- HuggingFace Models

---

### Properitary Models

- Co:here
- Lighten
- A121 Labs

---

**Generative AI on AWS**

- AWS Bedrock
- Amazon EC2 Trn1n and Amazon EC2 inf2
- Amazon Code whisperer

---

**Amazon Bedrock Foundation Models**

- AI21 labs - (Jurassic-2)
- ANTHROPIC - (Claude)
- Stability AI - (stable diffusion)
- Amazon - (Amazon Titan)

---

on **AWS** we can try connecting with LLM by going through the **Sagemaker foundation model - playground console**

---

Things we can do by prompting and only using LLM

1. Text Generation
2. Summarization
3. Translation
4. Code Generation
5. Question and Answering

---

Choice of Choosing LLM should depend on these four things

1. Quality
2. Cost
3. Latency
4. Customization

---

**Prompting Tricks**

1. **Zero shot Prompting** - Decribing task that LLM needs to do without providing any examples

2. **One Shot Prompting** - Describing Task that LLM Needs to do along with one example

3. **Few Shot Prompting** - Describing Task along with Some examples to rely on

**Note:** Few shot **>** one shot **>** zero shot prompting

---

Challenges that we have while adapting LLM's to Enterprises

- Pretraining Model from scratch
- Data Privacy and Security and Ethics
- Model Interpretability and hallucination
- Fine Tuning and Customization
- Continual Model Improvement and Integration.

---

<img src="https://image.slidesharecdn.com/awsmeetupblrjuly22social-230724111823-412f5fa6/75/awsmeetupblrjuly22socialpdf-45-2048.jpg?cb=1690197896"  width="100%" height="100%" >

---

<img src="https://image.slidesharecdn.com/awsmeetupblrjuly22social-230724111823-412f5fa6/75/awsmeetupblrjuly22socialpdf-52-2048.jpg?cb=1690197896"  width="100%" height="100%" >
Magento 1 — Como criar um atributo personalizado na página do produto?
Tags: magento, magento1, tutorial, frontend
Published: 2023-07-25 05:29:29

O **Magento** oferece a opção de criar atributos personalizados nos produtos.

**Mas o que é isto?**
É alguma informação extra que você precisa por no seu produto e que não vem, por padrão, no Magento.
Por exemplo, um produto elétrico no qual você precisa exibir as informações de voltagem, amperagem, watts, etc…

---

**Quando que vou usar?**
Além de usar para definir as características isoladas de um produto não padrão, você pode criar atributos para usar em selos (frete grátis, extras).

Também para definir a quantidade de parcelas em que o produto pode ser pago.

Se utilizar a criatividade você encontrar uma série de outras vantagem desse recurso.
___

### Como fazer um atributo personalizado no produto?

Pelo admin acessar o menu:
_Catálogo > Atributos > Gerenciar Atributos
Catalog > Attributes > Manage Attributes_

Depois associar seu atributo criado no grupo de atributos

_Catálogo > Atributos > Gerenciar Grupo de Atributos
Catalog > Attributes > Manage Attribute Sets_

Quais são os tipos de atributo que posso criar?

Campo de text | _Text Field_
Área de texto | _Text Area_
Data | _Date_
Sim/Não | _Yes/No_
Múltiplas Seleções | _Multiple Select_
Selecionar (select) | _Dropdown_
Preço | _Price_
Imagem | _Media Image_
Taxa Adicional | _Fixed Product Tax_

> Materiais para estudar (em inglês):
> [How do Attributes work in Magento?](http://www.magentocommerce.com/knowledge-base/entry/how-do-attributes-work-in-magento)
>
>[Magento — Knowledge Base — Tutorial: Creating Attributes (custom fields)](http://www.magentocommerce.com/knowledge-base/entry/tutorial-creating-attributes-custom-fields)
>
>[Magento — Wiki — ADMIN: Catalog → Attributes → Manage Attributes](http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/catalog_product_attribute/index)

Chega de historinha!!!

### Quero saber como faço para exibir estes dados no lugar que eu desejar!!!
_Lembre-se que a variável que recebe a instância do produto pode ter nome diferente dependendo do módulo que você está._
___

#### Você gostou deste texto?
Compartilhe ele para que mais pessoas possam ler!
E me siga para ler mais conteúdo como este. ☻
<!-- Veja mais em nosso artigo. Clique aqui! -->
Multi-Cloud Security Auditing Tool
Tags: 100daystooffload, aws, security, tooling
Published: 2023-07-25 05:18:03

This is an easy to use tool to audit your cloud environment, [Scout Suite](https://github.com/nccgroup/ScoutSuite), from [nccgroup](https://www.nccgroup.com). It has support for several cloud providers, but I have only tried it with AWS.

The tool is written in python and is started from the terminal like this:

```sh
# requires that the profile audit has been configured
python scout.py aws --profile audit
```

When running the program it will give feedback in the console and finally produce a HTML report when it's done.

This is also nice:
> Use of Scout Suite does not require AWS users to complete and submit the AWS Vulnerability / Penetration Testing Request Form. Scout Suite only performs API calls to fetch configuration data and identify security gaps, which is not considered security scanning as it does not impact AWS' network and applications.

Checkout their [wiki](https://github.com/nccgroup/ScoutSuite/wiki/Amazon-Web-Services) page to see how to use it with AWS. Don't miss the [minimal privileges policy](https://github.com/nccgroup/ScoutSuite/wiki/AWS-Minimal-Privileges-Policy) they have defined which is great to apply on the account that is used when running the tool.
Magento 1 - Atributos personalizados nos Top Links utilizando XML
Tags: magento, magento1, tutorial, frontend
Published: 2023-07-25 05:02:45

E ai, Devs!
A dica que darei a vocês é como colocar atributos personalizados para um link que pertence ao bloco Top Links.
## Índice
        * [Por que isto parece uma tarefa difícil?](#chapter-1)
        * [liparams](#liparams)
        * [aparams](#aparams)
---

## Por que isto parece uma tarefa difícil?
Porque os links são inseridos através do layout.xml, então o HTML é renderizado pela aplicação do Magento, parecendo ficar difícil inserir outros atributos das tags `<li>` e `<a>`, como por exemplo: class ou id.

Digamos que você tem um menu de acesso rápido com os seguintes links:

- Entrar
- Cadastre-se
- Minha Conta
- Meu Carrinho

E no design da loja que você está montando o link "_Cadastre-se_" tem um estilo completamente diferente dos outros links.
Iria ser fácil aplicar um estilo se este link fosse o primeiro ou o último da lista, pois além dos pseudo-seletores do CSS (:first-child e :last-child) o Magento põe, por padrão, uma classe first e last nesse tipo de lista.
Mas o layout foi desenhado com o link lá no meio e o cliente quer que seja assim.

Então vamos lá:
No customer.xml você tem a seguinte instrução:

```
<customer_logged_out>
    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer">
            <label>Log In</label>
            <url helper="customer/getLoginUrl"/>
            <title>Log In</title>
            <prepare/>
            <urlParams/>
            <position>1</position>
        </action>
 
        <action method="addLink" module="customer">
            <label>Cadastre-se</label>
            <url helper="customer/getRegisterUrl"/>
            <title>Cadastre-se</title>
            <prepare/>
            <urlParams/>
            <position>2</position>
        </action>
    </reference>
</customer_logged_out>
```
### liparams <a name="liparams"></a>
Com a tag `<liparams>` você pode por o atributo que precisar na sua tag. Como no exemplo, colocando uma class:

```
<action method="addLink" module="customer">
    <label>Cadastre-se</label>
    <url helper="customer/getRegisterUrl"/>
    <title>Cadastre-se</title>
    <prepare/>
    <urlParams/>
    <position>2</position>
    <liParams>class="cadastro"</liParams>
</action>
```
### aparams <a name="aparams"></a>
Para colocar um atributo na tag `<a>` que está dentro da `<li>` você pode usar a tag xml: `<aparams>`
```
<action method="addLink" module="customer">
    <label>Cadastre-se</label>
    <url helper="customer/getRegisterUrl"/>
    <title>Cadastre-se</title>
    <prepare/>
    <urlParams/>
    <position>2</position>
    <liParams>class="cadastro"</liParams>
    <aParams>rel="subsection"</aParams>
</action>
```
Basicamente é isto, qualquer dúvida deixe um comentário!
___
#### Você gostou deste texto?
Compartilhe ele para que mais pessoas possam ler!
E me siga para ler mais conteúdo como este. ☻
Ubuntu 22.04 NEXUS OSS Kurulumu
Tags: linux, opensource, tutorial, beginners
Published: 2023-07-25 04:51:42

OpenJDK paketini sistemimize kuralım

``` bash
sudo apt install openjdk-8-jdk

```
Sonrasında kurulum dosyasını indirelim.
``` bash
wget https://download.sonatype.com/nexus/3/latest-unix.tar.gz
```
Aşağıdaki komutla tar.gz dosaysından çıkrtalım
``` bash
tar -xf latest-unix.tar.gz

sudo mv nexus-* /opt/nexus

```

Servis dosyasını oluşturalım
``` bash
sudo nano /etc/systemd/system/nexus.service
```

Servis dosyasını aşağıdaki gibi düzenleyip kayıt edelim.
```
[Unit]
Description=Nexus Repository Manager
After=network.target

[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus
Restart=on-abort


[Install]
WantedBy=multi-user.target

```

Aşağıdaki script ile gerekli klasörü ve kullanıcıyı oluşturup, yetkilerini verelim.

``` bash
mkdir /opt/sonatype-work

sudo adduser --disabled-login nexus
sudo chown -R nexus:nexus /opt/nexus
sudo chown -R nexus:nexus /opt/sonatype-work
```

Servisi başlatalım ve reboot sonrası yeniden başlayacak şekilde ayarlayalım.

``` bash
sudo systemctl start nexus
sudo systemctl enable nexus
```

Arayüzün yüklenmesini bir süre bekledikten sonra

http://localhost:8081 adresinden uygulamanın web arayüzüne erişebilirsiniz

Parola bilgisini aşağıdaki komut ile kontrol edebilirsiniz

``` bash
cat /opt/sonatype-work/nexus3/admin.password
```
Placeholder title
Tags: refinehackathon
Published: 2023-07-25 04:43:52

## What I built 

### Category Submission: 

### App Link

### Screenshots 

### Description 

### Link to Source Code 

### Permissive License 

## Background (What made you decide to build this particular app? What inspired you?) 

### How I built it (How did you utilize refine? Did you learn something new along the way? Pick up a new skill?) 

### Additional Resources/Info
Udacity FREE Courses
Tags: programming, sql, datascience, machinelearning
Published: 2023-07-25 04:42:25

In today's digital age, learning has changed a lot. Online learning platforms have made education available to everyone, no matter where they are. One amazing platform for learning is Udacity. They offer free courses that can help people gain new skills and knowledge. In this blog, we'll explore Udacity's free courses

### Udacity's FREE Courses List

1. **[Machine Learning by Georgia Tech](https://imp.i115008.net/P22jX)**
2. **[Introduction to Machine Learning Course](https://imp.i115008.net/e4Kbng)**
3. **[Intro to Artificial Intelligence](https://imp.i115008.net/1aa5R)**
4. **[Artificial Intelligence for Robotics](https://imp.i115008.net/ynnyW)**
5. **[What is Programming?](https://imp.i115008.net/a1ZxeM)**
6. **[Intro to HTML and CSS](https://imp.i115008.net/jW4Ezb)**
7. **[Introduction to Computer Vision](https://imp.i115008.net/ZdQRX0)**
8. **[Intro to Data Science](https://imp.i115008.net/YgDJnr)**
9. **[SQL for Data Analysis](https://imp.i115008.net/4e59RM)**
10. **[Data Wrangling with MongoDB](https://imp.i115008.net/2rkAMA)**

---


> **For more FREE Udacity Courses, Check👉 [200 Udacity FREE Courses](https://www.mltut.com/udacity-free-courses-on-machine-learning/)**

Happy Learning!
Troubleshooting due to K8s certificate expiration.
Tags: kubernetes, azure, cicd
Published: 2023-07-25 04:14:46

**Problem 1: **
**Unable to connect to the server: tls: failed to verify certificate: x509: certificate has expired or is not yet valid.**

When you try to access the K8s resources, this error message appears, which means your certificate has expired. Then you have to renew your certificate.
You can renew your certificates manually at any time with the kubeadm certs renew command, with the appropriate command line options.
This command performs the renewal using CA (or front-proxy-CA) certificate and key stored in `/etc/kubernetes/pki`.
After running the command you should restart the control plane Pods. 

`kubeadm certs renew` can renew any specific certificate or, with the subcommand all, it can renew all of them, as shown below:

`kubeadm certs renew all`



****Problem 2: **
error: You must be logged in to the server (the server has asked for the client to provide credentials
or
The connection to the server localhost:8080 was refused - did you specify the right host or port?**

Though your certificate has renewed but you are still getting the error but this time logged in error or port 8080 was refused. 

Solution:
Clusters built with kubeadm often copy the admin.conf certificate into `$HOME/.kube/config`, as instructed in Creating a cluster with kubeadm. On such a system, to update the contents of `$HOME/.kube/config` after renewing the admin.conf you must run the following commands:

`sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config`


If you have multiple users, then for each user, you have to update the `$HOME/.kube/config` file.
If you want to access from bastion host, you have to configure accordingly.
 
**Problem 3:
Azure DevOps Pipelines is facing similar problem.**
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zuked8s6z5y1odzy6w95.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jrzmmxfsm9see2gaarth.png)



   

Solutions: 
After renewing the certificate, you have to update the K8s end point. 

Step 1: Create new k8s end point 

From the Service connections -> New service connection -> Choose a service or connection type -> Kubernetes -> then select KubeConfig 
Configure the KubeConfig and other fields. Then verify and save.  
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uka5ex2764ydbqmfp8mk.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2gviqc38dzy3wnuv3cgp.png)


 	 

Step 2: 
Update the K8s end point from the drop down menu.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z28rcu0x3rbn560xvqxd.png)



Now create the new release and run it. Hopefully it will successfully run. 


**Conclusion:** 
Client certificates generated by kubeadm expire after 1 year. This document explains how to manage certificate renewals with kubeadm. It also covers Azure DevOps Pipelines K8s end point creation and updating.  Hope it will help you.
Revolutionizing Web Rendering with Angular Hydration for Superior User Experiences in Angular 16
Tags: angular16, hydration, seo, ssr
Published: 2023-07-25 03:53:07

Angular 16 introduces non-destructive hydration, revolutionizing Angular SSR with awaited improvements.

The Angular team prioritizes enhancing Server Side Rendering in 2023, aiming to improve Core Web Vitals scores, SEO performance, and eliminate 'flicker' in Angular Universal applications. They consider non-destructive hydration as a crucial step towards their future vision.

## Issue with classic SSR (Destructive Hydration) 
If you’ve ever used an Angular Universal application you may have come across the ‘flicker’:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yezdoja1kl7i4ze0d88.gif)
Angular Universal’s ‘flicker’ effect when using destructive hydration

This flicker occurs because Angular Universal uses destructive hydration by default. When an Angular application is Server Side Rendered, a static HTML file is immediately sent to the client on page load. This provides a faster First Contentful Paint than traditional SPAs because template is displayed before application code is downloaded.

With destructive hydration, as soon as the client code is bootstrapped it blows away the server-rendered DOM and replaces it with client-rendered DOM. That’s what causes the flicker.

## Non-Destructive Hydration

This technique will allow us to reuse the server-side rendered DOM and rather than rerendering it only attach event listeners and create data structures required by the Angular runtime.


## How do you enable hydration in Angular

Once you have SSR working with your application, you can enable hydration by visiting your main app component or module and importing provideClientHydration from @angular/platform-browser. You'll then add that provider to your app's bootstrapping providers list.

```
import {
  bootstrapApplication,
  provideClientHydration,
} from '@angular/platform-browser';
...

bootstrapApplication(RootCmp, {
  providers: [provideClientHydration()]
});
```

Alternatively if you are using NgModules, you would add provideClientHydration to your root app module's provider list.

```
import {provideClientHydration} from '@angular/platform-browser';
import {NgModule} from '@angular/core';

@NgModule({
declarations: [RootCmp],
exports: [RootCmp],
bootstrap: [RootCmp],
providers: [provideClientHydration()],
})
export class AppModule {}
```

New non-destructive hydration's impressive results: Lighthouse metrics of example application shown in two figures.

## Classic SSR - Destructive Hydration:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cbdpwx5jw9awa3i4xifq.png)

## SSR with Non-Destructive Hydration

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p5y5bgyk493e29b5wemi.png)
Mondrian Painting
Tags: css, grid
Published: 2023-07-25 03:18:07

Using CSS grid system to do this!

```HTML

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Mondrian Project</title>
  <style>
    body {
      margin: 0;
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh
    }
    .container {
      display: grid;
      width: 748px;
      height: 748px;
      grid-template-columns: 320px 198px 153px 50px;
      grid-template-rows: 414px 130px 155px 22px;
      gap: 9px;
      background-color: #000;
    }
    .box1{
      background-color: #E72F24;
    }
    .box2 {
      background-color: #F0F1EC;
      grid-column: span 3;
    }
    .box3 {
      background-color: #F0F1EC;
      grid-row: span 2;
    }
    .box4 {
      background-color: #F0F1EC;
      grid-column: span 2;
      grid-row: span 2;
    }
    .box5{
      background-color: #004592;
      border-bottom: 10px solid #000;
    }
    .box6{
      background-color: #F0F1EC;
      grid-row: span 2;
    }
    .box7{
      background-color: #F0F1EC;
    }
    .box8 {
      background-color: #F9D01E;
    }
    .box9{
      background-color: #232629;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <div class="box4"></div>
    <div class="box5"></div>
    <div class="box6"></div>
    <div class="box7"></div>
    <div class="box8"></div>
    <div class="box9"></div>
  </div>
</body>

</html>
```

Here is result!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhigbty2sfe5qn0pdor2.png)
From coding to IT and back to coding - My early career journey
Published: 2023-07-25 02:59:36

There is no linear path to finding what you want to do with the rest of your life. Hell, I am still only 23 years old and finally have some sort of answer to what my future looks like. I remember starting college in 2018 and being so sure that I was going to be a developer and work at Google or Microsoft, and yet now, I'm working for a company with only 3 developers. 

When I first went to college I was convinced that I would graduate with a Computer Science degree and make it big out in California. That all quickly changed when I got my first internship and realized that coding just wasn't for me. It was a boring Government job that used outdated technology and for some reason, I just assumed all developer roles would be just as bad. It didn't help that Covid had just hit and I needed a change. While retrospectively impulsive, after 6 months of that job I requested a change to become a systems engineer and changed my entire major to Information Technology.

Now, I talked to a lot of friends and family about this change before committing to it, but at the end of the day I knew I was going to make the change, I **needed** this change. For the next two years I would continue working at my IT/Cyber job while finishing up my degree. While it wasn't anything special, this job helped me realize what I like and hate about the IT world. I loved working with people and being in an in-person team environment, but I hated how repetitive the IT field is, and most importantly I realized how important good mangers are and how damaging bad mangers can be.

My final internship in college was my first real step into the private industry. I initially applied for a DevOps job, and when I got the job it actually turned out to be a front-end developer job which was an unexpected surprise. Fortunately for me, this job is where everything began to click. Turns out, I **didn't** hate coding! All of these career switches and it finally made sense; you need to care about the work you are doing, whether that is because you care about the work itself or the people you are working with.

I have now graduated and landed myself a development job in the eSports industry and I couldn't be happier. I've been competing in eSports for quite some time now and being able to have a job in an industry that I've grown so fond of has been amazing. Not only do I care about the people I work with, I also care about the product we are putting out. 

The field of work that I once ran away from has now become the place I want to stay for as long as I can. And yeah, would it have been nice if I had a computer science degree instead of an information technology degree, probably. But hey, at least now I know what I want and need from my future jobs.