nocin.eu

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

[Windows 10] Tab für Vorgängerversionen

In einer meiner Windows 10 Pro VM’s bemerkte ich letztens, dass im Contextmenü bzw. den Eigenschaften von Ordner und Dateien, der Eintrag für die Vorgängerversionen nicht mehr angezeigt wurde. Sowohl für lokale Dateien, als auch für einen Samba Share eines TrueNAS Servers mit Snapshots fehlte die Anzeige. Der Volume Shadow Copy Service (VSS) war jedoch aktiv und lief fehlerfrei. Die Ursache musste also woanders liegen.

Nach einer längeren Suche wurde ich auf dieser Seite fündig: https://www.tenforums.com/tutorials/79513-remove-previous-versions-context-menu-properties-windows-10-a.html

Hier gibt es ein Script, welches die erforderlichen Registry Einträge zurücksetzt: Add_Previous_Versions_to_Properties_and_context_menu.reg

Windows Registry Editor Version 5.00

; Add to context menu
[HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]

[HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]

[HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]

[HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]


; Add to Properties tab
[HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\PropertySheetHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]

[HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\shellex\PropertySheetHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]

[HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]

[HKEY_CLASSES_ROOT\Drive\shellex\PropertySheetHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]


; To clear any policies
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"NoPreviousVersionsPage"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
"NoPreviousVersionsPage"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PreviousVersions]
"DisableLocalPage"=-

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"NoPreviousVersionsPage"=-

[HKEY_CURRENT_USER\Software\Policies\Microsoft\PreviousVersions]
"DisableLocalPage"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked]
"{596AB062-B4D2-4215-9F74-E9109B0A8153}"=-

Nach der Ausführung wurde mir der Tab in den Eigenschaften, sowie der Eintrag im Kontextmenü für die Vorgängerversionen wieder angezeigt.

[ZFS] Send unencrypted dataset to encrypted pool

I recently added some disks to my TrueNAS server and created a new encrypted pool named data2 on it. My old pool data was created years ago, before the zfs encryption feature was released, so it is an unencrypted pool. Now I wanted to move a dataset, i.e. photos, to my new pool data2. I tried to archieve this via TrueNAS Gui using the Replication Task, but always got errors that it’s not possible to send unencrypted data to an encrypted pool.

On Reddit I found a thread with a solution using the parameter -x encryption.

Because I prefer keeping all my snapshots when moving a dataset, I send my oldest snapshot first.

zfs send -v data/photos@manual-01-05-2019 | zfs recv -x encryption data2/photos

In the next step I created a new snapshot and did an incremental send with the parameter -I (send incremental snapshots).

zfs send -v -I data/photos@manual-01-05-2019 data/photos@manual-01-10-2020 | zfs recv -F -x encryption data2/photos

Compare the datasets with zfs diff (see example here) or use the classic diff command to compare the folders:

diff -qr /mnt/data/photos /mnt/data2/photos
#or in background
diff -qr /mnt/data/photos /mnt/data2/photos >> diff.output & disown
#check if process finished with "ps"
less diff.output

Check if all Snapshots were replicated with:

zfs list -t snapshot | grep data2/photos

After that I just changed the path for my NFS photo share and did a sudo mount -a on the clients. Now the whole dataset is moved and encrypted.

[SAPUI5] Copy Table Row

Button für das Kopieren einer Zeile hinzufügen.

<Table id="itemsTable" items="{oModel>/ITEMS}">
<columns>
      <Column id="splitColumn" hAlign="Center" demandPopin="false">
            <Text text="{i18n>SPLIT}"/>
      </Column>
</columns>
<items>
      <ColumnListItem>
            <cells>
                  <Button press="onSplitPressed" id="SPLIT_ROW" icon="{= ${oModel>CUSTOM_ITEM} === true ? 'sap-icon://delete' : 'sap-icon://add'}"/>
            </cells>
      </ColumnListItem>
</items>
</Table>

Nur neu hinzugefügte Zeilen sollen auch wieder gelöscht werden dürfen, daher werden manuell hinzugefügte Zeilen markiert mit CUSTOM_ITEM = True;
Via Expression Binding wird dann das erforderliche Icon bestimmt.

onSplitPressed: function (oEvent) {
		var oContext = oEvent.getSource().getBindingContext("oModel");
		var path = oContext.getPath();
		var oModel = oContext.getModel();
		var oItems = oModel.getProperty("/ITEMS");
		var index = path.substr(path.length - 1);

		//selektiertes Item lesen
		var oItem = oModel.getProperty(path);

		//was soll passieren? Zeile hinzufügen oder entfernen?
		if (oItem.CUSTOM_ITEM !== true) {

			//Neues Item anlegen
			var oNewItem = JSON.parse(JSON.stringify(oItem));
			//Markiere neue Zeile, da nur diese auch wieder gelöscht werden darf
			oNewItem.CUSTOM_ITEM = true;
			// +1 weil Zeile soll ja nach der Aktuellen einfügt werden
			index++; 
			oItems.splice(index, 0, oNewItem);

		} else {
			// Item löschen
			oItems.splice(index, 1);
		}

		oModel.setProperty("/ITEMS", oItems);
	},

[NAS] WD Red Plus -> CMR

https://www.heise.de/news/NAS-Festplatten-Western-Digital-fuehrt-WD-Red-Plus-fuer-CMR-Garantie-ein-4794455.html

“Western Digital macht künftig besser erkenntlich, welche WD-Red-Festplatten auf klassisches Conventional Magnetic Recording (CMR) oder potenziell langsameres Shingled Magnetic Recording (SMR) setzen: Der Hersteller überführt alle CMR-Modelle der WD-Red-Serie in die neue Baureihe WD Red Plus. Wer künftig eine normale WD-Red-Festplatte ohne Namenszusatz kauft, bekommt folglich sicher eine SMR-Variante.”

CMR = Conventional Magnetic Recording
SMR = Shingled Magnetic Recording (ungeeignet für NAS)

https://dennisvitt.de/western-digital-fuehrt-wd-red-plus-festplattenreihe-ein-umbenennung-aufgrund-cmr-und-smr/

CMR Produktbezeichnungen: WD10EFRX (1 TB), WD20EFRX (2 TB) , WD30EFRX (3 TB), WD40EFRX (4 TB), WD60EFRX (6 TB), WD80EFAX (8 TB), WD101EFAX (10 TB), WD120EFAX (12 TB), WD140EFAX (14 TB)

SMR Produktbezeichnungen: WD20EFAX (2 TB), WD30EFAX (3 TB), WD40EFAX (4 TB) und WD60EFAX (6 TB)

[ABAP] ALV column header

DATA: o_salv TYPE REF TO cl_salv_table.

cl_salv_table=>factory( IMPORTING r_salv_table = o_salv
                        CHANGING  t_table      = l_lines ).

LOOP AT o_salv->get_columns( )->get( ) REFERENCE INTO DATA(l_column).
  DATA(lo_column) = CAST cl_salv_column( l_column->r_column ).
  lo_column->set_fixed_header_text( 'L' ).
ENDLOOP.

o_salv->get_columns( )->get_column( 'TEST1' )->set_long_text( 'Test1 Header' ).
o_salv->get_columns( )->get_column( 'TEST2' )->set_long_text( 'Test2 Header' ).

[Hardware] ASUS TUF GAMING B550M-PLUS and RTL8125B Realtek

Just switched some hardware parts in my main PC:

I moved from Intel to an AMD build. I kept my boot disk with Linux Mint 20 and everything was running out of the box, except there was no ethernet connection available. The RTL8125B Realtek network card is not yet supported on a Kernel < 5.9. Since I’m running Kernel 5.6.14, I had to manual install it.

Go to: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software

Download the “2.5G Ethernet LINUX driver r8125 for kernel up to 5.6”, untar and follow the installation instructions from the README. In fact you only have to run

sudo ./autorun.sh
#check with
lsmod | grep r8125
ifconfig -a

[Fiori] Debug deployed Fiori App

When opening the Dev-Tools for a deployed Fiori App, it will look like this:

You won’t see any controller.js to debug.
What to do? Close the Debugger-Tools and hit CTRL+ALT+SHIFT+P to open the Technical Information Dialog

Check the Checkbox (or choose a specific controller) and reload the app.

It reloads with a new URL parameter and if you open the Dev-Tools, you will now see the controller.js.

Other options to debug or at least to collect some information about your app are the UI5 Diagnostics (hit CTRL+ALT+SHIFT+S) and the UI5 Inspector which is a Brower Addon.

[HR] Infotype – add PBO or PAI logic

There are many ways to add custom logic when processing an Infotype. Here are just a few:

SMOD
PBAS0001
PBAS0002

ZXPADU01 – when an infotype is called
ZXPADU02 – when an action is performed on an infotype

https://regotz.jimdofree.com/abap/dynpro/infotypen-pai-pbo/

BAdI’s

  • HRPAD00INFTY (method IN_UPDATE) is called by the old infotype framework (PA30, SAP50UPR)
  • HRPAD00INFTYDB (method UPDATE_DB) is called in the decoupled infotype framework

BAdI: HRPAD00INFTY – Verbucher / Infotyp-Pflege

This image has an empty alt attribute; its file name is image-1.png
This image has an empty alt attribute; its file name is image-2.png
Interface: IF_EX_HRPAD00INFTY

BAdI: HRPAD00INFTYDB – HR: Stammdaten, Infotype DB Update Logik

“The BAdI is called, after the decoupled infotype framework writes the infotype data to the database. This is done during method FLUSH.”
Note: The Infotypes 2000-2999 are not decoupled yet! More here and here.

IF_EX_HRPAD00INFTYBL
IF_EX_HRPAD00INFTYDB