teleren/devto huggingface dataset:
DB and understanding the relationship of the JOIN table
Tags: jointable, database, identity, beginners
Published: 2023-08-19 14:13:43

Hello, all.

Currently learning about the basics of Database, and the relationship of the JOIN table between two different data sets. This is an example of a many to many relationship. When one data set needs to communicate with another, a join table will allow this connection. Now, if someone could elaborate on the importance of this in terms of orginization of the data between the two sets, I would very much appreciate it!!

Best,
 Daniel Todd
Surprising Apps in Testing
Tags: testing, discuss
Published: 2023-08-19 13:57:16

Do you have any applications that you test? I was wondering how to explain a common app. I decided to log in to my grocery account, and I was surprised to see...

![Grocery App Bug](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmhn9c8rpkzn650az33e.png)

I could guess. I'm an Android user. It's probably a hybrid app, and they probably know it. Well, that's life as a software tester. Play around and you'll find something new anytime.

What have you found?
Upcoming Book Launch: High Performance PostgreSQL for Rails
Tags: postgres, rails, ruby, sql
Published: 2023-08-19 13:23:14

---
title: Upcoming Book Launch: High Performance PostgreSQL for Rails
published: true
description: 
tags: PostgreSQL, Rails, Ruby, SQL
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-08-19 13:17 +0000
---

Hello! 👋 I’m the author of “High Performance PostgreSQL for Rails” being published by Pragmatic Programmers. The Beta launch is coming up in less than 2 weeks!

Subscribe to 👉<http://pgrailsbook.com> to be among the first to know when it’s live. You’ll also receive exclusive content and a discount code once it’s live.

Subscribers also get access to summaries of 40+ Ruby gems and PostgreSQL extensions mentioned in the book.

Thanks for taking a look! 😊
Deploy Phoenix App to fly.io with custom domain
Tags: flyio, phoenix, elixir
Published: 2023-08-08 22:47:07

this is a post about how to deploy phoenix app to fly.io and use custom donaim with SSL support.

when you need to deploy phoenix app to the world, there are lots of choices. I choose to use fly.io, because it's easy to use and free for small business.

## Deploy to Fly.io

this step is very easy, just follow [this guide](https://hexdocs.pm/phoenix/fly.html#what-we-ll-need), when you success deploy to fly.io you can visit your app through command `fly open`.

## Configure custom domain

although you can use `your-app-name.fly.dev` to visit your app, but it's nice to have your own domain. Let's do it.

### Change fly.toml config

replace `PHX_HOST` value to your custom domain

```toml
[env]
  PHX_HOST = "epona.me"
  PORT = "8080"
```

### Config A and AAAA Records

first, run `flyctl ips list` to see your app's addresses.

```
$ flyctl ips list
-------------------

TYPE   ADDRESS                                CREATED AT
  v4     77.83.143.105                          2020-03-02T14:59:13Z
  v6     2a09:8280:1:659f:6cb7:4925:6bfd:90a3   2020-03-02T14:59:13Z
```

next, Create an A record pointing to your v4 address, and an AAAA record pointing to your v6 address. 


### Adding the Certificate

```bash
flyctl certs create epona.me
```

### the important part

when you check certs there is likely an message like this below.

```bash
$ flyctl certs show epona.me

---------

The certificate for epona.me has not been issued yet.

Hostname                  = epona.me

DNS Provider              = cloudflare

Certificate Authority     = Let's Encrypt

Issued                    = 

Added to App              = 1 minute ago

Source                    = fly

Your certificate for epona.me is being issued. Status is Awaiting certificates. Make sure to create another certificate for www.epona.me when the current certificate is issued.

```

because our app can't handle HTTPS, so the error shows. we need to fix that.

in `config/prod.exs`, add these codes


```elixir
host = System.get_env("PHX_HOST") || "example.com"

config :spark, SparkWeb.Endpoint,
 url: [host: host, port: 443],
 force_ssl: [
   host: nil,
   rewrite_on: [:x_forwarded_port, :x_forwarded_proto],
   hsts: true
 ]
```

commit it and then deploy, now you can successfully visit your app with custom domain.


## References

- [Deploying on Fly.io](https://hexdocs.pm/phoenix/fly.html#content)
- [Using SSL](https://hexdocs.pm/phoenix/using_ssl.html)
Exploring PostgreSQL Extensions: Enhance Your Database Capabilities
Tags: postgres, opensource, database, extensions
Published: 2023-08-19 13:15:20

## Introduction
In today’s world, organizations grapple with increasingly complex data challenges, and the need for a robust yet flexible database system has never been more apparent. This is where PostgreSQL’s exceptional feature set comes into play, with one particular aspect shining brightly: extensions.

Being able to tailor database solutions to suit your specific needs is an invaluable asset for database administration. PostgreSQL seems to understand this need and allows users to seamlessly enhance PostgreSQL’s capabilities without altering its core codebase.

In this blog, we’ll delve into the purpose and potential of these extensions, exploring how they transform a standard PostgreSQL installation into a powerhouse of specialized functions.

## Understanding PostgreSQL Extensions
Think of extensions as specialized tools that can be plugged into PostgreSQL to give you exactly those functionalities which you require without needing to touch the codebase.

This allows you to get the capabilities you need without making any risky, complex changes to PostgreSQL’s architecture. Adding extensions provides benefits like retaining a maintainable architecture, customization without complexity, flexibility, adaptability, and community-driven innovation.

## Commonly Used PostgreSQL Extensions and Their Functions
- **pg_trgm**: A text similarity measurement extension that facilitates efficient text search and comparison, crucial for applications involving natural language processing.
- **hstore**: Key-value storage model, ideal for managing semi-structured or schema-less data within PostgreSQL.
- **PostGIS**: Equips PostgreSQL with geospatial objects and allows for advanced location-based queries, used for spatial data management.
- **uuid-ossp**: Generates universally unique identifiers (UUIDs), essential for ensuring data integrity and uniqueness across distributed systems.
- **pg_stat_statements**: Provides insights into query optimization, enabling better database performance by tracking and analyzing SQL query performance.
- **citext**: Useful in scenarios requiring case-insensitive text searching and matching.

## Advanced Extensions for Specialized Use Cases
- **TimescaleDB**: Tailored for time-series data, optimizes data storage and retrieval for temporal datasets This extension is a must-have for IoT applications and financial analyses.
- **pgBouncer**: Addresses connection pooling, and efficiently manages database connections. Useful for enhancing resource utilization and scalability.
- **PL/Python** and **PL/pgSQL**: Enable the incorporation of Python and SQL procedural languages, respectively. Ideal for creating custom functions and stored procedures that best fit with your application's logic.
- **pgAudit**: Provides detailed database auditing and monitoring capabilities, essential for tracking data access and changes.
Streaming Replication in PostgreSQL
Tags: apache, postgres, database, opensource
Published: 2023-08-06 12:00:34

Welcome to my blog series. In this blog, I will summarise the streaming replication in PostgreSQL.

PostgreSQL's streaming replication, introduced in version 9.1, enables single-master-multi-slave replication using log shipping. This process involves three essential processes: the main server utilizes walsender, the backup server uses walreceiver, and the standby server employs startup. Communication between walsender and walreceiver is established via a TCP connection, facilitating the smooth and efficient data transfer for replication.

PostgreSQL's streaming replication process starts with the standby server initiating the startup process, followed by the walreceiver procedure. Upon receiving a connection request from the walreceiver, the primary server launches a walsender process and establishes a TCP connection between them. During handshaking, the walreceiver shares the latest Log Sequence Number (LSN) of the standby's database cluster.

If the standby's LSN lags behind the primary's LSN, the walsender transmits the relevant Write-Ahead Log (WAL) data to the walreceiver for catch-up transmission. Once the standby server catches up, streaming replication commences, keeping it in sync with the primary server.

The primary server manages multiple standby servers using sync_priority and sync_state. The sync_priority value indicates the priority of each standby server, while the sync_state value denotes its status (sync, potential, or async). To ensure consistency and synchronization, the primary server waits for ACK responses from synchronous standbys.

Failures in backup servers are detected using mechanisms that encompass dropped connections, network issues, and unresponsiveness, all governed by customizable timeouts.

By understanding the launch process, communication, and management of multiple backup servers, PostgreSQL users can effectively establish and maintain streaming replication for high availability and data synchronization. This robust approach ensures data consistency and resilience in the event of primary server failures.
Contoh penggunaan `sync`
Tags: linux, sync, terminal
Published: 2023-08-19 13:11:37

Pada sistem operasi Linux, perintah `sync` digunakan untuk memastikan bahwa data dalam buffer sistem ditulis ke perangkat penyimpanan fisik seperti disk. Ini memastikan bahwa data yang ada dalam buffer benar-benar tertulis ke media penyimpanan sebelum operasi penting dilakukan. Berikut adalah beberapa contoh penggunaan perintah `sync`:

- **Sebelum Mematikan atau Me-restart Sistem:**
   Sebelum mematikan atau me-restart sistem, disarankan untuk menggunakan `sync` untuk memastikan semua data yang ada dalam buffer ditulis ke disk. Ini akan membantu mencegah kehilangan data yang belum disimpan.

   ```bash
   sync
   ```

- **Sebelum Mencabut Media Penyimpanan Eksternal:**
   Jika Anda memiliki perangkat penyimpanan eksternal seperti USB drive yang terhubung ke sistem, gunakan `sync` sebelum mencabutnya. Ini akan memastikan bahwa semua data yang ada dalam buffer ditulis ke perangkat sebelum dicabut.

   ```bash
   sync
   ```

- **Setelah Menjalankan Perintah Pengelolaan Disk:**
   Setelah menjalankan perintah untuk mengelola partisi atau sistem berkas (seperti `fdisk`, `parted`, atau `mkfs`), gunakan `sync` untuk memastikan bahwa perubahan yang Anda buat telah diterapkan pada media penyimpanan.

   ```bash
   parted /dev/sdX mklabel gpt
   sync
   ```

- **Sebelum Penggunaan `dd` untuk Menyalin Data:**
   Jika Anda menggunakan perintah `dd` untuk menyalin data dari atau ke perangkat penyimpanan, gunakan `sync` setelah selesai untuk memastikan bahwa semua data telah ditulis sepenuhnya.

   ```bash
   dd if=/dev/sda of=/dev/sdb
   sync
   ```

- **Sebelum Melihat Informasi Disk:**
   Jika Anda ingin melihat informasi terbaru tentang disk dan partisi menggunakan perintah seperti `lsblk` atau `fdisk`, pastikan untuk menggunakan `sync` terlebih dahulu untuk memastikan data terbaru ditampilkan.

   ```bash
   sync
   lsblk
   ```

Penting untuk diingat bahwa `sync` adalah perintah yang cepat dan tidak menghasilkan output. Ini hanya memastikan bahwa data dalam buffer ditulis ke perangkat penyimpanan. Pastikan untuk menggunakan `sync` dalam situasi yang tepat untuk memastikan integritas data Anda.
Dokumentasi Perbedaan antara `rsync` dan `sync`
Tags: rsync, sync, linux, terminal
Published: 2023-08-19 13:09:09

[_cover image_](https://logodownload.org/wp-content/uploads/2022/05/linux-logo-0.png)

### `rsync` vs `sync`

Kedua perintah, `rsync` dan `sync`, digunakan dalam konteks manajemen data dan sinkronisasi. Meskipun keduanya berbagi tujuan umum, mereka memiliki perbedaan dalam fungsionalitas, penggunaan, dan fokus utama.

### `rsync`

**Deskripsi:**
`rsync` adalah alat sinkronisasi dan transfer file yang akurat. Ini dirancang untuk menyalin data secara efisien antara host lokal atau jarak jauh. Keuntungan utama dari `rsync` adalah kemampuannya untuk menyalin perubahan data (dalam mode incremental) dan mendukung transfer melalui SSH yang aman.

**Fitur Utama:**
- Transfer data incremental, menyalin perubahan yang diperlukan.
- Sinkronisasi dengan cepat melalui jaringan lokal atau jarak jauh.
- Transfer aman melalui SSH.
- Sinkronisasi dua direktori atau host secara efisien.

**Contoh Penggunaan:**
```bash
rsync -avz source_directory/ remote_user@remote_host:destination_directory/
```

**Sumber Bacaan Lainnya:**
- [Dokumentasi Resmi Rsync](https://rsync.samba.org/documentation.html)
- [Pengantar Rsync pada DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps)

### `sync`

**Deskripsi:**
`sync` adalah perintah sederhana yang menginstruksikan sistem operasi untuk menulis semua data dalam buffer sistem ke perangkat penyimpanan fisik seperti disk. Ini digunakan untuk memastikan bahwa data tertulis sepenuhnya ke media penyimpanan sebelum perangkat dimatikan atau sebelum perubahan penting dilakukan pada sistem.

**Fitur Utama:**
- Menulis data dalam buffer ke media penyimpanan fisik.
- Memastikan integritas data sebelum operasi penting.

**Contoh Penggunaan:**
```bash
sync
```

**Sumber Bacaan Lainnya:**
- [Man Halaman Sync](https://man7.org/linux/man-pages/man8/sync.8.html)

---

Keduanya adalah alat yang bermanfaat saat di dalam terminal,  dengan fokus yang berbeda. `rsync` lebih cocok untuk sinkronisasi file dan transfer data, terutama dalam lingkungan jaringan, sementara `sync` berguna untuk memastikan integritas data sebelum operasi penting.

Pastikan untuk merujuk ke sumber-sumber yang disebutkan di atas untuk informasi lebih lanjut tentang penggunaan dan fitur dari kedua perintah ini.
What you learning about this weekend?
Tags: codenewbie, discuss, learning, beginners
Published: 2023-08-19 13:00:00

Heyo 👋

What y'all learning about this weekend?

Whether you're sharpening your [JS](https://dev.to/t/javascript) skills, making PRs to [your OSS repo of choice](https://github.com/forem/forem) 😉, sprucing up your portfolio, or [writing a new post](https://dev.to/new) here on DEV, we'd like to hear about it.

Keep on learning y'all! 📚

![A cartoon of a book opening up and a floating eye reading the book](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/clalyk0ma733qwfkj91i.gif)
the best way to convert python file to exe using Nuitka
Tags: python, coding, tutorial
Published: 2023-08-19 12:53:57

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

**Important**

**install this**

https://pypi.org/project/ordered-set/

https://pypi.org/project/zstandard/

https://nuitka.net/doc/user-manual.html
Bypass any captcha using python 😎
Tags: python, automation, programming
Published: 2023-08-19 12:49:14

{% embed https://www.youtube.com/watch?v=Qh3-UMWuqxY %}

You need to make a deposit of at least $2 to run the service
create an account now on 2captcha: https://bit.ly/3HJiUE8
------------------------------------------------------------------------------------------------------
install 2captcha lib : https://pypi.org/project/2captcha-python/
------------------------------------------------------------------------------
**Human-powered CAPTCHA-solving service**
2captcha solves your CAPTCHA with high accuracy. To start using the service
* Register
* Implement API
* Send us your CAPTCHAs
* Get your answer as text
It’s quick and easy! 2Captcha provides low prices and high accuracy for your CAPTCHAs.
**Supported captchas**
Normal Captcha ,Text Captcha, ClickCaptcha, Rotate, Captcha reCAPTCHA V2, reCAPTCHA V2 ,Callback reCAPTCHA V2, Invisible reCAPTCHA V3, reCAPTCHA Enterprise ,KeyCaptcha, GeeTest ,hCaptcha, FunCaptcha, Capy Puzzle, TikTok Captcha
Modern Note-Taking: How Obsidian Stands Out in 2023
Tags: obsidian, pkm
Published: 2023-08-19 12:48:01

In the vast galaxy of digital note-taking, stars emerge, flicker, and fade. Yet, as we barrel into 2023, one star blazes more brilliantly than the rest: Obsidian. As we wade through the deluge of our digital thoughts, a sanctuary like Obsidian becomes not just desirable, but downright essential.

## The Allure of the Local-First Paradigm

In an age where cloud-based everything seems the norm, Obsidian's audacious move towards a local-first approach is both a breath of fresh air and a grounding reminder. There’s an oddly satisfying nostalgia in knowing your thoughts are safely stored on your own machine, reminiscent of scribbling in a physical journal under the cover of night.

## Interlinking Thoughts: A Web of Brilliance

Remember those detective shows with walls covered in pictures, connected by strings in a maze of theories and suspects? That’s Obsidian’s backlinking and graph view for you. But instead of solving crimes, you’re untangling the intricate mysteries of your own mind, making connections you might never have otherwise perceived.

## Customization: A Playground for the Inquisitive

Why accept a one-size-fits-all when you can tailor to perfection? Obsidian isn’t just a tool; it's a canvas. Whether you're a minimalist seeking an uncluttered space or a maximalist hungering for intricate toolsets, Obsidian bends to your will.

## Knowledge, Not Notes

While most apps let you take notes, Obsidian lets you craft a knowledge base. It’s a subtle distinction, but one that shifts the focus from mere information recording to genuine understanding. It nudges you gently towards epiphanies and a-ha moments, those delightful instances when the fog lifts and clarity reigns.

## The Timelessness of Markdown

And, of course, the beating heart of Obsidian - markdown. In 2023, as more apps become bloated with features, the purity and simplicity of markdown stand unyielding. It's a nod to the digital romantics among us, who believe that words, in their most unadorned form, are magic enough.

## The Quiet Revolution of Obsidian

So, here we stand, on the precipice of an ever-evolving digital age, our thoughts scattered like leaves in the wind. But with Obsidian, there's a sense of grounding, a sense of coming home. In the crowded arena of note-taking apps, Obsidian doesn’t just stand out; it gleams, a beacon for those seeking a deeper, more profound relationship with their thoughts.

Let's embrace this tool not just for its features, but for the introspection and clarity it beckons us towards. After all, in the cacophony of modern life, a sanctuary for our thoughts is the most profound rebellion.
Emoji Support For Neovim
Published: 2023-08-19 12:30:37

Those who use neovim might miss something if you use emoji in your code so lets fix that now

1. Add this to the Neovim Config I am using LazyNvim 
```lua
return {
  "stevearc/dressing.nvim",
  {
    "ziontee113/icon-picker.nvim",
    config = function()
      require("icon-picker").setup({
        disable_legacy_commands = true,
      })
    end,
  },
}
```
Renomeando arquivos no Git do jeito certo
Tags: git, opensource, braziliandevs
Published: 2023-08-30 11:57:30

---
title: Renomeando arquivos no Git do jeito certo
published: true
date: 2023-08-19 11:25:00 UTC
tags: git,opensource,braziliandevs
canonical_url: https://jtemporal.com/renomeando-arquivos-no-git-do-jeito-certo/
---

Você já tentou renomear um arquivo nos seus projetos e teve dificuldade adicionar o ajuste em um commit? Isso não acontece só com você. Nessa colinha você vai aprender a renomear os seus arquivos em projetos git da forma correta para evitar dores de cabeça.

## O problema de renomear um arquivo sem usar o git

Vamos dizer que você decidiu renomear um arquivo e, por questão de simplicidade você decide fazer isso na interface de pasta mesmo (ou usando o comando `mv` no terminal). Depois disso você quer fazer o commit da alteração de nomes e ao rodar o `git status` você se depara com essa situação:

![imagem mostrando o arquivo deletado e um arquivo novo criado](https://res.cloudinary.com/jesstemporal/image/upload/v1692470010/images/git-mv/001-renamed-file-deleted-git-status_shmq3h.png)

Se você renomeia o arquivo sem usar o Git, o Git “se perde” e acha que o arquivo original foi apagado e um arquivo novo foi criado como mostrado na imagem acima. Por causa desse comportamento, você acaba tendo que obrigatoriamente fazer dois passos para commitar a alteração no nome:

1. Adicionar o arquivo deletado;
2. Adicionar o arquivo novo.

Para piorar, não é possível adicionar um arquivo “deletado” sem usar explicitamente o nome desse arquivo, o que torna esse processo todo ainda mais tedioso, pra não mencionar a esquisitice da frase “adicionar um arquivo deletado”.

Vamos dizer que você perseverou, adicionou o arquivo deletado e adicionou o arquivo novo e mais uma vez você roda um `git status`, e ai o git entende que foi uma alteração no nome do arquivo, veja:

![imagem mostrando o resultado de git status após adicionar o arquivo e o git entendendo que o arquivo foi nomeado](https://res.cloudinary.com/jesstemporal/image/upload/v1692470010/images/git-mv/002-renamed-file-git-status_lley9v.png)

Essa é uma solução relativamente tranquila se você não precisa fazer isso com frequência, mas existe uma solução melhor.

## Renomeando um arquivo no git do jeito certo

Para começar é necessário resistir ao impulso de renomear o arquivo usando a interface e passar a usar o comando `git mv`. Usando o mesmo exemplo do caso acima, onde renomeamos o arquivo `books.md` para `book.md`, o comando fica assim:

```
git mv books.md book.md

```

O resultado de usar apenas um comando é o seguinte:

1. Renomear o arquivo;
2. Adicionar a mudança de nome em staging.

Depois disso você pode seguir o fluxo normal de commits e fazer o commit dessa alteração.

## Recapitulando

Não use a interface para renomear os arquivos nos seus projetos Git, use o comando `git mv` para fazer isso e já adicionar essa mudança em staging para um commit.

## GitFichas

[
 ![GitFicha #052: git mv origem destino](https://res.cloudinary.com/jesstemporal/image/upload/v1692471498/gitfichas/pt/052/052-full_cu0alv.jpg)
](https://gitfichas.com/projects/052?utm_source=blog)