Knowledge Basement

Linux, Java, Open Source related how-to articles. Expert tutorials on system administration, programming, security, and DevOps best practices.

159 Articles
11+ Topics

Latest Articles

Web Development

How to Host Your Site for Free on Netlify

How to Host Your Site for Free on Netlify Netlify is a powerful platform for hosting static websites and modern web applications. It offers a generous...

👁
Web Development

How to Host Your Site for Free on GitHub Pages

How to Host Your Site for Free on GitHub Pages GitHub Pages provides free hosting for static websites directly from a GitHub repository. Whether you'r...

👁
Web Development

How to Create a Site with Eleventy (11ty)

How to Create a Site with Eleventy (11ty) Eleventy (11ty) is a simple, fast, and flexible static site generator built with JavaScript. Unlike other st...

👁
Linux

How to Convert WordPress to Jekyll

How to Convert WordPress to Jekyll WordPress is a popular content management system (CMS) that powers millions of websites. It is a great platform for...

👁
Linux

How to configure a Linux File Server with NFS

In the realm of networked storage solutions, NFS (Network File System) stands out as a robust and efficient option for sharing files and directories a...

👁
Linux

Setting Up a Chat Server with ejabberd

In today's interconnected world, instant messaging and real-time communication have become integral parts of both personal and professional interactio...

👁
Linux

Using the Vi text editor effectively

Introduction Welcome to our beginner's guide on how to use the Vi text editor effectively. If you're new to the world of programming or system adminis...

👁
Linux

Understanding and Using the Linux Kernel

Introduction Welcome to the world of Linux, a powerful, open-source operating system that powers a significant portion of the internet, corporate serv...

👁
Linux

How to Set Up a DNS Server with BIND

Introduction In the world of networking, the Domain Name System (DNS) plays a pivotal role in ensuring seamless communication between computers. It tr...

👁
Linux

Setting up a mail server with Postfix

A Beginner's Guide to Setting Up a Mail Server with Postfix Introduction In the digital age, email communication has become a vital part of our daily ...

👁
Linux

Setting up a secure SSH server

A Beginner's Guide to Setting Up a Secure SSH Server Introduction Secure Shell (SSH) is a cryptographic network protocol that allows secure remote log...

👁
Linux

Understanding and using Linux file permissions

A Beginner's Guide to Understanding and Using Linux File Permissions Introduction Linux, a powerful and versatile operating system, is known for its h...

👁
Linux

Using the Linux terminal for beginners

A Beginner's Guide to Using the Linux Terminal Introduction The Linux terminal, also known as the command line, is a powerful tool that can seem daunt...

👁
Linux

Configuring a firewall using iptables

A Beginner's Guide to Configuring a Firewall Using iptables Introduction In the world of network security, a firewall is a crucial component that help...

👁
Linux

Installing and configuring a LAMP stack

A Beginner's Guide to Installing and Configuring a LAMP Stack Introduction In the world of web development, the term "LAMP" is an acronym that stands ...

👁

How to Use Beans in Spring Boot

In Spring Boot, beans are managed objects that are instantiated, assembled, and otherwise managed by the Spring IoC (Inversion of Control) container. ...

👁
Java

How Do Quartz Jobs Work in Java

Quartz is a popular Java library for scheduling and managing jobs or tasks in applications. It allows you to schedule jobs to run at specific times o...

👁

How to Choose the Best Linux Distribution

Choosing the best Linux distribution depends on your specific needs and preferences. In the following view I explain how 20+ years of experience wi...

👁
Java

What is a Provider in Java

In Java, a Provider is a class or interface that provides a way to obtain or create instances of a specific type or service. It is a concept that is ...

👁
Java

What is a Supplier in Java

In Java, a supplier is a functional interface from the Java.util.function package that represents a supplier of results. It does not take any argumen...

👁
Linux

What are Docker Image Registries

Docker image registries are central repositories that store and distribute Docker container images. Docker container images are the building blocks o...

👁
Linux

What is Docker Swarm

Docker Swarm is a native container orchestration solution provided by Docker for managing and scaling containerized applications across a swarm of Do...

👁
Linux

What is Docker Compose

Docker Compose is a tool that allows you to define, configure, and run multi-container Docker applications using a YAML file. It provides an easy way...

👁
Linux

What are Docker Volumes

Docker volumes are a way to persist and manage data in Docker containers. A Docker volume is a directory or a named volume that is stored outside of ...

👁
Linux

What are Docker Networks

Docker networks are virtual networks that provide communication channels for Docker containers to communicate with each other and with the host syste...

👁
Linux

What is a Port Mapping (Forwarding) in Docker

In Docker, port mapping (also known as port forwarding) is the process of associating a port on the host system with a port on a Docker container, al...

👁
Linux

What is a Filesystem Mapping in Docker

In Docker, a file system mapping refers to the process of associating a directory or a file from the host system with a directory or a file inside a ...

👁
Java

How to Properly Use Reflection in Java

Reflection in Java is a mechanism that allows you to inspect and modify the behavior of classes, methods, interfaces, and fields at runtime, even if ...

👁
Java

How to Backup and Restore H2 Database

H2Database (or simply H2) is an open-source, lightweight, and fast relational database management system written in Java. It is a pure Java database ...

👁
Java

Overusing the Static Keyword in Java

The static keyword is often overused in Java and this can lead to several risks, including: Tight Coupling: When you declare a member (variable or...

👁
Linux

How to Write a Simple Linux Bash Honeypot

The first step in a malicious hacker attack is scanning. This means that an attacker will scan its target for open ports and vulnerabilities. So, the...

👁
Java

How to Use Properly Lambdas in Java

Lambdas are a concise way to define and use functional interfaces in Java. Here are some guidelines on how to use lambdas effectively in Java: Kno...

👁
Java

What is a Predicate in Java and How to Use It

In Java, a predicate is a functional interface from the java.util.function package that represents a function that takes in one argument and returns ...

👁
Java

How to Add Dependencies in a Maven Project

In Maven, you can manage dependencies using a pom.xml file. Here's how you can add dependencies to your pom.xml file: Open your pom.xml file in a ...

👁
Java

What is Polymorphism in Java

Polymorphism in Java is a concept that allows objects of different classes to be treated as if they were of the same type. It allows you to write cod...

👁
Java

How to Prevent Resources From Leaking in Java

In Java, a resource leak occurs when a program fails to properly release system resources after they are no longer needed. This can lead to a range o...

👁
Java

Reasons to Make Methods Final in Java

Making methods final in Java can provide several benefits, including: Preventing method overriding: When a method is marked final, it cannot be ov...

👁
Java

How to Improve Resilience With Hystrix

Hystrix is a library created by Netflix that provides fault tolerance and latency tolerance for distributed systems. It is particularly useful in mic...

👁
Java

Common Mistakes When Using Optional in Java

Optional in Java is a container object that is used to represent the presence or absence of a value. It is a powerful tool that can help to avoid nul...

👁
Java

How to Use Efficiently Generics in Java

In Java, generics provide a way to specify a type parameter for a class, method, or interface. A type parameter is a placeholder for a type that is s...

👁
Java

Why should You Use Method References in Java

In Java, a method reference is a shorthand notation for referring to a method as a lambda expression. Method references provide a way to pass a refer...

👁
Java

How to Create Custom Annotations in Java

In Java, annotations are a form of metadata that provide additional information about program elements such as classes, methods, fields, and paramete...

👁
Linux

Why Python Replaced Perl

Both Perl and Python are powerful scripting languages that are used extensively in software development, system administration, and data analysis. He...

👁
Linux

How to Write Bash Script with User Input

Here's a Linux bash script that performs the following tasks: Prompts the user to enter a directory path. Checks if the directory exists and if ...

👁
Java

What are the Benefits of Lambdas in Java

Lambda expressions were introduced in Java 8, and they provide several benefits over traditional anonymous inner classes. Some of the benefits of lam...

👁
Java

Pass by Value Meaning in Java

In Java, when you pass a parameter to a method, a copy of the value of that parameter is passed to the method, rather than the original object itself...

👁
Java

What are Varargs in Java and How to Use Them

In Java, varargs (variable-length arguments) are a feature that allows a method to accept an arbitrary number of arguments of the same type. The vara...

👁
Linux

When and How to Use Iptables and Ipsets

iptables and ipsets are both tools that are commonly used in Linux-based operating systems for managing network traffic. However, they serve differen...

👁
Java

Java Performance on Linux vs Windows

Java is a cross-platform language, which means that Java applications can run on a variety of operating systems, including Linux and Windows. The per...

👁
Java

Php Vs Java In Regards to Performance

The performance of PHP and Java can depend on a variety of factors, including the specific implementation, the hardware and software environment, and...

👁
Java

How to Develop Securely In Java

There are several good security practices to follow when developing Java applications. Here are some of the most important ones: Keep your Java ru...

👁
Java

How to Rewrite JSP Pages In Java

SP (JavaServer Pages) pages are essentially HTML files with embedded Java code. To rewrite JSP pages in Java, you will need to extract the Java code ...

👁
Java

Quick Win Hints for Refactoring Java code

There are several quick wins that can be achieved through refactoring Java code: Removing duplicate code: Duplicate code can make the codebase har...

👁

What are Maven Profiles and How to Use Them

Maven profiles are a way to define a set of configuration options for a Maven build. Profiles are used to specify different build configurations for ...

👁
Java

How to Implement a Retry Logic in Java

Retry logic can be implemented in Java using various libraries and frameworks, but the general idea is to have a block of code that can potentially f...

👁
databases

How to Back Up A MySQL Database With Java

In case you have wondered how to back up a MySQL database using Java code, here is one way to do it: import java.io.File; import java.io.IOExceptio...

👁
Java

How to Write Console Programs In Java

Console programs in Java can be easily written using System.out.println for output and Scanner for input. For example, here is a simple guessing ga...

👁
Java

How to Write Clean, Unobfuscated Code in Java

Writing clean, easy-to-read code in Java is important for improving code readability, maintainability, and overall quality. Here are some tips for wr...

👁
Java

How to Write Obfuscated Java Code

To some people obfuscating programming code, including Java, means: Job security. If no one can understand their code, they are irreplaceable. ...

👁
Java

Worst Practices to Avoid in Java Programming

One of our latests posts was how to become a better programmer with the help of OpenGPT. Still, even without the help of AI, there are things you can...

👁
Java

How to Use OpenGPT to Write JUnit Tests

Test driven development is the standard nowadays but sometimes somehow there appears a class before the test is written. This is especially true for ...

👁
Java

How to Skip A Finally Statement in Java

A common interview question for Java developers is to write some code inside a try / catch / finally statement so that the finally statement is not r...

👁
Java

Period, Duration and Instant in Java

Period, Duration and Instant are three different classes introduced since Java 8 to help us deal better with time. Period measures the time with ...

👁
Java

Why and How to Use Optional in Java

The Optional object type in Java was introduced with version 8 of Java. It is used when we want to express that a value might not be known (yet) or i...

👁
Linux

Introduction to Tengine Web Server

Tengine seems to be a popular web server for Chinese websites. I've come upon it while browsing through Aliexpress and stumbling upon a 404 error: ...

👁
Java

Avoid the Telescoping Anti-pattern in Java

The Telescoping anti-pattern is widely-spread, just like a virus. It starts with good intentions. For example, a class that has two properties like t...

👁
Java

How to Use a Functional Interface in Java

A functional interface is an interface that contains a single abstract method. It is used as the basis for lambda expressions in functional programm...

👁
Java

Reducing Streams in Java

Java 8 introduced streams, among other things, and one of my favourite features is the reduce() method. It combines a stream into a single method. ...

👁
Java

Delete Files with Java 8

A friend asked me to help him with the following in Bash - delete all files but a whitelisted and use mix / max depth for directory traversal. It's p...

👁
Java

How to Create a Simple Mockito Unit Test

Mockito is a popular Java framework which comes to great help in Unit testing. In Unit testing it's important to get to a state where you can conc...

👁
Java

Build A Java Project With Maven

Using Maven to maintain and build your Java projects has a lot of advantages including automatically resolving dependencies, running tests and packag...

👁
Linux

Getting Started with Chef and Chef-solo

Chef (the systems integration framework) provides a standalone tool called chef-solo. With chef-solo you can run locally chef recipes without the need...

👁
Linux

AppArmor Php-Fpm Configuration with ChangeHat

AppArmor is the default Mandatory Access Control module on Ubuntu, SuSE and other Linux distributions. Thanks to it, you can limit the filesystem acce...

👁
Java

Terminate Java Thread

The best way to terminate a Java thread is with a switch such as a boolean property, .e.g abort. As soon as a condition is met, usually a timeout, you...

👁
Java

Working with Time and Date in Java

Working with time and date in Java is essential to any project. There are three important classes you can use: java.time.LocalTime - working only wit...

👁
Java

How to Parse Time in Java

To parse time in Java, the most trouble-free and programatic way is using the parse method of the LocalTime class like this: import java.time.LocalTim...

👁
Middleware

How to Install and Configure SuPHP

Notice: This article was written when  SuPHP was the most popular choice for running multiple PHP sites on the same Apache server. Now, php-fpm with d...

👁
Middleware

How To Configure SSL In Tomcat

To secure the communication and increase the level of privacy to and from your Tomcat servlet container you should use SSL. Usually there's an Apache ...

👁

How To Create SSH Tunnel With Putty

SSH tunneling is very useful when the network access to a remote network is restricted. Thus, to gain remote network access you can use a tunnel to a ...

👁
Linux

How to Install Azure Python Package

You can install Azure Python package either for Python 2 or Python 3 using pip (Python package index). Before you are able to install it though you ha...

👁
Linux

How to Create Sudo User on CentOS

Working with root (admin privileged user) in CentOS is not a good idea because you can easily make a costly mistake. Instead, it's much better to gran...

👁
Linux

How to Create Sudo User On Ubuntu

Working with root (admin privileged user) in Ubuntu is not a good idea because you can easily make a costly mistake. Instead, it's much better to gran...

👁