teleren/devto huggingface dataset:
Avoid a Malicious Attack MongoDB: How It Happened and What We Did About It.
Tags: mongodb, database, security, programming
Published: 2023-02-25 08:34:14

Hacked any thing means big loss of organization? And if our database hack then it will be serious consequences for an organization, including financial loss, damage to reputation, and loss of sensitive information.

MongoDB have big community so I think may be not possible to hack this but it's hack,  In this article, we will discuss the very basic way in which a MongoDB database can be hacked, as well as how we can prevent this in simple way.


###The Beginning:

I have been using MongoDB in my application. First day I have create MongoDB database on my own server and added some testing data for testing purpose. Next day what I see there is no data available that was added yesterday. Just ignored because I think may be yesterday delete database by me or deleted data for testing purpose so added more testing data to database.

But Again next day again happen same thing **NO DATA** is available in my database.

###The Realization:
   
   I was not sure what exactly was going on. On initial research, I suspect that may be in background by mistake I have started some service and that is running and deleted my data from database so I have tried many thing like installing again MongoDB and starting and killing process of MongoDB, and again added some testing data. Because I think if background process is running it will be killed.
   
   
**But that was not Solution.** 

What I can see in my database, The new database named **READ_ME_TO_RECOVER_YOUR_DATA** is there with this message: 

> All your data was backed up from your server. You need to email us at EmailName@email to recover your data. If you dont contact us we will reach the General Data Protection Regulation, GDPR,and notify them that you store user data in an open form that is not safe. Under the rules of the law, you face a heavy fine or arrest and your database dump will be deleted from our server forever! 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/877au0vqcebmfgs1cxtl.jpg)




###Why this happen and Why hacker do this:

I created the MongoDB server without authentication, and some hackers were able to steal/delete all of your data, and are probably now expecting you to pay some bitcoin to get it back.



###The Final Fix:

I have uninstall the MongoDB and again installed with solid authentication.


###How to Avoid a Malicious Attack:

####Recommendation is to enable authentication for database.


You will find some MongoDB official doc here: https://www.mongodb.com/blog/post/update-how-to-avoid-a-malicious-attack-that-ransoms-your-data


If you like this post please share your thoughts in the comments. Feel free to follow me @slk5611 for more tech content.

One of my friend is also written about PostgreSQL server hack. If you want to learn about it be sure to follow him @jaytailor45 https://dev.to/jaytailor45/the-anatomy-of-a-postgresql-hack-how-it-happened-and-what-we-did-about-it-b9k


**Thank you for reading. Happy Codding!**
Team of Developers Required as Co-Founders Looking for Developers as Co-Founders
Published: 2023-02-25 08:27:25

Team of Developers Required as Co-Founders
Looking for Developers as Co-Founders for developing application on WEB / Android / iOS for Fingerprints Analysis and Brain Development applications . Required skills CSS / PHP / Java . Email : eka@kriscon.in LinkedIn : www.linkedin.com/in/ekapillai WA 7760587822
Fluxactive Complete - Prostate Health Solution, Benefits, Complaints & Warnings?
Tags: webdev, javascript, beginners, programming
Published: 2023-02-25 08:23:55


If you want to lose several [Fluxactive Complete](url) pounds or you have certain health problems, you should let doctor evaluate you prior to starting an appetite suppressant program. The exact same thing applies when you're in currently on medication. Doctor should assess your the health so you will not be at risk from any impediments. Your physician might even be inside a recommend a suitable [](https://www.outlookindia.com/outlook-spotlight/fluxactive-complete-reviews-prostate-health-flux-active-complete-fake-hype-revealed--news-265041)
https://www.click.in/gurgaon/fluxactive-complete-prostate-health-results-uses-price-c75-v51592990
https://melaninterest.com/pin/fluxactive-complete-prostate-health-solution-benefits-complaints-warnings/ 
https://lexcliq.com/fluxactive-complete-prostate-health-reviews-price-ingredients-scam-or-legit/
https://dsakhnyba.podbean.com/
https://soundcloud.com/fluxactive-complete-383419446/fluxactivecompleteinfo
https://www.linkedin.com/pulse/fluxactive-complete-prostate-health-results-uses-price-complete/
https://www.pinterest.com/pin/946670784151140063/
https://www.crunchbase.com/organization/fluxactive-complete-f7b7
https://www.crunchbase.com/event/fluxactive-complete-7d00
https://www.scoop.it/topic/fluxactive-complete-price-by-fluxactive-complete-buys
https://twitter.com/fluxactivecom17
https://www.sportsblog.com/dsakhnyba/fluxactive-complete-prostate-health-supplement-reviews-price/
https://www.launchora.com/story/fluxactive-complete-prostate-health-reviews-pri
A Quick Guide to Changing Laravel Passwords Using Tinker
Tags: laravel, php, webdev
Published: 2023-02-25 08:09:01

To change a user's password in Laravel using Tinker, you can follow these steps:

Step 1: Open your terminal and navigate to your project directory.

Step 2: Type php artisan tinker to enter the Tinker shell.

Step 3: Retrieve the user by finding the user instance. For example, if you want to change the password for a user with ID 1, you can use the following command:

```shell
$user = App\Models\User::find(1);
```


Step 4: Update the password for the user using the bcrypt function to encrypt the password. For example:

```shell
$user->password = bcrypt('new_password');
```

Step 5: Save the changes by calling the save method on the user instance:

```shell
$user->save();
```
What Are Some Hobbies That Are Beneficial to Coders and Developers?
Tags: discuss, beginners, codenewbie
Published: 2023-02-25 08:00:00

It's important to take breaks from work and engage in hobbies that not only help you relax, but also complement your skills. Here are some of our favorite hobbies. What hobbies to you enjoy that complement your career of give your brain a much needed break from time to time? 

1. **Playing Strategy Games** like chess, poker, or board games require critical thinking, problem-solving, and strategic planning — skills that are essential in coding and developing.
2. **Building and Fixing Computers** can give you a better understanding of how computer hardware works, and this knowledge can come in handy when working on software projects or debugging issues.
3. **Learning a New Language** can expand your cultural knowledge and improve your communication skills, and these are great skills to have when working on a team or communicating with clients.
4. **Creating Art or Music** allows you to exercise your creativity and problem-solving skills. 
5. **Writing** can help you organize your thoughts and communicate ideas clearly. 
6. **Photography** can provide you with opportunities to see the world in a new way and capture moments that inspire you.

What hobbies do you enjoy outside of coding? Share your favorites in the comments below!
Various Environments in Software Development
Tags: webdev, architecture, node, devops
Published: 2023-02-25 07:58:51

The journey of a software, starts from the core idea and goes on to the deployment of the final product. 

As our app, website, web app, or any tech product starts receiving huge traffic, it becomes important to provide the reliable services. 
Any error or bug in the code will lead to servers crashing down, which may eventually lead to huge losses in terms of both finances and number of users. 
Thus, the deployment of a new code, or changes in existing code base must go through a set of procedures to ensure smooth and bug free experience. Therefore, we need different environments, and each has its own role to play.

## There are basically 4 environments or stages:

1. Development Environment
2. Testing Environment
3. Staging Environment
4. Production Environment

## Development Environment
If you have ever written code, then there is a high chance that you were working in Development environment. 
In this environment, it's basically about writing code to build your websites, apps, web-apps, extensions, and everything else.

## Testing Environment
Now once you are done building your product, as a developer, you start writing testing scripts. 
In Test Scripts you write test cases, to test and to find bug in your own code so that you can correct them.
Developers usually do minimal testing in this stage.

## Staging Environment
Once developers are done with developing and testing at their level, codebase is sent for testing in Staging Environment. 
At this stage, rigorous testing is done. 
There are basically two types of tetsing:
1. Automatic Testing
2. Manual Testing

For example your code is staged for first time, then you'll be having Stage 1 -> Version 1.0
Now tester will come up with some improvements. Developer will implement those improvements and thus now you are in Stage 2 and product is in Version 2.0

This stage continues in loop until a satisfactory Version is developed.

## Production Environment
**Anything Which goes into production, has to be defect free.**
This is the simple rule that must be followed.

Once previous stages are complete, code is deployed and is available for customers to use.


So this is a small and crisp information on different environments. Hope you found it useful and interesting. If you do, please follow for more upcoming articles.
What is Overline decentralized connectivity Metaverse?
Tags: metaverse, crypto, nft, ethereum
Published: 2023-02-25 07:40:03

Own a free piece of both the real and virtual world with ÔLand — your digital collectible representing 1.67 acres of land and a slice of the Overline metaverse!

Refferal Link 👇👇
[https://bit.ly/3S04BC0](https://bit.ly/3S04BC0
)

Join the revolution of decentralized telecom with Overline — the people-powered network shaking up the industry like Bitcoin did for banking

Refferal Link 👇👇
[https://bit.ly/3S04BC0](https://bit.ly/3S04BC0
)

Cash in on the wireless world with ÔLand — your ownership stake in Overline’s decentralized network bringing in crypto rewards from every bit of activity passing through your 1.67 acre virtual plot!

Scan QR code for Refferal 👇👇

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


“Maximize your mining rewards with ÔLand — the hotter the wireless activity, the bigger the payouts! And with Emblems (EMB), you can turbocharge your earning potential in the Overline ecosystem.

It’s Free giveaway until minting date.

Refferal Link 👇👇
[https://bit.ly/3S04BC0](https://bit.ly/3S04BC0)
Github Workflow
Published: 2023-02-25 07:39:31

**Events**

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

```
on:
  push:
    paths-ignore:
      - 'docs/**'
```
Ref:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

Alternatively, developers can also add strings in the commit comments to skip manually:
`[skip ci]`
https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs

**Steps**
can be shell scripts, or actions (using "`with`" to configure).

**Jobs: In Parallel vs Sequential**
Jobs can be sequential be specifying "`needs: [job1, job2]`" keywords.

**Expressions & Context Objects**
e.g.  

```
run: echo "${{ toJSON(github) }}"
```

**Example NodeJS project workflow**

```
name: Deploy Project
on: [push, workflow_dispatch]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Get code
        uses: actions/checkout@v3
      - name: Install NodeJS
        uses: actions/setup-node@v3
        with:
          node-version: 18
      - name: Install dependencies
        run: npm ci
      - name: Run tests
        run: npm test
  deploy:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: Get code
        uses: actions/checkout@v3
      - name: Install NodeJS
        uses: actions/setup-node@v3
        with:
          node-version: 18
      - name: Install dependencies
        run: npm ci
      - name: Build project
        run: npm run build
      - name: Deploy
        run: echo "Deploying ..."

```

Useful actions:

**Uploading Job Artifacts**
https://github.com/actions/upload-artifact

**Downloading Artifacts**
https://github.com/actions/download-artifact

```

**Job Outputs**
find dist/assets/*.js -type f -execdir echo 'my-variable={}' >> $GITHUB_OUTPUT ';'
later on, this variable can be accessed via:

outputs:
	script-file: {{ steps.publis.outputs.my-variable }}
```

**Sharing outputs across multiple jobs**
`needs`
https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context

**Caching Dependencies for speeding up jobs**
https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
e.g. use cache action in both build and test, with same hash value in the cache name (to make sure they are using the same cache in the central place):

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o9jsqzzdr37c64liffiu.png)
Getting pixel color from canvas
Tags: webdev, javascript, functional
Published: 2023-02-25 07:30:13

Ever had a problem getting the color of a pixel from a canvas? Well I spent a week figuring it out so you don't have to.

```
function getColorOnCanvas(x, y, canvasElement){
	let imageData = canvasElement.getContext('2d').getImageData(0,0,canvasElement.width, canvasElement.height).data;
	let f = function(x1,y1,width){return y1 * (width * 4) + x1 * 4;}

	let red = imageData[f(x,y,canvasElement.width)];
	let green = imageData[f(x,y,canvasElement.width)+1];
	let blue = imageData[f(x,y,canvasElement.width)+2];
	let alpha = imageData[f(x,y,canvasElement.width)+3];

	return {
		red: red,
		green: green,
		blue: blue,
		alpha: alpha
	};
};
```

_or, if you're feeling fancy_

```
function getColorOnCanvas(x, y, canvasElement, canvasContext){
	let imageData = canvasContext.getImageData(0,0,canvasElement.width, canvasElement.height).data;
	let f = function(x1,y1,width){return y1 * (width * 4) + x1 * 4;}

	let red = imageData[f(x,y,canvasElement.width)];
	let green = imageData[f(x,y,canvasElement.width)+1];
	let blue = imageData[f(x,y,canvasElement.width)+2];
	let alpha = imageData[f(x,y,canvasElement.width)+3];

	return {
		red: red,
		green: green,
		blue: blue,
		alpha: alpha
	};
};
```
C++ Ma'lumot turlari
Published: 2023-02-25 07:11:06

Assalamu aleykum bugun siz bilan `Data types` - `Ma'lumot turlari` xaqida ko'rib chiqamiz.

```
#include <iostream>
using namespace std;
​
int main() {
  int myNum = 5;               // Butun (whole number)
  float myFloatNum = 5.99;     // O'nli kasr
  double myDoubleNum = 9.98;   // O'nli kasr Float bilan chegarasi bilan farq qiladi.
  char myLetter = 'D';         // Char
  bool myBoolean = true;       // Boolean (Rost yoki Yolg'on)
  string myText = "Hello";     // Satr
}
```

**Ma'lumotlarning asosiy turlari**

`Ma'lumotlar turi` o'zgaruvchini saqlaydigan ma'lumot hajmi va turini belgilaydi:


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

**Raqam turlari** - `integer` = `int` - butun sonlar uchun.

```
#include <iostream>
using namespace std;
​
int main() 
{

  int butun = 13; // Butun (whole number)

return 0;
}
```

**Raqam turlari** - `float` - kasr sonlar uchun.

```
#include <iostream>
using namespace std;
​
int main() 
{

  int mn = 13.15; // Haqiqiy (whole number)

return 0;
}
```
**double** - kasr sonlar uchun.

**Misol uchun:**

```
#include <iostream>
using namespace std;

int main()
{

double myNum = 19.99;
cout << myNum;

return 0;
}
```
**float va double**

**float** - nuqtadan keyin uzida 8 ta sonlar  xotirasida saqlay oladi xolos.
**double **- esa nuqtadan keyin uzida 16 ta sonlar xotirasida saqlay oladi xolos.


**String** - `satr turlari`;
`String` - turi belgi (matn yoki tekst) bir ketma-ketlikni saqlash uchun ishlatiladi. Satrda yozilganidek qo'shtirnoq yozishni unutmang.

**Misol uchun:**

```
#include <iostream>
using namespace std;

int main()
{

cout << "Biz C++ o'rganishni boshladik";

return 0;
}
```
**char** - `belgilar turlari`.
`char` - ma'lumotlar turi saqlash uchun foydalanadigan `yagona` belgi. Belgilar 'A', yoki 'c' kabi bir tirnoq bilan o'ralgan bolishi kerak:

Misol uchun:

```
#include <iostream>
using namespace std;

int main()
{

char belgi = 'A';
char belgi1 = 'c';
char belgi2 = '#';

cout << belgi << endl;
cout << belgi1 << endl;
cout << belgi2;

return 0;
}
```

`Shu bilan bir qatorda, siz ma'lum bir belgilarni ko'rsatish uchun  ASCII  qiymatlaridan foydalanishingiz mumkin:`

```
#include <iostream>
using namespace std;
​
int main()
 {
  char a = 65, b = 66, c = 67;
  cout << a;
  cout << b;
  cout << c;

return 0;
}
```
**Natija:** `ABS`

**Boolean turlari**

`Boolean` ma'lumotlar turi bilan e'lon qilinadi `bool` kalit so'z va faqat qiymatlarni qabul qilishi mumkin `true`, yoki `false`. Qiymat qaytarilganda `true = 1` va `false = 0`.

**Misol uchun:**

```
#include <iostream>
using namespace std;
​
int main() 
{
    bool togri = true;
    bool yolgon = false;
    cout << togri;  // Chiqadi 1 (true)
    cout << yolgon;  // Chiqadi 0 (false)

return 0;
}
```
How To Remove Background Noise From Audio - Adobe Audition
Tags: webdev, javascript, beginners, programming
Published: 2023-02-25 06:53:36

To remove background noise in Adobe Audition, you can use the following steps or follow my [youtube tutorial](https://www.youtube.com/watch?v=1ZH1DodzAtg&t=10s) :

1. Import the audio file that you want to remove the background noise from into Adobe Audition.
2. Select the part of the audio file that contains the background noise by highlighting it.
3. Click on the "Effects" tab in the top menu and choose "Noise Reduction/Restoration" from the drop-down menu.
4. From the sub-menu that appears, select "Noise Reduction (process)".
5. In the "Noise Reduction (process)" dialog box, click on the "Capture Noise Print" button to select the background noise.
6. After selecting the noise, click on the "OK" button to close the dialog box.
7. Now select the entire audio track by pressing "Ctrl+A" or "Cmd+A" on your keyboard.
8. Go back to the "Effects" tab, choose "Noise Reduction/Restoration" again, and this time select "Noise Reduction (process)".
9. In the "Noise Reduction (process)" dialog box, adjust the "Reduction" and "Residue" sliders to reduce the background noise to the desired level.
10. Preview the changes by clicking on the "Preview" button, and adjust the settings as needed.
10. When you're satisfied with the results, click on the "OK" button to apply the changes to the audio file.
By following these steps, you should be able to effectively remove the background noise from your audio file in Adobe Audition.
How to get the time duration of cumulative temperature values
Tags: help, mongodb
Published: 2023-02-25 06:29:59

Hi,
I am having a new requirement in mongodb, I am having a collection and having a fields like dId, tmp, and createdOn,
my requirement is to get the cumulative tmp values which are greater than 10 for 24 hours with in last two days from the current date. For getting the last two days records from current date I am using the following aggregation

[ { $match: { createdOn: { $gte: new Date(new Date().getTime() - 22460*60 * 1000) } } } ]

For example i am having a data like
/* 1 */
{
“_id” : ObjectId(“61e67d390fcdd25fa73aa080”),
“dId” : “356849088494265”,
“tmp” : 7.0,
“createdOn” : ISODate(“2022-01-18T08:41:29.932Z”)
}

/* 2 */
{
“_id” : ObjectId(“61e67d390fcdd25fa73aa081”),
“dId” : “356849088494265”,
“tmp” : 25.9,
“createdOn” : ISODate(“2022-01-18T08:42:29.953Z”)
}

/* 3 */
{
“_id” : ObjectId(“61e67d390fcdd25fa73aa082”),
“dId” : “356849088494265”,
“tmp” : 5,
“createdOn” : ISODate(“2022-01-18T08:45:29.953Z”)
}

/* 4 */
{
“_id” : ObjectId(“61e67d390fcdd25fa73aa083”),
“dId” : “356849088494266”,
“tmp” : 26.0,
“createdOn” : ISODate(“2022-01-18T08:41:29.953Z”)
}

/* 5 */
{
“_id” : ObjectId(“61e67d470fcdd25fa73aa085”),
“dId” : “356849088494266”,
“tmp” : 12.5,
“createdOn” : ISODate(“2022-01-18T08:50:29.953Z”)
}

/* 6 */
{
“_id” : ObjectId(“61e67d470fcdd25fa73aa086”),
“dId” : “356849088494266”,
“tmp” : 25.9,
“createdOn” : ISODate(“2022-01-18T08:55:29.953Z”)
}

/* 7 */
{
“_id” : ObjectId(“61e67d470fcdd25fa73aa087”),
“dId” : “356849088494266”,
“tmp” : 7.0,
“createdOn” : ISODate(“2022-01-18T08:56:29.953Z”)
}

/* 8 */
{
“_id” : ObjectId(“61e67d470fcdd25fa73aa088”),
“dId” : “356849088494267”,
“tmp” : 26.0,
“createdOn” : ISODate(“2022-01-18T09:41:29.953Z”)

}

/* 9 */
{
“_id” : ObjectId(“61e67d530fcdd25fa73aa08a”),
“dId” : “356849088494267”,
“tmp” : 26.0,
“createdOn” : ISODate(“2022-01-18T09:55:29.953Z”)
}

/* 10 */
{
“_id” : ObjectId(“61e67d530fcdd25fa73aa08b”),
“dId” : “356849088494267”,
“tmp” : 2.0,
“createdOn” : ISODate(“2022-01-18T09:56:29.953Z”)
}

Here i am providing 3 different dId’s, which are 356849088494265, 356849088494266 and 356849088494267, and providing their tmp values and their dates, whenever tmp value changes the new record will be inserted with their tmp value, and with createdOn date with time and its device Id which is dId.

So here we can observe that for dId: 356849088494265 for record 2 the tmp value is 25.9 which is greater than 10 and its date and time is 2022-01-18T08:42:29.953Z. And In 3rd record its tmp value is 5 which is less than 10 and its date and time is 2022-01-18T08:45:29.953Z . the tmp value is greater than 10 for 8:42 to 08:45 right? i have to get that time duration.
Artificial Intelligence Training in Chennai | AI Course in Chennai
Published: 2023-02-25 06:21:02

Take your career to the next level with advanced [Artificial Intelligence training in Chennai](https://www.softlogicsys.in/artificial-intelligence-training-in-chennai/)! Learn the fundamentals of Artificial Intelligence and Machine Learning with our comprehensive training courses in Chennai. Get hands-on experience with the latest AI tools and techniques. Our instructors are experts in the field with years of experience to share, so you can get up-to-date knowledge about AI and ML. Upgrade your skills and be job-ready for the future.
Show detail data of a table with ngFor in Angular
Tags: angular, typescript, javascript, programming
Published: 2023-02-25 06:12:46

The ngFor core directive allows us to create lists and data display tables in our HTML templates. It also has its own "let" with which we can pass information to show the detail of a table.

In the following example we have this array:



![array_heroes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gc3y3xvl6vaa5klwoaid.png)



In a table we will show the general part of the array and then we will pass the "info" as a parameter using ngFor so that it is displayed in a second table.

We show the general data in the table, and clicking on the name will show the detail in another table.

![first_table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eom15kyylg77eqfmg23w.png)


![display](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oaiwcxltmc4ucge7t6hc.png)



![detail_data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvsobdx2p9tz73ms5o0k.png)


Now we use the variable that contains the table detail with another ngFor on the table that we want to display.


![detail_table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vt9zs5xj9qsorwp0qfad.png)

Thanks for reading, you share if it served you 😉