teleren/devto huggingface dataset:
grub rescue
Tags: discuss, linux, terminal, debian
Published: 2021-09-13 08:37:19

**#THIS METHOD WORKS FOR ANY LINUX DISTRIBUTION**
I was updating my Kali Linux Packages then there was a sudden power failure before the update was complete and my PC shut down. When i powered it on later i found myself in this trouble: 👇

**grub rescue>**

I spent a whole week on online help and tried out fixing the boot error with all the solutions i found but failed.
I tried all the (hd0,msdos5) stuff that you have also tried 😅 but my pc still returned "unknown file system" . Reason why this can't fix the problem is because my bootloader was not displaced but it was deleted or corrupted.
I only found one method that is very simple and quick.

Now get this:

**BOOT REPAIR TOOL**
1. Create a Bootable Flash Disk with UBUNTU using Rufus or any other tool that can burn an iso image.
2. Shut down your Pc then plug in the Flash Disk.
3. Power on your pc and press the ESC button as the PC boots and then boot from the Flash Disk
4. Select TRY UBUNTU !!(do not instal Ubuntu)!! .
5. Enter the Ubuntu System and Open the Terminal.
6. Connect to a network.
7. Enter the following commands:

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update

"Press Enter"

sudo apt-get install -y boot-repair && boot-repair

8. Click repair,complete then restart the computer and boot yo linux.
9. Open the terminal and type this command to uodate grub menu.

sudo update-grub

🥳🥳You fixed it.
Scripts for begginer Pen Tester
Published: 2021-09-13 08:33:25

Programming is at the essence of any field in computer science. I come from a background in Programming and some of the things that I learnt will stay with me for a lifetime. With that said, I am currently a Pen tester for an organisation and I am also still learning so you should by no means expect this to be an expert level article, It is meant for absolute beginners who want to learn what scripts are and a brief explanation of what each line of the script does. So these are some of the scripts that I learned as a absolute beginner.

I will be using Python for this tutorial. However, the script can be formatted to your preferred scripting language eg. Bash, Perl

SUBDOMAIN ENUMERATION


import requests 
import sys 

sub_list = open("subdomains.txt").read() 
subdoms = sub_list.splitlines()

for sub in subdoms:
    sub_domains = f"http://{sub}.{sys.argv[1]}" 

    try:
        requests.get(sub_domains)
    
    except requests.ConnectionError: 
        pass
    
    else:
        print("Valid domain: ",sub_domains)   

What the Script does:

import requests 
import sys 

These first two lines are self explanatory, they import requests Python module,(if you want to find out more about the request module: https://docs.python-requests.org/en/latest/), and the Sys module, This module is used to provide access to some variables used or maintained by the Python interpreter and to functions that interact strongly with the interpreter.(https://docs.python.org/3/library/sys.html).

sub_list = open("subdomains.txt").read() 
subdoms = sub_list.splitlines()

The first line, opens a file that you have saved locally(or can be downloaded) and reads its content. The second line prepares the file to be used by splitting the files content into singular lines like you would do using “/n” or “/r”

for sub in subdoms:
    sub_domains = f"http://{sub}.{sys.argv[1]}" 

    try:
        requests.get(sub_domains)
    
    except requests.ConnectionError: 
        pass
    
    else:
        print("Valid domain: ",sub_domains)   

These consecutive lines iterate through the file that you’ve opened, make the requests to the relevant HTTP subdomains and return valid sub domains.

sub_domains = f"http://{sub}.{sys.argv[1]}" 

This line uses string formatting to go to the subdomain, for example, “http://example.com”

{sys.argv[1]}

As mentioned before, “sys” gives you access to the variables maintained by the python Interpreter.

The line above exposes the first argument of passed to the commandline/Terminal. which in this case might be .com, .io or whatever the domain of your target’s IP address.

I will post more scripts where I do Open ports, Directory enumeration and port scanning. Thank you
Print Excel Documents Using Java
Tags: java, excel, print
Published: 2021-09-13 08:13:01

After finish editing an Excel document, it's inevitably that sometimes we may need to print it. And this article will introduce how to print Excel documents using Free Spire.XLS for Java.

**Installation (2 Method)**
**1#** Download the [free library](https://www.e-iceblue.com/Download/xls-for-java-free.html) and unzip it, then add the Spire.Xls.jar file to your project as dependency.
**2#** You can also add the jar dependency to maven project by adding the following configurations to the pom.xml.
```xml
<repositories>
    <repository>
        <id>com.e-iceblue</id>
        <name>e-iceblue</name>
        <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.xls.free</artifactId>
        <version>3.9.1</version>
    </dependency>
</dependencies>
```

**Sample code**
```java
import com.spire.xls.Workbook;

import javax.print.PrintService;
import java.awt.print.PageFormat;
import java.awt.print.Paper;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;

public class PrintExcel {

    public static void main(String[] args) throws Exception{

        //Create a workbook and load an Excel file
        Workbook workbook = new Workbook();
        workbook.loadFromFile("C:\\Users\\Administrator\\Desktop\\Sample.xlsx");

        //Create a PrinterJob object
        PrinterJob printerJob = PrinterJob.getPrinterJob();

        //Specify printer name
        PrintService myPrintService = findPrintService("\\\\192.168.1.104\\HP LaserJet P1007");
        printerJob.setPrintService(myPrintService);

        //Create a PageFormat object and set it to the default size and orientation
        PageFormat pageFormat  = printerJob.defaultPage();

        //Return a copy of the Paper object associated with this PageFormat.
        Paper paper = pageFormat .getPaper();

        //Set the imageable area of this Paper.
        paper.setImageableArea(0,0,pageFormat .getWidth(),pageFormat .getHeight());

        //Set the Paper object for this PageFormat.
        pageFormat .setPaper(paper);

        //Set the number of copies
        printerJob .setCopies(1);

        //Call painter to render the pages in the specified format
        printerJob .setPrintable(workbook,pageFormat);

        //execute print
        try {
            printerJob.print();
        } catch (PrinterException e) {
            e.printStackTrace();
        }
    }
    //Get print service by printer name
    private static PrintService findPrintService(String printerName) {

        PrintService[] printServices = PrinterJob.lookupPrintServices();
        for (PrintService printService : printServices) {
            if (printService.getName().equals(printerName)) {
                return printService;
            }
        }
        return null;
    }
}
```
AWS SQS vs SNS vs EventBridge
Tags: aws, serverless, backend
Published: 2021-09-13 08:02:32

In this article we will take a look at following AWS messaging services - SQS, SNS and EventBridge.

On the first look, these services can seem quite similar as they pretty much do the same thing, which is decoupling the producer from the consumer. Which makes our architecture asynchronous and loosely coupled. But looking closely these services have different capabilities.

## SQS (Simple Queue Service)

[AWS Simple Queue Service (SQS)](https://aws.amazon.com/sqs) is a distributed message queuing service which helps with sending, storing and receiving messages between services easier using the pull model.

- Ordered processing of the events
- Consumer can pull the message with long-polling
- Only one consumer can read an individual message
- Cost Effective and Automatic scaling
- Cannot invoke consumer based on the message (needs SNS message filtering for this)
- Message encryption at rest with KMS available
- HIPAA compliant

## SNS (Simple Notification Service)

[AWS Simple Notification Service (SNS)](https://aws.amazon.com/sns) is a notification service that is based on publisher subscriber model.

- Can have multiple consumers like Lambda, HTTP, SQS etc.
- Message Fanout gives asynchronous event notifications, which in turn allows for parallel processing
- Can invoke the subscriber based on the message
- Message encryption at rest with KMS available
- SNS is also HIPAA compliant

## EventBridge

[AWS EventBrige](https://aws.amazon.com/eventbridge) is a relatively newer service compared to SQS or SNS. It's very similar to SNS but with tons of added on features.

- Provides great integration options with third-party SaaS applications
- Can transform events before sending
- Event filtering and routing based on message
- No encryption at rest with KMS
- Message order is not maintained
- Has a Schema Registry/Discovery feature
- Message archiving is available
- Can re-play events
Replace Virtualenv with Poetry.
Tags: python, programming, productivity, datascience
Published: 2021-09-13 07:54:06

You are not still using virtualenv, are you?

Virtualenv is an old school way to manage dependencies in a Python project. They use to do well. but we have excellent alternatives to replace it now.

Poetry is the best tool I found in Python.

[Learn more about Poetry](https://towardsdatascience.com/poetry-to-complement-virtualenv-44088cc78fd1)

This relatively new tool is not a replacement but a complement to Virtualenvs.

* They help you manage development and production dependencies separately. 
* Sync environments with the team
* Conveniently package and publish it to repositories (eg: PyPI)
How To: Manage Containers at the Edge with #Portainer
Published: 2021-09-13 07:44:37

In this session, (the 6th of our PortaiNerd series), you'll learn how to manage #containers at the Edge with 
@portainerio
.

#Cloud #edujobs 
Register using the link belowDown pointing backhand indexDown pointing backhand index to learn

https://bit.ly/3AkWzKt
JavaScript stop form submit
Tags: javascript
Published: 2021-09-13 07:27:12

Forms are a very important part of building apps and websites. They are the key to user input.

Let's look at some examples of forms we can think of:

- Login form
- Subscribe to a newsletter
- Feedback forms
- Contact
- Order
- CMS system
- Etc...

As you can see, forms are a big pillar in development.
And generally, a form will perform a specific type of request to a defined action.

```html
<form action="post.php" method="POST"></form>
```

Take the above example. It will perform a POST request to a file called `post.php`.

However, in modern development, we often want to keep the user on the page and do these transactions in the background by using JavaScript.

Think about a search bar, for instance, how annoying it would be if it had to refresh the page every time you change the search query.

That's where handling forms with JavaScript comes in super handy. Let's see how this works.

## Handle form submits in JavaScript

To catch the form submit in JavaScript, we have to have the form available in our code.

The easiest way would be to add a selector. This could be a `querySelector` or fetch the form by its unique ID.

```html
<form id="form-id">
  <input type="text" name="name" id="name-field" />

  <input type="submit" value="submit" />
</form>
```

```js
const form = document.querySelector('form');

const formId = document.getElementById('form-id');
```

Both these methods will have the same reference to the form.

However, I would urge you to use the latter one since it's more unique especially if you can have more than one form on a page.

Let's take the ID method and handle the form submit in JavaScript to stop the submit.
For this to work, we need to attach an event listener on the form's submit action.

```js
const form = document.getElementById('form-id');

form.addEventListener('submit', (event) => {
  alert('submitting');
});
```

This will perform the following actions:

- User clicks submit
- Alert shows up
- User dismisses alert
- HTML form submit happens

That's not exactly what we want, as we want the HTML submit not to happen at all.

To intercept that behavior, we have to use the `event.preventDefault` code.

```js
form.addEventListener('submit', (event) => {
  event.preventDefault();
  alert('submitting');
});
```

Now we only get the alert, and our form is stopped!

You can check out the JavaScript form submit in this CodePen.

{% codepen https://codepen.io/rebelchris/pen/XWgNYyM %}

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Software Development Company UK, USA
Published: 2021-09-13 07:14:04

The choice of technology plays a crucial role when it comes to developing an app or a website. Choosing the right technologies is a difficult task since many technologies exist for similar tasks, Pros and Cons of each technology must be analysed extensively to boil down to an optimum technical Stack for development. Choosing the technology also depends on your company’s needs and the advantages each of Java/.Net/Python can individually offer.
‍
Java Enterprise Edition and the applications developed in it can run on any platform. Whereas, the applications developed in .NET, on the other hand, can work seamlessly on Windows Environment. Python’s dynamic system relies on brevity, fluidity, and experimentation in code, giving it more versatility than Java’s rigid style and it can be adapted into automated testing. Go through each of the IT software development services available at GRhombus and decide what works best for your company and its requirements.
Google Colab, Pyspark, Cassandra remote cluster combine these all together
Published: 2021-09-13 07:06:35

If you don't know what are these things, please navigate to the introductory links mentioned bellow to get and rough idea about the tech stack mentioned here and what you can achieve using them. 
* [Google Colaboratory aka Google Colab](https://colab.research.google.com/notebooks/intro.ipynb)
* [Cassandra](https://cassandra.apache.org/)
* [PySpark](https://databricks.com/glossary/pyspark)
* [Spark](https://spark.apache.org/)

Though it's really easy to connect Apache Spark with Cassandra or any other data source. But I can't find any source where it is mentioned clearly how to connect PySpark and Cassandra. To reduce the struggle of them who are are going to do the same, just follow this tutorial and you are all set to stark working with Sparks RDD by using Cassandra database as the data source. 

At the very first please create one new notebook in Google Colab. Then you need to install jdk, apache spark on hadoop cluster, findspark library on python env. Copy the commands bellow and paste it into Google Colab notebook. Running the code block will install all of them. 
```
!apt-get install openjdk-8-jdk-headless -qq > /dev/null
!wget -q https://archive.apache.org/dist/spark/spark-2.4.8/spark-2.4.8-bin-hadoop2.7.tgz
!tar xf spark-2.4.8-bin-hadoop2.7.tgz
!pip install -q findspark
```
Here I am using spark-2.4.8, but can install the latest versions as per your requirement.

Then you need to set some environment variables: 
```
import os
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
os.environ["SPARK_HOME"] = "/content/spark-2.4.8-bin-hadoop2.7"
```

Initialize findspark and check where it is located:
```
import findspark
findspark.init()
findspark.find()
```

Now this is the step where you are going to connect PySpark with Cassandra:
```
from pyspark.sql import SparkSession
from pyspark import SQLContext

spark = (SparkSession.builder.master("local[*]")
         .config('spark.cassandra.connection.host', "[host_ip_address]")
         .config('spark.jars.packages', "datastax:spark-cassandra-connector:2.4.0-s_2.11")
         .config('spark.cassandra.auth.username', "[db_username]")
         .config('spark.cassandra.auth.password', "[db_password]")
         .getOrCreate())

SQL_LOCAL_CONTEXT = SQLContext(spark)

def read_table(context, table):
    return context.read.format("org.apache.spark.sql.cassandra").options(table=table, keyspace="[key_space]").load()
```

Test your connection:
```
groups = read_table(SQL_LOCAL_CONTEXT, "[db_table]")
groups.show()
```

Replace the variables placed inside the brackets, such as: host_ip_address, db_username, db_password & key_space with the values of your database.

**groups** will store data as PySpark dataframe.
Checking for Reduced Motion Preference in JavaScript
Tags: javascript, a11y
Published: 2021-09-13 06:59:30

When animating elements with CSS, you can use a snippet such as the following to disable animations for users with browsers that request reduced motion:

```css
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition-duration: 0s !important;
    }
}
```

However, some fancier animations actually require JavaScript effects.

You can still disable those animations for users that request it by checking for those requests using the following code:

```js
const isReduced = window.matchMedia(`(prefers-reduced-motion: reduce)`) === true || window.matchMedia(`(prefers-reduced-motion: reduce)`).matches === true;

if (!!isReduced) {
    // DON'T use an amination here!
} else {
    // DO use an animation here!
}
```

And that's about it! The [media matching function](http://www.javascriptkit.com/dhtmltutors/cssmediaqueries4.shtml) is an extremely powerful built-in feature supported by most browsers, and this is just one of the many excellent use cases for it.

## Conclusion

I hope you enjoyed this brief little tutorial. It's just a few lines of code that can make a *massive* impact on the experience of some of your users (probably more than you might expect, in fact).

Thanks for reading!
The rules of corporate life!
Tags: corporatelife
Published: 2021-09-13 06:59:01

1) Don't trust everyone.
2) What happens in the office remains in the office. Never take office gossips to home & vice versa.
3) Enter office on time, leave on time; your desktop is not helping improve your health.
4) Never make GF/BF or Brothers/Sisters in office. It will always backfire on you.
5) Expect nothing. If somebody helps, feel thankful. If not, it’s still fine; you will learn to know things on your own.
6) Never rush for the position. If you get promoted, congratulations. If not, it doesn't matter. You will always be remembered for your knowledge and politeness, not for your designation.
7) Never run behind office stuff always; you have better things to do in life.
8) Avoid taking everything in your ego and personal; your salary matters, you are being paid. Use your assets to get happiness.
9) It doesn’t matter how people treat you. Be humble and help others. Remember, you are not everyone’s cup of tea.
10) In the end, nothing matters except family, friends, home, inner peace, and the most important being Healthy.
Amazon Seller Partner API : Need to Upload stock Quantity and Price APIs
Published: 2021-09-13 06:54:26

Hello Everyone , 

Good Morning, Need Amazon Seller Partner APIs regarding Upload Stock and Quantity , I tried but Not able to find any such APIs 
I am flowing below link , Please suggest me on this ,How Can I Proceed with this.it will help me a lot .

https://www.postman.com/restless-capsule-266764/workspace/amazon-spapi/collection/14782630-18170ca2-3a44-4daf-8a7b-79992fa1b7e7?ctx=documentation
How do revert all local changes in Git?
Tags: git, github, gitlab, javascript
Published: 2021-09-13 06:46:50

![git-logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cj5vgc6ck3uxx2tts5gn.jpg)

If you want to revert changes made to your working copy, do this:
```
git checkout .
```

If you want to revert changes made to the index (i.e., that you have added), do this. Warning this will reset all of your unpushed commits to master!:
```
git reset
```

If you want to revert a change that you have committed, do this:
```
git revert <commit 1> <commit 2>
```

If you want to remove untracked files (e.g., new files, generated files):
```
git clean -f
```

Or untracked directories (e.g., new or automatically generated directories):
```
git clean -fd
```
Test techniques mapped to types of features
Published: 2021-09-13 06:38:24

(in progress)

Test technique -> Type of feature

*Boundary Value Analysis*

a little too little, just enough, too much - blocking someone 

*Equivalence partitioning*



*State transition testing*

if the user does this, their status changes to that. 

*Decision table testing* 

This is for forms. this is especially for complex forms with logic. if this response is made, this question or content is shown. 

*Graph based testing*



*Error guessing technique*

For anything used frequently or just key features. Might be used to see all the ways a chart COULD be manipulated.
HTML tags | hr
Tags: html, tags, hr
Published: 2021-09-13 06:18:24

It is used to **represent a thematic break in the flow of a set of paragraphs**, for example a scene change in a story or a topic change within a section.

It has always been represented as a horizontal line, and although this is how visual browsers usually display it, `<hr>` **is now defined in semantic terms rather than in terms of presentation**, so if you want to draw a line horizontal should be done with CSS.

Has an **implicit ARIA role** `separator`.

- Type: *block*
- Self-closing: *Yes*
- Semantic value: *No*

[Definition and example](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr) | [Support](https://caniuse.com/mdn-html_elements_hr)
Diseño Orientado por Objetos
Tags: orientadoobjetos, diseniosoftware, objetos
Published: 2021-09-13 05:59:57

El diseño orientado por objetos ayuda a comprender el tratamiento que se le dará al sistema informático, facilita la comprensión debido a que se toma la idea esencial de una entidad real, y que dentro del sistema se incorporan eventos, funciones, que al final se traduce en la construcción del objeto.
IST 402 Blog - Boilerplates
Published: 2021-09-13 04:40:34

#Commonalities Between Boilerplate Code
While I can only currently compare VueJs and Angular from our repository, it seems that there are some similarities between the boilerplate codes. Both seem to have a decent amount of informational documentation type text that shows different features and simple directions for getting started which makes sense since boilerplate code is supposed to be a standard starting point. Also, both seem to have an extremely large amount of dependencies that were downloaded.

#Which is the easiest DX to get going?
Out of the two it seemed that VueJS is better for easier/smaller-scale projects whereas if you are interested in creating something more complex, Angular would be the best choice. Personally, I do not think I am at the coding level to be creating complex projects so VueJS seems like the best choice for me.

#Links
[VueJS Boilerplate:](https://github.com/render-examples/vue-hello-world) 
[Repository:](https://github.com/IST402-Group-F)