teleren/devto huggingface dataset:
how to make URL Shortener using Python and cutt.ly api
Tags: python, webdev, programming, tutorial
Published: 2023-08-12 10:37:37

## welcome everybody 🙂🖐

Today I will share with you how to shorten a link using Python language and cutt.ly api
In an easy and simple way

## step 1

you need to create an account in **[cutt.ly](https://cutt.ly/)**
create account from [**here**](https://cutt.ly/)

## step 2

click on API and select "API key"

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


## step 3

click on "manage API"


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

## step 4

Generate api key

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


click on "OK"

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

## step 5

Now you have api key you can use it to shorten links
copy this key  


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

## step 6

use the api key in this code with any link you want to shorten it  

```python

import requests

api_key = 'Your API Key'
url = 'https://www.flaticon.com/uicons/interface-icons'

r = requests.get(f'http://cutt.ly/api/api.php?key={api_key}&short={url}')
print(r.json())

```

## result 

"""
{'url': {'status': 7, 'fullLink': 'https://www.flaticon.com/uicons/interface-icons', 
'date': '2023-08-12', 'shortLink': 'https://cutt.ly/hwf2vorm', 
'title': 'UIcons: 18,000+ Free icons, SVG and icon font. Awesome icons for any project'}}  
"""

**Now we're done 🤗**

**Don't forget to like and follow 🙂**
**Support us on [PayPal](https://www.paypal.com/paypalme/amr396)**
Backup manually installed libraries and packages in Ubuntu
Tags: backup, libraries, packages, ubuntu
Published: 2023-08-12 10:06:00

Backup Manually Installed Libraries and Packages in Ubuntu
----------------------------------------------------------

As a software developer, you know how important it is to have a reliable development environment. Ubuntu, being a popular choice among developers, offers a wide range of libraries and packages that can be manually installed to enhance your development experience. However, what happens when you need to reinstall Ubuntu or set up a new development machine? You don't want to go through the hassle of manually installing all those libraries and packages again. That's where backing up your manually installed libraries and packages comes in handy.

### Method 1: Using dpkg to Backup and Restore

One way to backup your manually installed libraries and packages is by using the dpkg command-line tool. Here's how:

1.  Open a terminal by pressing `Ctrl + Alt + T`.
2.  Run the following command to list all your manually installed packages:

    $ dpkg --get-selections | grep -v deinstall > packages.txt

This will create a file named `packages.txt` in your current directory containing a list of all your manually installed packages.

3.  Copy the `packages.txt` file to your backup location.

To restore your packages on a new machine or after reinstalling Ubuntu, follow these steps:

1.  Copy the `packages.txt` file from your backup location to the new machine.
2.  Open a terminal and navigate to the directory where you copied the `packages.txt` file.
3.  Run the following command to install the packages listed in the file:

    $ sudo dpkg --set-selections < packages.txt

This will install all the packages listed in the `packages.txt` file.

### Method 2: Using Aptik to Backup and Restore

If you prefer a graphical tool to backup and restore your manually installed libraries and packages, you can use Aptik. Aptik is a powerful backup and restore tool specifically designed for Ubuntu. Here's how to use it:

1.  Install Aptik by running the following command in a terminal:

    $ sudo apt-add-repository -y ppa:teejee2008/ppa
    $ sudo apt-get update
    $ sudo apt-get install aptik

2.  Launch Aptik from the applications menu.
3.  Select the libraries and packages you want to backup.
4.  Choose a backup location and click on the "Backup" button.

To restore your packages using Aptik, simply launch the application, choose the backup file, and click on the "Restore" button.

With these methods, you can easily backup and restore your manually installed libraries and packages in Ubuntu, saving you time and effort. So go ahead, backup your development environment and never worry about reinstalling everything from scratch again!

### References:

*   [Ask Ubuntu: How to backup settings and list of installed packages](https://askubuntu.com/questions/9135/how-to-backup-settings-and-list-of-installed-packages)
*   [OSTechNix: Aptik - A Tool to Backup/Restore Your Favourite Packages in Ubuntu](https://www.ostechnix.com/aptik-a-tool-to-backuprestore-your-favourite-packages-in-ubuntu/)
Exploring Shadow DOM With Examples Using Cypress
Tags: testing, dom, tutorial, beginners
Published: 2023-08-12 10:01:23

Handling of Shadow DOM Element using Cypress with different approaches.

[Please click on link](https://talent500.co/blog/shadow-dom-cypress-examples/)

Shadow DOM allows developers to encapsulate their custom HTML elements and styles from the rest of the page.

To handle shadow DOM elements in Cypress, we need to use some custom commands and utilities that can pierce through the shadow boundary and locate the elements we want to test.
Les Avantages Incontestables de l'Hébergement Cloud : Souplesse, Performance et Évolutivité
Published: 2023-08-12 09:44:00

[L'hébergement cloud](https://hebergement-site-canada.com/hebergement-cloud/) a révolutionné la manière dont les entreprises et les particuliers gèrent leurs données et leurs applications en ligne. Cette technologie offre une myriade d'avantages qui vont bien au-delà des solutions d'hébergement traditionnelles. Dans cet article, nous explorerons les atouts indéniables de l'hébergement cloud.

**1. Souplesse et Élasticité**

L'un des avantages majeurs de l'hébergement cloud réside dans sa flexibilité. Les ressources cloud sont hautement adaptables à vos besoins, que vous ayez un petit site web ou une application complexe. Vous pouvez facilement augmenter ou réduire les ressources (CPU, mémoire, stockage) en fonction du trafic, sans interruption de service. Cette élasticité vous permet de mieux gérer les pics de demande sans surcoût inutile.

**2. Performance Améliorée**

L'hébergement cloud offre des performances exceptionnelles. Les fournisseurs cloud utilisent des serveurs de pointe, des réseaux rapides et des technologies de stockage avancées. Votre site ou votre application bénéficie ainsi de temps de chargement plus rapides, d'une disponibilité élevée et d'une expérience utilisateur améliorée.

**3. Économies de Coûts**

L'hébergement cloud peut être plus rentable que les solutions [d'hébergement traditionnelles](https://hebergement-site-canada.com/). Vous payez uniquement pour les ressources que vous utilisez, évitant ainsi les coûts fixes associés à l'achat et à la gestion de serveurs physiques. De plus, vous n'avez pas à vous soucier des opérations de maintenance, des mises à jour matérielles, ni de l'infrastructure physique.

**4. Sécurité Renforcée**

Les fournisseurs de services cloud investissent massivement dans la sécurité. Vos données sont souvent réparties sur plusieurs serveurs et sauvegardées régulièrement. De plus, vous bénéficiez généralement de pare-feux, de chiffrement et d'autres mesures de sécurité avancées, ce qui réduit les risques liés à la sécurité des données.

**5. Évolutivité Simplifiée**

Avec l'hébergement cloud, vous pouvez faire évoluer vos ressources en quelques clics. Si votre entreprise se développe, vous n'avez pas à vous soucier de la migration vers un serveur plus puissant. Le cloud facilite l'expansion de votre infrastructure de manière transparente, sans perturber vos opérations.

En conclusion, l'hébergement cloud offre des avantages considérables en termes de souplesse, de performance, d'économies de coûts, de sécurité et d'évolutivité. C'est une solution moderne qui répond aux besoins des entreprises et des individus, leur permettant de se concentrer sur leurs activités sans se soucier des contraintes techniques de l'hébergement traditionnel.
Will Cash App Refund Stolen Money Directly To Your Linked Bank?
Published: 2023-08-12 09:25:55

If you are using Cash App account to send or receive money, you must know the fact that Cash App balance is not FDIC insured. It simply means Cash App won’t be responsible if someone steal money from your Cash App account. So, if you are seeking a quick explanation and confirmation about [Will Cash App Refund Stolen Money](https://www.experts-support.com/blog/will-cash-app-refund-stolen-money) or not in a proper manner, you must contact the Cash App support engineers instead of wandering for any third-party sources.
How To Rectify An Unexpected Arrival Of Cash App Payment Failed Error?
Published: 2023-08-12 09:24:53

Are you having problems with [Cash App Payment Failed](https://www.experts-support.com/blog/fix-my-cash-app-failed-for-my-protection) error? Don’t you know the reasons why you are facing such problems with your Cash App account? To understand the possible reasons to deal with all these issues, you need to check and go through several parameters upon which you may diagnose the reasons behind the Cash App payment failure error. Apart from that, you also need to take help from the Cash App engineers who will also suggest you the required aid in no time.
Running Tensorflow Scripts on GPU: Execution Time Benchmarking
Tags: tensorflow, gpu, nvidia, benchmarking
Published: 2023-08-12 08:06:46

Running Tensorflow Scripts on GPU: Execution Time Benchmarking
--------------------------------------------------------------

Tensorflow is a popular open-source library for machine learning and deep learning tasks. It provides a flexible architecture to develop and deploy machine learning models efficiently. One of the key advantages of Tensorflow is its ability to leverage the power of GPUs to accelerate computations. In this article, we will explore the execution time benchmarking of Tensorflow scripts on GPUs and understand the benefits it offers.

### Why Use GPUs for Tensorflow?

GPUs, or Graphics Processing Units, were originally designed for rendering graphics. However, due to their parallel processing capabilities, they have become an excellent choice for accelerating machine learning tasks. Tensorflow takes advantage of this parallelism to perform computations on large datasets efficiently.

When running Tensorflow scripts on a GPU, you can expect significant speed improvements compared to running them on a CPU. This is especially true for deep learning models that involve complex computations and large datasets. GPUs can handle thousands of parallel operations simultaneously, making them ideal for training deep neural networks.

### Benchmarking Execution Time

To benchmark the execution time of Tensorflow scripts on a GPU, we can compare it with the execution time on a CPU. Let's consider a simple example of training a convolutional neural network (CNN) on the MNIST dataset.

First, we need to ensure that Tensorflow is properly configured to use the GPU. You can use the following code snippet to check if Tensorflow is detecting your GPU:

`import tensorflow as tf tf.test.gpu\_device\_name()`

If the output is the name of your GPU, then Tensorflow is successfully detecting it.

Next, we can run our Tensorflow script on both the GPU and CPU and measure the execution time. We can use the `time` module in Python to calculate the elapsed time:

`import time start\_time = time.time() # Run Tensorflow script on GPU # ... gpu\_execution\_time = time.time() - start\_time start\_time = time.time() # Run Tensorflow script on CPU # ... cpu\_execution\_time = time.time() - start\_time`

By comparing the execution times on the GPU and CPU, you can observe the performance gain achieved by using the GPU.

### Conclusion

Running Tensorflow scripts on GPUs can significantly reduce the execution time of machine learning and deep learning tasks. GPUs provide parallel processing capabilities that accelerate computations, making them ideal for training complex models on large datasets. By benchmarking the execution time on both the GPU and CPU, you can quantify the performance gain achieved by utilizing the GPU.

### References

*   Tensorflow Documentation: [https://www.tensorflow.org/](https://www.tensorflow.org/)
*   Python Documentation: [https://docs.python.org/](https://docs.python.org/)
*   Stack Overflow: [https://stackoverflow.com/](https://stackoverflow.com/)
Fixing the OpenGL Exception Thrown at 0x0000000000000000 Access Violation Executing Location
Tags: c, opengl, windows10
Published: 2023-08-12 09:03:03

Fixing the OpenGL Exception Thrown at 0x0000000000000000 Access Violation Executing Location
--------------------------------------------------------------------------------------------

As a software developer, encountering exceptions is a common occurrence. One of the most frustrating exceptions to deal with is the OpenGL exception thrown at 0x0000000000000000 access violation executing location. This exception often leaves developers scratching their heads, wondering where to start fixing the issue. But fear not, we're here to help you navigate through this problem with a touch of humor!

Firstly, let's understand what this exception actually means. The "OpenGL exception thrown at 0x0000000000000000" part indicates that an exception occurred within the OpenGL library. The "access violation executing location" part suggests that the exception was caused by an attempt to access memory that the program does not have permission to access.

Now that we have a basic understanding of the exception, let's dive into some possible solutions:

### 1\. Update Your Graphics Drivers

Outdated or incompatible graphics drivers can often be the culprit behind OpenGL exceptions. So, head over to your graphics card manufacturer's website and download the latest drivers for your specific model. Remember, keeping your drivers up to date is like giving your computer a refreshing cup of coffee in the morning!

### 2\. Check Your Code for Memory Leaks

Memory leaks can lead to all sorts of unexpected behavior, including OpenGL exceptions. Go through your code with a fine-toothed comb and make sure you're not forgetting to release any allocated resources. Remember, memory leaks are like little gremlins that eat away at your program's performance!

### 3\. Verify OpenGL Initialization

Make sure you're initializing OpenGL properly before using any of its functions. Double-check that you have a valid OpenGL context and that you're calling the necessary initialization functions. Remember, a proper initialization is like a warm hug that sets the stage for a smooth OpenGL experience!

### 4\. Isolate the Problematic Code

If you're still facing the exception, try isolating the problematic code. Comment out sections of your code and see if the exception disappears. This will help you narrow down the root cause and focus your debugging efforts. Remember, isolating the problem is like playing detective, but without the cool hat and trench coat!

By following these steps, you should be well on your way to fixing the OpenGL exception thrown at 0x0000000000000000 access violation executing location. Remember, debugging can be a frustrating experience, but with a little perseverance and a sprinkle of humor, you'll conquer any exception that comes your way!

### References:

*   [OpenGL Official Website](https://www.opengl.org/)
*   [NVIDIA Graphics Drivers](https://www.nvidia.com/Download/index.aspx)
*   [AMD Graphics Drivers](https://www.amd.com/en/support)
Standard Linux Commands and Their Outputs
Tags: linux
Published: 2023-08-12 08:12:23

---
title: Standard Linux Commands and Their Outputs
published: true
description: 
tags: Linux
---
## File Operations
- `ls`: List directory contents
  ```bash
  $ ls
  file1.txt  file2.txt  dir1/
  ```

- `pwd`: Print working directory
  ```bash
  $ pwd
  /home/user
  ```

## Text Operations
- `cat`: Display file content
  ```bash
  $ cat file1.txt
  This is the content of file1.
  ```

- `head`: Display the beginning of a file
  ```bash
  $ head file1.txt
  First line of the file.
  ```

- `tail`: Display the end of a file
  ```bash
  $ tail file1.txt
  Last line of the file.
  ```

## System Information
- `uname -a`: Display system information
  ```bash
  $ uname -a
  Linux hostname 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  ```

- `free`: Display memory usage
  ```bash
  $ free -h
            total        used        free      shared  buff/cache   available
  Mem:      7.7Gi       1.2Gi       5.8Gi       123Mi       717Mi       6.2Gi
  Swap:     2.0Gi          0B       2.0Gi
  ```

## Networking
- `ping`: Test network connection
  ```bash
  $ ping -c 4 google.com
  PING google.com (172.217.22.14) 56(84) bytes of data.
  64 bytes from fra15s11-in-f14.1e100.net (172.217.22.14): icmp_seq=1 ttl=53 time=29.3 ms
  ...
  ````

## Miscellaneous
- `echo`: Display a line of text
  ```bash
  $ echo "Hello, World!"
  Hello, World!
  ```

- `history`: Display command history
  ```bash
  $ history
  1  ls
  2  cd ..
  3  pwd
  ...
  ```
Permissions and Ownership in Linux
Published: 2023-08-12 08:12:19

---
title: Permissions and Ownership in Linux
published: true
description: Linux
tags: 
---
In Linux, files and directories have three types of permissions (read, write, execute) for three types of users (owner, group, others).
`r` (read): Allows reading the file's contents.
`w` (write): Permits modifying the file's contents.
`x` (execute): Enables executing the file as a program.

## Changing File Permissions with chmod
You can use the chmod command to modify access permissions for files and directories.
- Symbolic Mode:
  ```bash
  $ chmod u+x file.txt  # Add execute permission to the owner
  $ chmod g-w file.txt  # Remove write permission from the group
  $ chmod o=r file.txt  # Set read-only permission for others
  ```

- Octal Mode:
  ```bash
  $ chmod 755 file.txt  # rwxr-xr-x: Owner has all permissions, group has read and execute, others have read and execute
  ```

## Changing File Owner and Group with chown
The chown command lets you change the owner and group of files and directories.
```bash
$ chown newowner file.txt          # Change the file's owner
$ chown newowner:newgroup file.txt # Change both the owner and group of the file
```

## Changing Group Ownership with chgrp
Using the chgrp command, you can change the group ownership of files and directories.
```bash
$ chgrp newgroup file.txt
```

## Viewing File Permissions with ls -l
The ls -l command displays file and directory access permissions, owner, and group.
```bash
$ ls -l
-rwxr-xr-x 1 owner group 1234 Jan 1 12:00 file.txt
```
Understanding and managing permissions and ownership is crucial for maintaining security and proper access control in a Linux system.
System Operations in Linux
Tags: linux
Published: 2023-08-12 08:12:18

---
title: System Operations in Linux
published: true
description: 
tags: Linux
---
Performing system operations is a crucial part of managing a Linux system. Here are some essential commands for handling 

## System Operations in Linux
### `ps`: Display currently active processes

- Basic usage:
  ```bash
  $ ps
  ```

- Show all processes for all users:
  ```bash
  $ ps aux
  ```

### `top`: Real-time Process Monitoring
- Basic usage:
  ```bash
  $ top
  ```

- Some key commands while `top` is running:
  - `q`: Quit top
  - `u`: Show processes for a specific user
  - `k`: Kill a specific process

### `kill`: Terminate Processes
- Basic usage (using process ID):
  ```bash
  $ kill [process_id]
  ```

- Send a specific signal to a process (e.g., sending the SIGKILL signal):
  ```bash
  $ kill -[signal] [process_id]
  ```
  For example, to send the `SIGKILL` signal:
    ```bash
    $ kill -9 [process_id]
    ```

### `shutdown`: Shutdown or restart the system
- Shutdown immediately:
  ```bash
  $ shutdown -h now
  ```

- Reboot immediately:
  ```bash
  $ shutdown -r now
  ```

- Shutdown with a message:
  ```bash
  $ shutdown -h +10 "System will shutdown in 10 minutes"
  ```

This will shut down the system in 10 minutes and broadcast the provided message to all logged-in users.

Understanding these system operation commands is essential for effectively managing and maintaining a Linux system.
Windows Command Prompt vs Linux Commands
Tags: windows, linux
Published: 2023-08-12 08:12:16

---
title: Windows Command Prompt vs Linux Commands
published: true
description: 
tags: Windows, Linux
---
### File and Directory Operations

| Windows Command | Description                | Linux Command |
|-----------------|----------------------------|---------------|
| dir             | List directory contents    | ls            |
| cd              | Change directory           | cd            |
| mkdir           | Create a new directory     | mkdir         |
| rmdir           | Remove a directory         | rmdir or rm -r|
| copy            | Copy files                 | cp            |
| move            | Move or rename files       | mv            |
| del             | Delete a file              | rm            |
| type            | Display contents of a file | cat           |

### Text Processing

| Windows Command | Description            | Linux Command |
|-----------------|------------------------|---------------|
| find            | Search in a file       | grep          |
| sort            | Sort input             | sort          |
| more            | Display output one screen | more or less  |

### System Operations

| Windows Command | Description                | Linux Command |
|-----------------|----------------------------|---------------|
| tasklist        | List running processes     | ps            |
| taskkill        | Kill a process             | kill          |
| shutdown        | Shutdown or restart system | shutdown      |

### Networking

| Windows Command | Description                | Linux Command |
|-----------------|----------------------------|---------------|
| ipconfig        | Display IP configuration   | ifconfig or ip a |
| ping            | Send ICMP echo request     | ping          |
| netstat         | Network statistics         | netstat       |

### Disk Operations

| Windows Command | Description                | Linux Command |
|-----------------|----------------------------|---------------|
| chkdsk          | Check disk for errors      | fsck          |
| diskpart        | Disk partitioning          | fdisk or parted |
| format          | Format a disk              | mkfs          |