xcrun: error: invalid active developer path on macOS

Issue

After a major macOS upgrade (currently to Ventura) the command line tools, including git, in the terminal windows (Terminal, iTerm) stop working. We get the error message

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Cause

The macOS terminals use the Xcode Command Line Tools to execute commands on the Mac. When you upgrade the Macintosh operating system, you need to accept the licensing agreement of the Xcode Command Line Tools.

Solution

The simplest way to do it, to re-install the Xcode Command Line Tools and click the Accept button.

  • Open a terminal window and execute
    xcode-select --install
  • The installation starts, and when prompted, Accept the license terms and complete the installation.

Troubleshooting

  • If after the re-installation you still get the same error message, try to execute
    sudo xcode-select --reset

There is a double quote at the end of the value read from the .env file

Developers frequently use the .env file to store configuration values on the workstation. If the values contain sensitive data add the line to the .gitignore file to avoid committing the file into source control.

.env

If the value contains spaces, enclose it in double quotes

DEBUG_COLUMN_NAME="x Debug"

Symptom

Your application reads a double quote at the end of the value:
gDebugColumnName: x Debug”

Issue

There is an extra space character at the end of the line after the closing double quote in the .env file

Solution

Delete all trailing spaces from the lines in the .env file.

KSP2 Modding with SpaceWarp

Install SpaceWarp

To install SpaceWarp you need the following tools installed on your computer

Get SpaceWarp from GitHub

  • Create a new directory external_dlls for SpaceWarp in the Kerbal Space Program 2 “C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\KSP2_x64_Data\Managed” directory
    cd "C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\KSP2_x64_Data\Managed
    md external_dlls
  • Clone the SpaceWarp repository in to the external_dlls directory
    cd external_dlls
    git clone https://github.com/X606/SpaceWarp.git

Install the Python dependencies

Build SpaceWarp

  • Open the ksp2_mod_loader_patcher.sln Visual Studio solution from “C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\KSP2_x64_Data\Managed\external_dlls\SpaceWarp\SpaceWarp”
  • Open the list of references to see the missing packages

  • The packages marked with an exclamation point are missing

  • Open the NuGet package manager

Add references to the missing assemblies

  • Right-click References and select Add Reference…
  • On the Browse tab click the Browse button
  • Browse to the C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\KSP2_x64_Data\Managed folder and select the DLLs
    • Assembly-CSharp.dll
    • Newtonsoft.Json.UnityConverters.dll
    • Unity.TextMeshPro.dll
    • UnityEngine.dll
    • UnityEngine.AssetBundleModule.dll
    • UnityEngine.CoreModule.dll
    • UnityEngine.IMGUIModule.dll
    • UnityEngine.InputLegacyModule.dll
    • UnityEngine.UI.dll

Rebuild the solution

  • Right-click the solution and select Rebuild Solution

Using SpaceWarp

You can also download SpaceWarp from https://spacedock.info/mod/3257/Space%20Warp

  • Unzip the downloaded file
  • Copy the contents (the SpaceWarp directory) into the KSP2 main directory

Maybe needed to configure Visual Studio to work with Unity

See https://learn.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/getting-started-with-visual-studio-tools-for-unity?pivots=windows for details

To select the installed Visual Studio version

  • Open the Unity Editor
  • In the Edit menu select Preferences
  • On the External Tools tab click the Open by file extension and select your Visual Studio version

Error: Route.post() requires a callback function but got a [object Undefined]

If you use the NodeJS Express server, you have just created a new route with the code like this

router.post('/my_new_action', authenticationMiddleware, myController.myNewFunction);

and created a new function to handle the request, like

async function myNewFunction(req, res) {
...
}

and get the error message:

…/node_modules/express/lib/router/route.js:211
throw new Error(msg);
^

Error: Route.post() requires a callback function but got a [object Undefined]

make sure you export the new function in the controller.

module.exports = {
  myFirstFunction,
  myNewFunction
};

Rover Construction in Kerbal Space Program

To construct a rover we need a base to attach the wheels, seats, and the power source.

Structural plates

We can start with structural plates, but we need to apply some tricks to attach them to each other.

  • Place one plate in the horizontal position
  • If you cannot attach the second plate directly to the edge
    • Attach the second plate first in a 90° angle
    • Turn on Snap
    • First, rotate
    • then move it into position

Stability assistance

Even if the rover performs fine on Kerbin, the low gravity on the Mun will cause the rover to roll in a quick direction change, a steep curve or during braking.

  • Move the wheels as high as possible on the body, so the center of mass is as low as possible.
  • Add Small Inline Reaction Wheels close to the center of mass, and set the Reaction Wheels to SAS only. In the default Normal setting as you control the rover the reaction wheels would flip it in the same direction.

Installing ngrok

“ngrok is a simplified API-first ingress-as-a-service that adds connectivity,
security, and observability to your apps with no code changes”

Create a free ngrok account

Install ngrok

On macOS

  • Create the ngrok folder in your user’s opt directory
    mkdir ~/opt/ngrok
  • Step into the new directory
    cd ~/opt/ngrok
  • Move the downloaded installer into the new directory. Replace THEVERSION with the version of the downloaded file
    mv ~/Downloads/ngrok-vTHEVERSION-stable-darwin-amd64.zip .
  • Unzip the ZIP file
    unzip ngrok-vTHEVERSION-stable-darwin-amd64.zip
  • To be able to start ngrok from any directory, add the binary to the PATH. Add this to your ~/.bashrc file where the rest of the PATH statements are
    PATH=~/opt/ngrok:$PATH
  • IMPORTANT: Restart all your terminals for the PATH change to take effect

Verify the installation

When the terminals have been restarted for the PATH change to take effect

  • Test the installation with
    ngrok --version

Connect to your ngrok account

  • Execute this in the terminal to connect to your ngrok account. Get your authentication token from your setup page at 2. Connect your account
    ngrok config add-authtoken YOUR-AUTHENTICATION-TOKEN

Enable Surround, PhysX for multiple displays on ASUS ROG Strix laptop

If you have multiple monitors, you can connect them to your laptop and set up an immersive gaming environment.

Connect the monitors

  • Connect one of the monitors with an HDMI cable to the large HDMI port of the laptop
  • Connect the other monitor with a USB-C to DisplayPort cable to the USB 3.2 Gen 2 Type-C/Displayport/Power Delivery combo port next to the HDMI port (connectors 3 and 4 on the picture below) at the rear of the computer.

Configure the monitors

  • Start the NVIDIA Control Panel application
  • On the Configure Surround PhysX page select Span displays with Surround, and click the Configure button
  • To view the keyboard shortcuts click the Keyboard Shortcuts button
  • Enable the first two shortcuts and click OK
  • Set the bezel correction to set up the displays for a continuous image
    • Click the bezel correction button and adjust the offset of the two displays
  • To enable the Surround configuration click the Enable Surround button
  • OPTIONAL: If you want seamless experience, but don’t mind to cover a stripe in the middle of the screen, on the Change resolution page set the resolution to the bezel corrected value. This may not work for certain games where the center line contains important information.

Enable all displays

When you set up Surround, PhysX, the laptop built-in display gets disabled. To be able to use all displays

  • Open Windows Settings
  • On the Display page click the down arrow next to Show only on 2
  • Select Extend these displays
  • Using Alt-Tab quickly find the confirmation popup and click Keep changes
  • Select the large, combined display and make it the default display, so games start to run on it

Working with the surround display

In some programs the middle of the screen contains important information, and it can be distracting to be divided by the bezel. There are some tricks we can apply to circumvent it

Kerbal Space Program

Hold the the middle mouse button and pan the screen to move the important object out of the center of the view.

ASUS ROG Strix laptop configuration

Optimizations for windowed games in Windows 11

To enable Optimizations for windowed games in Windows 11

  1. Select the Start  button, then select Settings .
  2. In Settings , select System  > Display  > Graphics Change default graphics settings.
  3. Select the setting under Optimizations for windowed games to turn it On.
  4. Restart your game.