1. October 2020

How to display Debug Console with output from the application in Xcode

When you hit Build and Run button in Xcode the application will start.

If everything is ok you should see messages from the application displayed in the lower right part of Xcode window. The Console output contains text printed by the application.

Sometimes it might happen that there is no Console output window. How to fix it?

Here is small tip for Xcode developers.

To show/hide the Console click the icon Show/Hide the console in the lower right corner. It’s the last icon on the lower right side of the panel.

Facebook Comments

21. September 2020

How to install upgrade of Xcode 12 when there are just few GBs free on the mac

Xcode was always a big bundle. Each release was slightly bigger and an user has to remove some software to install the upgrade.

The release of Xcode 12 is way bigger and it requires more than 40 GB of free disk space to install the upgrade.

The question is: How to install Xcode 12 when there is nothing else to delete?

Simply: Go to Launchpad and throw Xcode to Recycle Bin to uninstall the current version of Xcode.

This step will release the space consumed by Xcode 11. The delete process will take several minutes and you can check your disk for free space.

df -h

Once you have sufficient disk space then open App Store, search for Xcode and perform new installation.

Facebook Comments

2. September 2020

Kubeapps missing permission when installing by Helm

Kubeapps allows you to create service catalog in Kubernetes cluster.

You can deploy Kubeapps to the cluster using Helm. Helm is pretty cool and the app should work out of box.

What if you encounter following errors:

Web interface is not accessible:

Sorry! Something went wrong.
Unable to load Kubeapps configuration: Network Error

Tiller proxy is crashing immediatelly after installation:

kubeapps-internal-tiller-proxy-... 0/1     CrashLoopBackOff

Web interface displays error after login:

Sorry! Something went wrong.
You don't have sufficient permissions to use the namespace kubeapps

App Repositories also displays error:

App Repositories
You don't have sufficient permissions to fetch App Repositories in all namespaces
Ask your administrator for the following RBAC roles:

list apprepositories (kubeapps.com) in all namespaces.
See the documentation for more info on access control in Kubeapps.

The reason for the error might be simple. You’re using Helm 3 to install the application and in that case you must specify following parameter when starting installation:

--set useHelm3=true

How to fix the situation? Uninstall Kubeapps and install it again with the parameter:

helm uninstall kubeapps
helm install kubeapps --namespace kubeapps bitnami/kubeapps --set useHelm3=true

If the problem still persists, check the definition of clusterrolebinding. It might happen that it’s defined for namespace ‘default’. Change it to ‘kubeapps’:

kubectl edit clusterrolebinding kubeapps-operator

Change namespaces from default to kubeapps, save it. Reload the web interface. The catalog should start working.

Facebook Comments

26. August 2020

How to run multiple Bash commands in parallel

If you’d like to run multiple commands in shell which is executed one by one, you can simply type:

command1; command2; command3.... commandn

What if you need to run all these jobs in parallel. When you have just single command you can add & and the command will be executed in the background. So the temptation for a solution might be:

command1 &; command2 &;... commandn &

Well, it does not work. The correct solution for oneliners is simple. Just replace ; by &

command1 & command2 & command3 & ... commandn

The same solutions works also for other shells like zsh.

Facebook Comments

21. August 2020

Common mistake why GDB debugger does not work in Visual Studio Code

Visual Studio Code has great C/C++ support and it’s possible to debug a project with it.

Visual Studio Code can use gdb as a debugger.

If you have your project with a binary and you press F5 to launch the debugger, then Visual Studio will prompt you to configure GDB launcher in launch.json.

Here is sample launch.json for binary my_application on Linux:

    "version": "0.2.0",
    "configurations": [
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/my_application",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true

Just define a path to your binary, save the file and press F5.

Still, it might happen that debugger does not stop at your break point. Why?

There is one very common mistake. People often forget to add -g for gcc parameter when building the project.

GCC without parameter -g will build a release version of the project without debug information. To fix the problem just add -g to your Makefile, clean, and rebuild the project.

Facebook Comments