teleren/devto huggingface dataset:
Bash Scripting: An Introduction
Tags: bash, shell, programming
Published: 2022-11-17 16:26:35

Bash stands for Bourne Again Shell because it is an improvement on the previously existing shell. This blog post is to understand the whole concept of bash and get why developers really use bash! This is just the beginning so it will cover the basics.

Bash is used on linux OS. I will be using Mac OS in this. blog post the default shell is zsh. To use bash installed some dependencies to get started.

Bash can be used for virtual machines, deploying services and automating basic tasks.

##write a bash script with me
Open terminal and type the following commands to change your file directory and move from zsh to bash.

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

To access bash terminal, type these commands. Notice the change to bash.

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

Create a new file as .sh file for scripting.


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

Use "nano" to open the script in terminal and start typing bash script.


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

Every bash script should begin with this code below known as "Shebang".

```
!# /bin/bash
```
Now type the bash script.

```
!# /bin/bash
echo "Good morning Karece!"
```
Select Ctrl + x on your keyboard then select "y" also on your keyboard, then enter to save the script.

Check permissions. And make your script executable.

```ls -al```


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

Now run your bash script using.


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

That's the first bash script!

Another bash script you can try.
```
 #!/bin/bash

name=$1
compliment= $2

user=$(whoami)
whereami=$(pwd)
date=$(date)

echo "Good morning $name!!"
sleep 1
echo "You're looking good today $name!"
sleep 1
echo "You have the best $2 ever $name!"

sleep 2

echo "You are currently logged in as $user and you are in the directory 
$whereami. Also today is: $date"
```

Run with

```
./nameofscript Karece Code
```

Some helpful videos can be found [here](https://www.youtube.com/playlist?list=PLIhvC56v63IKioClkSNDjW7iz-6TFvLwS)

Done!
A fun experiment: Create Azure resources using AWS CloudFormation (Built using GoLang)
Tags: aws, azure, go, devops
Published: 2022-11-17 16:22:23

Azure has quickly become one of the leading cloud providers in the market now. So I started having deep dives in learning about Azure resources. One of the useful aspect of Azure is the usage of Azure API to interact with the resources. Similar to AWS, the Azure API also has methods to access various resources. Best way to learn this is to implement a project using the API. Thats where I started having this fun experiment to learn use of the Azure API. In this post I am describing a process which I used to spin up Azure resources using AWS cloudformation. Normally we use AWS cloudformation to interact with AWS resources. But to extend its usage using Azure API, I am using Cloudformation to create a Storage account on Azure (similar to S3 bucket on AWS). I am describing below the whole process how I achieved this. This may not be a proper Production scenario but who know if such scenario may arise in our projects. Will be a good learning. Please do not try this in Production scenarios unless you know exactly what you are doing :)

For more details:
https://amlanscloud.com/cfntoazure/
Create generic React components
Tags: react, beginners, generic, components
Published: 2022-11-17 16:09:48

As your application starts to grow, you often write repeated code. A simple example of this is with a form:

```
const SignupForm = () => {
  return (
    <form onSubmit={handleSubmit}>
      <label>Nickname</label>
      <input
        type="text"
        required
        onChange={handleChange}
        name="nickname"
        value={nickname} />

      <label>Email</label>
      <input
        type="email"
        required
        onChange={handleChange}
        name="email"
        value={email} />

      <label>Password</label>
      <input
        type="password"
        required
        onChange={handleChange}
        name="password"
        value={password} />

      <button type="submit">Submit</button>
    </form>
  )
}

export default SignupForm
```

The combination of label + input is repeated 3 times with the same attributes but differences in some values.

## Generic component

In order to reduce our code we'll create a new component FormInput where we group every label + input so we can reuse this code:

```
import React from 'react';

const INPUT_TYPE = {
    text: 'text',
    email: 'email',
    password: 'password',
}

const FormInput = ({ label, type, ...otherAttributes  }) => {

    if (!type) {
        throw Error('form input is missing the required type attribute');
    }

    return (
        <div>
            {label && (
                <label className="form-label">{label}</label>
            )}
            <input type={INPUT_TYPE[type]} className="form-input" {...otherAttributes} />
        </div>
    )
}

export default FormInput
```

I've separate the label prop from all other attributes (...otherAttributes) which can be passed on, to keep it clean and readable. We'll check the label prop to make sure it exists, since maybe in the future we want to use an input without a label.

Now we can import our FormInput to our SignupForm, make sure your path is set right, so we can replace every label + input bij our FormInput component:

```
import FormInput from "./FormInput" // imports our component

const SignupForm = () => {
  return (
    <form onSubmit={handleSubmit}>
      <FormInput
        label="Nickname" // label prop with title as string
        type="text" // followed by all otherAttributes...
        required
        onChange={handleChange}
        name="nickname"
        value={nickname} />

      <FormInput
        label="Email"
        type="email"
        required
        onChange={handleChange}
        name="email"
        value={email} />

      <FormInput
        label="Password"
        type="password"
        required
        onChange={handleChange}
        name="password"
        value={password} />
    </form>
  )
}

export default SignupForm
```

Congrats! You just created a generic component.
5 things to improve cybersecurity for startup
Tags: learning, startup, bestpractices, video
Published: 2024-06-22 01:35:18

---
title: 5 things to improve cybersecurity for startup
published: true
date: 2022-11-17 15:47:12 UTC
tags: learning,startup,BestPractices,video
canonical_url: https://guptadeepak.com/5-things-to-do-on-a-limited-budget-to-improve-cybersecurity/
---

 ![5 things to improve cybersecurity for startup](https://images.unsplash.com/photo-1503676260728-1c00da094a0b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDF8fGxlYXJuaW5nfGVufDB8fHx8MTY2ODU2OTk2Ng&ixlib=rb-4.0.3&q=80&w=2000)

As a startup, maintaining cybersecurity is difficult. You have a small team and a small budget, and you probably don't know much about cybersecurity. But there are a few things that you can do!  
  
First, some of the systems that you're using within your company—like authentication systems—can be done through cloud-based solutions that are low code or no code. These solutions are easy to manage and easy to implement. You can use a CRM or database—many cloud-based solutions available could help protect your data!  
  
Second, create an IT policy for your team with basic structures of how information is being shared within the company and what kind of password complexity should be used by team members. They should be using true federal authentication and not storing work data on PERS devices or work laptops.  
  
Third, back up all customer, employee, and all data you have! You never know when something like a cybersecurity incident will happen, but if it does happen and you have a backup, you can get it back up and running very quickly. Many of these cloud-based or SaaS solutions already have backups in place—you need to enable them!  
  
Fourth, keep up with the latest software updates—you must stay on top of security patches for your operating system, antivirus solution, or other third-party solutions. Security researchers often find vulnerabilities in these systems, so you must install those updates as quickly as possible.  
  
Lastly, look into implementing a bug bounty program. Many security researchers are out there looking for vulnerabilities in apps and services like yours, so if you invite them to test your product and offer a small reward when they find something, they'll help you fix it! This is another way to outsource your cybersecurity needs.

<iframe width="200" height="150" src="https://www.youtube.com/embed/tXOc3CJeVsU?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen title="5 Things You Can Do in Limited Budget to Improve Your Cybersecurity,"></iframe>
_5 Things You Can Do in Limited Budget to Improve Your Cybersecurity - GuptaDeepak_
Investigating which events are being dispatched in Magento2
Tags: magento
Published: 2022-11-17 15:46:50

There are cases when certain events expected to be dispatched aren't, such as with product MassUpdate and individual product edit. Individual product edit dispatches `catalog_product_save_after`, but this does not apply to MassUpdate so we must investigate which events can be hooked in.

Go to `vendor/magento/module-staging/Model/Event/Manager.php` and in function `dispatch` below $eventName variable declaration add the following:

```
$eventName = mb_strtolower($eventName);
```

```
// devmod start
$filename = BP . '/var/log/events.log';

$writer = new \Zend\Log\Writer\Stream($filename);
$logger = new \Zend\Log\Logger();
#Fix for 2.4.x below
$logger->addWriter($writer);
$logger->info($eventName);
// devmod end
```

Magento 2.4.x Fix

```
$writer = new \Zend_Log_Writer_Stream($filename);
$logger = new \Zend_Log();
```

Before running your Magento process or journey
```tail -f /tmp/events.log```

E.g. Search and investigate events
`cat /tmp/events.log | grep catalog_product`
`cat /tmp/events.log | grep save_after`
`cat /tmp/events.log | grep update_before`
`cat var/log/events.log| grep save_after | grep -v model | grep -v theme`
Define Canonical URL in a Hugo Theme
Tags: hugo
Published: 2022-11-17 15:34:47

Hugo is a static site generator, but links to your site may contain optional
params like `ref=...` which may produce duplicate content for search engines.
You can use canonical URL to define, which URL should be used by Google and co.

Google has a very detailed description how to [consolidate duplicate
URLs](https://developers.google.com/search/docs/advanced/crawling/consolidate-duplicate-urls).

If you know [Hugo](https://gohugo.io) and want just a copy a paste solution,
just add this to your head:

```html
<head>
  ...
  <link rel="canonical" href="{{ .Permalink }}">
  ...
</head>

```

This will result in an URL like:

```html
<head>
  <link rel="canonical" href="https://qameta.com/posts/your-blog-post/">
</head>
```

There is more you can do. See the full post here: https://qameta.com/posts/define-canonical-url-in-a-hugo-theme/
How did you improve your coding skills?
Tags: javascript, webdev, beginners, programming
Published: 2022-11-17 15:24:47

## Reading others code. Lots of it.

## Networking.
It’s important to surround yourself with other developers who are willing to push you and critique your work.
Writing code. Again, lots of it.

## Research. 
If you aren’t learning something new every day, at least one tiny thing, you wasted your day.

## Study multiple languages. 
It’s interesting to go from something procedural to object oriented to functional. Switching between interpreted languages and compiled language is equally interesting.
Seeing the different design patterns, conventions, and “culture” of each can be an incredible eye-opener. Case in point: I’m reading Clean Code right now, and while it’s written in Java (which I have worked with in the past), I’ve been able to apply many of the lessons to my work in PHP. Just cool little things like that come from studying multiple languages.

## Love doing it. 
Without that passion, you’ll burn out quick and have no interest in it. Then you’ll just be another run-of-the-mill average coder taking up desk space that someone passionate could be using. Not to be rude, just being straight forward: love doing it or find another profession.

## Have someone to look up to.
I’ve grown my skills by looking to a few mentors and secretly competing with them. This won’t work for everyone, but it did wonders for me.
Suggestions to my file sharing Web App
Published: 2022-11-17 15:19:43

As if you have followed my blogs my famous blog was about creating a File Sharing website using simple javascript
{%embed https://dev.to/varshithvhegde/how-i-created-a-file-sharing-website-using-simple-javascript-355g %}

# Why this blog?

First of all , I thank all the Dev.to community who made that blog a great success. Also ,it was my first blog that made top 10 in the trending section. I am really thankful to all of you.  
When I made that blog there were many suggestions from the community. 
So I want to get direct suggestions from the community to make my website better.
This is a open source project and you can contribute to it.

# What is the project about?

github link: [https://github.com/Varshithvhegde/shareit]

{%embed https://github.com/Varshithvhegde/shareit %}

- Please suggest some of the features that may be added 
- Project is open source on GitHub create a pull request

### All comments are Accepted
**Fictional Ideas are also well accepted**
Aplicación "Modelo de Sistema" en Java/Swing
Tags: java, swing, netbeans, sistema
Published: 2022-11-17 14:44:36

"ModeloSistema" es un proyecto creado en [Apache NetBeans IDE](https://netbeans.apache.org).
Sirve de modelo de desarrollo para una aplicación de escritorio
poniendo énfasis en el diseño de la interfaz gráfica y en su
uso simple. Está orientado hacia un sistema informático comercial
que podría ser: una farmacia, un depósito de materiales para la construcción, una tienda de comestibles varios, etc.
Ha sido probado en las versiones 12.2, 12.6, 15 y 16 bajo la plataforma Windows 64 bits y Oracle Linux Server 64 bits.
Se ha usado [Oracle Java](https://www.oracle.com/ar/java/) JDK 17 como biblioteca de desarrollo en Windows y en Oracle Linux Server a OpenJDK 11.0.16.1 y 18.0.2.0.9.
Todo el proyecto, código fuente + jars, está disponible en pCloud.
**Fichero comprimido**: en base/Proyecto/NeBeans, buscar y descargar el archivo [ModeloSistema-Java.7z](https://u.pcloud.link/publink/show?code=kZ4I1h7Z5TAxbJqo2i0JgaDaBWkvm5DOKvQ7#folder=1743374552)
**Directorio proyecto(Windows)**: [pcloud.base/Proyecto/NetBeans/ModeloSistema](https://u.pcloud.link/publink/show?code=kZ4I1h7Z5TAxbJqo2i0JgaDaBWkvm5DOKvQ7&lang=es#folder=15191295059)
**Directorio proyecto(Linux)**:
[pcloud.base/Proyecto/NetBeansLX/ModeloSistema](https://u.pcloud.link/publink/show?code=kZ4I1h7Z5TAxbJqo2i0JgaDaBWkvm5DOKvQ7&lang=es#folder=15223912951)
<<<_____________________________>>>
Puede ser tomado a ModeloSistema como una especie de plantilla grande para comenzar a hacer algo mucho más interesante. Está orientado a estudiantes de programación en Java con un nivel de conocimiento intermedio~avanzado. Que pueda además pasar todo el código fuente hacia otros [IDEs de Java](https://www.quora.com/Is-there-any-free-Java-IDE-available-for-windows) por ejemplo [Eclipse IDE](https://www.eclipse.org/ide/), [Oracle JDeveloper IDE](https://www.oracle.com/application-development/technologies/jdeveloper.html), [JetBrains IntelliJ IDEA](https://www.jetbrains.com/es-es/idea/) y más.
Además debería ser un modelo de trabajo independiente del S.O.: Linux y Windows. Puede ser cualquier otro S.O. como ser Android.
Y de la arquitectura de la CPU también, porque al estar programado en Java los archivos .jars son ejecutados por una máquina virtual llamada JVM que incorpora el paquete Java/JDK y Java/JRE.
Que puede ser de 32 bits, 64 bits y más lo que se viene en las próximas décadas en la industria de la electrónica hasta alcanzar los 1024 bits en una única CPU con múltiples núcleos.
O sea, el futuro es promisorio y excitante...
<<<_____________________________>>>
Software Testing Trends for 2023
Tags: softwaretesting, testing, trends
Published: 2022-11-17 14:39:09

With software becoming the main value driver and the primary interface between developers and customers, focus on software quality is growing. The need to deliver high-quality, bug-free products in ever-accelerating cycles is putting pressure on software teams. Software testing has to apply new methods to keep pace. Here's a list of new testing strategies that are gaining ground in 2023, and which software testing trends Symflower expects to continue to unfold this coming year!

> **Continue reading on Symflower's blog:**
[**Software testing trends for 2023**](https://symflower.com/en/company/blog/2022/software-testing-trends-2023/)
100+ WEB DEVELOPMENT THINGS YOU SHOULD KNOW
Published: 2022-11-17 14:17:53

1. Internet
2. Internet Protocol (IP) Suite
3. IP Address
4. Transmission Control Protocol (TCP)
5. Packets and Data Link (Open Systems Interconnection(OSI) Model)
6. World Wide Web (WWW)
7. Hypertext Transfer Protocol (HTTP)
8. Uniform Resource Locator (URL)
9. Browser
10. Client
11. Server
12. HTTP Request
13. HTTP Response
14. HTTP Messages
15. Domain Name
16. Registrar
17. Internet Corporation for Assigned Names and Numbers (ICANN)
18. Domain Name System (DNS)
19. HyperText Markup Language (HTML)
20. Dev Tools
21. Code Editor
22. HTML Elements
23. HTML Forms
24. HTML Attributes
25. Anchor tag
26. Document Object Model (DOM)
27. Head
28. Body
29. Accessibility and Semantics
30. Div tag
31. Cascading Style Sheets (CSS)
32. Inline Style
33. CSS properties
34. Cascade
35. Style Tag
36. Selector
37. Class
38. CSS Specificity
39. External Stylesheet
40. Box Model
41. Block
42. Inline
43. Relative positioning
44. Absolute positioning
45. Fixed positioning
46. Responsive Layout
47. Media Query
48. Flexbox
49. Grid Layout
50. calc() function
51. Custom Properties
52. Syntactically Awesome Stylesheets (SASS)
53. JavaScript
54. Script Tag
55. Defer attribute
56. ECMAScript
57. Let keyword
58. Const keyword
59. Dynamically Typed
60. TypeScript
61. Events
62. Browser API
63. Event Listener
64. Functions and Data Structures
65. Array
66. Object
67. Primitive types
68. Prototypal Inheritance
69. Classes
70. Frontend Framework
71. Components
72. Declarative Code
73. Imperative Code
74. NodeJS
75. V8 Engine
76. Event Loop
77. Node Package Manager (NPM)
78. Module
79. Export statement
80. Import statement
81. Server-Side Rendering (SSR)
82. HTTP Methods
83. Status Code
84. 404 Not Found
85. Single-page application (SPA)
86. JavaScript Object Notation (JSON)
87. Static-Site Generation (SSG)
88. Hydration
89. First Contentful Paint (FCP) & Time to Interactive (TTI)
90. Fullstack Framework
91. Module Bundlers
92. Linter
93. Database
94. User Authentication
95. Web Server
96. Localhost
97. Cloud
98. Containers
99. Infrastructure as a service (IAAS) / Platform-as-a-Service (PAAS) / Backend-as-a-Service (BAAS) / Software as a service (SAAS)
100. World Wide Web-based on blockchain technology (Web3)
101. Google it.
Git & tricks: commands
Tags: git
Published: 2022-11-17 13:48:34

This is my collection of unconventional git commands. Here you won’t find basic commands like `git log` or `git checkout`, but more particular instructions that have come in handy during my daily work.

{%- # TOC start -%}
- [Empty commit](#empty-commit)
- [Restore file from another branch](#restore-file-from-another-branch)
- [Delete branches by filters. ](#delete-branches-by-filters)
- [Delete all local branches not matching the provided name(s)](#delete-all-local-branches-not-matching-the-provided-names)
{%- # TOC end -%}

## Empty commit
If you want to make a commit even if you didn't modify any file, for example
to create a bookmark or checkpoint, just pass the `--allow-empty` option: 

```bash
$ git commit --allow-empty -m 'Started working on PR'
```

##  Restore file from another branch
To restore a file using the version from another branch:
```bash
$ git restore --source develop -- /path/to/file/to/restore
```
where 
- `--source develop` is the source branch. This version will override the file in your current branch;
- `/path/to/file/to/restore` is the path (absolute or relative) of the file to restore.

##  Delete branches by filters. 
In the example, all the branches starting with "`fix`" will be removed:
```bash
$ git branch -D $(git branch --list 'fix-*')
```

## Delete all local branches not matching the provided name(s)
In this example, all the branches different from `master`, `main` or `develop` will be deleted:
```bash
$ git for-each-ref --format '%(refname:short)' refs/heads \
| grep -v "master\|main\|develop" \
| xargs git branch -D
```
Determine Your Skill Gaps
Tags: career, softwareengineer, skills
Published: 2022-11-17 14:09:05

Software engineers need both technical and essential skills to be successful.

There tends to be greater awareness of gaps in technical skills and a disproportionate amount of effort goes into developing them.

Essential skills remain underdeveloped.

David VanDusen, a Commit Engineering Partner and Community Member recognized this after many conversations with leaders in technical organizations about what they believe are the most crucial skills software engineers need to advance their careers.

So, he created TESSA which aims to help software engineers become more self-aware of the skills they can use to learn faster, collaborate more effectively, and succeed as technical leaders.

Determine your gaps: https://bit.ly/TESSA_Project