teleren/devto huggingface dataset:
Ubuntu 22.04 Sunucu Üzerinde Liman MYS 2.0 Kurulumu
Tags: linux, opensource, beginners, tutorial
Published: 2023-10-30 08:32:57

HAVELSAN Liman Merkezi Yönetim Sistemi(MYS) 2.0 sürümü ile görsel ve özellik olarak zenginleşen ürünü kurmak için aşağıdaki adımları takip edebilirsiniz.

Liman MYS 2.0 sürümünü kurmak için öncelikle NodeJS güncel repolarını sistemimize eklememiz gerekiyor. Node 18 versiyon ve sonrası kullanılması önerilmektedir.

``` bash
NODE_MAJOR=18

sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

```

Ürün çalışabilmek için PHP 8.1 sürümünü kullanmakta. Bundan dolayı PHP repolarını da ekliyoruz.

``` bash
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
```

Veri tabanı olarak da açık kaynak kodlu ve ücretsiz  **PostgreSQL** kullanılmakta. Repolarını ekleyelim.

``` bash
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget -O- https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > pgsql.gpg
sudo mv pgsql.gpg /etc/apt/trusted.gpg.d/pgsql.gpg
```

Bağımlı olunan paketlerin repolarını eklediğimize göre artık debian paketini indirip kurulum işlemini gerçekleştirebiliriz.

``` bash
sudo apt update
wget https://github.com/limanmys/core/releases/download/release.feature-new-ui.863/liman-2.0-RC2-863.deb
apt install ./liman-2.0-RC2-863.deb
```

Kurulumu yaptığınız sunucunun ip adresini tarayıcıya yazdığınızda aşağıdaki gibi login ekranını görebiliyorsanız kurulumunuz başarılı gibi düşünebiliriz.

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

Giriş yapabilmek için ise admin kullanıcısının parolasını oluşturmamız lazım.

Bunun için sunucumuzun komut satırına aşağıdaki komutu yazarak oluşturabiliriz.

``` bash
sudo limanctl administrator
```

Daha önce oluşturduysanız, eski bir sürümden güncellediyseniz veya parolanızı kaybettiyseniz ise aşağıdaki komutu kullanarak admin kullanıcısı için yeni parola oluşturabilirsiniz.

``` bash
sudo limanctl reset administrator@liman.dev
```

Sonuç olarak aşağıdaki gibi bir çıktı bekliyoruz.
``` bash
E-mail: 
administrator@liman.dev

New password: 
_8-7+0268+<45,*@

When you login you will be prompted to change your password.

```

Bu bilgileri kullanarak arayüze giriş sağlayabilirsiniz. Sizden parolanızı sıfırlamanızı isteyecektir. Bu işlemden sonra arayüze ulaşabilirsiniz.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hehk1a2ab80esgbxwaei.png)
0.x Major Releases
Tags: ruby, programming, versioning
Published: 2023-10-30 08:20:37

Dear Ruby gem maintainers

Are you aware that `0.x` releases of your libraries have to be treated as major releases by me? – Even and especially if you're following semantic versioning (see https://semver.org/#spec-item-4).

In the list of my [Depfu](https://depfu.com/) updates I more and more often receive lists like this.

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

I feel that you're bailing out of your responsibility for compatibility that we all owe to Matz. You should have every right to change everything you want in your code, but why not simply bump the correct version number part when you do that? Are you afraid of real first digit major versions?
MyISAM Database Management using GUI Client
Tags: mysql
Published: 2023-10-30 08:18:26

The appropriate tools and knowledge are essential for navigating the complexity of database management, particularly when working with specialized storage engines like MyISAM in MySQL and MariaDB settings. This thorough book gives you an in-depth understanding of the key functions and features of MyISAM clients, demystifying their purpose and functionality. We handle everything, from starting CRUD processes to maximizing table speed. We also highlight the feature-rich IDE dbForge Studio for MySQL, which makes working with MyISAM tables and databases easier. This is the go-to guide for anyone wanting to learn more about MyISAM clients and make the most of their capabilities, be they a developer or an experienced DBA.

## A MyISAM client is what?

A specific program or module created to communicate with the MyISAM database storage engine is referred to as a MyISAM client. Its main purpose is to make basic database activities—creating, reading, updating, and deleting data—easier via particular protocols, APIs, or query languages. These actions are usually referred to as CRUD operations.

It's crucial to remember that when we discuss MyISAM, we are talking about a MySQL/MariaDB client because these database management systems rely heavily on the MyISAM storage engine. Starting database administration procedures, submitting queries to databases, and managing the resulting results all depend heavily on a MyISAM client.

To put it another way, the interface users use to communicate with MySQL/MariaDB is any MyISAM client. Many options are available to meet various demands, such as feature-rich IDEs based on graphical user interfaces, such as dbForge Studio for MySQL or MySQL Workbench, as well as versatile options like the MySQL Command-Line Client and lightweight command-line utilities like myisamchk.

The activities that must be completed, the particular work environment, and the user's preferences all play a major role in selecting the best client.

Learn more: https://mariadb.com/kb/en/myisam-database-management-using-gui-client/
Remove MySql 5.7 on Ubuntu 20.04
Tags: linux, ubuntu, nzucode
Published: 2023-10-30 07:55:41

Hai kawan,
Pada postingan kali ini akan membahas tentang cara meremove bersih mysql 5.7 pada Ubuntu.
masukan perintah berikut:

```
apt remove --purge mysql-server mysql-client mysql-common
```
Nanti akan muncul konfirmasi penghapusan mysql, tekan `yes`. Kemudian hapus direktori mysqlnya

```
rm -rf /var/lib/mysql
```
Masukan juga perintah berikut untuk memersihkan semua cachenya.

```
apt autoremove
```
```
apt autoclean
```
Setelah semua selesai konfirmasi dengan menjalankan perintah mysql, seharusnya sudah tidak ada servicenya.
Semoga bermanfaat.
Add "Edit in New Tab" link on Posts/Pages
Tags: wordpress, posts, button, php
Published: 2023-10-30 07:47:38


## How to Implement "Edit in New Tab" Links
While editing a post or page you need to click "Edit" link on WordPress. For my use cases, I don't want to leave the main dashboard. Always, I use 'ctrl' button for opening posts to new tab.

By using this feature judiciously, you can significantly improve your writing or editing experience.

Implementing "Edit in New Tab" links in your WordPress posts and pages is a straightforward process with the below codes:

> Implement codes as per your needs on 'functions.php' file.

**For Posts**
![Post Editing Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqj8tqppjpno19zujenn.png)

Code Snippet:
```
add_filter( 'post_row_actions', 'myposts_tab_row_actions', 10, 2 );
function myposts_tab_row_actions( $actions, $post ) {
    if( get_post_type() === 'post' ) {
        $edit_tag = "<a target='_blank' href='";
        $link = admin_url( 'post.php' );
        $edit_tag .= add_query_arg(array('post' => $post->ID, 'action' => 'edit'), $link);
        $edit_tag .= "'>Edit in New Tab</a>";
        $actions['edit_new_tab'] = $edit_tag;
    }
    return $actions;
}
```

**For Pages**

![Page Editing Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ddmcgq74ldkovokdim60.png)

Code Snippet:
```
add_filter( 'page_row_actions', 'mypages_tab_row_actions', 10, 2 );
function mypages_tab_row_actions( $actions, $post ) {
	if( get_post_type() === 'page' ) {
        $edit_tag = "<a target='_blank' href='";
        $link = admin_url( 'post.php' );
        $edit_tag .= add_query_arg(array('post' => $post->ID, 'action' => 'edit'), $link);
        $edit_tag .= "'>Edit in New Tab</a>";
        $actions['edit_new_tab'] = $edit_tag;
    }    
    return $actions;
}
```



**For Custom Post Types**

![Custom Post Types Editing new tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fugunegzksgkc18qv82n.png)


Code Snippet:
```
add_filter( '{custom_post_type_name}_row_actions', 'my_custom_post_type_name_s_tab_row_actions', 10, 2 );
function my_custom_post_type_name_s_tab_row_actions( $actions, $post ) {
	if( get_post_type() === '{custom_post_type_name}' ) {
        $edit_tag = "<a target='_blank' href='";
        $link = admin_url( 'post.php' );
        $edit_tag .= add_query_arg(array('post' => $post->ID, 'action' => 'edit'), $link);
        $edit_tag .= "'>Edit in New Tab</a>";
        $actions['edit_new_tab'] = $edit_tag;
    }    
    return $actions;
}
```

This is how it looks like:

![Open in New tab for Pages](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jljhjkim03vysc9xa7pd.png)
Supermarket Rack Manufacturers for Your Business
Tags: supermarketdisplayracks, supermarketracks, supermarketrackmanufacturers
Published: 2023-10-30 07:44:35

https://santechsheetmetal.com/display-rack/supermarket-display-rack/

Santech Sheet Metal’s wonderfully crafted display shelves are extensively used in all layouts and sizes of supermarkets. They are highly praised for their attributes, including durability, sleek configurations, high-quality materials, and superior building methodologies. We are the top producers and manufacturers of modular display racks in India. To know more, visit our website today: https://santechsheetmetal.com
Convert array into Zig-Zag fashion
Tags: geeksforgeeks, beginners, algorithms, array
Published: 2023-10-30 07:42:15

> link : https://practice.geeksforgeeks.org/problems/convert-array-into-zig-zag-fashion1638/1#

Given an array Arr (distinct elements) of size N. Rearrange the elements of array in zig-zag fashion. The converted array should be in form a < b > c < d > e < f. The relative order of elements is same in the output i.e you have to iterate on the original array only.

Example 1:
```
Input:
N = 7
Arr[] = {4, 3, 7, 8, 6, 2, 1}
Output: 3 7 4 8 2 6 1
Explanation: 3 < 7 > 4 < 8 > 2 < 6 > 1
```

Example 2:
```
Input:
N = 4
Arr[] = {1, 4, 3, 2}
Output: 1 4 2 3
Explanation: 1 < 4 > 2 < 3
```

Your Task:
*You don't need to read input or print anything. Your task is to complete the function zigZag() which takes the array of integers arr and n as parameters and returns void. You need to modify the array itself.*

> Expected Time Complexity: **O(N)**

> Expected Auxiliary Space: **O(1)**

Constraints:

1 <= N <= 105

0 <= Arr[i] <= 106

## Solution:

We on an overall level wanted to make the odd index maximum than it's adjacent even index peers, and with the even index we need to make those minimum.

If such situation arises, then we are good but if odd index element is min than even (or vice versa) we need to alter the array upon that spot

The idea here to alter is to keep the elements intact, so the best way to do is to swap the adjacent index (and not to increase or decrease the value of array elements).

This could be done in one iteration only, and hence could expect the time complexity of O(N) and space complexity of O(1).

```
//User function Template for Java

class Solution{
    public void zigZag(int a[], int n){
        // Code your solution here.
        // 0 < 1 > 2 < 3 > 4
        // wanting odd index to be max
        for (int i = 0; i < n-1; i++) {
            if (i % 2 == 0) {
                // need to min
                if (a[i] > a[i+1]) swap(a, i, i+1);
            } else {
                // need to max
                if (a[i] < a[i+1]) swap(a, i, i+1);
            }
        }
    }
    
    private void swap(int[] a, int i, int j) {
        int t = a[i];
        a[i] = a[j];
        a[j] = t;
    }
}
```

This solution works as in the current or next iteration, the odd index would have the higher value. The best possible way to track this is by taking a sorted array and dry run upon it.

Alternative solution:
```
public class ToggleSolution {
	void zigZag(int arr[], int n) {
		boolean isGreater = false;
		for(int i = 0; i < n-1; i++) {
			if(!isValid(arr, i, i+1, isGreater))
				swap(arr, i, i+1);
			isGreater = !isGreater;
		}
	}
	
	boolean isValid(int[] a, int i, int j, boolean isGreater)  {
		return (a[i] > a[j]) == isGreater;
	}
	
	void swap(int[] a, int i, int j) {
		int tmp = a[i];
		a[i] = a[j];
		a[j] = tmp;
	}

	public static void main(String[] args) {
		int[] a = 
			// {1,2,3,4,5,6,7};
			{4, 3, 7, 8, 6, 2, 1};
			// {1, 4, 3, 2};
		new ToggleSolution().zigZag(a, a.length);
		System.out.println(Arrays.toString(a));
	}
}
```

Let me know which solution is a clean and proper!
Hotel Reservations in Pearl
Tags: hotelbookinginpearlms, luxuryhotelsinpearl, hotelsinmississippi
Published: 2023-10-30 07:38:22

Welcome to Courtyard, Pearl's premium abode. Make your [hotel reservations in Pearl](https://courtyardpearl.com/) with us and enjoy the best of amenities, ambiance, and location. Dive into a serene experience tailored just for you.
access custom api in theme app extension
Published: 2023-10-30 07:36:12

Hello 

I want to access the custom api from a JS project. I write the below code but is showing CORS error

const apiResp = api.fetch('/getquizedata', {
  method: 'POST',
  body: JSON.stringify({ quizId }),
  headers: {
    'Content-Type': ' application/json
  },
});
console.log(apiResp);
The time.sleep() Function in python.
Published: 2023-10-30 07:25:46

If you need to pause your program for a while, call the time.sleep() function and pass it the number of seconds you want your program to stay paused.  Launch interactive shell and Enter the following:

```
import time
for i in range(3):
    print('chelsea lost')
    time.sleep(1)
    print('Manchester lost')
    time.sleep(1)
    
time.sleep(10)
```
The for loop will print chelsea lost, pause for one second , print Manchester lost ,pause for one second, print chelsea lost, pause, and so on until chelsea and Manchester have each been printed three times.

The time.sleep() function will block—that is, it will not return and release your program to execute other code—until after the number of seconds you passed to time.sleep() has elapsed. For example, if you enter time.sleep(5) ,you’ll see that the next prompt (>>>) doesn’t appear until five seconds have passed.
Turn your website into a mobile app with PWA
Tags: webappdevelopment, programming, web, productivity
Published: 2023-11-01 06:28:25

---
title: Turn your website into a mobile app with PWA
published: true
date: 2023-10-30 07:25:17 UTC
tags: webappdevelopment,programming,web,productivity
canonical_url: https://medium.com/@emma.ngo1110/turn-your-website-into-a-mobile-app-with-pwa-5451838798cc
---

![pwa](https://cdn-images-1.medium.com/max/1024/1*0TwclvnwRWb1b4Q5jDxzPA.png)

When I used Lighthouse to analyze my website, I found out that there was one criterion that my website could not meet, and that was PWA.

I’m starting to wonder what PWA is.

PWA (Progressive Web Apps) is a web app that uses progressive enhancement to provide users with a more reliable experience, uses new capabilities to provide a more integrated experience, and can be installed. And, because it’s a web app, it can reach anyone, anywhere, on any device, all with a single codebase.

Read my article about PWA [here](https://medium.com/p/5451838798cc)
what is software testing ?what we need to know about software testing? what is the relevance of software testing?
Published: 2023-10-30 07:14:40

software testing is an important process in the software development lifecycle that involves evaluating a software application to identify and fix defects or issues.it aim to ensure that the software function correctly meets requirement.

 what we need to know about software testing?
1. type of testing
functional testing
  a. unit testing
  b. integration testing
  c. system testing
  d. user interface testing
  e. regression testing 
  f. acceptance testing and etc.,
non-function testing
  a. documentation 
  b. installation testing
  c. performance testing
  d. Reliability testing
  e. security testing   

2. Testing Techniques
  a. manual testing
  b. automation testing
in both testing techniques there are  following some methods
-boundary values analysis
-decision table testing
-use case testing
-linear code sequences and jump

3. Bug detection
one of the primary goal is to find and report defects or bugs in the software.

4.quality assurance
 It helps ensure that the final product is reliable, functional, and safe for users.

5. relevance 
 ability to reduce the risk of software failures and improve the overall quality of the product.

6.continuous testing

7.user satisfaction
Chocolate Distribution Problem
Published: 2023-10-30 07:14:10

> link : https://practice.geeksforgeeks.org/problems/chocolate-distribution-problem3825/1#

Given an array A[ ] of positive integers of size N, where each value represents the number of chocolates in a packet. Each packet can have a variable number of chocolates. There are M students, the task is to distribute chocolate packets among M students such that :
1. Each student gets exactly one packet.
2. The difference between maximum number of chocolates given to a student and minimum number of chocolates given to a student is minimum.

Example 1:
```
Input:
N = 8, M = 5
A = {3, 4, 1, 9, 56, 7, 9, 12}
Output: 6
Explanation: The minimum difference between 
maximum chocolates and minimum chocolates 
is 9 - 3 = 6 by choosing following M packets :
{3, 4, 9, 7, 9}.
```

Example 2:
```
Input:
N = 7, M = 3
A = {7, 3, 2, 4, 9, 12, 56}
Output: 2
Explanation: The minimum difference between
maximum chocolates and minimum chocolates
is 4 - 2 = 2 by choosing following M packets :
{3, 2, 4}.
```

Your Task:

*You don't need to take any input or print anything. Your task is to complete the function findMinDiff() which takes array A[ ], N and M as input parameters and returns the minimum possible difference between maximum number of chocolates given to a student and minimum number of chocolates given to a student.*

> Expected Time Complexity: **O(N*Log(N))**

> Expected Auxiliary Space: **O(1)**

Constraints:

1 ≤ T ≤ 100

1 ≤ N ≤ 105

1 ≤ Ai ≤ 109

1 ≤ M ≤ N


## Solution:

To sort the array so that the number of chocolates are in increasing order, we can now be sure that the adjacent elements are the pair with the least difference.

Now for each packet check, let say i, could we distribute this packet to the children till the (i + m - 1)th packet? Also keep track of the minimum difference.

Post the complete iteration of the array you got your result.

```
class Solution {
    public long findMinDiff (ArrayList<Integer> a, int n, int m) {
        // your code here
        if (m > n) {
            // throw new IllegalArgumentException("Number of students less than packets");
            return -1;
        }
        int min = Integer.MAX_VALUE;
        Collections.sort(a);
        for (int i = 0; i + m - 1 < a.size(); i++) {
            min = Math.min(min, a.get(i + m - 1) - a.get(i));
        }
        return min;
    }
}
```
All-Time Favorite Halloween Costume?
Tags: discuss, watercooler
Published: 2023-10-30 07:00:00

Time for some Halloween fun! What's your all-time favorite costume, and if you've got a pic, we'd love to see it!

---

👻🎃 Join Our Halloween Costume Contest! 🎃👻

Embrace the eerie season, don your most creative costume, and snap a pic. Share it with our community for a chance to win badges. [Check out our post for more info](https://dev.to/devteam/coding-in-costume-join-our-halloween-costume-contest-3dg1). 😈📸🏆

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Effortlessly add new characters to Your keyboard layout
Tags: learning, beginners, linux, productivity
Published: 2023-10-30 06:59:12

Ever wanted to add new characters to the keyboard while keeping Your beloved keyboard layout the same? 

That's exactly what I needed to do! I wanted to use german characters _äüöß_ on my RHEL 8 machine. The problem was that each keyboard layout I could find with those characters was with other symbols in different places. It would be so good if I could simply add a few new characters while keeping the rest of the layout the same, right?

After some googling I came up with the following.

Created a file _custom_xmodmap_ with the contents:

`keycode 30 = u U udiaeresis Udiaeresis
keycode 32 = o O odiaeresis Odiaeresis
keycode 38 = a A adiaeresis Adiaeresis
keycode 39 = s S ssharp paragraph
keycode 108 = Mode_switch`

Here the _keycode 108_ is _AltGr/Right Alt_.

Then executed `xmodmap custom_xmodmap` in console. And that's it. Now holding _AltGr/Right Alt_ button down and pressing any of _u/o/a/s_ I get the corresponding german character.

To make the change permanent, I added the last command in the _~/.bashrc_.

Some tips for Your particular settings:

For checking the current xmodmap You can use `xmodmap -pke`.

For getting the keycodes of the keys, You can use command `xev`.

I also found a cool [EurKEY package](https://eurkey.steffen.bruentjen.eu/download.html) where I could see the examples of the keycodes and keyboard layout.

Hope it makes Your life easier as it made mine!
Elasticsearch - storing and indexing logs
Published: 2023-10-30 06:58:54

Elasticsearch is commonly used for storing and indexing logs in a scalable and searchable way. To store logs in Elasticsearch, you typically follow these steps:

1. **Set Up Elasticsearch**:

   - Install and configure Elasticsearch on a server or cluster. You can run Elasticsearch locally or in a distributed setup, depending on your requirements.

2. **Create an Index**:

   - In Elasticsearch, logs are typically stored in indices. An index is a logical container for your log data. You can create an index for each type of log or application.

   ```json
   PUT /mylogs
   ```

3. **Send Logs to Elasticsearch**:

   - You need a mechanism to send logs to Elasticsearch. This is often done through a log shipper or agent. Popular log shippers include Filebeat, Logstash, and Fluentd. These tools can collect logs from various sources, transform them if necessary, and send them to Elasticsearch.

   For example, in Filebeat's configuration, you might specify:

   ```yaml
   output.elasticsearch:
     hosts: ["http://elasticsearch-server:9200"]
     index: "mylogs-%{+yyyy.MM.dd}"
   ```

   This configuration tells Filebeat to send logs to Elasticsearch at the specified host and create daily indices.

4. **Ingest and Index Logs**:

   - Elasticsearch will receive the logs and index them automatically. It uses a schema-less approach, which means you can send logs with different structures, and Elasticsearch will adapt.

5. **Search and Analyze Logs**:

   - You can use Elasticsearch's Query DSL to search and filter logs based on various criteria like timestamps, keywords, or custom fields. The Kibana visualization tool often accompanies Elasticsearch for log exploration and visualization.

6. **Retain and Manage Logs**:

   - Elasticsearch provides mechanisms for managing log retention, such as configuring the index lifecycle policies to control how long log data is kept.

7. **Scale as Needed**:

   - As your log volume grows, you can horizontally scale Elasticsearch by adding more nodes to your cluster to handle the increased load and storage requirements.

Here's a simplified example of how you might query logs in Elasticsearch using its Query DSL:

```json
GET /mylogs/_search
{
  "query": {
    "match": {
      "message": "error"
    }
  }
}
```

This query retrieves all log entries in the "mylogs" index containing the word "error" in the "message" field.

Elasticsearch is a powerful tool for storing and searching logs at scale. When combined with log shippers and visualization tools like Kibana, it becomes a comprehensive log management solution for monitoring and troubleshooting applications and systems.