1. How to perfectly set up your Mac with Apple Silicon for software development

In this tutorial we prepare the device especially for Java development.

1. Install the missing package manager brew on you device by following the installation description on
    https://brew.sh/index_de

Follow the instruction in the terminal to complete this setup

2. Install sdkman to easily manage your java sdks.
   curl -s "https://get.sdkman.io" | bash

After we installed sdkman install the java sdk with this command

   sdk install java
3. Now we install maven
   brew install maven
4. Now we install git
   brew install git
5. For a better window management in macOS I recommend to install rectangle
   brew install rectangle
6. For a secure password management I recommend keepassxc
   brew install --cask keepassxc
7. To use docker on your device we use brew again
   brew install docker
To keep your tools up to date you just execute
   brew upgrade
For the IDE we recommend the IntelIJ Ultimate

Install it through the Toolbox App to keep it simple up to date


2. These are the must-haves apps for your Mac

1. Homebrew

Since years apple just provides the App Store to install further apps on your device. Especially for developers there a special needs in further tools and how they keep this tools up-to-date. For this we highly recommend, and you will need it in the following steps, HomeBrew

To install HomeBrew follow the instruction on brew.sh or use the script below

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

To keep all tools you installed with brew and brew itself up-to-date just ran

Update brew to the latest version

brew update

Update all tools to the latest version

brew upgrade

2. iTerm2

MacOS already provides a terminal, but for advanced developers we recommend iTerm2. iTerm2 has more feature and is highly customizable. How to customize iTerm2 you will finde in a different tutorial.

To install iTerm2 to just execute the following script

brew install --cask iterm2

3. Bartender

Every macOS user knows the problem: Dozens of icons in your taskbar. To clean up your taskbar and hidde icons you didn’t use all the time. Unfortunately Bartender isn’t for free but highly recommended for your.

4. Alfred

Using Spotlight to find things faster is already an efficient way to use your Mac. To boost your productivity with more hotkeys, keywords, text expansion and more we use Alfred. Alfred replaces the old spotlight search with a way more efficient and customizable bar. Search, browse or automate. To increase the productivity with Alfred without any limit you need to buy the Powerpack.

5. Atom

With Atom you bring a tool similar to notepad++ to you system. To install Atom just use brew

brew install atom

6. CheatSheet

MacOS provide many hotkeys for different tools to work faster and more efficient. The problem is, how to learn all the shortcuts in an easy way?

For this we recommend CheatSheet, a small and easy to use app to see all available hotkeys in one sheet by just pressing one button.

7. Micro Snitch

Control you Mac and let not the Mac control your. With Micro Snitch you can easily control your Mac, when does it use the micro, to camera or even just an internet connection. With Mirco Snitch you control your Mac and you can prevent it to control you.

8. Rectangle

Unfortunately macOS hasn’t a god window management. To bring this to your Mac, just install rectangle to solve this issue fast and for free. You can install rectangle easily with brew

 brew install rectangle

9. KeyPassXC

We know macOS already has a build in password manager, but with KeyPassXC it’s easy to share key databases with different users and separate keys in different databases. KeePassXC is for free. Install it with brew by just running this command.

brew install --cask keepassxc

10. Jiggler - Keep your Mac Online

Sometimes there could be a use case you need to keep your Mac active. For this you can use the Jiggler. The Jiggler virtually shakes your cursor visually or hidden and simulated your presence. This could be for example helpful if you are running longer tests, or you just have a short break, and you want to prevent your remote session from disconnect on missing activity. Even the Jiggler could be installed with brew.

brew install --cask jiggler

11. DropOver

Dropover is a macOS utility that makes Drag and Drop easier. Use it to stash, gather or move any draggable content without having to open side-by-side windows. Dropover could be installed via App Store

12. Later

A simple Mac app to clear and restore your workspace with ease.

This app is available here.

13. CopyClip - Clipboard History

CopyClip is the simplest and most efficient clipboard manager for your Mac. Running discreetly from your menu bar, this app stores all that you have copied or cut in the past, allowing you to quickly find that snippet of text you’ve been looking for.

CopyClip could be installed via App Store


3. Customize iTerm 2 to your perfect and individual terminal

1. Install iTerm2

If you’re not using iTerm2 already you have to install it for these tutorial. Install it easily via brew. If you haven’t installed homebrew follow the tutorial 01 first.

brew cask install iterm2

2. Now we start to customize iTerm 2

To customize iTerm2 we use Oh My Zsh. Fist download the installation script via this command:

curl -fsSL --output omz_installer.sh https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh

After that execute the script with this command:

zsh omz_installer.sh

When the installation is completed restart iterm to experience the new world of Oh My Zsh.

To check the version of your shell run command:

zsh --version

To upgrade it run the command:

upgrade_oh_my_zsh

3. Use a custom theme

To customize the theme of iTerm2 we use the most popular theme Powerlevel10k. To install Powerlevel10k for Oh My Zsh use:

git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

To enable the theme open the ~/.zshrc file with:

vi ~/.zshrc

and the change ZSH_THEME to

ZSH_THEME="powerlevel10k/powerlevel10k"

To insert changes in vi press i to activate the insert mode. When you have done the changed press [esc] and then :wq to save and quit vi.

After that run the command

source ~/.zshrc

to update the zsh configuration. Regularly the Powerlevel10k configuration setup should start automatically. If not run the command p10k configure.

1. zsh-autosuggestions

This plugin autocompletes suggestions based on your own history. Install with:

git clone https://github.com/zsh-users/zsh-autosuggestions \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
2. zsh-syntax-highlighting

This plugin highlights the correctly taped commands green and the incorrect red, abd underlines folders and files.

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

To activate the plugins change the line plugins= in the ~/.zshrc to

plugins=( git zsh-syntax-highlighting zsh-autosuggestions)

4. These are the best plugins to increase your development speed with IntelIJ IDEA

1. JPA Buddy

JPA Buddy is the most advanced plugin for IntelliJ to manage your JPA data model. With this plugin you can easily create your JPA-Entities and data-related object. You just need a few clicks to migrate databases or creating entities from existing Tables. To get use of all the power of JPA Buddy we recommend to use to paid version.

2. AsciiDoc

With the AsciiDoc plugin you can edit AsciiDoc files in the IDE with syntax highlighting, auto-completion and a live preview. AsciiDoc is a text document format, similar to formats like Markdown, for writing notes, documentation, articles, books, ebooks, slideshows, web pages, man pages and blogs. AsciiDoc files can be translated to many formats including HTML, PDF, EPUB, man page. AsciiDoc is, in contrast to Markdown, highly configurable: both the AsciiDoc source file syntax and the backend output markups (which can be almost any type of SGML/XML markup) can be customized and extended by the user.

3. SonarLint

SonarLint is a free IDE extension to find and fix bugs, vulnerabilities and code smells as you write code! Like a spell checker, SonarLint highlights issues on the fly and provides quick fixes or clear remediation guidance to help you clean the code before it is even committed. With support for several popular and classic languages, SonarLint helps developers of all experience and skill levels write efficient, safe code.

SonarLint integrates with most JetBrains IDEs including IntelliJ IDEA, CLion, WebStorm, PHPStorm, PyCharm, Rider, Android Studio & RubyMine. Supported languages include C, C++, Java, JavaScript, TypeScript, Python, C#, Kotlin, Ruby, HTML & PHP.

4. CodeGlance

The CodeGlance IntelliJ plugin that displays a zoomed out overview or minimap similar to the one found in Sublime into the editor pane. The minimap allows for quick scrolling letting you jump straight to sections of code. Rework on CodeGlance,support more feature

Features

  • Hide original scrollbar.

  • Right click to quick config.

  • Support markup highlights.

  • Support error stripes highlights.

  • Support Vcs line highlights.

  • Support caret line highlights.

  • Support language ColorScheme.

  • Quick view code on Glance.

  • Automatically calculate width in splitter mode.

5. Jenkins Control

The Jenkins Plugin integrates Jenkins directly in your IDE. Start and monitor builds from your ide and get directly informed when a build fails or is successfully done.

Features

  • View Jobs

  • Trigger Jobs

  • Show Log for Job (including running)

  • Show Job Result as JUnit View

  • Multibranch support

6. Maven Helper

The Maven Helper must-have plugin for working with Maven. The easy way for analyzing and excluding conflicting dependencies Adds actions to run/debug maven goals for a module that contains the current file or on the root module. Supports action to open terminal at the current maven module path and actions to run/debug the current test file.

7. Rainbow brackets

Every developer knows the problem, counting brackets is annoying. With the Rainbow Brackets plugin this ends. It gives each set of opening and closing brackets their own colors, making it easier to track where a code block starts and ends. If you tried it ones, you’ll never want to miss it.

8. GitToolBox

InteliJ has already a very good git integration but with GitToolBox you will get a few feature.

Features

  • Git status:

    1. number of ahead / behind commits for current branch as status bar widget

    2. ahead / behind, current branch, tags on HEAD as Project View decoration on modules

    3. status bar widget with detailed information and additional actions

  • Git blame:

    1. inline blame - show blame for line at caret in active editor

    2. blame details balloon for line at caret

    3. status bar widget with detailed information and additional actions

  • Auto fetch - runs git fetch at fixed intervals

  • Push tags on current branch - available in VCS / Git

  • Behind tracker - shows notification when behind count of current branch changes and is non-zero

  • Branch name completion in Commit dialog - provides branch name completion inside Commit dialog message

  • Gitmoji completion in Commit dialog - provides gitmoji completion inside Commit dialog message

  • Recent branches switcher - switch between recently used branches

  • Outdated branches cleanup - find and remove merged and stale branches

  • Git Extender integration - can be selected as update action executed from behind tracker popup

9. Extra Icons

With the Extra Icons plugin you get more than 500 new icons for several file types.

10. RoboPOJOGenerator

With RoboPOJOGenerator you can easily create POJOs (Plain Old Java Objects) from JSON. This Plugin supports Java and Kotlin.

All the plugins are available through the IntelliJ Marketplace


5. Build your first custom maven plugin

Introduction

Hello and welcome to our YouTube tutorial! Today, we will show you how to create your first Maven plugin and deploy your Jar file to a server using SSH. I’m [HOSTNAME], and I’ll guide you through the process. Let’s get started!

Introduction to Maven Plugins

Before we dive into the tutorial, let’s have a quick overview of Maven plugins. Maven is a build management tool that helps developers create, test, and deploy projects. Plugins are extensions that add additional functionality to Maven. Today, we will learn how to create our own plugin to deploy a Jar file to a server using SSH.

Setup

Before we start with the actual plugin code, we need to set up a few prerequisites. Make sure you have Maven and an SSH client installed on your system. To check this, run the commands mvn -v and ssh in your terminal. If they are not installed, you can download and install Maven from the official Apache Maven website and choose an SSH client of your preference.

Create Project and Plugin

Let’s begin by creating our Maven plugin project. Open your preferred development environment or text editor and create a new directory for the project.

Navigate to the project directory and open your terminal or command line. Execute the following command to create a new Maven project:

mvn archetype:generate -DgroupId=com.example -DartifactId=my-maven-plugin -DarchetypeArtifactId=maven-archetype-plugin

This command generates a basic Maven plugin structure with the provided information. Adjust the values for groupId and artifactId according to your needs.

Once the command completes, you have created a new Maven plugin project. Navigate to the project directory to edit the code.

Open the file src/main/java/com/example/MyMojo.java in your text editor or development environment. This file contains the implementation of our plugin.

Here is the code for our plugin:

package com.example;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;

@Mojo(name = "deploy")
public class MyMojo extends AbstractMojo {

    @Parameter(property = "jarFile", required = true, defaultValue = "${project.build.directory}/${project.build.finalName}.jar")
    private String jarFile;

    @Parameter(property = "serverAddress", required = true)
    private String serverAddress;

    @Parameter(property = "serverUsername", required = true)
    private String serverUsername;

    @Parameter(property = "serverPassword", required = true)
    private String serverPassword;

    public void execute() throws MojoExecutionException {
        try {
            JSch jsch = new JSch();
            Session session = jsch.getSession(serverUsername, serverAddress, 22);
            session.setPassword(serverPassword);
            session.setConfig("StrictHostKeyChecking", "no");
            session.connect();

            Channel channel = session.openChannel("exec");
            String command = "scp " + jarFile + " " + serverUsername + "@" + serverAddress + ":/path/to/destination/";
            ((ChannelExec) channel).setCommand(command);
            channel.connect();
            channel.disconnect();

            session.disconnect();

            getLog().info("Jar file deployed to the server successfully.");
        } catch (Exception e) {
            throw new MojoExecutionException("Error deploying Jar file to the server: " + e.getMessage(), e);
        }
    }
}

Plugin Configuration

Now, let’s configure the plugin in the pom.xml file. Open the pom.xml file of your plugin project and add the following code:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>my-maven-plugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>maven-plugin</packaging>

    <properties>
        <jarFile>path/to/your/jar/file.jar</jarFile>
        <serverAddress>example.com</serverAddress>
        <serverUsername>username</serverUsername>
        <serverPassword>password</serverPassword>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>0.1.55</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.5.3</version>
                <configuration>
                    <goalPrefix>my-maven-plugin</goalPrefix>
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-generation</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Deploying the Jar File

Now we are ready to deploy our Jar file to the server using SSH. Open your terminal or command line and navigate to a Maven project that contains the Jar file you want to transfer.

Execute the following command:

mvn com.example:my-maven-plugin:deploy -DjarFile=path/to/your/jar/file.jar -DserverAddress=server_address -DserverUsername=server_username -DserverPassword=server_password

Replace path/to/your/jar/file.jar, server_address, server_username, and server_password with the actual values you want to use.

Once you run the command, Maven will execute the deploy goal of your plugin, which will establish an SSH connection, transfer the Jar file to the specified server address, and log a success message once the transfer is complete.

Congratulations! You have successfully created your Maven plugin and deployed your Jar file to a server using SSH.

Feel free to explore more functionalities and customizations for your Maven plugin.


6. Unleashing Your Full Potential: Why Every Developer at 4BrainSolutions Should Embrace JetBrains AI

Introduction

Imagine a world where your development tools do more than just respond - they actively assist and guide you. This isn’t a distant future scenario anymore, thanks to JetBrains AI and its groundbreaking AI Assistant. Let’s dive into why you, as a developer at 4BrainSolutions, should incorporate this tool into your daily workflow.

AI-Powered Development Features

JetBrains AI introduces a paradigm shift in coding efficiency and creativity. The AI Assistant, a key component of this platform, offers a suite of functionalities that can dramatically enhance your coding experience:

  • Code Explanation and Query Resolution: The AI Assistant can interpret complex code segments, offering explanations and resolving queries you might have. This feature acts as an on-demand mentor, guiding you through challenging coding scenarios.

  • Intelligent Code Suggestions: Imagine having a tool that not only understands your current coding project but also suggests optimizations and improvements. JetBrains AI does just that, offering context-aware code suggestions that can refine and elevate your work.

  • Automated Documentation Generation: Writing documentation is often seen as a tedious but necessary task. The AI Assistant eases this burden by automatically generating comprehensive and understandable documentation for your codebase.

Enhancing Developer Experience

With JetBrains AI, repetitive and mundane tasks are automated, allowing you to focus on creative and complex problem-solving. This approach not only boosts your productivity but also keeps you engaged and in the flow of development.

Security and Flexibility

In an era where data security is paramount, JetBrains AI offers a secure and flexible platform. The underlying AI models are carefully selected and managed to ensure your data’s safety, providing a trustworthy environment for your development work.

Specific Features for Development Tasks

Beyond code assistance, the AI Assistant enriches your development process with:

  • Refactoring Support: The AI Assistant offers intelligent refactoring suggestions, helping you improve and optimize your code structure with ease.

  • Commit Message Generation: Craft meaningful commit messages effortlessly. The AI Assistant analyzes your code changes and generates concise, descriptive commit messages, enhancing team communication and project tracking.

User-Friendly Access and Integration

JetBrains AI is not just powerful but also user-friendly. Accessible to all JetBrains' paid product customers, it seamlessly integrates into your existing workflow. As a developer at 4BrainSolutions, you’ll find it easy to adopt these advanced features, enriching your daily work experience.

Conclusion

As a developer at 4BrainSolutions, you have the unique opportunity to be at the forefront of technological innovation. Embracing JetBrains AI can extend your capabilities, boost your productivity, and lead to the development of better, more efficient software solutions. Seize this opportunity and revolutionize your workflow with the advanced tools offered by JetBrains AI.


7. Why a Developer Mode Should Always Be Present

Introduction

Developer Mode, commonly referred to as DevMode, is a specialized environment in software development designed to facilitate development and testing. This blog post explores why DevMode is an indispensable tool in the development lifecycle, particularly in handling sensitive data and enhancing software security.

Understanding DevMode

DevMode is essential for safely testing and developing applications without affecting the production environment. It provides a sandbox-like setting where developers can experiment, debug, and validate changes without the risk of disrupting end-users or compromising data integrity.

DevMode and Security

In DevMode, security is a primary focus. It’s crucial for testing security measures, identifying vulnerabilities, and ensuring that sensitive data is handled correctly. This mode allows for a thorough evaluation of security features under controlled conditions.

Efficient Development Process

DevMode accelerates the development process. It enables rapid prototyping, testing of new features, and immediate feedback, which is critical for agile development methodologies.

Key Aspects of DevMode

DevMode encompasses several practices and tools aimed at enhancing the development experience while ensuring data security and compliance.

Regular Software Updates and Patching

Keeping software components updated is vital in DevMode. It ensures that the latest security patches and features are in place, reducing the risk of vulnerabilities.

Strong Authentication Mechanisms

Implementing robust authentication methods like multifactor authentication and access controls is crucial. It ensures that sensitive parts of the application are only accessible to authorized personnel.

Data Encryption

Encryption is a cornerstone of data security in DevMode. It involves encrypting data both at rest and in transit, safeguarding it from unauthorized access and breaches.

Error Handling and Data Privacy

Proper error handling mechanisms are essential in DevMode to prevent information leakage and maintain data privacy across different platforms.

Developer Training

Educating developers about secure coding practices and emerging security threats is vital. It empowers them to write more secure code and stay vigilant against new attack vectors.

Implementing DevMode in Java Projects

For Java-based projects, DevMode includes strategies like conditional interface injection and environment variable-based configurations, which help in seamlessly transitioning between development and production setups.

Conditional Interface Injection

This technique allows for different implementations of an interface based on the current environment (development or production), promoting flexibility and ease of testing.

Environment Variable-Based Configurations

Using environment variables to manage configurations enables developers to switch between different settings for development, testing, and production environments without changing the codebase.

Secure Data Management in DevMode

Managing sensitive data securely in DevMode involves a combination of strategic planning, technical measures, and continuous monitoring.

Data Classification-Based Access Controls

Implementing access controls based on data classification rather than the data itself is a scalable and regulatory-compliant approach to data security.

Consistent Data Privacy Controls

Uniform data privacy controls across all platforms and consumption approaches are essential to prevent potential data leaks.

Visibility and Scalability

Maintaining visibility into data management practices is critical for regulatory compliance and adapting to organizational changes. Scaling data access controls with organizational needs ensures that all security and access demands are met efficiently.

Comprehensive Data Security Strategy

A robust data security strategy in DevMode includes encryption, identity access management, and other security measures to combat threats and ensure compliance.

Conclusion

DevMode is not merely a feature in the software development process; it’s a strategic necessity that plays a crucial role in ensuring data security, regulatory compliance, and the reliability of software applications. By integrating DevMode practices into the development process, developers can safeguard sensitive data, enhance customer trust, and build more secure and reliable software.


Impressum

200
4BrainSolutions GmbH
Große Gallusstraße 16 - 18
60312 Frankfurt am Main
Tel.: +49 69 3400 78 78 00
E-Mail: office@4brainsolutions.com