Search This Blog

Wednesday, 8 May 2024

Activate Windows 10 using Command prompt trick

 

 By command prompt

Step 1: Click on the start button, search for “cmd” then Open Command Prompt (cmd) as administrator.

The following is the list of Windows 10 Volume license keys.

Home: TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Home N: 3KHY7-WNT83-DGQKR-F7HPR-844BM
Home Single Language: 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
Home Country Specific: PVMJN-6DFY6–9CCP6–7BKTT-D3WVR
Professional: W269N-WFGWX-YVC9B-4J6C9-T83GX
Professional N: MH37W-N47XK-V7XM9-C7227-GCQG9
Education: NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
Education N: 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ
Enterprise: NPPR9-FWDCX-D2C8J-H872K-2YT43
Enterprise N: DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4

Step 2: Install KMS client key

Type this command (note: replace yourlicensekey according to your windows edition license key given above.)

slmgr /ipk yourlicensekey

Set KMS machine address

Use the command “slmgr /skms kms8.msguides.com” to connect to my KMS server.

Activate your Windows

The last step is to activate your Windows using the command “slmgr /ato”.

Now check the activation status again.

Windows 10 is activated successfully.

Sunday, 31 March 2024

How to Recover Deleted Files Using Foremost in Linux?

 

How to Recover Deleted Files Using Foremost in Linux?

Foremost is a digital forensic application that is used to recover lost or deleted files. Foremost can recover the files for hard disk, memory card, pen drive, and another mode of memory devices easily. It can also work on the image files that are being generated by any other Application. It is a free command-line tool that is pre-installed in Kali Linux. This tool comes pre-installed in Kali Linux. Foremost is a very useful software that is used to recover the deleted files, if some files are deleted accidentally or in any case files are deleted. You can recover the deleted files from foremost only if the data in the device is not overridden, which means after deleting the files no more data is added to the storage device because in that case data may be overridden and the chances of recovery also get reduced and data must get corrupted.

Installing the Foremost Tool:

Use the following command to install this tool in any Debian based Linux Operating System or in any other Operating System using the APT package manager.

sudo apt install foremost

Use the following command to install this tool using dnf package manager

sudo dnf install foremost

Use the following command to install this tool using Pacman package manager or in Arch Linux.

sudo pacman -S foremost

Syntax:

foremost [options]

foremost help

Here you can check the options available and their functions. Let us now see how to recover deleted files using foremost: 

Recovering from USB/Hard Disk:

  • Connect the External memory storage with the system.
  • First, you need to know the path of your external memory device, for that use the command
fdisk -l
  • Now from here, you can copy the path of the disk.

fdisk disk listing

  • After copying the device path, now we have to recover the files from that device.

Use the options available by the “foremost -h” command.

For example 

foremost -t jpg,pdf,mp4,exe -v -q -i /dev/sdb2 -o /root/desktop/recover

Here I use this command to recover the data from the device.

  • -t: It is the type of files we want to recover. Here I want to recover jpg, pdf,mp4, and exe files.
  • -q: It is a quick scan for the device
  • -i: It means the input as in this case external memory.
  • -o: It is the output folder, where to save the recovered files.

recover data with foremost command

Hereafter running this command, all the files will be saved in the folder name as mentioned. Here you can see the folder recover on desktop and all the files will be stored here.


Tuesday, 6 February 2024

Top 10 and Most useful Strings Operation in C++

 String functions play a key role in manipulating and processing text in C++

And as a C++ programmer, mastering these functions is essential for completing projects and improving your overall programming skills. 

In this post, we'll review a comprehensive list of C++ string functions that will help you streamline your string operations and write clean and efficient code. 

From searching for a substring to replacing text, this list comes equipped with clear definitions and examples that will help you take your project to the next level. 

List of C++ string functions

Without further ado, let's dive in.

C++ String Functions

1. String Length: std::string::length

The string length function calculates the length (number of characters) of a string.

Example:

#include <iostream>
#include <string>
int main() {
  std::string str = "Hello, World!";
  int length = str.size();  // Returns the length of the string, which is 13
  std::cout << "The length of the string is: " << length << std::endl;
    return 0;
}

Output:

The length of the string is: 13

2. String Copy: std::strcpy

The string copy function copies a string from a source location to a destination location.

Example:

#include <iostream>
#include <cmath>
int main() {
    char source[] = "Hello, World!"; // Source string
    char destination[20]; // Destination character array
    std::strcpy(destination, source); // Copy the source string to the destination
    std::cout << "Source string: " << source << std::endl;
    std::cout << "Copied string: " << destination << std::endl;

    return 0;
}

Output:

Source string: Hello, World!
Copied string: Hello, World!

3. String Comparison: std::string::compare

The string comparison function compares two strings lexicographically and returns an integer representing the result.

Example:

#include <iostream>
#include <string>
int main() {
  std::string str1 = "apple";
  std::string str2 = "banana";
  int result = str1.compare(str2);
  if (result == 0) {
    std::cout << "The strings are equal." << std::endl;
  } else if (result < 0) {
    std::cout << "The string str1 is less than str2." << std::endl;
  } else {
    std::cout << "The string str1 is greater than str2." << std::endl;
  }
  return 0;
}

Output:

The string str1 is less than str2.

4. String Conversion to Integer: std::stoi

This function converts a string to an integer.

Example:

#include <iostream>
using namespace std;
int main() {
  string str = "123";
  int num = stoi(str);
  cout << num << endl;
  return 0;
}

Output:

123

5. String Conversion to Double: std::stod

This function converts a string to a double.

Example:

#include <iostream>
using namespace std;
int main() {
  string str = "3.14";
  double num = stod(str);
  cout << num << endl;
  return 0;
}

Output:

3.14

6. Numeric to String Conversion: std::to_string

This function converts a number to a string.

Example:

#include <iostream>
#include <string>
using namespace std;
int main() {
  int num = 42;
  string str = to_string(num);
  cout << str << endl;
  return 0;
}

Output:

42

7. String Concatenation: std::string::operator+

This function concatenates two strings. 

Example:

#include <iostream>
#include <string>
using namespace std;
int main() {
  string str1 = "Hello";
  string str2 = " World!";
  string result = str1 + str2;
  cout << result << endl;
  return 0;
}

Output:

Hello World!

8. String Substring: std::string::substr

The string substring function extracts a substring from a string, starting at a specified position and with a specified length.

Example:

#include <iostream>
#include <string>
int main() {
  std::string str = "Hello, World!";
  std::string substr = str.substr(75);  // Extracts "World" from the original string
  std::cout << "The substring is: " << substr << std::endl;
  return 0;
}

Output:

The substring is: World

9. String Padding: std::setw

The string padding function pads a string with a specified character or space to a certain width.

Example:

#include <iostream>
#include <string>
using namespace std;
int main() {
  string str = "Hello";
  cout << setw(10) << setfill(' ') << str << endl;
  return 0;
}

Output:

Hello

10. String Replacement:

This function replaces a portion of a string with another string.

Example:

#include <iostream>
#include <string>
using namespace std;
int main() {
  string str = "Hello, World!";
  str.replace(75"Universe");  // Replaces the substring "World" with "Universe"
  cout << str << endl;=

  return 0;
}


Output: 

Hello, Universe!

Using String Functions in C++

String functions are a crucial component of any programming language and C++ is no different. Once you're comfortable with these functions, you'll be able to manipulate several lines of text simultaneously to achieve whatever outcome you desire. Keep this post handy as a reference sheet that you can return to whenever you need a quick reminder on how to call string functions in C++.

Saturday, 2 December 2023

What is Difference in Node MCU and Arduino, IOT Development Boards

Introduction:

NodeMCU and Arduino are both popular platforms for building DIY electronics projects, but they have some key differences in terms of their hardware, programming languages, and use cases.

NodeMCU:

NodeMCU is a development board that utilizes the ESP8266 WiFi module.

It includes a built-in USB-to-Serial converter, allowing easy programming and communication with a computer.





Programming Language:

NodeMCU is typically programmed using the Lua scripting language, though it also supports Arduino IDE with additional ESP8266 board support.

Lua is a lightweight scripting language, and it is often used in embedded systems.


Wireless Connectivity:

NodeMCU is designed with a focus on wireless connectivity, making it well-suited for IoT (Internet of Things) projects.

It has built-in WiFi capabilities, enabling it to connect to the internet and communicate with other devices.


Use Cases:

Commonly used for IoT projects, home automation, and projects that require wireless communication.

Suitable for applications where internet connectivity and real-time data transfer are essential.


Arduino:

Arduino is an open-source electronics platform that can use various microcontrollers. The most popular one is the AVR-based Arduino boards, but there are also Arduino boards based on other microcontroller architectures, such as ARM.

Arduino boards do not typically have built-in WiFi capabilities.




Programming Language:

Arduino is typically programmed using the Arduino IDE, which uses a simplified version of C/C++.

The Arduino IDE abstracts away some of the complexities of low-level programming, making it beginner-friendly.


Connectivity:

Arduino boards can connect to the internet using shields or modules (e.g., Ethernet shields, WiFi modules), but this requires additional hardware.

Arduino boards are often used for a wide range of electronics projects, from simple LED blinking to more complex robotics.


Use Cases:

Well-suited for a broad range of applications, from simple electronic projects to robotics and automation.

Arduino is commonly used for educational purposes due to its simplicity and ease of use.


Comparison:

Complexity:

NodeMCU can be more complex due to its focus on internet connectivity and the Lua programming language.

Arduino is often considered more beginner-friendly with a simpler programming environment.


Connectivity:

NodeMCU excels in projects that require wireless communication and internet connectivity out of the box.

Arduino can handle a variety of projects but may require additional components for internet connectivity.


Programming Language:

NodeMCU primarily uses Lua (can be programmed in C++ Also) , while Arduino uses a simplified version of C/C++.

In summary, NodeMCU and Arduino are both versatile platforms, but the choice between them depends on the specific requirements of your project, your familiarity with the programming languages, and your preference for built-in wireless capabilities.

how to implement YOLOv3 using Python and TensorFlow

Object Detection with YOLOv3 Introduction YOLOv3 (You Only Look Once version 3) is a real-time object detection algorithm that can detect ob...