teleren/devto huggingface dataset:
Menganalisis dan Menyimpan Log
Published: 2022-10-26 08:05:15

###Arsitektur Log Sistem

**Pencatatan Sistem**
Proses dan kernel sistem operasi merekam log peristiwa yang terjadi. Log ini digunakan untuk mengaudit sistem dan memecahkan masalah.

Banyak sistem mencatat log peristiwa dalam file teks yang disimpan dalam /var/logdirektori. Log ini dapat diperiksa menggunakan utilitas teks normal seperti less dan tail .

Terdapat beberapa sistem pada bagian ini, salah satunya yaitu systemd-journald layanan rsyslog

Layanan systemd-journaldini merupakan inti dari arsitektur pencatatan peristiwa sistem operasi. Ini mengumpulkan pesan acara dari banyak sumber termasuk kernel, keluaran dari tahap awal proses boot, keluaran standar dan kesalahan standar dari daemon saat dijalankan dan dijalankan, dan peristiwa syslog. Ini kemudian merestrukturisasinya ke dalam format standar, dan menulisnya ke dalam jurnal sistem yang terstruktur dan terindeks. 

Sedangkan Layanan rsyslog mengurutkan dan menulis pesan syslog ke file log yang tetap ada di seluruh reboot di /var/log. Layanan rsyslogmengurutkan pesan log ke file log tertentu berdasarkan jenis program yang mengirim setiap pesan, ataufasilitas, dan prioritas setiap pesan syslog.


**Tabel File Log Sistem yang Dipilih**
**_Berkas log :_** /var/log/messages
**_Jenis Pesan yang Disimpan :_** Sebagian besar pesan syslog dicatat di sini. Pengecualian termasuk pesan yang terkait dengan otentikasi dan pemrosesan email, eksekusi pekerjaan terjadwal, dan yang murni terkait debug.

**_Berkas log :_** /var/log/secure
**_Jenis Pesan yang Disimpan :_** Pesan syslog terkait dengan peristiwa keamanan dan otentikasi.

**_Berkas log :_** /var/log/maillog
**_Jenis Pesan yang Disimpan :_** Pesan syslog terkait dengan server email.

**_Berkas log :_** /var/log/cron
**_Jenis Pesan yang Disimpan _**: Pesan syslog terkait dengan eksekusi pekerjaan terjadwal.

**_Berkas log :_** /var/log/boot.log
**_Jenis Pesan yang Disimpan :_** Pesan konsol non-syslog yang terkait dengan startup sistem.
Developing Code Quality With Git.
Tags: git, github, webdev, beginners
Published: 2022-10-26 08:51:56

In this article we will see about version control system like git. It's always difficult to write clean, readable and maintainable code.

Clean and Maintainable is necessary to collaborate with other developers. Whether you are working on a project, open source or your own multi million 💵 project 😁.

## Creating a lot of branches

So if you're working in a project with a remote repository and a lots of folks working in it.

Always try to create a branch for any experiment, feature, or bug.
This will help you keep track down of things easily.

## Squashing Commits

Always keep in mind to squash your commits, whether you're commiting on main branch. As it help to keep your main branch log clear and understandable.

Otherwise its meaningless to create separate branches for any experiment, feature or bug.

## Writing Actions

This is not about version control, it's about automation.
If you're familiar with github actions. These are code that run on some virtual machine to perform some actions on your code.

These comes with triggers, like when there is a pull, push, merge or a issue in your repo. Also triggers can be periodic using cron.
Wednesday Links - Edition 2022-10-26
Tags: java, jvm, kafka, latency
Published: 2022-10-26 08:26:16

Please pick a number (5 min)🔢
https://blog.softwaremill.com/please-pick-a-number-b283894ce8ba

Introducing Spring Modulith (6 min)߷
https://spring.io/blog/2022/10/21/introducing-spring-modulith

Venkat Subramaniam Brings a Contemporary Twist to GoF Design Patterns with Modern Java (9 min)🦹
https://www.infoq.com/news/2022/10/modern-java-design-patterns

Input latency (1 min)🐇
https://twitter.com/maxbittker/status/1584384636129796097

Latency vs sales (1 min)🐢
https://twitter.com/penberg/status/1584071717135482880

Explain why you use dependency in Gradle (30 sec)🤷
https://pbs.twimg.com/media/FfwnxeCWQAEInAQ?format=jpg&name=900x900

CVE-2022-31684: Reactor Netty HTTP Server may log request headers (45 sec)🗣️
https://tanzu.vmware.com/security/cve-2022-31684

BellSoft Introduces Alpaquita Linux for Containerized Java Applications (2 min)🦙
https://www.infoq.com/news/2022/10/alpaquita-linux

End-to-end field-level encryption for Apache Kafka Connect (8 min)🔑
https://developers.redhat.com/articles/2022/09/27/end-end-field-level-encryption-apache-kafka-connect
DPS909 Blog :Fourth contirbution in HACKTOBERFEST
Tags: opensource, javascript
Published: 2022-10-26 06:22:06

Hey everyone, thanks for reading my Blog post. This post is regarding my Fourth contribution to the [HACKTOBERFEST](https://hacktoberfest.com/).

## Overview 
In Release 0.2 we were asked to participate in the [HACKTOBERFEST](https://hacktoberfest.com/) so that we could contribute to real open source projects. Furthermore, the main goal of this release is to help you gain experience and confidence in contributing to open source projects through direct involvement in a number of real projects.

## Finding right Open Source Projects
For my Fourth contribution to an open source project i have chosen this Repo on [Bhagavad Gita Website](https://github.com/gita/bg-frontend).

Link to their webiste [Bhagavad Gita ](https://pedantic-easley-9a534c.netlify.app).

[Bhagavad Gita Website](https://github.com/gita/bg-frontend) Code for the Bhagavad Gita website, a website built for Gita readers by Gita readers.


## Issue
Issue which i have found in [Bhagavad Gita Website](https://github.com/gita/bg-frontend) is about the Language options in the footer section which convert the html page to different language was bugged. Code maintainers have asked to remove this feature until their next release. 

Link to [issue-104](https://github.com/gita/bg-frontend/issues/104).

## Pull Request
After fixing their bug I have created this [PR](https://github.com/gita/bg-frontend/pull/113) i am still waiting for them to review my changes and merge the code into the main.

## Conclusion

Working on Open source projects has really helped me a lot to learn about the new way and let me gain some experience on how to work on open source projects.

`Thanks`
Dark mode pictures & 4 other webdev tips you may want to know 🚀
Tags: webdev, html, css, beginners
Published: 2022-10-26 08:12:28

## 1. Dark mode pictures

This is how you can display different pictures in dark mode:

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

More on this topic on the article below:
{% embed https://dev.to/mustapha/responsive-images-for-better-performance-start-using-srcset-and-picture-11kc %}



&nbsp;
## 2. HTML lang attribute
In HTML, the lang attribute specifies the language in which a content is written in and it can be used to help search engines index your site:


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


&nbsp;
## 3. CSS `:lang`
You can use the `:lang` pseudo-class to target elements based on the language they are determined to be in. Here is an example:

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



&nbsp;

---

Hi there! I'm Mustapha, a technical writer, speaker and a passionate JS / TS developer. Follow me on [Twitter](https://twitter.com/TheAngularGuy) for daily tech tips 🚀


---


&nbsp;
## 4. No script
Use the `<noscript>` element to provide alternative content for browsers that do not support scripting, or in which javascript has been disabled:

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


&nbsp;
## 5. Devtools tip: Last evaluated expression

You can access the most recently evaluated expression by typing `$_` in the console:


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









&nbsp;
&nbsp;

That's all for now. I hope you found this useful! 
Leave a comment to let me know which tip (if any) you found useful ⤵


Until next time, have a nice week!



&nbsp;
### What to read next?

{% embed https://dev.to/mustapha/a-deep-dive-into-es6-classes-2h52 %}
Have you tried React classnames?
Tags: react, beginners
Published: 2022-10-26 07:57:36

Regarding classes in React, we get a lot of power out of the box.
However, we can enhance this power to make it even better.

We can leverage the [classnames](https://www.npmjs.com/package/classnames) package, which has been in the React ecosystem since 2015.

## Why React classnames rock

If all you do is write static classes like this:

```js
<div className='static-class'></div>
```

This article might not be for you. Not to disrespect you, but in that case, keep doing what you are doing.

React classnames rock when it comes to dynamic classes or combined classes.

A combined class, for instance, if we allow the [className to be passed](https://daily-dev-tips.com/posts/passing-classname-to-components-in-react/) from a parent component like this.

```js
<div className={`existing-class ${className}`}>
```

Or even classes that render conditionally.

```js
<div className={`existing-class ${success && 'bg-green'}`}>
```

Let's see how this would like with React classnames, but before we dive into that, we have to install it first.

```bash
npm install classnames
```

I tend to import it differently, so I never get confused with the default `className` by doing this.

```js
import classnames from 'classnames';
```

And now we can use it like this.

```js
<div className={classnames('foo', 'bar')}></div>
```

Or, in the more advanced examples, we can do stuff like this:

```js
<div className={classNames('existing-class', className)}>

<div className={classNames('existing-class', 'bg-green': success)}>
```

And this is where it shines. It's a great way to abstract, difficult class conditions to be more readable.

For the result of your output code, it doesn't matter which way you go. It will be the same.
However, this is way easier and more consistent across your code base from a maintainability point of view.

If you are an avid React user and use conditional classes, I would like you to try classnames.

### 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)
Flutter Dependency Injection: ioc_container V1
Published: 2022-10-26 07:54:57

Dart doesn't really have library specifically for dependency injection. There are libraries that you can use as a service locator but they have global declarations

[ioc_container](https://pub.dev/packages/ioc_container) is full fledged, fast and simple library for dependency injection. Check out the benchmarks to compare the performance with other libraries. 

 https://link.medium.com/EHKzqaV1qub
Golang TwoSum
Published: 2022-10-26 07:49:49

```
package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func BruteForce(nums []int, target int) []int {
	IntSlice := new([]int)
	// using linear search chek
	for index1, Num1 := range nums {
		for index2, Num2 := range nums {
			//if both the number add == target and index not same then append to IntSlice
			if Num1+Num2 == target && index1 != index2 {
				*IntSlice = append(*IntSlice, index1)
			}
		}
	}
	return *IntSlice
}
func HashMap(nums []int, target int) []int {
	//Hashmap store the complement and index
	//3,2,3 -->6
	see := make(map[int]int)
	//map[]

	//result
	IntSlice := new([]int)
	//chek the complement if true append both index to IntSlice if not update to Hashmap
	for Cindex := 0; Cindex < len(nums); Cindex++ {
		// 3:=6-3
		r := target - nums[Cindex]
		//val,bool:=map[key]
		index, ok := see[r]
		if ok {
			*IntSlice = append(*IntSlice, index, Cindex)
			//0,2
		}
		//update to Hashmap
		//complement=index
		//
		//map[3:0,2:1,]
		see[nums[Cindex]] = Cindex
	}
	return *IntSlice

}

func main() {
	reader := bufio.NewReader(os.Stdin)
	//using reader read the input by using readline
	fmt.Print("Please enter your Slice Numbers: ")
	//example:
	//Please enter your Slice Numbers:2 7 11 6
	val, _, _ := reader.ReadLine()
	//ReadLine return byte,bool,error

	//convert byte to string
	Readline := strings.TrimSpace(string(val))

	//split convert string to slice_string
	input1 := strings.Split(Readline, " ")
	var a []int
	for i := 0; i < len(input1); i++ {
		intnum, err := strconv.Atoi(input1[i])
		if err != nil {
			log.Fatal(err)
		}
		a = append(a, intnum)
	}

	//convert byte to string
	fmt.Print("Please enter your target Number : ")
	var w int
	fmt.Scanln(&w)
	output := HashMap(a, w)
	fmt.Println("Hash map Two Sum is :", output)
	output2 := BruteForce(a, w)
	fmt.Println("Bruit_Force Two Sum is :", output2)

}

```
unit test of about code
```
package main

import (
	"reflect"
	"testing"
)

func TestHashMap(t *testing.T) {
	type args struct {
		nums   []int
		target int
	}
	tests := []struct {
		name string
		args args
		want []int
	}{
		{
			name: "CHEk",
			args: args{
				nums:   []int{2, 7, 11, 15},
				target: 9,
			},
			want: []int{0, 1},
		}, {
			name: "CHEk",
			args: args{
				nums:   []int{3, 2, 4},
				target: 6,
			},
			want: []int{1, 2},
		}, {
			name: "CHEk",
			args: args{
				nums:   []int{3, 3},
				target: 6,
			},
			want: []int{0, 1},
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := HashMap(tt.args.nums, tt.args.target); !reflect.DeepEqual(got, tt.want) {
				t.Errorf("HashMap() = %v, want %v", got, tt.want)
			}
		})
	}
}

```
02.16 React State - User List in one component (functional components)
Tags: javascript, react, tutorial, webdev
Published: 2022-10-26 07:46:10

App preview:
![The way the app will look like](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ipcful7g08atede4cyw.gif)


Project files:
![An image of project file structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ikiybnhelpjm8zq6fao.png)



<hr/>

```react
import React, { useState, useEffect} from 'react';
import './App.css'

function App () {
  const [users, updateUsers] = useState([]);
  const [newName, updateNewName] = useState('');
  const [newEmail, updateNewEmail] = useState('');
  const [newUser, updateNewUserl] = useState({});

  useEffect(() => {
    //simillar to componentDidMount, we useEffect() hook 
    //... for the side effect of populating the initial component state
    //... and by adding an empty array ([]) as a second argument, 
    //... we make sure to run this effect only once (on mount ) 
    updateUsers( [
      {
        name: "Jane Doe",
        email: "jane.doe@gmail.com"
      },
      {
        name: "Joe Shmoe",
        email: "joe.shmoe@gmail.com"
      }
    ])
  }, []);

  const handleNameInputChange = (event) => {
    const inputValue = event.currentTarget.value;
    updateNewName(inputValue);
  }

  const handleEmailInputChange = (event) => {
    const inputValue = event.currentTarget.value;
    updateNewEmail(inputValue);
  }

  const handleFormSubmit = (event) => {
    event.preventDefault(); //prevent page refresh
    const newUser = {
        name: newName,
        email: newEmail,
    }
    updateUsers([...users, newUser]);
  }


  return (
    <div className="App" >
      <h1>App.js</h1>
      

      <div>
        <form className="user-add-form" onSubmit={(event)=>{handleFormSubmit(event)}} >
          <label htmlFor="name">Name:</label>
          <input 
              type="text" 
              name="name" 
              onChange={(event)=>{handleNameInputChange(event)}}
          />

          <label htmlFor="emai">Email:</label>
          <input 
              type="email" 
              name="email" 
              onChange={(event)=>{handleEmailInputChange(event)}}
          />
          <input type="submit" value="Add New User!"/>
        </form>
      </div>
      
      <br/>
      <button onClick={()=>{console.log(users)}}>Log users to console!</button>

      <div>
        {
            users.map((user, index) => {
                return(
                  <div  key={user.email}>
                    <br/>
                    <div><span>{index +1 }. </span><span>{user.name}</span></div>
                    <div><span>{user.email}</span></div>
                  </div>
                ) 
            }) 
        }
      </div>
    </div>
  
  );
}

export default App;
```
<hr/>
```css
.App{
  background-color: lightskyblue;
  padding: 20px 10px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
```
Back to Back #17 - Back-end news by SFEIR
Tags: newsletter, french, backend, sfeir
Published: 2022-10-26 07:40:01

_Comme chaque fin de mois, les experts de SFEIR publient la newsletter back-end. Retrouvez la sélection de contenu, les outils coup de cœur et les astuces._

---

## 📰 Articles

### [Python 3.11.0 is now available](https://blog.python.org/2022/10/python-3110-is-now-available.html)
La PSF a annoncé la sortie de la version 3.11 de Python. Ce billet de blog liste les nouveautés du langage (comme une meilleure localisation des erreurs dans les tracebacks ou les groupes d'exceptions) mais aussi un gain de performances notable par rapport à la 3.10.

### [Quarkus Defends REST APIs against Attack](https://www.infoq.com/news/2022/10/quarkus-csrf-defense/)
La version 2.13.0 de Quarkus est sortie avec l’ajout d’un filtre CSRF pour les serveurs RESTEasy Reactive. Un [guide](https://quarkus.io/guides/security-csrf-prevention) est disponible pour les développeurs voulant activer ce mécanisme de défense.

### [Ten Years of TypeScript](https://devblogs.microsoft.com/typescript/ten-years-of-typescript/)
TypeScript a 10 ans ! L’anniversaire a eu lieu au tout début de ce mois. Pour cette occasion, Daniel Rosenwasser revient sur les premiers pas du langage et le scepticisme ambiant de l’époque.

## 🛠️ Outils

### bat

Avec Halloween, l’occasion est parfaite pour parler de bat 🦇 Écrit en Rust, ce clone de la commande `cat` qui vient avec une coloration syntaxique pour un grand nombre de langages et une intégration de Git pour afficher les modifications dans les fichiers.

{% embed https://github.com/sharkdp/bat %}

### Key Promoter X

Pour ceux qui utilisent Intellij, le plugin Key Promoter X affiche le raccourci clavier pour l'action que vous venez de faire avec la souris. Pour les boutons qui n'ont pas de raccourci, le plugin vous propose d'en créer un. Ainsi, Key Promoter vous aide à prendre le réflexe d’utiliser le clavier au lieu de la souris.

{% embed https://github.com/halirutan/IntelliJ-Key-Promoter-X %}

## 💡 Trucs et astuces

Ce guide d'Anthony [_Package NPM universel_](https://k49.fr.nf/package-npm-universel-ou-comment-construire-un-package-quon-pourra-utiliser-partout/) répond à une problématique du développement en JS : créer un module qui pourra être utilisé partout, aussi bien sur un serveur que dans un navigateur Internet Explorer.
DNAnalyzer Discord Server
Tags: hacktoberfest, dnanalyzer, java
Published: 2022-10-26 07:01:25

I started developing DNAnalyzer in July of 2022, and it quickly grew to have over 25 contributors, with more to come. I really appreciate everyone's support! It means miles to me every time a contributor asks to be assigned an issue and opens a PR. I am excited to see what is in store for DNAnalyzer in the next six months. Our team is pleased to announce the release of our new Discord server, where contributors and users will get the opportunity to collaborate on this project. I hope you will consider joining, and I look forward to continuing to work with everyone. Thank you.

DNAnalyzer Discord Server: https://discord.gg/X3YCvGf2Ug
Angular Not Redirecting After Getting Auth Token
Tags: angular
Published: 2022-10-26 06:59:41

Dear Experts Angular, Please See The Code Below And Tell Me Is It Correct or Wrong ?

```
  onFormSubmit() {
    this.isLoadingResults = true;
    this.authService.login(this.loginForm.value).subscribe(data => {
        this.isLoadingResults = false;
        this.router.navigate(['/secure'],{ replaceUrl: true }).then(_ => console.log('You are secure now!'));
      }, (err: any) => {
        console.log(err);
        this.isLoadingResults = false;
      });    
  }
```
need help to know the best react course / website to learn web & mobile dev.
Published: 2022-10-26 06:44:30

hi all,
i am very new to React world. i was in Oracle Forms & Reports, Oracle Apex, SQL & PL/SQL. so, there are too much differences in learning phase.
i want to learn from scratch to understand web & mobile development especially business applications with CRUD oprations. please help me with name and (if possible) links to the paid / free courses and websites with tutorials & guides. there are many but some says ReactJS and some says React Native? some uses Doc. Database like Mongo and some uses MySQL. i have XAMPP on my Win 10 PC. 
this will go long to ask many things. in short help a child to learn walking.
regards
Jenkins issue while saving system configuration - A problem occurred while processing the request
Tags: bash
Published: 2022-10-26 06:37:11

This issue happens because of incompatibility of plugins. 

Go to Jenkins system logs at 

> Manage Jenkins > System logs > All Jenkins logs

monitor the log generated while saving the configuration. 
search for "plugin" string in the log snippet. Uninstall or upgrade the problematic plugin mentioned in the logs. It will fix the issue.

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