Posts

[SOLVED] E: Problem executing scripts APT::Update::Post-Invoke

If you have a legacy docker version and you try to update you repositories with apt update, probably you will get the following error: E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true' E: Sub-process returned an error code To solve it, you must install a version higher than 20.10.9. If you haven't this version in you apt repositories, you can install it throught snap. To check your docker version just write this command: docker -v  Enjoy it!

[Solved] Issue to run Julia from snap: symbol lookup error: /snap/core18/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_vfork, version GLIBC_PRIVATE

If you installed Julia from snap, and tried to run it from Python3, probably you get the following issue. from julia.api import Julia jl = Julia(compiled_modules=False) Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "/usr/local/lib/python3.10/dist-packages/julia/core.py", line 472, in __init__     self.api = LibJulia.from_juliainfo(jlinfo)   File "/usr/local/lib/python3.10/dist-packages/julia/libjulia.py", line 203, in from_juliainfo     return cls(   File "/usr/local/lib/python3.10/dist-packages/julia/libjulia.py", line 226, in __init__     self.libjulia = ctypes.PyDLL(libjulia_path, ctypes.RTLD_GLOBAL)   File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__     self._handle = _dlopen(self._name, mode) OSError: /snap/core18/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_vfork, version GLIBC_PRIVATE Appears to be a core...

[Solved] Interface *mon is too long for linux so it will be renamed to the old style (wlan#) name.

If you tried to start monitor mode in a wireless interface, probably you will see the following message: Interface wlx6466b31e7738mon is too long for linux so it will be renamed to the old style (wlan#) name.  , where 6466b31e7738 is the MAC address from your interface.  Just write the following commands in your terminal: sudo ifconfig wlx6466b31e7737 down sudo ip link set wlx6466b31e7737 name wlan0 sudo ifconfig wlan0 up , where wlx6466b31e7737 is your wireless interface. Now, you could start monitor mode in your interface as follows: sudo airmon-ng start wlan0 Found 4 processes that could cause trouble. Kill them using 'airmon-ng check kill' before putting the card in monitor mode, they will interfere by changing channels and sometimes putting the interface back in managed mode     PID Name    1382 avahi-daemon    1388 NetworkManager    1424 wpa_supplicant    1427 avahi-daemon PHY    Interface  ...

Javascript for LibreOffice scripting

Image
Now, a js example to run in OO Calc: importClass(Packages.com.sun.star.uno.UnoRuntime); importClass(Packages.com.sun.star.sheet.XSpreadsheetDocument); importClass(Packages.com.sun.star.container.XIndexAccess); importClass(Packages.com.sun.star.table.XCellRange); importClass(Packages.com.sun.star.table.XCell); documentRef = XSCRIPTCONTEXT.getDocument(); spreadsheetInterface = UnoRuntime.queryInterface(XSpreadsheetDocument, documentRef); allSheets = UnoRuntime.queryInterface(XIndexAccess, spreadsheetInterface.getSheets()); theSheet = allSheets.getByIndex(0); Cells = UnoRuntime.queryInterface(XCellRange,theSheet); cellA1 = Cells.getCellByPosition(0,0); theCell = UnoRuntime.queryInterface(XCell,cellA1); theCell.setFormula("Hello World"); // https://wiki.documentfoundation.org/images/f/f0/CG6212-CalcMacros.pdf   And here the result:  

VisualBasic scripting in LibreOffice

Image
 Here an example to run in Writer: Sub Hello Dim oDoc Dim sTextService$ Dim oCurs REM ThisComponent se refiere al documento actualmente activo oDoc = ThisComponent REM Verifica que este es un documento de texto sTextService = "com.sun.star.text.TextDocument" If NOT oDoc.supportsService(sTextService) Then MsgBox "This macro only works with a text document" Exit Sub End If REM obtiene la vista del cursor del controlador actual oCurs = oDoc.currentController.getViewCursor() REM Mueve el cursor al final del documento oCurs.gotoEnd(False) REM Inserta el texto “Hola” al final del documento oCurs.Text.insertString(oCurs, "Hello World", False) End Sub REM https://documentation.libreoffice.org/assets/Uploads/Documentation/es/GS52/PDF/GS5213-PrimerosPasosConMacros.pdf And the result is here:

BeanShell scripting in LibreOffice

Image
Here is a BeanShell script to xploit functionalities from LibreOffice spreadsheeat: import com.sun.star.uno.UnoRuntime; import com.sun.star.sheet.XSpreadsheetView; import com.sun.star.text.XText; import com.sun.star.sheet.XCellRangeData; // // Get active spreadsheet // model = XSCRIPTCONTEXT.getDocument(); controller = model.getCurrentController(); view = UnoRuntime.queryInterface(XSpreadsheetView.class, controller); sheet = view.getActiveSheet(); // // Create a TEXT CELL // // Get cell by position cell = sheet.getCellByPosition(0, 0); // Access the cell text cellText = UnoRuntime.queryInterface(XText.class, cell); // Get the text cursor of the cell text textCursor = cellText.createTextCursor(); // Insert a string in the cell through the text cursor and overwrite the cell content // Using 'false' as third parameter adds the inserted string cellText.insertString(textCursor, "BeanShell macro example", true); // // Access and modify VALUE CELLS // // Get cell by position...

[Solved] Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

 If you run apt update, you probably will see the following message: [Solved] Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. To solve it, you need to export the GPG key from the deprecated keyring and store it in /usr/share/keyrings. To do it, just get the last 4 bytes from the fingerprint and export the key to /usr/share/keyrings folder: sudo apt-key list Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). /etc/apt/trusted.gpg -------------------- pub   rsa4096 2018-08-14 [SC]       E869 7E2E EF76 C02D 3A63  3277 8881 B2A8 2109 76F2 uid           [ unknown] Package Manager (Package Signing Key) <packages@pgadmin.org> sub   rsa4096 2018-08-14 [E]  sudo apt-key export 210976F2 | sudo gpg --dearmour -o /usr/share/keyrings/pgadmin4.gpg   Now, you need ...