teleren/devto huggingface dataset:
lftp – move files between different Linux remote machines quickly and reliable
Tags: devops, linux
Published: 2023-03-30 09:59:19

It’s based on lftp linux utility, that was written by Russian programmer – Alexander Lukyanov; it is made available under the GNU General Public License.
 
Among its amazing features, it allows you download files in parallel. The utility is open source and freely available via yum. More about it here: http://en.wikipedia.org/wiki/Lftp
 
It allows to move huge files by ftp in parallel.

Assume, we have machine A and machine B, and we want to move some heavy file from machine A to machine B.

On machine B:

```
[my_user_B@machine_B somedir]$ lftp -u my_user_A machine_A

Password: xxxxxxxxxxxxx

lftp my_user_A@machine_A:~> ls

drwxr-xr-x    2 222      111          4096 Jan 08 14:07 .

-rw-r—–    1 222      111      7067885260 Jan 08 14:10 some_huge_file.dmp.gz
drwx——   32 222      111          4096 Jan 08 14:40 ..

lftp my_user_A@machine_A:~> pget -n 10 some_huge_file.dmp.gz

7067885260 bytes transferred in 2471 seconds (2.73M/s)

lftp my_user_A@machine_A:~>
```

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

Transferring the same file, using traditional ftp would take much more:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/25v7tt4o1xdj7hmieq0g.png)
Configuring Git SSH Keys for Multiple Accounts and Workspaces
Published: 2023-03-30 09:54:04

You can have different keys based on different domains. The following code is an example of how you can configure your SSH keys for different accounts on GitHub and Bitbucket.


`code ~/.ssh/config`

```
# Personal account
Host github.com
   HostName github.com
   User git
   UseKeychain yes 
   AddKeysToAgent yes
   IdentityFile ~/.ssh/id_ed25519
   
# Work account-1
Host bitbucket.org    
   HostName bitbucket.org
   User git
   UseKeychain yes
   AddKeysToAgent yes
   IdentityFile ~/.ssh/id_rsa
```

 
## Multiple git configs 

If you want to have multiple git configs one of the easiest ways to achieve this is having a separate workspaces and gitconfigs respectively.

In the context git, a workspace refers to a directory or folder on your computer where you store your work-related projects and files.

By using the includeIf directive in your .gitconfig file, you can tell Git to use a specific configuration file depending on which workspace you're currently in.

In case you don't have a gitconfig;
```
touch .gitconfig 
code .gitconfig
```

Inside of  .gitconfig separate config files based on path 

```
[includeIf "gitdir:/Users/your_username/workspace-company/"]
path = ~/.gitconfig-company
[includeIf "gitdir:/Users/your_username/workspace-personal/"]
path = ~/.gitconfig-personal
```
then in each config you’ll have different setup.

`.gitconfig-company`

```
[user]
 name = Orhun Ozer
 email = orhun.ozer@company.com
```

`.gitconfig-personal`

```
[user]
 name = HelluvaDevelopa
 email = helluva@developa.com
```
<img width="100%" style="width:100%" src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYTI1NWU4MTliMDhjNTRkM2Y0ZWVjMjNhZjBlYTU4M2I5ZDhlZTUwOCZjdD1n/goEWraNuCucVi/giphy.gif">

Resources [freecodecamp](https://www.freecodecamp.org/news/how-to-handle-multiple-git-configurations-in-one-machine/)
How to compose SQL queries based on values from CSV file?
Tags: database, devops, csv, sql
Published: 2023-03-30 09:49:40

_Issue:_

How to compose SQL queries based on values from CSV file?

_Solution:_

```
SQL> create table MY_TABLE(a varchar2(100), b varchar2(100));

[oracle@myora ~]$ tail Some_Input_CSV_file
Some Data A 1,Some Data B 1
Some Data A 2,Some Data B 2
Some Data A 3,Some Data B 3
Some Data A 4,Some Data B 4
Some Data A 5,Some Data B 5
Some Data A 6,Some Data B 6
Some Data A 7,Some Data B 7
Some Data A 8,Some Data B 8
Some Data A 9,Some Data B 9
Some Data A 10,Some Data B 10
[oracle@myora ~]$

[oracle@myora ~]$ cat Some_Input_CSV_file | awk -F, ‘ { printf(“insert into MY_TABLE values(trim(\x27%s\x27), trim(\x27%s\x27));\n”, $1, $2); } ‘ > RunMe.sql

[oracle@myora ~]$ tail RunMe.sql
insert into MY_TABLE values(trim(‘Some Data A 1’), trim(‘Some Data B 1’));
insert into MY_TABLE values(trim(‘Some Data A 2’), trim(‘Some Data B 2’));
insert into MY_TABLE values(trim(‘Some Data A 3’), trim(‘Some Data B 3’));
insert into MY_TABLE values(trim(‘Some Data A 4’), trim(‘Some Data B 4’));
insert into MY_TABLE values(trim(‘Some Data A 5’), trim(‘Some Data B 5’));
insert into MY_TABLE values(trim(‘Some Data A 6’), trim(‘Some Data B 6’));
insert into MY_TABLE values(trim(‘Some Data A 7’), trim(‘Some Data B 7’));
insert into MY_TABLE values(trim(‘Some Data A 8’), trim(‘Some Data B 8’));
insert into MY_TABLE values(trim(‘Some Data A 9’), trim(‘Some Data B 9’));
insert into MY_TABLE values(trim(‘Some Data A 10’), trim(‘Some Data B 10’));
[oracle@myora ~]$

[oracle@myora ~]$ sqlplus myuser/mypwd@myinst

SQL> @RunMe.sql

…

1 row created.

1 row created.

1 row created.

1 row created.

1 row created.

SQL> commit;

Commit complete.

SQL> exit
```
Issue or Documentation?
Tags: automation, documentation, writing
Published: 2023-03-30 09:42:54

![issue-or-doc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4znjyq36m3e3qilhkylr.png)

At Woovi we don't like to spend time discussion non-important things. 
One common question was if a developer should write in an issue or add a new documentation item in our internal documentation.
We made a script to make it easy to convert from a GitHub issue to a markdown format of our documentation, so we don't need to discuss about this anymore.

## Transforming an issue in a markdown

`yarn es ./scripts/issue.ts <https://github.com/<owner>/<repo>/issues/43155>`

`yarn es` is an alias to `node -r esbuild-register`, it run node using esbuild to support TypeScript and modern JavaScript.

The first thing we need to do is to read the command line arguments to extract the issue path

```jsx
const [, , ...unsanitizedArgs] = process.argv;

const [url] = unsanitizedArgs;
```

Then we need to parse url to extract issue number

```jsx
const getIssueNumber = (url: string) => {
const tokens = url.split("/");

if (tokens.length !== 7) {
  return null;
}

const [issueNumber] = tokens[6].split("#");

return issueNumber;
};
```

Then we need to get the issue content from GitHub API

```jsx
const octokit = new Octokit({
  auth: config.GITHUB_TOKEN,
});

const issue = await octokit.rest.issues.get({
  owner,
  repo,
  issue_number: issueNumber,
});
```

After this, you just need to create the markdown with the correct format and save it to a file

```jsx
const id = slug(issue.data.title);
const title = issue.data.title;
const body = issue.data.body.split("\r\n").join("\n");

const md = `---
id: ${id}
title: ${title}
tags: 
- dev-docs
---

${body}
`;

const mdFile = path.join(cwd, 'md', `${id}.md`);

await writeFile(mdFile, md);
```

After this, the developer just needs to copy the file to the docusaurus internal documentation.

## To summarize
At Woovi we try to avoid wasting time bikeshedding, discussing non-important issues. We prefer to focus our time in hard issues that will move the needle to make us move forward.
This article is one example of how automation can remove some procrastination or bikeshedding.

---
Woovi
[Woovi](https://www.woovi.com) is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are [hiring](https://woovi.com/jobs/)!

---
Photo by <a href="https://unsplash.com/@zal3wa?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Damian Zaleski</a> on <a href="https://unsplash.com/photos/RYyr-k3Ysqg?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Common mistakes Web Developers make when they start with React Native
Tags: react, reactnative, javascript, beginners
Published: 2023-03-30 09:34:33

---
title: Common mistakes Web Developers make when they start with React Native 
published: true
description: How not to do common mistakes in React native which everyone does when they have web developer background.  
tags: react, reactnative, javascript, beginners
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-03-13 06:57 +0000
---

React Native is a popular framework among developers for building mobile applications. However, web developers who are new to React Native may make some mistakes due to their familiarity with web development. One of the common mistakes is related to navigation state.

In web development, when a user navigates from route A to route B, the component rendered in route A becomes inactive or unmounted, and a new component is mounted for route B. The history object is maintained to track the user journey, and the browser back button is usually not used as websites and web apps are designed to have their own back button inside the app.

On the other hand, in mobile development, the back button is placed at the bottom of the screen, making it easily accessible to the user. Due to this, web developers need to consider what happens when the mobile back button is pressed.

Here are some common patterns in React Native codebase that web developers may encounter:

1. **Just pushing new screens into the stack** - While there is nothing wrong with pushing new screens, there are cases where you need to replace the current screen with a new screen. For example, when a user successfully authenticates and you want to navigate to the app's home screen, you should clear the current stack and push a new screen or replace the login screen with the home screen, so that when the user presses the back button, they don't end up on the login screen again.

2. **Unnecessary re-rendering** - All the screens that are not cleared from the navigation stack remain active. Any global state change consumed in these screens will trigger a re-render. The ideal solution is to create Pure components or High-Order Components to avoid unnecessary re-rendering.

3. **Not clearing the navigation stack** - Some code may push the Login screen into the stack on logout. This is not desirable, as the user should not be able to go back to the app's home screen when they press the back button on the login screen. In this case, the navigation stack should be cleared, and only the Login screen should be pushed.

As cross-platform technologies like React Native and Flutter become more popular, more web developers are transitioning to mobile development. By understanding the differences between web and mobile development and being mindful of these common mistakes, web developers can avoid issues when starting with React Native.
Conversation about – Power platform
Tags: powerfuldevs, lowcode
Published: 2023-03-30 09:34:19


Kevin and Stuart sitting on the porch of Gru's house on a sunny afternoon. The Kevin the tech savvy was using his laptop and Stuart was curious to learn a bit more.

**Stuart**: "Kevin, what are you doing on your laptop ??"
**Kevin**: "Working on Power Platform !!"
**Stuart**: "What!!!!!"
**Kevin**: "It's a suite of tools that businesses use to automate processes and create custom apps without any coding knowledge. It's really powerful stuff."
**Stuart**: "Wow, that sounds really cool. But I'm not very tech-savvy. Do you think I could use it?"
**Kevin**: "Absolutely, Stuart. The Power Platform is designed to be user-friendly, even for people who aren't tech-savvy. It's all drag-and-drop, so you don't need to know any coding to get started." 
**Stuart**: "That's great to hear. But what could I actually do with it?"
**Kevin**: "Well, you could use it to automate tasks and processes in your business, like creating digital forms or tracking inventory. You can even use it to build your own custom apps without any coding knowledge."
**Stuart**: "That sounds really powerful. But I'm not sure where to start."
**Kevin**: "No problem, Stuart. There are lots of online resources and tutorials that can help you learn how to use the Power Platform. And if you ever get stuck, I can always help you out."
**Stuart**: "Thanks, Kevin. You're really good at explaining things."


Overall, the conversation emphasizes that the Power Platform is accessible and easy to use, even for people who aren't tech-savvy. It also highlights some specific examples of how the Power Platform could help businesses, such as by automating tasks and processes. The uncle reassures his nephew that there are resources available to help him learn and grow, and offers to assist him if he ever needs help.


**Useful Resources**:

1. Reza - https://www.linkedin.com/in/rezadorrani/
2. Shane - https://www.linkedin.com/in/cincyshane/
3. Matt - https://www.linkedin.com/in/matthew-devaney-6499271b7/
4. Dave - https://www.linkedin.com/in/wyattdave/
Think/Code
Tags: rust, refactoring, beginners
Published: 2023-03-30 09:28:37

Day three of code refactoring... Trying to start to think this way

My original code:
```Rust
let mut results: Vec<u32> = engine.search(&input);
let total = results.len();
if total > 10 {
    results.drain(10..);
}
let mut top_ten: Vec<(u32, String)> = vec![];
for index in results {
    top_ten.push((index, catalog[index as usize].1.clone()))
}

let mut answer_vec: Vec<u32> = vec![];
for (i, _) in top_ten.iter() {
    answer_vec.push(*i)
}
```

After refactoring and explanations:
```Rust
let answer_vec: Vec<u32> = engine
    .search(&input)
    .into_iter()
    .take(10)
    .collect();
```
Both do the same:
1) Send "input" to search function
2) Iterate through it's output
3) Take first 10 elements
4) Collect them into a vector
But look different.

It's important to catch an idea before you start to write code. If you can't - write step by step like in the first example then try to figure out what your idea actually is and try to refactor.
How I broke my terminal
Tags: bash, documentation
Published: 2023-03-30 09:20:27

Before config read the docs or you'll just waste your time like I did

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

Now it looks fine

PS1="\[\033[00;33m\]\W \[\033[00m\]\[\033[00;36m\]\$ \[\033[00m\]"
Bubble sort algorithm
Tags: sort, programming, algorithms
Published: 2023-03-30 09:18:25

The Bubble sort algorithm is a simple sorting algorithm that operates by comparing pairs of values in an array. It works by iterating through the array and comparing adjacent values, swapping them if the value on the left is greater than the value on the right. This process is repeated until there are no more values that are greater than the highest value in the array, resulting in a sorted list/array in ascending order.

While Bubble sort is a straightforward algorithm, it can be slow and inefficient for large arrays. Despite its limitations, it is still a useful algorithm to understand as it forms the foundation for more complex sorting algorithms.

In summary, the Bubble sort algorithm compares pairs of values and swaps the greatest with the least until the array is sorted in ascending order.

so the steps are simple:
1. nested loop to run through input array, using 2 variables (i and j). such that 0≤i≤(n-1) and 0≤j≤(n-i-1)
2. if arr[j] is greater than arr[j+1] then swap the adjacent value else so on.
3. return sorted array.


Below is the solution in javascript.

```
const swap = (arr, pos1, pos2) =>  {
    //swap pos2 val with pos1 val
    let temp = arr[pos1];
    arr[pos1] = arr[pos2];
    arr[pos2] = temp;
}

const bubbleSort = (arr = []) => {
    let len = arr.length;

    for(let i=0; i<len; i++) {
        for(let j=0; j<(len - i - 1); j++ ) {  

            //swap arrayValue with its adjacent if its greater than it.
            if(arr[j] > arr[j+1]) {
                swap(arr, j, j+1); 
            }
        }
    }
    return arr;
}
```
The Best case scenario is when the input array is sorted in ascending order, worst case scenario is when the input array is sorted in descending order. 
Time complexity for Best case O(n);
Time complexity for Worst case O(n^2);

Worst case scenario analysis:
If the input array is in descending order, that means that many iterations/passes will be required to swap elements
total number of iterations on an input array (n-1)

  At iteration 1:  Number of comparisons = (n-1)
                     Number of swaps = (n-1)

  At iteration 2:  Number of comparisons = (n-2)
                     Number of swaps = (n-2)

  At iteration 3:  Number of comparisons = (n-3)
                    Number of swaps = (n-3)   .... and so on
= (n-1) + (n-2) +  (n-3) + . . . 2 + 1
= (n-1)*(n-1+1)/2  { using sum of n natural Number formula }
= n(n-1)/2  
= n^2
therefore Total number of swaps = Total number of comparisons
Worst case scenario: O(n^2)  

```
Input:
[6,4,1]
Output:
[1, 4, 6]
```
Bubblesort is relatively easy to implement but due to its time complexity of O(n^2) it can be very slow for large datasets.
Skills needed to achieve goals in life
Tags: webdev, career, beginners, tutorial
Published: 2023-03-30 09:14:15

Achieving goals in life requires a combination of various skills, tactics, and techniques. Here are some of the most effective ones:

1.Goal Setting: The first step towards achieving your goals is to set specific, measurable, achievable, relevant, and time-bound (SMART) goals. This helps you to have a clear understanding of what you want to achieve, and how you will achieve it.

2.Planning: After setting your goals, it is important to create a plan of action. Break down your goals into smaller, manageable steps and set deadlines for each step. This will help you to stay focused and motivated, and track your progress towards achieving your goals.

3.Time Management: Time is a valuable resource, and managing it effectively is crucial for achieving your goals. Prioritize your tasks, eliminate distractions, and focus on the most important activities that will help you achieve your goals.

4.Self-Discipline: Consistency is key when it comes to achieving your goals. Developing self-discipline is important to stay focused, motivated, and committed towards your goals.

5.Continuous Learning: Learning new skills and knowledge is essential to improve your chances of achieving your goals. Stay updated with the latest trends and developments in your field, and seek out opportunities for professional development.

6.Networking: Building a strong network of like-minded individuals can help you to achieve your goals faster. Attend conferences, seminars, and other networking events to meet new people and build relationships that can help you in your personal and professional life.

7.Positive Thinking: Having a positive mindset can help you to stay motivated and overcome challenges on your path to achieving your goals. Focus on your strengths, celebrate your successes, and learn from your failures.

8.Adaptability: Be prepared to adapt and adjust your plans as you progress towards your goals. Life is unpredictable, and being flexible and open to change can help you to stay on track towards achieving your goals.

By combining these skills, tactics, and techniques, you can increase your chances of achieving your goals and living the life you desire.
Prevent Social Media Hacking
Tags: socialmedia, internet, hacking
Published: 2023-03-30 08:58:23

In today's digital age, social media platforms have become an integral part of our daily lives. We use them to share our thoughts, keep up with our friends and news, and showcase our pictures and videos. However, the rise of social media has also led to an increase in hacking attempts that can compromise your sensitive information. To avoid such hacking attempts or data breaches, it's essential to take measures to protect your social media accounts.
How to 

## Protect Social Media Accounts from hackers
Below are some tips and best practices to safeguard your [social media accounts](https://www.hindimeinbatao.in/search/label/Social%20Media) against hackers :

1. Strong Passwords - One of the most important things you can do to protect your social media accounts from hacking attempts is to use strong passwords . Your passwords should be at least 12 characters long and include a combination of uppercase and lowercase letters, numbers, and symbols. Avoid using personal information such as your name, address, or birthdate, as these can be easily guessed.

2. Two-Factor Authentication - Enabling two-factor authentication (2FA) adds an additional layer of security to your social media accounts. This feature usually requires a code sent to your phone or an authentication app, even if someone knows or guesses your password, they still won't be able to log in without the second factor.

3. Beware of Phishing Scams - Be vigilant of phishing scams that target social media accounts. These usually appear as fake login pages or messages from fake accounts prompting you to enter your password. Never click on links from sources you don't trust, and always verify the authenticity of the links before clicking on them.

4. Use Private Browsing Mode - When using public computers or shared devices, consider using a private browsing mode or incognito mode. This mode prevents the browser from storing your login information and browsing history, reducing the chances of someone accessing your information.

5. Use a VPN - Using a Virtual Private Network (VPN) can help protect your online activity from being monitored by snooping parties or from someone trying to access your accounts from an unsecured network. Make sure to choose a trustworthy VPN service and avoid using free services as they may not be reliable.

6. Regularly Review Your Activity Log - Most social media platforms have an activity log feature that tracks every login, post, and comment. Take the time to review this regularly to ensure that all activity on your account was initiated by you.

In conclusion, protecting your social media accounts from hacking attempts is not a one-time job. It's important to stay vigilant and take the necessary measures to safeguard your social media accounts continuously.
These AI tools are helpful to a wide range of professions, including:
Tags: ai, community, news, programming
Published: 2023-03-30 08:55:57



## 7 AI Tools for helping IT Professionals  

Software developers: Open AI Codex, TensorFlow, and PyTorch can help software developers automate programming tasks and accelerate software development. These tools can be used to build and deploy machine learning models, develop neural networks, and write code in natural language.

 

## Data scientists
: TensorFlow, PyTorch, Hugging Face, and AutoML are commonly used by data scientists to build and deploy machine learning models. These tools can help data scientists to automate model selection, hyperparameter tuning, and feature engineering.

 

## Natural language processing specialists
: GPT-3 and Hugging Face are useful for natural language processing specialists working with substantial amounts of data. These tools can help process and analyze text data, translate text between languages, and generate human-like text.

 

## Business analysts
: Tools like AutoML help business analysts to automate the process of building predictive models. It is optimized for business applications, such as fraud detection, customer segmentation, and churn prediction.

 

## Cloud architects
: Kubeflow is particularly useful for cloud architects who manage large-scale machine learning pipelines in cloud environments. It provides tools for deploying and managing machine learning workflows in a scalable and efficient manner.

 

These are just a few examples of professions that can benefit from these AI tools. As AI continues to evolve, we can expect to see many more professions adopting AI tools and techniques into their workflows.

Follow For More Blog updates

visit [www.hypeteq.com](https://hypeteq.com/top-ai-tools-developer-needs-know-about/)