teleren/devto huggingface dataset:
How to setup Meilisearch and Laravel Scout
Published: 2023-03-09 21:46:57

{% embed https://www.youtube.com/watch?v=1SExF824u_E %}

```
public function toSearchableArray()
{
  $array = $this->toArray();

  return [
'id' => $array['id'],
'title' => $array['title'],
'body'=> $array['body']
   ];
}
```

## Step 3: Import existing database records to search indexes

Laravel Scout is like a magical genie, providing us with a simple way to import records. With just one artisan command, you can quickly and easily import data into your database. Let's take a look at an example to see just how easy it is!

```
❯ php artisan scout:import "App\Models\Post"
Imported [App\Models\Post] models up to ID: 10
All [App\Models\Post] records have been imported.
```

## Step 4: Test out search

```
>>> App\Models\Post::search('Lorem')->get();
=> Illuminate\Database\Eloquent\Collection {#4219
     all: [
       App\Models\User {#4230
         id: 5,
         title: "Lorem ipsum dolor sit amet, consectetur",
         body: "...Sed ut perspiciatis unde omnis iste natus …",
       },
     ],
   }
```

## Step 5: Install Meilisearch on your server

Install Meilisearch on your server following the official documentation. Use the Quick Script feature in Cleavr to add the following script and then run it on the target server to install Meilisearch.

```
# Add Meilisearch package
echo "deb [trusted=yes] https://apt.fury.io/meilisearch/ /" | sudo tee /etc/apt/sources.list.d/fury.list

# Update APT and install Meilisearch
sudo apt update && sudo apt install meilisearch

# Launch Meilisearch
meilisearch
```

## Step 6: Add a process monitor for Meilisearch

Now, let's add a process monitor in the Server > Process Monitors section. With a process monitor, you can start Meilisearch and keep it running smoothly.


![add a new process monitor for meilisearch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r8gvvd5n058a9anc3hph.png)



Update the master key `test123@@` with the master key you'd like to use. Keep note of your master key as you'll need to add it in the next section to your environment file.

## Step 7: Update your project's environment file

Ready, set, update! It's time to make sure your project environment variables are up to date.

Head over to Deployment > Workflow > Environment and get to work. Don't forget to add the following variables and you'll be good to go.

```
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://127.0.0.1:7700
SCOUT_QUEUE=true
MEILISEARCH_KEY=test123@@
```

---

Voila! You now have Meilisearch set up and ready to serve up relevant search results in no time. Now you can impress your friends and family with your lightning-fast search capabilities!

Check out [Meilisearch documentaion](https://docs.meilisearch.com/learn/getting_started/filtering_and_sorting.html#settings) for more info on how to use Meilisearch with your project.

- [Kiran Mandal](https://www.linkedin.com/in/kiran-mandal-82bb97122/)
Welcome Thread - v215
Tags: welcome
Published: 2023-03-09 21:33:17

---
title: Welcome Thread - v215
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![A cartoon egg being cracked on surface, the yolk turns into a goofy smiling face and a hand reaches up from the egg white to wave](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zvhslf6g5nsoyqckrhii.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
Setup Redis Replica in Ubuntu/Linux
Tags: redis, replica
Published: 2023-03-09 21:30:57

---
title: Setup Redis Replica in Ubuntu/Linux
published: true
description: 
tags: redis, replica
# cover_image: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ekdv3n41lnjp3drosfuj.png)
# Use a ratio of 100:42 for best results.
# published_at: 2023-03-09 21:17 +0000
---

Redis is a powerful in-memory database that can handle a huge volume of data at high speeds. However, as your data grows, you may find that your Redis instance is struggling to keep up. This is where Redis replication comes in.

Redis replication allows you to scale your Redis database horizontally, without downtime. By configuring a replica server, you can create a copy of your master server that automatically updates itself whenever changes are made to the master. This means you can handle more read traffic and improve your database's fault tolerance.

Setting up Redis replication is easy. First, configure your master server with a password and a unique identifier. Then, create a replica server and use the replicaof command to specify the IP address and port number of the master server. Redis will handle the rest, automatically replicating data to the replica server in real-time.

With Redis replication, you can handle more traffic and keep your database running smoothly, all without downtime. So why not give it a try and see how it can improve your Redis performance?  


### setup Steps:

 1. Login to your Master Server
 
  --Run 

     nano /etc/redis/redis.conf 

  --Uncomment ‘requirepass’ and set a password like👇

      requirepass [password] 

  --restart redis

2. Login to your replica server

  --Run 

      nano /etc/redis/redis.conf

  --Uncomment ‘replicaof’, 'masterauth'  and set value like👇
    
      replicaof [master-server-private-ip] 6379  
      masterauth [master-requirepass]  

  - restart redis

  --Finally Run:

    redis-cli
    AUTH <master-requirepassword>
    info replication


 3. Verify: ```ss -antpl | grep redis```

#### Done 😃 Follow me On [Twitter](https://twitter.com/ALEMRANCU)

AL EMRAN
CTO at [Besnik](https://besnik.net)
pyaction 4.17.0 Released
Tags: github, python, docker, showdev
Published: 2023-03-09 21:27:06

## TL;DR

I just released [pyaction](https://github.com/cicirello/pyaction) 4.17.0, a [Docker container with Python, git, and the GitHub CLI](https://dev.to/cicirello/pyaction-a-docker-container-with-python-git-and-the-github-cli-930).


## Changelog 4.17.0 - 2023-03-09

### Changed
* Bumped GitHub CLI to 2.24.3.


## Current Version List

This latest release of pyaction includes:
* Python 3.11.2
* [GitHub CLI 2.24.3](https://github.com/cli/cli/releases/tag/v2.24.3)
* git 2.30.2
* curl 7.74.0
* gpg 2.2.27



## More Information

For more information, see my earlier post about pyaction here on DEV, as well as pyaction's GitHub repository.

{% link https://dev.to/cicirello/pyaction-a-docker-container-with-python-git-and-the-github-cli-930 %}

{% github cicirello/pyaction %}



## Where You Can Find Me

Follow me here on DEV:

{% user cicirello %}

Follow me on GitHub:

{% github cicirello/cicirello %}

Or visit my website:

{% embed https://www.cicirello.org/ %}
The Journey Begins
Tags: webdev, beginners, javascript, design
Published: 2023-03-09 21:25:45

"Wisdom is the daughter of experience." -Leonardo da Vinci (1452-1519)

My path towards software engineering has begun. Actually, I briefly studied HTML and CSS on freeCodeCamp several years back. JavaScript is a stern teacher and certainly instills a sense of humility in the student. From perseverance, however, comes the necessary knowledge to move forward.

I come to coding with a background in liberal arts (Rutgers: MA and BA in history), warehouse leadership, and a basic understanding of cybersecurity acquired via Kenzie Academy last year. I'm incredibly grateful to Flatiron for being able to cultivate a passion for web development with this opportunity. Flatiron has a tremendous benefit over other schools in that it is very flexible for those who work full-time.

Learning to code opens so many doors and allows one to thrive in the dynamic work environment of the 21st century. The future looks bright! Happy Coding!
Update CloudFormation template
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-03-09 21:22:53

[68/100] #100DaysOfCloud Today, I updated the instance type of one EC2 instance, added an inbound security rule allowing HTTP access to the instances from anywhere exposing the instance id of one of the instances as a stack template output.

You can try do it by yourself by following the steps from the link below: [GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/068/Readme.md)
Maximizing B2B Transactions for Increased Revenue
Tags: career
Published: 2023-03-09 21:03:14


Business-to-Business (B2B) transactions can be a powerful way to generate revenue and grow your business. However, maximizing the potential of B2B transactions requires a strategic approach and a focus on building strong relationships with your partners.

One key strategy for maximizing B2B transactions is to identify your target market and tailor your sales and marketing efforts to their needs. By understanding your ideal customer and their pain points, you can create a more effective sales pitch and increase your chances of success.

Offering exceptional customer service is also crucial for maximizing B2B transactions. By being responsive to your customers' inquiries and concerns, you can build trust and establish long-term relationships. This can lead to repeat business and increased revenue over time.

Another important strategy for maximizing B2B transactions is to offer value through specialized products or services. By developing unique offerings that address your customers' specific needs, you can stand out in a competitive marketplace and increase your revenue potential.

Finally, building strong relationships with your B2B partners is key to maximizing the potential of these transactions. By taking the time to get to know your partners and understand their needs, you can build trust and establish a strong foundation for future business.

Overall, B2B transactions can be a powerful way to generate revenue and grow your business. By taking a strategic approach and focusing on building strong relationships with your partners, you can unlock the potential of B2B transactions and achieve long-term success.
The Benefits of B2B for Growing Your Business
Tags: productivity, programming, tutorial, devops
Published: 2023-03-09 21:01:18


Business-to-Business (B2B) transactions can be a powerful way to grow your business and expand your reach. Unlike Business-to-Consumer (B2C) transactions, B2B transactions often involve larger orders, longer sales cycles, and more complex negotiations. However, the benefits of B2B can be significant for businesses looking to grow and succeed.

One of the key benefits of B2B is the access it provides to new markets and customer bases. By partnering with other businesses, you can tap into their existing customer base and expand your reach beyond your current network. This can help you grow your business and increase your revenue.

Another benefit of B2B is the increased efficiency it can provide. By buying and selling in larger quantities, businesses can take advantage of economies of scale and reduce their costs. B2B transactions can also lead to greater specialization, as businesses can work with specialized providers to access advanced technologies and processes.

Building strong relationships with other businesses is also a key benefit of B2B. By providing exceptional customer service and building trust over time, businesses can create loyal customers who are more likely to return for repeat business. This can lead to long-term relationships and increased revenue over time.

Overall, B2B transactions can be a powerful way for businesses to grow and expand their operations. By understanding the unique challenges and benefits of B2B, businesses can make informed decisions and achieve success in today's competitive marketplace.
Best way to learn a framework/language
Tags: beginners, programming, codenewbie, discuss
Published: 2023-03-09 20:56:58

People prefer learning a framework/language in different ways.

For example, some people (like me) like reading the docs and then going straight into making a project with the language/framework.
Others like following tutorials (either videos or blogs) on making projects step-by-step.

### What do you think is the best way to learn a framework or language?
CLI Client for ReductStore v0.8.0 has been released
Tags: database, news, datascience, reductstore
Published: 2023-03-09 20:50:39



Hey, I've released [version 0.8.0](https://github.com/reductstore/reduct-cli/releases/tag/v0.8.0) of Reduct CLI, the Python package for managing data stored in [ReductStore](https://www.reduct.store/). This release includes two new features that will be particularly helpful for [our public datasets hosted]() on ReductStore, where metadata can be used
to provide important context for the data.

1. The `rcli export folder` command now has a new option `--with-metadata`, which exports meta information about a record and its labels into a JSON file along with the content of the record.

2. The `rcli export` commands now accept integers for `--start` and `--stop` options, which means you can specify a time interval in Unix time or use it as a range of record IDs if you don't care about time:

   ```
    # Export records with ID from 0 to 5 
    rcli export folder instance/bucket ./export_path --start 0 --stop 5
   ```


I hope these new features make it even easier to work with ReductStore and manage your data. As always, if you have any questions or feedback, please don't hesitate to reach out! 

Thanks for using [ReductStore](https://www.reduct.store)!
🤖 Pair-programming w. ChatGPT to get live Beaches quality Water at Nouméa🏖️
Tags: chatgpt, python, smartcity, opendata
Published: 2023-03-09 20:43:46

## ❔ About

I wanted to go to the beach at [Nouméa, New Caledonia](https://fr.wikipedia.org/wiki/Noum%C3%A9a). ... and wanted to know:

🗺️ Where are the beaches
🧫 Their water quality

💡 So I asked myself if...

> [`ChatGPT`](https://openai.com/blog/chatgpt/) could help with doing that with a Python script for automation tasks.

{% youtube 9MG3p9J4flk %}


## 🎤 What you'll learn

👉 In this **short post** you'll discover how I could co-author a script with `ChatGPT` from scratch 🙀. 

## 🍿 Demo time (`< 7'`)

{% youtube M6awjGe7sMk %}

## 🐍 Original Source code

```python
#!/usr/bin/env python3

import requests
from bs4 import BeautifulSoup

# Make a GET request to the webpage
url = 'https://www.noumea.nc/noumea-pratique/salubrite-publique/qualite-eaux-baignade'
response = requests.get(url)

# Parse the HTML content of the page with BeautifulSoup
soup = BeautifulSoup(response.content, 'html.parser')

# Find the table element containing the beach data by class name
beach_table = soup.find('table', class_='table')

# Extract the beach names and flag colors from the table
beach_data = []
for row in beach_table.find_all('tr')[1:]:
    columns = row.find_all('td')
    beach_name = columns[0].get_text().strip()
    flag_color = columns[1].find('img')['alt']
    beach_data.append((beach_name, flag_color))

# Print the beach data
for beach in beach_data:
    print(beach[0] + ': ' + beach[1])
```

## 🍿 Opportunties

As I showed this work to my girlfriend, she asked : 

> _"You got the beaches status in text... now what ? Why is it cool ?"_

To answer the question, I told here that it makes it possible to contribute to build Smartcities, to create _"programs for robots"_ (eg. `API`) can help making cool things like [`@BotCagou`
](https://twitter.com/BotCagou):

{% twitter 1111161336996814848 %}

Below are some works I did thanks to API on this topic : a twiiter BOT : 

{% youtube 6WqrF-Zf_yc%}

{% youtube uOH1cjQVtIQ %}

## 📑 Resources

Below a collection of innovations I did thanks to the API I built once a while:

{% embed https://www.linkedin.com/pulse/open-data-public-apis-founding-together-collaborative-adrien-sales/ %}

{% embed https://www.linkedin.com/pulse/air-eau-la-convergence-des-%C3%A9l%C3%A9ments-via-les-%C3%A0-lanse-vata-adrien-sales/ %}

{% embed https://www.linkedin.com/pulse/building-smartcities-how-i-started-from-scratch-website-adrien-sales/ %}

{% embed https://www.linkedin.com/pulse/let-twitter-bots-tell-you-when-can-go-swim-adrien-sales/ %}

{% embed https://www.linkedin.com/pulse/geekbeach-get-water-quality-straight-outta-svg-badges-adrien-sales/ %}
3 ways that understanding design fundamentals can help advance your career
Tags: webdev, design, career
Published: 2023-03-09 20:32:47

Bridging the gap between design and development is key for successful teams building websites or products. “Should designers learn to code?” has been asked many times over the years, but “Should developers learn design?” seems to be much less asked.

You don’t need to become an award-winning designer but if you’re a developer who builds for things that need a UI, learning design fundamentals can help you outside of just being able to make your projects look better.

## With design fundamentals you can…

1. Build your collaboration and communication skills with designers on your team to better understand their process and thinking so you can provide more feedback early in the project. More feedback early on = less back and forth in the development stage if a design isn’t feasible or the code needed to implement a design is going to negatively affect the user experience of a project.

2. Understand how to improve the user experience of a product with a user-centric approach and identify points where designs may not translate well with code. Communication is key. If you can understand why your designers made certain decisions, you can help to brainstorm other ideas if the design isn’t going to be easy to build.

3. Stand out in the job market with a diverse skill set. Being able to act as a liaison between design and development teams can help move you into more senior roles as you think about the whole product and not just the development side of things. You don’t have to be an amazing designer, but understanding the “why” behind decisions makes you a stronger candidate to be in a lead role.

Understanding design fundamentals and user experience basics will help you build products that look better but can contribute to the growth of your career in other ways.

If you’re interested in advancing your design skills and learning the basics of visual design and user experience, the book [Design for Developers](https://www.manning.com/books/design-for-developers?utm_source=stimac&utm_medium=affiliate&utm_campaign=book_stimac_design_4_19_22&a_aid=stimac&a_bid=5f6ba095) teaches those basics.

Level up today and stay tuned for more tips on how visual design and user experience basics can help advance your skillset and career!
Outreachy: Final blog
Published: 2023-03-09 20:27:35

| Outreachy |
|----------|
| [1. Outreachy: Introducing myself with Eclipse Adoptium](https://dev.to/julian55455/outreachy-introducing-myself-with-eclipse-adoptium-3bam)   |
| [2. Outreachy: Everyone Struggles](https://dev.to/julian55455/outreachy-everyone-struggles-1cn1)|
| [3. Outreachy: Experience with Adoptium](https://dev.to/julian55455/experience-with-eclipse-adoptium-2c3m)| 
| [4. Outreachy: Final blog](https://dev.to/julian55455/outreachy-final-blog-30ki)|



## My final outreachy blog with adoptium

As my Outreachy internship comes to a close, I am excited to reflect on my journey with the Eclipse Adoptium community and the work I have done on the SmoothBOM project. My project was focused on signing and validating Software Bill of Materials (SBOMs) to enhance the security of the Adoptium project.

During my internship, I had the opportunity to work on various aspects of the project, including implementing digital signatures, integrating the signing and validation process into the existing codebase, and creating test cases to ensure robustness. This involved working with various technologies and tools, including openkeystore, ant, Apache Maven etc.

One of the significant challenges I faced during this project was working with digital signatures and ensuring their validity in different scenarios. However, with the guidance and support of my mentors Andrew, Wen, and Shelly, I was able to learn and implement the best practices for signing and validation processes.

In addition to the technical aspects of the project, I also gained valuable experience in open-source collaboration and community involvement. Working closely with my mentors and the community allowed me to communicate effectively, seek feedback, and contribute to the project's overall vision.

Overall, my experience with the SmoothBOM project has been enriching and fulfilling. I am grateful for the opportunity to work with the Eclipse Adoptium community and the support provided by my mentors. This internship has not only enhanced my technical skills but also taught me the importance of open-source collaboration and effective communication.

To anyone considering applying for the Outreachy program, I highly encourage you to take the leap. It is a valuable opportunity to work on meaningful projects, learn new skills, and be part of a supportive community. I look forward to staying connected with the Eclipse Adoptium community and contributing to open-source projects in the future.
Introducing Address Parser Go REST: A Simple Solution for Address Parsing
Tags: apidevelopment, go, restapi, addressparsing
Published: 2024-06-19 20:27:04

---
title: Introducing Address Parser Go REST: A Simple Solution for Address Parsing
published: true
date: 2023-03-09 20:16:58 UTC
tags: APIdevelopment,golang,RESTAPI,addressparsing
canonical_url: https://blog.gkomninos.com/introducing-address-parser-go-rest-a-simple-solution-for-address-parsing
---

Parsing addresses can be a complex and time-consuming task. Different address formats and variations can make it challenging to extract accurate information from address strings. Fortunately, Address Parser Go REST provides a simple solution to this ...
Episode 23/09: RouterTestingHarness, Signals, "TypeScript Magic" behind NgRx
Tags: webdev, javascript, angular, programming
Published: 2023-03-09 19:53:32

Andrew Scott wrote about the RouterTestingHarness, which makes router-related testing a joy. Then, Manfred Steyer discussed the future of Change Detection in a world of signals, and Marko Stanimirović with a masterclass on advanced TypeScript techniques.

{% embed https://youtu.be/GRQl-8gSM1M %}

## `RouterTestingHarness`

Next to the migration script to standalone components,  Angular 15.2 introduced the RouterTestingHarness. In the past, testing components that depended on the Router was always hard. However, with that new harness, it is relatively easy.

Andrew Scott, a member of the Angular team, published a blog post where he showed in detail how that harness works and also clearly presented the advantages over manually written test doubles that you might have.

{% embed https://blog.angular.io/write-better-tests-without-router-mocks-stubs-bf5fc95c1c57 %}

## Signals in Angular: The Future of Change Detection

The hype around Signals, the most awaited feature in Angular, doesn't end. We got quite a lot of new articles. For example, "Signals in Angular: The Future of Change Detection" by Manfred Steyer.

In his demo application, he used the current signals prototype to apply them not to a single value, as we see in most articles these days, but to an array containing objects.


{% embed https://www.angulararchitects.io/aktuelles/angular-signals/ %}

You can find more signal's related articles on

{% embed https://dev.to/this-is-angular %}

## TypeScript Magic behind NgRx

If you are interested in advanced TypeScript concepts, then you should watch Brandon Robert's video. He hosted Marko Stanimirovic, one of the NgRx core developers. Marko was behind some of the latest features that heavily used conditional types, mapped types, and template literal types. It almost looks like magic if you see them in action.

Marko live-coded prototypes of those NgRx features and of course explained them.

{% embed https://www.youtube.com/watch?v=V6eHIvwDFP4 %}