nocin.eu

Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[Terminal] Simple man page

If you are using the man command, e.g.:

man find

You will often get a very long manual.
But there is a much easier to read man page called tldr, with examples how to use the command.

apt install tldr
tldr find

[Terminal] Terminal cat grep

Most users are using cat and grep for searching for a string in a file:

cat filename | grep search_string

But you can use grep completely without cat:

grep search_string filename

[Terminal] !!

You can repeat the last used command by typing “!!”. For example if you typed:

apt upgrade

as non root user, you will get the following message:

error: you cannot perform this operation unless you are root.

But you don’t have to type the whole command again with sudo in front of it, just type:

sudo !!

And it’s doing a:

sudo apt upgrade

[ABAP] Clean Code

ABAP Clean Code


DRY – Don’t repeat yourself

KISS – Keep it simple, stupid

YAGNI – You ain’t gonna need it

PEBKAC – Problem Exist Between Keyboard And Chair

SoC – Separation of concerns


Issues generally come in three forms:

  1. syntax errors that prevent a program from running
  2. runtime errors when code fails to execute or has unexpected behavior
  3. semantic (or logical) errors when code doesn’t do what it’s meant to

[Linux Mint] Citrix Receiver on multiple monitors

Citrix Receiver download.
Here is the offical how to guide.

The following command can be used to test for window manager support.
If there is no output, there is no support.

xprop -root | grep _NET_WM_FULLSCREEN_MONITORS

Further troubleshooting infos here.

In my case, I just had to launch the configuration manager and set it to “Full Screen”.

/opt/Citrix/ICAClient/util/configmgr

If needed, the resolutions settings can be found here:

/opt/Citrix/ICAClient/config/All_Regions.ini

DesiredHRES=1024
DesiredVRES=768

[ABAP] Read infotype records

* Read multiple infotype records
DATA: ls_p0001 TYPE p0001,
      lt_p0001 TYPE TABLE OF p0001.

* Initialise Infotyp reader 
cl_hrpa_read_infotype=>get_instance( IMPORTING infotype_reader = DATA(lr_infotype_reader) ).

* Read Infotyp 1
lr_infotype_reader->read( EXPORTING tclas         = 'A'
                                    pernr         = 1
                                    infty         = '0001'
                                    begda         = if_hrpa_read_infotype=>low_date
                                    endda         = if_hrpa_read_infotype=>high_date
                                    no_auth_check = abap_true
                          IMPORTING infotype_tab  = DATA(lt_infotype)
                                    data_exists   = DATA(lv_data_exists) ).

LOOP AT lt_infotype INTO DATA(ls_infotype).
  cl_hr_pnnnn_type_cast=>prelp_to_pnnnn( EXPORTING prelp = ls_infotype
                                         IMPORTING pnnnn = ls_p0001 ).
  APPEND ls_p0001 TO lt_p0001.
ENDLOOP.

cl_demo_output=>display( lt_p0001 ).
* Read single infotype record
DATA: ls_p0001 TYPE p0001.

* Initialise Infotyp reader
  cl_hrpa_read_infotype=>get_instance( IMPORTING infotype_reader = DATA(lr_infotype_reader) ).

* Read Infotyp 1
  lr_infotype_reader->read_single( EXPORTING tclas         = 'A'
                                             pernr         = 1
                                             infty         = '0001'
                                             subty         = space
                                             objps         = space
                                             sprps         = if_hrpa_read_infotype=>unlocked
                                             begda         = '20200101'
                                             endda         = '20200131'
                                             mode          = if_hrpa_read_infotype=>first_record_containing_begda
                                             no_auth_check = abap_true
                                   IMPORTING pnnnn         = ls_p0001 ).

cl_demo_output=>display( ls_p0001 ).

[Proxmox] Mount dataset into LXC

Open LXC config file in your favorite editor. In this case the container name is 101:

nano /etc/pve/lxc/101.conf

Append a single line for each mountpoint you want to add. The first mountpoint is “mp0”, the second “mp1” and so on.

mp0: /data/music,mp=/mnt/nfs/music

First the source (my zpool “data”, folowing the dataset name “music”), after that the destination inside the container beginning “mp=”.