teleren/devto huggingface dataset:
[Hack] PicoCTF : GET aHEAD
Tags: cybersecurity
Published: 2023-07-24 09:00:00

Passing through the [picoCTF](https://play.picoctf.org/practice/challenge/) web challenges, the chosen challenge is called "GET aHEAD", which means that's something about requests of a web page, maybe a GET request, or something in the Header parameters response.

First, let's look at the page:

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

A simple page that changes the background of the page.
If the user selects Red, the page background-color changes to red. 
If the user selects Blue, the page background-color changes to blue.

First let's check the requisition on the [Postman](postman.com/), maybe I can find something useful there.

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

First I did a GET Request, but nothing useful came in the header response. Playing a little with the options, I found the request for HEAD, and then tried to send a standard request:


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

With only that change, the response headers have the final CTF flag :

{% spoiler Answer:Flag %}
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o968pelbqbpuit8gt6l.png)
Flag : picoCTF{r3j3ct_th3_du4l1ty_70bc61c4}
{% endspoiler %}

That was a simple flag, to make the user learn that not only exists the GET and POST Request Methods.
I'm pledging $30K to open source. Which efforts need support?
Tags: opensource
Published: 2023-07-24 08:55:06

I'm a self-taught developer since the late 90s which is a phrase I honestly wouldn't have been able to say had it not been for open source.

I absolutely love the OSS ecosystem and am eternally grateful for what it has offered me and effectively the career it has enabled. Therefore, earlier this month I sent out a [tweet](https://twitter.com/birk/status/1676592046386077697) pledging $30K of my savings toward impactful open source efforts that maintainers want or are pursuing. 

I'm starting with efforts around education ($10K). Everything from updating docs, translating them to creating educational materials around OSS initiatives. Or software for education itself which is OSS.

I've been looking at GitHub Issues with labels such as "docs", chatting with a few maintainers about upcoming efforts and more. However, I would also greatly appreciate suggestions from the community.

So if you know of any outstanding issues/efforts around improving education surrounding the OSS libraries you use and like, I'd greatly appreciate your recommendations and links to such GitHub issues or equivalent. Thank you :)
“Shadows of Intent: Probing the Mind to Protect”
Tags: neuralnetworks, brainwavedetection, smartcitysecurity, justicetech
Published: 2023-07-24 08:35:08


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

https://chattywriters.com/index.php/2023/07/24/shadows-of-intent-probing-the-mind-to-protect/
Dual Boot Your PC with Windows 10 and Ubuntu
Tags: apacheage, ubuntu
Published: 2023-07-24 08:34:55

Your computer or laptop most likely already has Windows 10 installed, and you want to add Ubuntu as a second operating system. Even though neither system is currently installed, you should first install Windows 10 before configuring dual boot with Ubuntu.


## Step 1: Prepare Windows

First, check whether your system is set up for dual booting at all. For this UEFI is needed, the further development of BIOS. Newer PCs and laptops should be equipped with the interface in any case. To be sure, you can simply call up the system information. You should find the corresponding information under the item “BIOS Mode”.

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

For the Ubuntu installation, you will also require storage. The second operating system should have its own hard disk, if possible. If there is only one available, a new partition must be made. Plan at least 20 GB here so you can effectively use Ubuntu. However, more is undoubtedly preferable.




## Step 2: Prepare A Bootable USB

Now you create a bootable USB stick. First you need an empty USB stick. Then download the ISO image of Ubuntu (or a comparable distribution). Now you need some software to make the USB stick bootable. The tool called Rufus is often used for this. With this, only a few clicks are needed to load the ISO file correctly onto the stick. 

You may also need to set the correct boot order in UEFI. To do this, start the BIOS and set it to boot from a USB stick first.

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




## Step 3: Install Ubuntu

After making all the necessary preparations, restart the computer or laptop by inserting the USB stick. The Ubuntu setup application will now be launched by the BIOS after it has accessed the USB stick. Follow the instructions of the installer until the software asks you if you want to install Ubuntu in addition to Windows 10 (or Windows Boot Manager).                                                                      In the next step, you just need to verify that the software has chosen the correct partition for the installation. When you have completed the setup, both operating systems are installed in parallel. Now remove the USB stick again, so that the system will not try to boot from it at the next startup.



## Step 4: Select Operating System


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

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


You can download Ubuntu from this link: [https://ubuntu.com/download/desktop]
"In the Eye of the Tech-Storm: Navigating Crime with Neural Networks"
Tags: aiinaction, neuralnetworks, safercities, cuttingedgecrimeprevention
Published: 2023-07-24 08:32:37


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

https://chattywriters.com/index.php/2023/07/24/in-the-eye-of-the-tech-storm-navigating-crime-with-neural-networks/
Kotlin Code Smell 21 - Mocking Business
Tags: kotlin, codesmells, cleancode, programming
Published: 2023-07-30 05:35:33

---
title: Kotlin Code Smell 21 - Mocking Business
published: true
date: 2023-07-24 08:30:09 UTC
tags: kotlin,codesmells,cleancode,programming
canonical_url: https://yonatankarp.com/kotlin-code-smell-21-mocking-business
---

## Problem

- Complexity

- False sense of security.

- Parallel/Paired objects (real and mocks) can lead to maintainability issues.

- Maintainability

## Solution

- Mock just non-business entities.

- Remove the mock if its interface has too much behavior.

## Sample Code

### Wrong

```
class PaymentTest {
    @Test
    fun `process payment should return true on successful payment`() {
        val paymentDetails = mapOf(
            "amount" to "100",
            "currency" to "USD",
            "cardNumber" to "1234567890123456",
            "expiryDate" to "12/20",
            "cvv" to "123"
        )

        // We should not mock a business object
        val payment = mockk<Payment>()
        every { payment.process(any(), any()) } returns true

        // This is an external and coupled system.
        // We have no control on it so tests might be fragile
        val authorizeNet = AuthorizeNetAIM(Payment.API_ID, Payment.TRANSACTION_KEY)

        val result = payment.process(authorizeNet, paymentDetails)
        assertTrue(result)
    }
}

```

### Right

```
class PaymentTest {
    @Test
    fun `process payment should return true on successful payment`() {
        val paymentDetails = mapOf(
            "amount" to "100",
            "currency" to "USD",
            "cardNumber" to "1234567890123456",
            "expiryDate" to "12/20",
            "cvv" to "123"
        )

        val payment = Payment()

        // External system is mocked
        val response = Response(approved = true, transactionId = "1234567890")
        val authorizeNet = mockk<AuthorizeNetAIM>()
        every { authorizeNet.authorizeAndCapture() } returns response

        val result = payment.process(authorizeNet, paymentDetails)
        assertTrue(result)
    }
}

```

## Exceptions

- Mocking accidental problems (serialization, databases, APIs) is a very good habit to avoid coupling.

## Conclusion

Mocks, like other test doubles, are valuable tools. Using them judiciously is an art.

Imagine a play in which each actor, instead of rehearsing with other actors, had to interact with 25 scriptwriters. The actors would never rehearse together. How would the result of the play be?

* * *

I hope you enjoyed this journey and learned something new. If you want to stay updated with my latest thoughts and ideas, feel free to register for my [**newsletter**](https://yonatankarp.com/newsletter). You can also find me on [**LinkedIn**](https://www.linkedin.com/in/yonatankarp/) or [**Twitter**](https://twitter.com/yonatan_karp). Let's stay connected and keep the conversation going!

* * *

## Credits

- [Code Smell 30 - Mocking Business](https://maximilianocontieri.com/code-smell-30-mocking-business) by [Maxi Contieri](https://hashnode.com/@mcsee)
Risk Management in the Era of Virtualization: Ensuring Business Continuity, Disaster Recovery, and Hardware Independence
Tags: webdev, security, devops, news
Published: 2023-07-24 08:20:17

One of the primary concerns for any business is maintaining uninterrupted operations during unexpected disruptions. Virtualization plays a crucial role in ensuring business continuity by creating a virtual representation of physical servers, networks, and storage devices. This allows for seamless data migration and flexible resource allocation, mitigating the risk of downtime caused by hardware failures or maintenance.


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

By leveraging virtual machines and containers, businesses can promptly shift workloads and applications between different host servers. This versatility enhances fault tolerance and minimizes the impact of hardware malfunctions, ensuring the continuity of critical business operations.

Disasters, whether natural or cyber-related, can strike at any moment and pose significant threats to an organization's data and infrastructure. Traditional disaster recovery methods often involve complex backup procedures and lengthy recovery times. Virtualization, however, offers a more efficient and scalable approach to disaster recovery.

With virtualized environments, snapshots and backups of entire systems can be created rapidly. In the event of a disaster, these snapshots can be restored onto alternative infrastructure, reducing recovery time objectives (RTO) and recovery point objectives (RPO) considerably. This swift recovery process aids in maintaining productivity and customer service, even during challenging times.

Companies like [Serverspace](https://serverspace.us/) have been at the forefront of enabling organizations to harness the full potential of virtualization. Serverspace offers a range of virtual machines and cloud-based services tailored to diverse business needs. By hosting critical workloads on virtual servers, businesses can reduce hardware dependency, cut down operational costs, and quickly scale resources based on demand.
Nhà cái tặng tiền
Tags: webdev, javascript
Published: 2023-07-24 07:40:15

Điều kiện tham gia khuyến mãi của nhà cái tặng tiền JUN88
[Nhà cái tặng tiền](https://tangtien.net/) JUN88 là một trong những điểm đến hàng đầu của các anh em cược thủ. Bên cạnh kho game bài hấp dẫn, mới mẻ anh em còn có nhiều cơ hội nhận tiền. Những phần thưởng mà nhà cái đưa ra luôn tạo được sự hứng khởi cho thành viên của mình. Ít nhiều thì đây cũng chính là nguồn thu nhập phụ khi tham gia cá cược trực tuyến. Để biết chi tiết hơn thì anh em có thể theo dõi bài viết sau.
Vì sao anh em không nên bỏ qua khuyến mãi JUN88?

Vì sao anh em không nên bỏ qua khuyến mãi JUN88?
JUN88 được xem là một trong các sân chơi chất lượng bậc nhất thị trường. Nhà cái này đã thu hút không ít thành viên đăng ký tham gia. Ngoài sự uy tín, chuyên nghiệp thì hệ thống khuyến mãi tặng tiền của JUN88 cũng vô cùng hấp dẫn.
Anh em nên cập nhật các chương trình khuyến mãi JUN88 thường xuyên. Bởi lẽ sân chơi này tung ra rất nhiều ưu đãi hấp dẫn. Nếu anh em bỏ lỡ thì sẽ vô cùng nuối tiếc. Dù là người chơi mới hay cũ thì tiền thưởng ẩn chứa trong các sự kiện khuyến mãi cũng rất lớn. Đó chắc chắn sẽ đủ để anh em cá cược vài giờ đồng hồ đấy nhé!
Với cương vị là một nhà cái uy tín, chất lượng thì JUN88 luôn được người chơi ưu tiên hàng đầu. Dù nói về kho trò chơi hay khuyến mãi, tỷ lệ đổi thưởng thì anh em cũng khó tìm được một nhà cái thứ 2 như JUN88.
Điều kiện để nhận khuyến mãi của JUN88

Điều kiện để nhận khuyến mãi của JUN88
Bất kỳ nhà cái nào khi tổ chức khuyến mãi cũng đưa ra một vài điều kiện. Việc này sẽ giúp giữ gìn sân chơi được công bằng, chặt chẽ. Vì thế trước khi tham gia các chương trình khuyến mãi của JUN88, anh em phải đáp ứng những điều kiện cơ bản sau đây:
Phải là thành viên chính thức
Đây hẳn là việc không cần phải bàn đến bởi không phải hội viên thì anh em sẽ không tham gia được bất cứ khuyến mãi nào. Ngay cả việc nhà cái tặng tiền khi đăng ký cũng cần trở thành hội viên chính thức mới được trả thưởng.
Anh em khi đăng ký cần đảm bảo tài khoản chính chủ. Nếu để lộ tình trạng dùng thông tin người khác hoặc tạo tài khoản thứ 2 sẽ bị nhà cái khóa ngay lập tức. Tất nhiên tiền thưởng khuyến mãi sẽ không được chi trả.
Tuân thủ nghiêm các chính sách chung
Người chơi phải tuân thủ nghiêm mọi quy tắc của nhà cái. Trong đó, các hành vi lừa đảo, gian lận hay cố tình hack chương trình để thay đổi kết quả trả thưởng. Nhà cái sẽ khóa tài khoản và tịch thu toàn bộ tiền thắng cược.
Số dư tài khoản đạt mức tối thiểu
Tài khoản người chơi phải có số dư tối thiểu thì mới tham gia quay thưởng các ưu đãi. Đồng thời, anh em cũng không được sử dụng tài khoản người chơi khác. Đây được xem là một phần trong chính sách bảo mật mà nhà cái đưa ra.
Kết luận
Hy vọng với những thông tin trên, anh em đã biết được những điều cần lưu ý khi tham gia các chương trình nhà cái tặng tiền JUN88. Mọi người chưa đăng ký thì đừng chần chờ nữa mà hãy trải nghiệm ngay hệ thống cá cược của nhà cái nhé!
Get file name without extension in laravel
Published: 2023-07-24 07:33:43

if ($request->hasfile('filename')) {
    $image = $request->filename;
    $namewithextension = $image->getClientOriginalName(); 
    //Name with extension 'filename.jpg'
    $name = explode('.', $namewithextension)[0]; 
    // Filename 'filename'
    $extension = $image->getClientOriginalExtension(); 
    //Extension 'jpg'
    $uploadname = time() . '.' . $extension;
    $image->move(public_path() . '/uploads/', $uploadname);
}
Handling the Change Password url
Published: 2023-07-24 07:36:02

---
title: Handling the Change Password url
published: true
date: 2023-07-24 07:23:42 UTC
tags: 
canonical_url: https://blog.mandraketech.in/handling-the-change-password-url
---

Most web applications require user identification for login. There are normally two possible strategies (build vs buy):

1. Build your own

2. Use a 3rd Party identity service, like Google or Okta

In either of the cases, there is the need to "change password".

The browser and stand-alone password managers have a standard URL to use to enable their users to change passwords, especially when the security analysis shows that there may have been a leak, either from their site or where the "same" password has been reused.

The best practice is to redirect the `/.well-known/change-password` URL to the page where the password can be changed by the user.

Also, the field that asks for the current password should have the `autocomplete="current-password"` property in it, to enable the password managers to behave correctly.

Google has a great page to call out these, and more practices:

[https://web.dev/change-password-url/](https://web.dev/change-password-url/)

If you are interested in the standards page to see this, and more in the `.well-known` world, check out these :

`.well-known` change-password specification

[https://w3c.github.io/webappsec-change-password-url/](https://w3c.github.io/webappsec-change-password-url/)

All `.well-known` registered URLs:

[https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml](https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml)
How cryptocurrency destroys environment
Tags: web3, environment, bitcoin, ethereum
Published: 2023-07-24 07:22:29

I want to bring up a horrible cryptocurrency impact on environment.

> Cryptocurrency has an energy consumption problem. Bitcoin alone is estimated to consume 127 terawatt-hours (TWh) a year — more than many countries, including Norway. In the United States, cryptocurrency activity is estimated to emit from 25 to 50 million tons of CO2 each year, on par with the annual emissions from diesel fuel used by US railroads.

https://rmi.org/cryptocurrencys-energy-consumption-problem/

How could we contribute tackling this? Could we maybe brainstorm possible actions on this?

Some ideas which already came to my head are: 

1. Not using crypto. If one has to, choosing better alternatives than bitcoin.
2. Supporting development of environment friendly crypto.
3. Avoiding support for bitcoin wherever possible to reduce it's attractiveness to the users, businesses and investors. Once its worth falls, mining it becomes unprofitable.
Upgrade Perl 5.16.3 to 5.30.3 for Mojolicious 9.22 Framework
Tags: mojolicious, perl
Published: 2023-07-24 07:17:19

Dear Folks,

I have tried to upgrade existing Perl 5.16.3 version of server to 5.30.3. But when I ran mojolicious code using 

/soft/perl/bin/morbo -l "http://*:1000" filename
where perl / -> 5.30.3 (softlink). What upgrade could have been made in the existing code. Using Mojolicious 9.22 (version). Kindly, share your expertise to help me in solving this problem.

--
Thanks
ANUJ JAIN
Jest vs. Vitest: Which Test Framework Would You Choose for a New Project?
Tags: testing, javascript, jest, webdev
Published: 2023-07-24 07:06:03


Hey Dev.to community!

I'm starting a [new project under Firecamp](https://github.com/firecamp-dev/firecamp), and I'm currently trying to decide on a test framework for my TypeScript code. I've narrowed down my choices to two popular options - Jest and Vitest. However, I'm having a hard time making the final decision, and I'd love to hear your insights and experiences.

**If you were starting a project today, which test framework would you go with - [Jest](https://jestjs.io/) or [Vitest](https://vitest.dev/)? And more importantly, why would you choose one over the other?**


Your insights will play a crucial role in helping me and others in the community make an informed choice when starting new projects.

Looking forward to hearing your opinions and experiences!

Thank you in advance for your valuable input.

Best regards,
[Nishchit](https://twitter.com/Nishchit14)
How to update a value incrementally (+1) in MySQL
Published: 2023-07-24 07:00:00

**Updating a value incrementally in MySQL is a common task for developers. It is useful when you want to keep track of something, such as the number of times a user has performed a certain action. In this blog post, we will discuss how to update a value incrementally in MySQL using the UPDATE statement and the SET clause.**

---

### _Tools used in this tutorial_
[DbVisualizer](https://www.dbvis.com/download/), top rated database management tool and SQL client
The [MySQL database](https://dev.mysql.com/downloads/mysql/) version 8 or later

---

## The UPDATE Statement
The `UPDATE` statement is used to modify existing data in a table. The `SET` clause is used to specify the columns to be updated and the new values for those columns. To update an integer value, you can use the + operator along with the column name. Here is an example:

```
1 UPDATE table_name SET column_name = column_name + 1 WHERE condition;
```
In this example, `table_name` is the name of the table, `column_name` is the name of the column to be updated, and `condition` is the condition that must be met for the update to occur. The `column_name + 1` syntax increments the column's current value by 1.

## Examples
Let's say we have a table named `users` with a column named `login_count`. We want to increment the `login_count` column by 1 every time a user logs in. Here is the SQL query we can use:

```
1 UPDATE users SET login_count = login_count + 1 WHERE id = 1;

```
This query will update the `login_count` column of the user with an `id` of 1 by adding 1 to the current value.

## Conclusion
Updating a value in MySQL is a simple task that can be accomplished using the `UPDATE` statement together with the `SET` clause. By using the `+` operator along with the column name and integers you can easily increment the current value of a column by an integer. This is useful when you want to increment the value of a column again, again, and again to create a “snowball” effect when a user performs a specific action.


## About the author
The Table by DbVisualizer is where we gather together to learn about and simplify the complexity of working with database technologies.
Resilience & Perseverance: How Vital Are They?
Tags: codenewbie, beginners, discuss, career
Published: 2023-07-24 07:00:00

_This week, we're diving into the essential qualities that define exceptional coders. Share your practical tips, inspiring stories, and invaluable insights to help our newbies cultivate these qualities and unlock their full coding potential. Together, let's empower the next generation of coding superstars. Today's quality is:_ 

**Resilience and Perseverance**

> How do you maintain resilience and persevere through challenges and setbacks while coding? Any personal practices or mindsets you adopt?

> Can you recall a difficult coding problem that tested your resilience? How did you overcome it, and what did you learn from the experience?

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*