Run DeepSeek LLM locally on your M series Mac with LM Studio and integrate iTerm2

With the integration of LM Studio and iTerm2, powered by the cutting-edge DeepSeek LLM, developers can now streamline their workflows.
This setup enhances coding efficiency while maintaining complete control over their data.

Running DeepSeek LLM locally offers several benefits:

  1. Customization: You have full control over the model and can fine-tune it to better suit your specific needs and preferences.
  2. Offline Access: You can use the model even without an internet connection, making it more reliable in various situations.
  3. Cost Efficiency: Avoiding cloud service fees can be more economical, especially for extensive or long-term use.

These advantages make running DeepSeek LLM locally a powerful option for developers and users who prioritize privacy.

The following steps show the integration of LM Studio with iTerm2.

LM Studio

Download your preferred LLM and load the Model:

  1. Jump to the Developer screen
  2. Open Settings and set the Server Port to: 11434
  3. Start the Engine

The screen shows now a running service:

Click on the copy-button and close the page

iTerm2

Open the Settings of iTerm2

  1. install the plugin
  2. Enable AI features
  3. enter any API Key (entry is necessary but is not checked locally)
  4. For the first test you can leave the AI Prompt
  5. Use llama3:latest Model
  6. paste the URL copied from LM Studio and add /v1/chat/completions

    The final URL is then
    http://localhost:11434/v1/chat/completions

close the Settings-Windows

Action

-Press command-y in your iTerm2 session
-type your question into the windows and press shift-enter to ask your LLM:

Now you can use your local running LLM, even when you switch off your network-adapter 🙂

SSH Security Made Easy: An Introduction to ssh-audit

ssh-audit is a powerful tool designed to help you assess the security of your SSH servers (and clients!). It provides detailed information about the server’s configuration, supported algorithms, and potential vulnerabilities. In this guide, I’ll walk you through the steps to install ssh-audit and run your first security tests. Secure SSH configuration made easy.

Installation on Linux

  1. Clone the Repository: Open your terminal and clone the ssh-audit repository from GitHub:
    git clone https://github.com/jtesta/ssh-audit.git
  2. Navigate to the Directory: Change to the ssh-audit directory:
    cd ssh-audit
  3. Install Dependencies: Ensure you have Python installed on your system. If not, install it using your package manager. For example, on Ubuntu:
    sudo apt-get install python3

Installation on macOS

To install ssh-audit , run:
brew install ssh-audit
(You have already Brew installed, right ?)

Please check the ssh-audit url for many other setup options (Docker,Windows,etc.)

Test the SSH-Server against vulnerabilities

execute ssh-audit <hostname>
Replace <hostname> with the IP address or domain name of the SSH server you want to audit.

Example of Ubuntu’s 24.04 LTS default SSHD setup:

(if you add the -l warn switch you just get the vulnerabilities presented)

Interpreting the Results: ssh-audit will provide a detailed report of the server’s configuration, including supported key exchange algorithms, encryption ciphers, and MAC algorithms. Look for any warnings or recommendations to improve your server’s security.

Remediation

After running ssh-audit and identifying potential vulnerabilities or weak configurations in your SSH server, it’s important to take steps to remediate these issues. Below are examples of how to apply them:

Example for Ubuntu 24.04.1 LTS:

(Note: This is just an example. The example eliminates vulnerabilities for the SSH-daemon, but it can well be that this snippet does not fit for your setup. Handle with care)

This snippet creates a configuration file (51-ssh-harden_202412.conf) in directory /etc/ssh/sshd_config.d/ with the specified settings to enhance the security of your SSH server.

(SSHD restart required)



Example for RHEL 9.4

(Note: This is just an example. This example eliminates vulnerabilities for the SSH-daemon, but it can well be that this snippet does not fit for your setup. Handle with care)

(SSHD restart required)

Proof the remediation

run ssh-audit again!

Example-output after remediation:

How can I test if my SSH-Client is not vulnerable ?

If you run ssh-audit with the switch -c it creates an ssh-service on port 2222 and audits every connection attempt:

output after the login-attempt (ssh 127.0.0.1 -p 2222)


Make your SSH-communication more secure, if not the SSH-Service opens an attack surface for uninvited visitors.
Secure SSH configuration is Key!

Consider other additional security-steps like:
Secure your SSH communication with certificates
Lab setup: Secure your SSH communication with certificates
Fail2Ban: ban hosts that cause multiple authentication errors

..
.


MacOS: Streamline Your App Management with MAS

Managing apps on your Mac can sometimes feel like a chore, especially when you have to manually update, install, or remove them.

Enter MAS (Mac App Store command line interface), a powerful tool that simplifies these tasks and more.
In this blog post I explore how MAS can make your life easier and why you should consider adding it to your toolkit.

What is MAS?

MAS is a command-line interface for the Mac App Store, allowing you to manage your apps directly from the terminal. With MAS, you can search for, install, update, and remove apps without ever opening the App Store. This can be particularly useful for developers, system administrators, or anyone who prefers using the terminal for their workflows.

Installing MAS

Before you can start using MAS, you’ll need to install it. The easiest way to do this is through Homebrew, a popular package manager for macOS. If you don’t have Homebrew installed yet, you can install it by running the following command in your terminal:

Once Homebrew is installed, you can install MAS with the following command:

Benefits of Using MAS

  1. Efficiency: MAS manage your apps quickly and efficiently from the terminal. No more clicking through the App Store interface—just type a few commands, and you’re done.
  2. Automation: With MAS, you can script your app management tasks. This is particularly useful for setting up new machines or maintaining multiple systems.
  3. Consistency: Using MAS ensures that your app management process is consistent across all your devices. You can easily replicate the same setup on different machines.
  4. Control: MAS gives you more control over your app management. You can see detailed information about your installed apps and manage them in a way that suits your needs.

Disadvantages of the Old App Store App

App Store App

While the App Store app on macOS has its merits, it also comes with several disadvantages:

  1. Cumbersome Interface: The graphical interface can be slow and cumbersome, especially when managing multiple apps. Navigating through various menus and options can be time-consuming.
  2. Lack of Automation: The App Store app does not support automation, making it difficult to script repetitive tasks. This can be a significant drawback for users who need to manage multiple devices or frequently install and update apps.
  3. Limited Control: The App Store app provides limited control over app management. Users cannot easily access detailed information about installed apps or manage them in bulk.
  4. Inconsistent Performance: The performance of the App Store app can be inconsistent, with occasional slowdowns and crashes. This can be frustrating, especially when trying to quickly install or update apps.

Getting Started with MAS

Here are a few basic commands to get you started with MAS:

  • Search for an appmas search <app-name>
  • Install an appmas install <app-id>
  • List installed appsmas list
  • Update all appsmas upgrade
  • Remove an appmas uninstall <app-id>

Example to upgrade your current installed apps:

For a full list of commands and options, you can check the MAS documentation.

MAS is a powerful tool that can save you time and effort when managing your Mac apps. Whether you’re a developer, a system administrator, or just someone who loves the terminal, MAS is worth checking out. Give it a try and see how it can streamline your app management process.

iPad Samba file transfer fails

To be able to copy files over from iPad to Samba-shares the enhanced compatibility with Apple SMB clients and interoperability with Netatalk 3 AFP fileserver must be enabled.

Vfs-module is typically missing if you see in tshark messages like:

To get this fixed add to the [global] section in /etc/samba/smb.conf the following command:

The package samba-vfs-modules must be installed prior restarting the smb service.
Check if the package is installed with commands like:

If the package is missing add it with:

Restart Samba:

Done!