24. March 2017

How to start Wireshark on openSUSE

The simple way how to start Wireshark on Linux is to type:

wireshark

If you run this command as a normal user you won’t be able to capture packets. In order to dump packets, you need to execute it as root. This must be done in a specific way. If try just sudo you’ll end up with interesting errors like:

Attempt #1

$ sudo su
# wireshark
QXcbConnection: Could not connect to display 
Aborted (core dumped)

Attempt #2

$ sudo wireshark
QXcbConnection: Could not connect to display 
[1]    8836 abort      sudo wireshark

The proper way how to start Wireshark is by gtk-su:

xdg-su -c wireshark

13. March 2017

How to switch tabs in Konsole

Konsole has support for tabs like other terminal emulators. The question is how to switch between tabs using a keyboard.

Default keyboard shortcut is Shift + Left/Right Arrow.

If you’re used to other keyboard shortcuts like Ctrl + PgUp/PgDn which are common in Google Chrome then you can add new shortcuts easily.

Open menu Settings, select Configure Shortcuts…

Type word tab into Search field.

Find item Next tab. Click column Alternate. Click button with title None. Now you can define a keyboard shortcut. Press Ctrl + PgUp.

Find item Previous tab. Click column Alternate and button with title None. Press Ctrl + PgDown. Click OK to confirm your configuration.

Now you can enjoy new configuration. If you like this tip or you’d like some other hint about Linux let me know in the comments section bellow.

8. March 2017

How to enable line numbers in KWrite

The text editor KWrite has support for line numbers. This feature is disabled by default. You can enable it by few clicks.

From menu Settings select Configure Editor…

Navigate to Appearance. Select Borders tab, click Show line numbers and click OK.

Here you can see KWrite with enabled line numbers:

2. March 2017

How to increase font size in pgAdmin 4 on Windows

New version of pgAdmin 4 is based on QT5. When you install pgAdmin 4 on Windows computer with a high-density display you may see that letters are too small.

Solution is to send one parameter to QT engine. It will handle DPI in different way.

Open PowerShell and go to directory with pgAdmin. Then launch application with parameter:

cd "c:\Program Files\PostgreSQL\9.6\pgAdmin 4\bin"
.\pgAdmin4.exe -platform windows:dpiawareness=0

You can persist the configuration by creating qt.conf. Start PowerShell as Administrator. Go to directory with pgAdmin and create the file:

cd "c:\Program Files\PostgreSQL\9.6\pgAdmin 4\bin"
notepad qt.conf

Write there following content:

[Platforms]
WindowsArguments = dpiawareness=0

Save the file and start pgAdmin 4 and enjoy new font size.

1. March 2017

Microsoft Azure IoT Hub MQTT device to device communication is not supported

Microsoft Azure provides IoT Hub. It might sound great because it has support for MQTT. It is very important to mention that Azure IoT Hub has a different way how it operates than Mosquitto which means that architecture of your IoT solution must be different.

Let’s check differences.

Default port:

  • Mosquitto is 1883 which is not secure, it is possible to enable TLS
  • IoT Hub 8883 secured by TLS/SSL (only)

Publishing and subscription of messages:

That’s a huge difference. In the case of Mosquitto you can easily build network of devices which can communicate together and management logic could be injected by Node-RED. In the case of IoT Hub whole interaction is managed by the cloud.

If you still want to play with IoT Hub and MQTT, I recommend article written by Satish Pagare who explains how to use mosquitto_sub and mosquitto_pub to interact with IoT Hub.