teleren/devto huggingface dataset:
Day 2.3: AWS IAM Security Best Practices
Tags: aws, iam, beginners, cloudpractitioner
Published: 2024-01-09 19:34:43

>_**<u>To help secure your AWS resources, follow these best practices for AWS Identity and Access Management (IAM)</u>**_


|**<u>!.Requires Federation for human users:</u>** 
|--|
|Enable human users to access aws using temporary credentials obtained through federation with an identity provider.
|**<u>2.Use temporary Credentials with IAM roles:</u>**
|Ensure workloads utilize temporary credentials obtained through IAM roles to access AWS resources.
|**<u>3.Implement MFA(Multifactor authentication)</u>**
|Apply the use of MFA to add an extra layer of security for user authentication.
|**<u>4.Update Access keys when needed:</u>**
|Regularly refresh access keys, especially for use cases requiring long-term credentials, to minimize security risks.
|**<u>5.Secure Root user credentials:</u>**
|Follow best practices to protect the credentials of the root user, including enabling MFA for the root account.
|**<u>6.Apply Least-Privilege Permissions:</u>**
|Grant users and processes the minimum permissions necessary to perform their tasks, reducing the risk of misuse.
|**<u>7.Start with AWS Managed Policies:</u>**
|Begin with AWS managed policies and progressively move towards implementing least-privilege permissions.
|**<u>8.Utilize IAM Access Analyzer:</u>**
|Utilize IAM Access Analyzer to generate least-privilege policies based on access activity and ensure secure permissions.
|**<u>9.Regularly review and remove unused resources:</u>**
|Conduct regular reviews to identify and remove unused users, roles, permissions, policies and credentials.
|**<u>10.Use conditions in IAM Policies:</u>**
|Improve access control by incorporating conditions in IAM policies to further restrict user access.
|**<u>11.Verify public and cross-account access:</u>**
|Use IAM Access Analyzer to validate public and cross-account access to resources, ensuring security and compliance.
|**<u>12.Establish permissions guardrails:</u>**
|Implement security policies across multiple AWS accounts to enforce consistent access controls.
|**<u>13.Delegate permissions boundaries:</u>**
|Manage permissions within an account by setting up defined boundaries.|



>_**By following these IAM best practices, you can greatly strengthen the security of your AWS environment, ensuring both secure and efficient access to resources.**_
Let's make a curry!
Tags: javascript, webdev, beginners
Published: 2024-01-09 19:32:41

> Currying is a technique in JavaScript that allows you to transform functions with multiple arguments into a sequence of functions, each taking one argument at a time. That is from `f(a, b, c)` to `f(a)(b)(c)`.

This might sound overwhelming at first but should be very easy to understand with an example.

Suppose we want to multiply 2 numbers together. Assuming it is not straight forward, we can declare a function called `multiply` as

```
function multiply(num1, num2) {
    // pseudo complex logic
    return num1 * num2;
}
```

**But what if we want to generate variants which can either double or triple or quadruple a number?**

One option could be to simply define each variant separately as

```
function double(num1) {
    return multiply(2, num1);
}
```

Or we can be clever and use currying here

```
const generateMultiplier = function(multiplier) {
    return function multiply(num) {
        return multiplier * num;
    }
}
```

This would give us the power to generate variants as we like


```
const double = generateMultiplier(2);

const result = double(2); // returns 4

```

Best of coding!
Privacy and GDPR Compliance in Custom Software Development
Tags: webdev, softwaredevelopment, customsoftwaredevelopment
Published: 2024-01-09 19:13:34

The article emphasizes the critical importance of incorporating privacy and data protection measures at every stage of custom software development, particularly in light of the General Data Protection Regulation (GDPR) introduced in 2018. The GDPR imposes strict standards for data protection, and non-compliance can lead to substantial fines and damage to an organization's reputation.

The comprehensive guide outlines key steps for integrating data privacy into the software development life cycle:

Requirements Analysis Stage:

Conduct a Privacy Impact Assessment (PIA) to identify potential risks and establish necessary controls.
Emphasize data minimization, anonymization, accuracy, and access control.

**Design Phase:**

- Implement "privacy by design" principles, integrating data protection into architectural and technological choices.
- Incorporate encryption methods, safeguarded APIs, and access control systems.
- Prioritize transparency by openly communicating data collection and usage to users.

**Coding Stage:**

- Maintain a focus on secure coding practices to prevent vulnerabilities.
- Emphasize input validation, output encoding, secure error handling, and the principle of least privilege.

**Testing for Privacy and Data Security:**

- Conduct thorough privacy and data security testing, including both automated tools and manual penetration testing.
- Ensure the robustness of software defenses against potential threats.

**Deployment and Maintenance:**

- Vigilantly monitor and audit software for weaknesses and vulnerabilities post-deployment.
- Implement timely updates and patches to strengthen software against new threats.
- Swiftly respond to and investigate any data breaches, with a commitment to transparency.
- Foster a culture of constant vigilance, open communication, and commitment to privacy within the organization.

**Training and Documentation:**

- Engage in regular training sessions for developers on GDPR requirements and secure coding practices.
- Emphasize the critical role each individual plays in safeguarding data.
- Maintain comprehensive documentation as evidence of GDPR compliance efforts.

The article concludes by highlighting that GDPR compliance is not just about processes but also about fostering a culture of privacy. It encourages organizations to invest in training and documentation to ensure ongoing commitment to the highest standards of data protection. 

We follow these principles at [Schnell Solutions Limited](https://www.bespokesoftwaredevelopment.com), a London-based software development company specialising in [custom software development services](https://www.bespokesoftwaredevelopment.com/custom-software-development).
I built a SaaS boilerplate for NextJS and Supabase
Tags: nextjs, supabase, saas, webdev
Published: 2024-01-09 19:11:06

Hey Developers!

To build a SaaS, you need to make a lot of components work together: Backend, Frontend, Payments, and more.

This year I learned NextJS and Supabase from scratch. These are amazing techs that helped me build five side-projects myself in one year having a full-time job.

Recently I created a SaaS boilerplate based on NexJS and Supabase, which has everything one needs to create a full-stack web app: Database, Auth, Storage, Stripe payments (one-time and subscriptions), OpenAI AI connection, Design elements, Landing Page template, Email APIs.

[https://supalaunch.com/](https://supalaunch.com/)

I hope it can help you launch your next project faster.

Some projects that are built with Supalaunch:

- [QuickSEO](https://quickseo.io/)
- [CoolGPTs](https://coolgpts.ai/)
🐱‍👤Leveraging MathJax in React.js with CDN✨
Published: 2024-01-09 18:58:02


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yb8qqjb6y22uv8lmo9gc.png)
## Introduction:
MathJax is a JavaScript display engine for mathematics that works in all browsers. Integrating MathJax into a React.js application can be a game-changer for projects that involve mathematical expressions, equations, or any kind of mathematical notation. MathJax, a powerful JavaScript library, makes it easy to display mathematical content beautifully on the web. In this blog post, we'll explore how to seamlessly incorporate MathJax into your React.js application using a CDN (Content Delivery Network).

## step 1: Install MathJax using CDN
In your _public/index.html_ file, add the MathJax CDN link in the _head_ section:

```
 <script type="text/javascript" async
      src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
    <script id="MathJax-script" async
      src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
    </script>
```

## step 2: Create a Component for MathJax Rendering
In your _src/components/MathJaxComponent.js:_

```
import React, { useEffect } from 'react';

const MathJaxComponent = ({ mathExpression }) => {
  useEffect(() => {
    window.MathJax.typeset();
  }, [mathExpression]);

  return (
    <div>
      {mathExpression && (
        <span
          dangerouslySetInnerHTML={{ __html: mathExpression }}
        />
      )}
    </div>
  );
};

export default MathJaxComponent;

```

## Step 3: Use the MathJax Component in Your App
```
function App() {
  const mathExpression = '\\[x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.\\]'; // Replace with your mathematical expression

  return (
    <div className="App">
      <h1>MathJax in React.js</h1>
      <MathJaxComponent mathExpression={mathExpression} />
    </div>
  );
}
```

### Output

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

## Conclusion:
By following these steps, you can seamlessly integrate MathJax into your React.js application using a CDN. Whether you're building an educational platform, a scientific tool, or any other project involving mathematical content, MathJax will elevate the quality and accessibility of your mathematical expressions on the web. Happy coding!
Create Engaging Instagram Stories for Free using AI Technology
Published: 2024-01-09 18:53:41

Simplified's Free [AI Instagram Story Maker](https://simplified.com/create/instagram-stories) is the ultimate solution for anyone looking to create engaging and visually stunning stories without any design experience. Powered by advanced AI algorithms, this tool makes it easy to design captivating visuals that will captivate your audience and boost your social media presence.Take your Instagram game to the next level with Simplified's Free [AI Instagram Story Maker](https://simplified.com/create/instagram-stories). This powerful tool allows you to design professional-quality stories that will make your brand shine. Whether you're promoting a product, sharing a behind-the-scenes moment, or showcasing your creativity, this AI-powered tool has got you covered.
CSS: Selector vs declaration duplication dilemma
Tags: webdev, frontend, css, codequality
Published: 2024-01-09 18:50:14

If you used CSS analyzer tools e.g. [CSS Analyzer by Project Wallace](https://www.projectwallace.com/analyze-css) you may have noticed the relation between selector duplication and declaration duplication.

Let's say we want to apply a `padding` of `1rem` to three different selectors then we have multiple choices:

Choice one: **Repeat the declaration for all selectors**

```css
.selector1 {
  /* other declarations */
  padding: 1rem;
}

.selector2 {
  /* other declarations */
  padding: 1rem;
}

.selector3 {
  padding: 1rem;
  /* other declarations */
}
```
Result: Higher declaration duplication score and higher declarations per ruleset.

Choice two: **Combine selectors that share the same declaration**
```css
.selector1,
.selector2,
.selector3 {
  padding: 1rem;
}

.selector1 {
  /* other declarations */
}

.selector2 {
  /* other declarations */
}

.selector3 {
  /* other declarations */
}
```
Result: lower declaration duplication but higher selector duplication.

Choice three: **Using of utility classes**

```css
.padding-1rem {
  padding: 1rem;
}

.selector1 {
  /* other declarations */
}

.selector2 {
  /* other declarations */
}

.selector3 {
  /* other declarations */
}
```
Result: lower score of both selector and declaration duplications but it violates the Separation of concerns concept and we end up with markup like this:

```html
<p class="padding-1rem margin-0 text-bold text-center etc">...</p>
```
which is not really good for maintainability.
So, as an experienced developer how you deal with this dilemma?
NeoGPT contributions continued...
Tags: gpt3, opensource, python, ai
Published: 2024-01-09 18:43:55

I have made good progress in my contribution pans for the NeoGPT  project as discussed in my previous post [“Escalating NeoGPT contribution”] (https://dev.to/bseefieldt/escalating-neogpt-contribution-o14). I was able to work through my first goal of adding command line switches for the export functionality in my most recent [Pull Request](https://github.com/neokd/NeoGPT/pull/122) which was successfully merged into the main branch of the project.  

This PR also included some enhancements to the original export_config() function which I created, that provides some level of sanitization of the optional filename parameters which the user can provide along with the `--export` argument.  Essentially, if a string ( representing the config filename) is provided by the user (overriding the default config filename to be written) then the export function forces a .yaml file format. In addition, it enforces some checks to provide a new filename if the provided filename is attempting to overwrite an existing config file of the same name. These changes were all wrapped into the now merged PR.
  
In reviewing my export configuration process, the project author was able to extrapolate much of the functionality and transpose it to the load configuration process, which was my planned next step.  As they have provided the initial framework for the load_config() function I set out to create, I am now going through it to add some similar validation enhancements to those discussed above, as well as to test the functionality and provide any necessary debugging.

As much of the intended scope initially laid out is near completion, I have discussed with the project author, implementing some unit test suites for the functionality I have introduced, to be included in the ongoing contribution QA process, and for future inclusion in the introduction of some CI/CD workflows into the project.  I will continue to update on the process as I introduce unit tests into my previous work.
Devops learning complete guide(5)
Published: 2024-01-09 18:34:23

# Creating an id in aws and configuring with cli 

[Create an aws account->](https://dev.to/aws-builders/create-a-free-aws-account-and-configure-the-aws-cli-1khf)

Connecting to AWS (Amazon Web Services) from a Linux terminal typically involves using the SSH (Secure Shell) protocol. Here are the general steps to connect to an AWS instance from your Linux terminal:

Prerequisites:
AWS Account:

Make sure you have an AWS account and the necessary permissions to access EC2 instances.
Key Pair:

When you launch an EC2 instance, you will need to specify a key pair. Download and save the private key file (.pem) securely on your local machine.


Steps:
Open Terminal:

Open your Linux terminal on your local machine.
Navigate to the Directory:

Move to the directory where you saved your private key file using the cd command.


`cd /path/to/your/keypair/`

Change Key File Permissions:
Set the correct permissions for your private key file.

`chmod 400 your-key-pair.pem`

Connect using SSH:

Use the ssh command to connect to your AWS instance. Replace your-instance-ip with the actual public IP address or DNS name of your AWS instance and your-key-pair.pem with the name of your private key file.

`ssh -i your-key-pair.pem ec2-user@your-instance-ip`

If your instance uses a different username (e.g., ubuntu for Ubuntu instances), replace ec2-user with the appropriate username.

Confirm Connection:
If prompted to confirm the connection, type "yes" and press Enter.
Connected to AWS Instance:

You should now be connected to your AWS instance via the Linux terminal.

Successfully changed 
`[ec2-user@ip-xxx-xx-xx-xxx ~]$`

[AWS Ec2](https://dev.to/surajvast/devops-learning-complete-guide5-33h4)
Call for Speakers for the 2024 Carolina Code Conference is open until April 15th
Tags: polyglot, conference, programming, security
Published: 2024-01-09 18:32:16

A polyglot conference for all who code!

Just wanted to drop by and let everyone know that our Call for Speakers has opened for 2024. We're growing this year, doubling from 150 to 300 attendees and a 2 day event in beautiful Greenville, SC. 

[2024 Call for Speakers](https://blog.carolina.codes/p/happy-new-year-call-for-speakers)

If you'd like a look at our speakers from last year, we had a solid line up headlined by keynotes from Charles Nutter (jRuby) and Bruce Tate (7 Languages in 7 Weeks, active with Elixir) for a total of 15 speakers on a single track. 

[Full List of 2023 Speakers and links to video](https://blog.carolina.codes/p/announcing-our-2023-speakers)

We utilize a staggered schedule throughout the day with alternating 30 minute (moderate) and 10 minute (lightning) talks between keynotes to showcase a variety of topics to the audience while keeping everyone engaged. We're committed to maintaining the single track to ensure that our speakers have the entire audience available. There's nothing worse than being selected for a conference and then ending up in a room where nobody shows up to your talk.

All talks are professionally recorded and published.

Please let me know if you have any questions. It's an excellent opportunity to showcase your favorite language or technology to a broad audience.
8 Years, 8 Lessons: My Tech Odyssey
Tags: softwaredevelopment, career, learning
Published: 2024-01-09 18:20:25

In my 8 years of navigating the tech industry, I have embarked on a remarkable journey filled with valuable lessons. From countless challenges to significant achievements, here are the 8 lessons I've learned during my tech odyssey:

1️⃣ Embrace Continuous Learning: The tech landscape is ever-evolving, and it's crucial to stay updated with the latest trends, tools, and technologies. Continuous learning ensures growth and adaptability.

![Engineer Learning](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7crigtes4q5a4axf1sku.png)


2️⃣ Emphasize Problem-Solving: Don't try to label yourself like a Frontend Engineer or Backend Engineer. Tech professionals are problem solvers at their core. Focusing on finding innovative solutions and approaching challenges with a problem-solving mindset is key to success.

![Problem Solving](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qqrro752dooy1ggm9qj.png)



3️⃣ Cultivate Resilience: The tech industry can be demanding and fast-paced. Building resilience allows you to bounce back from setbacks, adapt to change, and persevere in the face of obstacles.

![Resilience](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3eixayo6o6jv8v2x9kt.png)



4️⃣ Prioritize Collaboration: Collaboration is essential in the tech world. Working effectively with teammates, stakeholders, and cross-functional teams fosters creativity, innovation, and successful project outcomes.

![Team work](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zlmmi6d3cr8rhavbkh9b.png)


5️⃣ User-Centric Mindset: Technology exists to serve users and solve their problems. Adopting a user-centric mindset ensures that the solutions we create are valuable, usable, and delightful for the end-users.


6️⃣ Be Mindful of Your Time: Avoid mindlessly scrolling on social media and consume meaningful content. Instead of watching Instagram or YouTube, consider reading a book or some blog.

![Mindful](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vp97ocm3w0rwmkdq1r69.png)




7️⃣ Communicate Effectively: Clear and concise communication is vital in the tech industry. Whether it's explaining complex concepts to non-technical stakeholders or collaborating with team members, effective communication fosters understanding and alignment.

![Communicate](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tpg3q4pbsuftnpwdu815.png)




8️⃣ Foster Work-Life Balance: Building a sustainable career in tech requires maintaining a healthy work-life balance. Prioritizing self-care, setting boundaries, and finding time for personal interests and relationships is crucial for long-term success and well-being.

![Work Life](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kfu8rzo01fzl959g39dk.png)



These 8 lessons have shaped my tech odyssey and continue to guide my journey towards further growth and success in the ever-evolving world of technology.
Chaining Prompts
Tags: ai, openai, python, promptengineering
Published: 2024-01-09 18:19:57


![Prompts Chaining](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r3727lctygh85avg2dbb.jpeg)


_**Chaining Prompts**_ ?

- Chaining prompts refers to the practice of connecting a series of prompts in a conversation or interaction, where each subsequent prompt builds upon the previous one. This technique is employed to guide the conversation in a specific direction, allowing for a more coherent exploration of a topic or the elicitation of more detailed information from the user. Chaining prompts can create a structured and meaningful dialogue, fostering a deeper understanding of the subject at hand.

_**Example**_ :

- Prompt 1: Share your favorite type of music.
User Response 1: I really enjoy listening to classical music.

- Prompt 2 (chained): That's interesting! What specifically do you like about classical music, and do you have a favorite composer or piece?
User Response 2: I love the soothing melodies and intricate compositions. My favorite composer is Mozart, especially his Symphony No. 40.

- In this example, the second prompt is directly related to the user’s initial response about their favorite type of music. The chaining of prompts encourages the user to provide more details about their preferences, leading to a more in-depth conversation.

_**Follow up**_:
- Here is the interesting discussion in the article below.

![About Chaining Prompts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlku31aul64ax87lig9w.jpeg)


- Medium Article Link:
[Chaining Prompts](https://medium.com/@naqvishahwar120/chaining-prompts-316d51a30800)

- My LinkedIn:
[My LinkedIn](https://www.linkedin.com/posts/activity-7150513901225361408-dekJ?utm_source=share&utm_medium=member_ios)

hhh<u></u>