Introducing EasyCoda

EasyCoda is a learn by doing platform build by our team for developers and programmers. We have added some cloud native courses and will contine add more in the future. We also bring AI capability to learning, in each course/toturials, you can ask AI for help of unaware concepts, or problem solving. And we hope it can give you a…

Deploy and setup jmeter cluster on kubernetes

Deploying JMeter on Kubernetes can significantly enhance your performance testing capabilities, enabling you to scale effortlessly and manage your test infrastructure efficiently. In this guide, we’ll walk you through the steps to deploy JMeter on Kubernetes. We will deploy a one master/two slaves jmeter service on kubernetes cluster v1.30. Introduction Apache JMeter is a popular open-source tool for performance testing,…

Disable URL Encoding In Spring WebClient

In Spring, the WebClient class does not provide a direct way to disable URL encoding globally because encoding is generally required to ensure that URLs are correctly interpreted by servers. However, you can manage encoding at the point of specifying URI components when building the request. This allows you greater control over which parts of the URL should be encoded.…

How to configure huge pages for pod?

Recently, I build a Kubernetes AI Assistant(chat bot) with knowledge from kubernetes docs website using RAG technology. And I ask this assistant a common question for test case. The result is well performed. Here is the result from the assistant: To configure huge pages for a Pod in Kubernetes, you need to follow these steps: After updating the configuration file,…

Squid Username/Password Configuration

Configuring password authentication for Squid, a popular open-source proxy server, involves several steps. Here’s a basic guide on how to set up username and password authentication in Squid: This command will prompt you to enter and confirm the password for the specified username. The -c flag is used to create a new file. Adjust the paths and settings according to…

NPM Proxy / Registry Configuration

When working with npm (Node Package Manager), you might need to configure a proxy if you are behind a corporate firewall or if you’re accessing the internet through a proxy server. Here’s how you can configure npm to use a proxy, such as http or https, socks5,.etc, Also, you can set a custom or private local registry for npm. Setting…

ImportError: cannot import name ‘url_quote’ from ‘werkzeug.urls’

when you run your python app with flask and werkzeug packages, if the version do not match, it will through the following error:  It is because Werkzeug 3.0.0 was released and Flask doesn’t specify the dependency correctly (requirements says Werkzeug>=2.2.0). This is why, Werkzeug 3.0.0 is still installed and Flask 2.2.2 isn’t made for Werkzeug 3.0.0. to resolve this issue, just reinstall werkzeug with version 2.2.2 if your…

Configure socks proxy for Python pip

To setup a socks5 proxy for python pip, you need to install pysocks package, otherwise the following error will be occured: and run following command to install pysocks and then run pip with socks5 proxy settings:

Understanding goroutine in Go

The biggest feature of Go language is that it supports concurrency (Goroutine) from the language level. Goroutine is the most basic execution unit in Go. In fact, every Go program has at least one Goroutine: the main Goroutine. It is created automatically when the program starts. In this article, we will talk about the the detail of goroutine, including what…

How to Read and Parse RSS Feeds with Rome in Java

Introduction RSS (Really Simple Syndication) feeds are a valuable source of information for both content creators and consumers. In the world of software development, you may find yourself needing to read and parse RSS feeds to extract valuable data for your projects. Fortunately, Java provides a powerful library called Rome that makes it easy to work with RSS feeds. In…

Read PDF file in java

PDF (Portable Document Format) is a popular file format for sharing documents. We will use pdfbox to read texts from pdf and extract images from pdf in java. Apache PDFBox is an open-source Java library that provides a wide range of features for working with PDF documents. To get started, we need to add PDFBox as a dependency in our…

How to read csv file in java?

To read a CSV file in Java, you can use the OpenCSV library, which is a very simple and easy to use library that allows you to work with CSV files in Java. Here’s a basic example of how you can read a CSV file: This will read the CSV file line by line and print out the first two…

Mastering HTTP Requests with WebClient in Spring WebFlux

Introduction In the world of web development, making HTTP requests is a fundamental operation. In this comprehensive guide, we’ll explore how to make HTTP requests with WebClient in Spring WebFlux, including how to set custom http headers, proxy setting, rate limit and retry, error handling, and sse(server sent event) requests, making post requests with multipart Table of Contents Introduction 1.…

How to delete a directory and its sub directories in Java?

Introduction Deleting directories and their subdirectories is a common task in Java programming, especially for developers managing files and directories in their applications. Whether you’re building a file management system, a cleanup utility, or just need to remove unwanted folders, it’s crucial to understand the proper techniques for handling this task efficiently. In this blog post, we’ll explore various methods…

How to download and save file with apache httpclient in java?

Apache HttpClient is a robust and efficient library for making HTTP requests in Java applications. It provides a wide range of features for working with HTTP, including making GET and POST requests, handling cookies, and managing connection pooling. In this blog post, we will focus on using Apache HttpClient to download files from a remote server. We also cover an…

Merge fine-tuned checkpoint with base model

if you have fine-tuned an open source model, such as llama or llama2 with lora or qlora, you can only public the fine-tuned checkpoints or merge the checkpoint into the base model, the public the new fine-tuned model. here is the code: check_point_dir is the directory where your fine tuned checkpoints located, the contents looks as below, you can also…

Size Mismatch In Lora Fine Tuning

When you fine tuning a model with lora or qlora methods, the lora_r(lora rank) parameter is important, it will define the saved checkpoint size, for example, with lora_r = 8, the saved checkpoint shape size is [8, 4096], if the lora_r is different with the saved checkpoint size, you will get an size mismatch error as below: it mentions that…

Mastering Kubernetes VolumeMount: User Groups and File Permissions

Introduction Kubernetes is a powerful container orchestration platform that helps developers manage and deploy applications at scale. While it simplifies many aspects of application management, handling file permissions and user groups within Kubernetes can be a challenge. In this blog post, we’ll delve into the intricate details of Kubernetes VolumeMount user groups and file permissions, and how to manage them…

Extract sub-array from an array in javascript

You can use the slice() method in JavaScript to get a sub-array from an array. Here’s a simple example: In this example, the slice() method takes two arguments: the start index and the end index. The start index is inclusive, and the end index is exclusive. So array.slice(3, 7) returns a new array starting from the 4th element (index 3)…

Configure Git Proxy With Socks5

To configure Git to use a SOCKS proxy, you use the http.proxy and https.proxy configuration options. Here is how you can do it: In this command, 127.0.0.1 is the local IP address and 1080 is the port number. Replace these with your SOCKS proxy’s IP address and port number. Again, replace 127.0.0.1 and 1080 with your SOCKS proxy’s IP address…

Setup ngx-translate in angular

In angular typescript, we can use ngx-translate for i18n, and ngx-translate-extract for extracting keys to generate multiple language file. i will describe how to setup i18n in angular with ngx-translte, and how to extract messages with ngx-translate-extract. To setup ngx-translate, run the following command: in app.module, add module import for whole app usage, in app constructor function, setup default language…

Configure Monaco Editor Language and Theme in Angular Typescript

In angular typescript environment, the vscode editor is integrated by ngx-monaco-editor, for how to install ngx-monaco-editor on angular typescript environment, refer to previous article intergrate-vscode-editor-in-angular When ngx-nonaco-editor is ready, update your html file, add onInit() callback when initlalizing it, In onInit() function, save the instance, Add on language change or theme change event call function

Install and Setup Docker On CentOS Stream 8

Install and Setup Docker On CentOS Stream 8, the docker repo should be installed first, and then install it by yum, the default centos does not distribute docker packages. Set up the repository Install the yum-utils package (which provides the yum-config-manager utility) and set up the repository. Install Docker Engine Install Specific version To install a specific version, start by listing the available versions…