teleren/devto huggingface dataset:
🔐Make an Informed Decision: Selecting the Best Licence for Your Code : Open-source and licensing series - (3/7)
Tags: opensource, community
Published: 2023-07-16 08:21:24


📜What Is the Purpose of a Software Licence?
A software licence is essential for informing others what they can and cannot do with your source code. It establishes the rules and permissions for use, distribution, and modification, providing clarity and legal protection for your work.

⚖️Default Copyright Laws and the Freedom to Choose
Remember that you are under no obligation to select a licence. However, in the absence of one, default copyright laws apply. This means that you retain complete ownership of your source code, and others may not reproduce, distribute, or create derivative works without your explicit permission. By choosing a licence, you can specify how your code can be used and shared within the developer community.

The Open Source Advantage
It is advisable to include an open source licence if you are starting an open source project. By selecting the appropriate licence, you enable a thriving ecosystem in which ideas flow freely and innovation thrives.

🔍Resources to Help You Make the Best Decision
I understand how difficult it can be to choose the right licence. Find the link of the resources in the comment.

Explore your options, think about your objectives, and then decide in a way that is consistent with your overall vision.
wget tips
Published: 2023-07-16 08:21:01

## Save a file with an extension and desired filename

```bash
wget -A png -O filename.png https://download.url/file.png
```

Downloadable image

![Saving files with extension and output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hgt1ib08m7tjx7j6i6sa.png)
Real-Time Network Status Monitoring/checking in React with TypeScript
Tags: react, webdev, typescript, beginners
Published: 2023-07-16 08:16:54

Efficiently Monitor and Respond to Network Connectivity in Real-Time using React and TypeScript

Most people use to detect internet status using `navigator.onLine`. but, it will not properly in some browsers and version.

For more info read the page:
[navigator-online-not-always-working](](https://stackoverflow.com/questions/14283124/navigator-online-not-always-working) ) 

```typescript
import { useEffect, useState } from "react";
import "./styles.css";

export default function App() {
  const [isOnline, setIsOnline] = useState<boolean>(navigator.onLine);

  const checkApiStatus = async () => {
    try {
      const response = await fetch("https://www.boredapi.com/api/activity");
      setIsOnline(response.ok);
    } catch (error) {
      setIsOnline(false);
    }
  };

  const checkInternetConnection = () => {
    if (navigator.onLine) {
      checkApiStatus();
    } else {
      setIsOnline(false);
    }
  };

  useEffect(() => {
    window.addEventListener("online", checkInternetConnection);
    window.addEventListener("offline", checkInternetConnection);

    return () => {
      window.removeEventListener("online", checkInternetConnection);
      window.removeEventListener("offline", checkInternetConnection);
    };
  }, []);

  return (
    <div className="container">
      <h2>Internet connection status: {isOnline ? "Online" : "Offline"}</h2>
      <p>Turn on/off your internet connection to see what happens</p>
      {isOnline ? (
        <h1 className="online">You are Online</h1>
      ) : (
        <h1 className="offline">You are Offline</h1>
      )}
    </div>
  );
}

```

In this example, we use the useState hook to manage the network status state (isOnline) with an initial value of navigator.onLine. The useEffect hook is used to add event listeners for the online and offline events. When the component is mounted, it registers the event listeners, and when the component is unmounted, it removes them to avoid memory leaks.

Whenever the network status changes, the corresponding event handler (checkInternetConnection) will be called, updating the isOnline state accordingly.

Finally, the component renders a heading displaying the current network status based on the value of isOnline.

**Live example**
{% embed https://codesandbox.io/embed/intetnet-status-s801xw?fontsize=14&hidenavigation=1&theme=dark %}

Remember to have TypeScript properly configured in your project for this code to work.
Function-based views in Django: Simple version
Tags: python, django
Published: 2023-07-16 08:05:59

When starting a Django project, we should create views and map them to URLs. Easy and straightforward, but why is it all confusing?

Let’s try to break it down.

There are two types of views that you can create in Django: function based views and class based views.

I'll focus on function-based views here.

Function based views have two types of responses: a simple HTTP Response, or they can render a template.

The following view returns an HTTPResponse:

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

The second view renders a template, which is the about us page, about.html:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0thqxdq5d4fdibfjocu.png)
Some Good AI Tools
Tags: ai, logomaker, logo, tools
Published: 2023-07-16 07:39:22

|S.No|Name|URL|
|----|----|----|
| 1 | Zoviz | [Zoviz](https://zoviz.com/logo-maker)|
| 2 | tl;dv | [tl;dv](https://tldv.io/)|
| 3 | Otter AI | [Otter AI](https://otter.ai/?irclickid=zhBxOmRo-xyNWY70Pm0w2xFkUkF0EK3XUzh%3ATc0&irgwc=1&utm_term=1113693&utm_medium=tracking_link&utm_source=affiliate&utm_content=other)|
| 4 | Taskade | [Taskade](https://www.taskade.com/)|
| 5 | Notion AI | [Notion AI](https://affiliate.notion.so/4k7toe8k1i48-4y5a7)|
| 6 | Bing | [Bing](https://www.bing.com/new)|
| 7 | Bard | [Bard](https://bard.google.com/)|
| 8 | Forefront | [Forefront](https://www.forefront.ai/)|
| 9 | Merlin | [Merlin](https://merlin.foyer.work/)|
| 10 | WNR AI | [WNR AI](https://wnr.ai/)|
| 11 | Chat ABC | [Chat ABC](https://chatabc.ai/)|
| 12 | Paperpal AI | [Paperpal AI](https://paperpal.com/)|
| 13 | Monic AI | [Monic AI](https://beta.monic.ai/)|
| 14 | ChartGPT | [ChartGPT](https://www.chartgpt.dev/)|
| 15 | Trinka AI | [Trinka AI](https://www.trinka.ai/)|
| 16 | Scholarcy | [Scholarcy](https://www.scholarcy.com/)|
| 17 | Lavender | [Lavender](https://www.lavender.ai/)|
| 18 | Regie | [Regie](https://www.regie.ai/)|
| 19 | Warmer | [Warmer](https://warmer.ai/)|
| 20 | Twain | [Twain](https://www.twain.ai/)|
| 21 | Octane | [Octane](https://octaneai.grsm.io/s6v7fey8zc8q)|
| 22 | 10Web | [10Web](https://10web.io/)|
| 23 | Uncody | [Uncody](https://uncody.com/)|
| 24 | Dora | [Dora](https://www.dora.run/ai)|
| 25 | Durable | [Durable](https://durable.co/)|
| 26 | Replit | [Replit](https://replit.com/)|
| 27 | Consensus | [Consensus](https://consensus.app/)|
| 28 | Writesonic | [Writesonic](https://writesonic.com/)|



Of All the above tools in order to build my personal brand and custom logo i had used [Zoviz](https://zoviz.com) extensively. It has many features in it. we can consider it as one of the best [ai logo maker](https://zoviz.com/logo-maker) ([ai logo generator](https://zoviz.com/logo-maker))specifically made for logo making.
Connecting to postgresql with C
Published: 2023-07-16 05:24:19



## Introduction:
When it comes to unleashing the full potential of PostgreSQL connectivity, developers turn to libpq, the official C library. In this technical blog post, we embark on a journey through the intricacies of libpq, exploring its rich feature set, advanced functionalities, and its role as the foundational component for seamless PostgreSQL integration. Whether you're delving into low-level database operations or building high-performance applications, libpq is your gateway to harnessing the raw power of PostgreSQL.

## Establishing Connections with Precision:
libpq simplifies the process of establishing connections with PostgreSQL databases. Through its well-defined API, developers can configure connection parameters, authenticate users, and handle various connection scenarios. From local connections to remote server setups, libpq offers the flexibility and control to adapt to any environment.

## Executing Queries and Retrieving Results:
Once connected, libpq empowers developers to execute SQL queries and retrieve results with precision. Leveraging its comprehensive query execution functions, developers can seamlessly prepare and execute SQL statements, bind parameters, and efficiently retrieve result sets. From simple SELECT queries to complex data manipulations, libpq ensures smooth interaction with the database.

## Advanced Transaction Management and Error Handling:
libpq provides robust tools for managing database transactions effectively. With support for transaction control functions, developers can initiate, commit, or rollback transactions, ensuring data integrity and consistency. Additionally, libpq offers comprehensive error handling mechanisms, allowing for graceful error reporting and efficient recovery in exceptional circumstances.

## Asynchronous Programming for Enhanced Performance:
libpq's standout feature lies in its support for asynchronous programming. By utilizing asynchronous functions, developers can execute multiple queries concurrently, maximizing application performance and responsiveness. Asynchronous capabilities enable efficient handling of large datasets and concurrent database operations, unleashing the true potential of PostgreSQL.

## Extensibility and Advanced Features:
Beyond its core functionalities, libpq boasts an array of advanced features and extensibility options. Developers can leverage SSL/TLS encryption for secure connections, implement connection pooling for optimized resource utilization, and utilize prepared statements for improved query performance. Server notifications, custom callback functions, and extensions further extend libpq's capabilities, enabling developers to tailor PostgreSQL connectivity to their specific needs.
Trailblazing Language or Legendary Software?
Tags: discuss
Published: 2023-07-16 07:00:00

Let's have a conversation about the excitement of discovering a groundbreaking programming language versus creating the most widely used software. Which path appeals to your ambitions, and why?

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Needs to convert dynamic html content to pdf
Tags: javascript, react
Published: 2023-07-16 06:27:19

Converting HTML content from Jodit editor to pdf, having issues with alignment, links and styling issues.
We have tried with libraries like 

html2pdf,
html2canvas,
jspdf,
react-pdf,
html-pdf-make,
react-html-pdf,
markdown-pdf,
react-to-pdf,

 and we got a close result in html2pdf library. But there are attachment link issue in the pdf that's generated.
Used the code to split the dymanic content to PDF for large pages from the link below
https://github.com/eKoopmans/html2pdf.js/issues/311#issuecomment-877571959
Please let us know any suggesstion or approach to solve the issue
Gestion Direct - Smart management for your company
Tags: software
Published: 2023-07-16 06:13:58

Gestion Direct is a business management software designed to facilitate daily tasks for companies in Spain, France, Andorra, and Portugal. With Gestion Direct, you can efficiently manage your company by enhancing productivity and automating processes. Choose among the various management tools that we offer and start designing the digital strategy that your company needs.

[https://gestiondirect.eu](https://gestiondirect.eu)
short tutorial on git config
Tags: git, tutorial
Published: 2023-07-16 05:00:01

Here is the starter config file.

you can open this with `git config -e` for any specific repository

```config
[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
[remote "origin"]
        url = https://github.com/j143/tcp
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
        remote = origin
        merge = refs/heads/main
[user]
        name = John Person
        email = jp@example.com
[credential "https://github"]
        com = j143
[credential]
        helper = store
[branch "show-tcp-syn-ack"]
	remote = origin
	merge = refs/heads/show-tcp-syn-ack
```


## credential

these lines control which credential to use

```config
[credential "https://github"]
        com = j143
[credential]
        helper = store
```

## author

author details

```config
[user]
        name = John Person
        email = jp@example.com
```

## Remote repository for example GitHub

How to reference a git server

```config
[remote "origin"]
        url = https://github.com/j143/tcp
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
        remote = origin
        merge = refs/heads/main
```
SMTP server for your application using SES
Published: 2023-07-16 04:55:38


We have certainly come to a point when developing an application where we needed to send emails from the application , the system requires to send outgoing mail which can come from various areas they can be monitoring , alerting batch processing . You may be not want to setup a different server for smtp or run it on-prem for only setting these feature. Amazon simple Email Service (SES) is a service provided by AWS for you to allow sending mails from any kind of application . Below shows the simplified architecture of how a SES works with an EC2 Instance to let users get a Email from the application.



![SES Integration Architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqtw9gxy2o0g5v2j9qrc.png)





## Prerequisites

At first we need to have an AWS account with an ec2 instance running an application . For the current configuration i have an EC2 instance that is running a php application , after you setup your application proceed to the SES service.


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



From the above select the SMTP settings and click on the Create SMTP credentials . 


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



The IAM account will be created automatically assigning the required policy  


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



The credentials are provided as shown in the above diagram , copy the required information.

Now everything is set to go , but you may want to create identities which can be used to send emails from , it can be of your custom domain type or 


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



Click on Create identites.


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



The above shows the Email address identity verification , after creating it you will get verification code to the email you have set .

You can use domain verification too if you own a domain .


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




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




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



For verification add these CNAME records to the DNS records of your domain. After that your domain or the email address you have configured is shown as verified as shown in the figure above.
You can now use the provided configurations like smtp endpoint , ports , SMTP username and password and set it to the application code and it will work perfectly.
SEGFAULT - BYPASS!
Tags: cybersecurity, security, hacking, linux
Published: 2023-07-16 03:51:32

Hi guys! 
I discover a 'cheat' to access many virtual machines on the Segfault, if you dont know... Segfault is a service created by The Hackers Choice.
Segfault offers free unlimited Root Servers. 
Features:
---------------------------------------------------
    Dedicated Root Server for every user.
    Pre-installed tools on Kali-Linux.
    Outgoing traffic is routed through NordVPN/CryptoStorm/Mullvad.
    Reverse TCP/UDP port on a public IP.
    Transparent TOR to connect to .onion addresses.
    Log in via .onion, .gsocket or direct ssh (port 22 or 443).
    Encrypted DNS traffic (DNS over HTTPS).
    Pre-configured .onion web server. Just put your files in /onion.
    Encrypted storage in /sec and /home with your password.
    Encrypted storage is only accessible while you are logged in. Keys are wiped on log out.
    Only the user can decrypt the data. We do not have the key.
    No Logs.
---------------------------------------------
OK... i can run many machines! Only using logical instinct...

Go to Segfault interactive shell here
When your machine starts, do this:
> ssh@lsd.segfault.net
Before access complete do this:
> ssh@adm.segfault.net

Do you can enjoy many machines and save your access to re-join later. That's incredible! And many ssh connections increase your security because all conection has vpn and tor.

Youtube Tutorial:
https://youtu.be/fTgD2YGEvrE

Github:
https://github.com/cristiancmoises/spaceinvaders
64 berufliches Vorwärtskommen: Zwei Lager.
Tags: deutsch, career, motivation, discuss
Published: 2023-07-16 03:40:00

Moin Moin,

mit der neusten Entwicklung in der sogenannten künstlichen Intelligenz, werde ich immer mit den zwei Lagern konfrontiert. Diese seien zum einen diejenigen, die menschliche Arbeit ersetzen wollen durch Maschinenarbeit - und zwar vollständig. Zum anderen diejenigen, die menschliche Arbeit ergänzen wollen durch Maschinenarbeit.

Dies scheinen mir zwei widersprüchliche Denkansätze zu sein, sobald es darum geht, wie wir als Menschheit unser Leben auf dem Planeten gestalten. Damit sei nicht gesagt, dass in einigen Bereichen eine Ersetzung und in anderen eine Ergänzung stattfinden kann. Die Frage ist eher worauf liegt unser Fokus? Mit welchem der beiden Hauptziele möchten wir kommende Generationen an IT-Fachkräften ausbilden?

1) Scheinbar geht es nicht nur um Arbeit, insbesondere bei den „Ersetzern“… Hast du dazu nähere Informationen?
2) Meinst du, dass sich eine der beiden Denkrichtungen in den nächsten Jahren durchsetzen wird oder dies bereits getan hat?

Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Oder auch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch
How to merge Tailwind class in Elixir Phoenix
Tags: elixir, phoenix, liveview, webdev
Published: 2023-07-16 03:32:42

## Problem

I am working on an open source project [OrangeCMS](https://github.com/bluzky/orangecms/) using Phoenix LiveView. I am building some reusable components which supports custom class. But many time custom class conflict with default class and I didn't get expected result.

**For example:**

```elixir
attr :class, :string, default: nil
slot :inner_block, required: true
def my_component(assigns) do
  ~H"""
   <div class={["bg-green-500", @class]}>
    <%= render_slot(@inner_block) %>
   </div>
  """
end
```

and use it

`<.my_component class="bg-red-500"> HELLO </.my_component>`

The result is not `red-500` as you might expected.



## Solution

I searched for a solution, and I found [tailwind-merge](https://github.com/dcastil/tailwind-merge) which is written in JavaScript. Basically it finds conflicted classes and resolve the conflict. For example:

```javascript
twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')
// → 'hover:bg-dark-red p-3 bg-[#B91C1C]'
```

I was thinking of porting this library to Elixir. But first, I searched on [hex.pm](http://hex.pm) and Surprising. I found two packages that support merging tailwind classes: [twix](https://hex.pm/packages/twix) and [tails](https://hex.pm/packages/tails) 

First, I try Twix but it doesn't support custom color classes and raise exception.

Then I try Tails , and with some little configuration, it works perfectly.

1. Add Tails to your dependencies

`{:tails, "~> 0.1.5"}`

2. Add custom `colors.json` files to `/assets/` or `/priv` directory

```json
{
  "primary": "orange",
  "secondary": "green"
}
```

3. Add Tails config

```elixir
config :tails, colors_file: Path.join(File.cwd!(), "assets/colors.json")
```

4. Update code

Wrap class list with `Tails.classes`

`class={Tails.classes(["bg-green-500", @class])}`

```elixir
attr :class, :string, default: nil
slot :inner_block, required: true
def my_component(assigns) do
  ~H"""
   <div class={Tails.classes(["bg-green-500", @class])}>
    <%= render_slot(@inner_block) %>
   </div>
  """
end
```


## Conclusion

Thank to **Zach Daniel **, it's now easier for us to resolve tailwind class conflict in Elixir. And before roll out my own solution, I should take a second to search on [Hex.pm](http://Hex.pm) , it's amazing that most of what I need was already implemented by Elixir community. Send my regards to all of those who spend their precious hours to make my life easier.
Harnessing the Power of Linux Networking
Tags: linux
Published: 2023-07-16 03:13:10


Hello there,

As many of you might already know, Linux is a potent operating system, particularly when it comes to handling networking tasks. From network configuration to troubleshooting, Linux offers a versatile range of commands and tools to give you complete control over your system's network. 

Today, let's extend our networking knowledge a step further and explore IP routing in Linux and how it plays a crucial role in your system's network.

**Decoding IP Routing in Linux**

In the realm of networking, routing is the process of selecting paths in a network along which to send network traffic. When a Linux system sends or receives traffic, the kernel uses a routing table to decide which interface the traffic should be forwarded on, which gateway to use, and what the default routes are. 

IP routing is, therefore, a fundamental aspect of networking in Linux. 

**Managing IP Routing in Linux**

In Linux, you can use the `route` or `ip` commands to view or manipulate the IP routing table. 

**1. Using the route command**: The `route` command is a traditional method for viewing and modifying the routing table.

    ```bash
    route -n
    ```

**2. Using the ip command**: The `ip` command is a newer, more versatile tool that you can use to manage routing in addition to other network tasks.

    ```bash
    ip route show
    ```

These commands display the routing table's entries, which can be crucial for diagnosing networking problems or configuring new connections.

While managing IP routing can be a complex task, especially for beginners, the process becomes significantly simpler once you understand how to find your IP address. You can check out this detailed guide on [how to find IP address in Linux](https://www.howtouselinux.com/post/check-ip-address-in-linux), which forms the foundational step in understanding and managing IP routing effectively.

To deepen your understanding of Linux networking, I would highly recommend exploring the resources provided by [Red Hat](https://www.redhat.com/en), a globally recognized provider of open-source solutions. They offer a wealth of knowledge about Linux, its networking capabilities, and much more.



**Wrapping Up**

Understanding IP routing is critical to mastering Linux networking. As you venture deeper into the realm of Linux networking, the ability to manage your routing table will prove to be an invaluable skill. So keep practicing, keep exploring, and make the most of Linux's powerful networking capabilities.

---

I compiled a pdf today and added it to this article. If you are interested, download it and do some Linux command practices.
This article covers all the basic commands. It will take you on a journey through the fundamental concepts and commands of the Linux command line.  

https://www.howtouselinux.com/post/linux-commands-for-linux-beginners-cheat-sheet