Monthly Archives: October 2018


LibreOffice Calc: Get workbook filename only

Get workbook filename only

For Linux and Mac

=TRIM(
  RIGHT(
    SUBSTITUTE(
      LEFT(
        CELL("filename"),
        FIND("#", CELL("filename")) -2
      ),
      "/",
      REPT(" ", LEN(CELL("filename")))
    ),
  LEN(CELL("filename"))
  )
)

For Windows

=TRIM(
  RIGHT(
    SUBSTITUTE(
      LEFT(
        CELL("filename"),
        FIND("#", CELL("filename")) -2
      ),
      "\",
      REPT(" ", LEN(CELL("filename")))
    ),
  LEN(CELL("filename"))
  )
)

The only change is changing the delimiter from / to \.


Qubes 4.0 with Fedora 26: Setup RPM Fusion and ffmpeg

Recently we wanted to process some media on a Fedora 26 running under a Qubes OS 4.0 installation, we decided to use ffmpeg which is not part of the default repositories but it can be found in the RPM Fusion repositories. To do so, first we updated our system and enabled the RPM Fusion repositories as follows:


sudo dnf update;

sudo dnf upgrade -y;

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm;

sudo dnf config-manager --set-enabled rpmfusion-free rpmfusion-nonfree;

By default DNF on the template VM did not enable the rpmfusion repositories so we had to enable them manually with the last command above or else we would get the following error:

$ sudo dnf install ffmpeg;
Last metadata expiration check: 0:17:49 ago on Tue Oct 16 09:09:22 2018.
No match for argument: ffmpeg

Then, we updated the system once more so that the information from the new repositories would get downloaded to our system and then we performed the installation of ffmpeg. While installing ffmpeg, since it was the first time that we were using the new repositories we were asked to verify the keys that were imported. We were able to manually verify the keys from this page.

The commands used to install ffmpeg are the following:


sudo dnf update;

sudo dnf install ffmpeg;



Qubes 4.0: Installation crashes when installing qubes-mgmt-salt-base-topd.noarch 5

Solution

  1. Disable Secure Boot from BIOS
  2. On boot order, select Legacy Devices first, again from BIOS
  3. At the first screen of the installer (like the image below), press the e button to edit the boot arguments, disabling the graphics card driver. For us what worked is the following:
    mboot.c32 xen.gz console=none --- vmlinuz inst.stage2=hd:LABEL=Qubes-R4.0-x86_64 i915.alpha_support=1 mapbs=1 noexitboot=1 modprobe.blacklist=nouveau rd.driver.blacklist=nouveau -- initrd.img
  4. Enjoy!

Back Story

Recently, we were trying to install Qubes GNU/Linux version 4.0 on a Lenovo Legion Y520 that has NVIDIA® GeForce® GTX 1050 Ti installed. After disabling secure boot from the BIOS and then setting the default boot to be on Legacy Devices, we were able to boot the anaconda installer.

We proceeded into configuring the installation (set the timezone, the keyboard layout, created the administrator user and selected the disk for the installation) and we waited for the system to install. After some serious amount of time, we realized that the installer had crashed completely while installing qubes-mgmt-salt-base-topd.noarch. We restarted the process and tried again, this time the installed did not crash but it would get stuck at the same step. Following, we gave it a few more tries just in case it would work but unfortunately it would always result either crashing or getting infinitely stuck.

Following the guide at https://www.qubes-os.org/doc/uefi-troubleshooting/ and https://www.qubes-os.org/doc/nvidia-troubleshooting/ we modified the boot parameters of the installer to add mabps and noexitboot, then disable the nouveau driver for the graphics card and it worked like a charm.


Horrible Solution: How to delete all docker logs 2

Recently, we needed to delete the logs of a running docker setup. To do so, we used the following horrible solution:

First, we executed docker system info | grep "Docker Root Dir";to get the installation path of docker. It resulted to the following:

Docker Root Dir: /var/lib/docker

Then, we truncated all log files using the following command while executing as root:

truncate -s 0 /var/lib/docker/containers/*/*-json.log;

Bonus

To make the command a onliner, use the following:


sudo sh -c 'truncate -s 0 $(docker system info | grep "Docker Root Dir" | cut -d ":" -f2 | cut -d " " -f2-)/containers/*/*-json.log';