Examples of Religious Syncretism

I’m always on the lookout for good examples of religious syncretism and wanted a good place to store these.

Lôtān -> Leviathan

In Psalm 74, verse 14, Yahweh is described as having defeated a sea monster called Leviathan. This sea creature, its name, and its mythology derive from a Ugaritic sea monster named Lôtān, who was similarly defeated by Hadad, a god in Canaanite and Mesopotamian religions. This is a clear case of Jewish religion incorporating earlier Canaanite and Mesopotamian beliefs.

Sargon of Akkad birth story -> Moses birth story

Sargon of Akkad, was the first ruler of the Akkadian Empire in the 24th to 23rd centuries BCE. Per a 7th century BCE Neo-Assyrian text purporting to be Sargon’s autobiography, Sargon was claimed to the illegitimate son of a priestess who put him as an infant in a basket of rushes sealed with tar and set him afloat in a river. He, of course, was found and raised, eventually becoming a great leader. This text may not be a direct antecedent of the biblical myth of Moses (Exodus 2) similarly being put into a basket of reeds that was sealed with tar and set afloat in the river but rather may have simply been a common archetype from the time period that served as the basis for multiple origin stories. Either way, it is a clear example of religious syncretism.

Virgin Births (or god impregnations) – Perseus, Oenopion, Romulus and Remus -> Jesus

The suggestion that a human was born to a virgin or that the individual had divine heritage was not uncommon in the ancient world. The following are some of the individuals who were claimed to have been fathered by a deity: Perseus (fathered by Zeus), Oenopion (fathered by Dionysus), and Romulus and Remus (fathered by Mars).

This is another scenario in which there may not be one specific belief, myth, or story that became the virgin birth story of Jesus, but the archetype of virgin/divine births was widespread and then incorporated into Christianity.

 114 total views,  11 views today

HandBrake – Convert Files with GPU/Nvenc Rather than CPU

I don’t know exactly when HandBrake added the capability of using the GPU for encoding, but it was somewhere between 1.3.1 (current version in the Ubuntu repositories) and 1.3.3 (current version on PPA). Regardless, this option offers dramatic speed improvements, particularly when working with 4K videos. In this post, I’ll show how to use this feature in Handbrake and show some comparisons to illustrate the benefits and tradeoffs that result.

HandBrake 1.3.1 is the current option in the Ubuntu 20.04 repositories.
Version of HandBrake available from the PPA that has NVENC/GPU encoding capabilities.

How to Use NVENC GPU Encoding

First, make sure you have the latest version of Handbrake installed (as of 6/26/2020 that is version 1.3.3). Also, to use Nvenc encoding, you’ll need the Nvidia Graphics Driver 418.81 or later and an Nvidia GeForce GTX 1050+ series GPU or better per HandBrake’s documentation. I’m using a GTX 1060 and have Driver version 440.100 installed. My CPU is an AMD Ryzen 5 3600 6-Core, 12-Thread processor.

My GPU (GeForce GTX 1060) and my driver version: 440.100.

The video I’m using to illustrate how to use GPU encoding is a Blu-Ray rip of Pan’s Labyrinth. I’m making a backup copy of the video to store on my file server. I used MakeMKV to pull the video off the BluRay disc, resulting in a 31.7GB file. I’m going to convert that to a 1080p H265 video file that is substantially smaller in size.

Open up HandBrake and load your file you want to convert by clicking on “Open Source.” Find the file you want to convert and select “Open.”

HandBrake will run through the file, gathering information about the codec, subtitles, audio tracks, etc. Once it’s done, you’ll need to select what format you want to convert it to. For this tutorial, I’m just going to use a General Preset, but I want to illustrate the difference in encoding speed, so I’m going to select Super HQ 1080p30 Surround rather than Fast 1080p30.

My mouse is on Super HQ 480p 30 in the image, but I selected Super HQ 1080p.

To change from CPU encoding to GPU encoding, click on the Video tab:

In the middle of the screen, you’ll see a drop-down menu labeled “Video Encoder.” Click on that drop-down menu and you should see two NVENC options: H.264 (NVenc) and H.265 (NVenc). Those are the two options for using your GPU for the encoding versus using your CPU. The H.265 codec is newer and has somewhat better compression algorithms, but I’m not going to opine as to which of these you should choose. That choice should really be driven by what device you’re going to be playing your videos on. Regardless of which you choose, those two will push the encoding to your GPU instead of your CPU.

Again, my mouse is on the wrong option here. The two options you want are: H.264 (NVenc) or H.265 (NVenc).

Make sure you’ve adjusted your Audio, Subtitles, and Tags to your preferences, then click “Start.” That’s all there is to it – you now have GPU encoding.

Benchmarks: Encoding Speed

Using the H.265 (NVenc) encoder, it took about 17 minutes to convert the 31.7GB MKV file into a 8.4GB m4v file.

My mouse is next to the estimated time for encoding the video: 16m50s.

You can also see that even using the H.265 (NVenc) encoder, much of the processing is passed to the CPU, as shown in this screenshot that shows my GPU is working, but it’s certainly not being stressed:

GPU load is on the left. CPU load is top right.

Using all the same options but CPU encoding instead, HandBrake took 1 hour and 15 minutes to encode the file, so about 5 times as long.

When I grabbed this screenshot, HandBrake was estimating 1h07m, but it ended up taking about 1h15m for the entire encode.

Here’s the same resource utilization illustration showing that HandBrake is drawing exclusively on the CPU and not the GPU:

GPU utilization is on the left; CPU utilization is upper right.

Other tests I ran encoding 4K video illustrated that this difference increases with 4K video. I converted one 4K movie that was about 1 hour, 40 minutes using H.265 (NVenc) and it took about 1 hour. Using the CPU alone, HandBrake estimated it would take 18 hours (I didn’t wait to see if that was accurate). Thus, there is a dramatic difference in encoding speed with higher resolution and larger video files.

Benchmarks: Video Size and Quality

What about file size and video quality? I’m probably not going to do justice the differences because I don’t have the most discerning eye for pixellation and resolution differences, but I will try to use some objective measures. The video encoded with the GPU was 8.39GB in size. The video encoded with the CPU was 3.55GB. I’m not exactly sure why the file sizes are so different given that I chose the same setting for both encodes, but this next screenshot illustrates that the NVENC encode resulted in a higher bitrate (9,419 kb/s) versus the CPU encode with a lower bitrate (3,453 kb/s). Strange.

On the left are the specs for the NVENC encoded video; the CPU encoded video specs are on the right.

I also wanted to see if I could tell if there was a noticeable difference in quality between the two videos. I navigated to the same scene in both videos and used VLC to take a screenshot. First, the NVENC encoded screenshot:

Click for full resolution. This is the NVENC encoded video.
Click for full resolution. This is the CPU encoded video.

My 43-year-old eyes don’t see much of a difference at all.

Conclusion

If you’ve got the hardware and want to save time, using GPU encoding with Handbrake is a nice option. The end result is a much faster encode, particularly with higher resolution videos. Some of the forums where I was reading about this option suggested there are problems with using GPU encoding. I certainly won’t challenge those assertions, but I can’t tell the difference.

 416 total views,  18 views today

2020 NAS – Plex, nomachine, Crashplan

After about a year and a half with my previous NAS (see here), I decided it was time for an upgrade. The previous NAS had served dutifully, but it was no match for 4K video (I don’t have a lot of it), it took forever to transcode files when I wanted to synchronize them with a device using Plex, and it couldn’t transcode pretty much any videos in real-time. For playing up to four files simultaneously that didn’t need to be transcoded, it worked like a champ. But it just couldn’t handle all the scenarios I was throwing at it. So, it was time for an upgrade.

Hardware

The major change, of course, was the hardware. Here are the specs for the new NAS:

Case: Fractal Design Define R5 – Mid Tower ATX case
RAM: Corsair LPX 32GB (2x16GB) 3200MHz C16 DDR4 DRAM
GPU: EVGA GeForce GTX 1060 3GB
Motherboard: ASUS AM4 TUF Gaming X570
CPU: AMD Ryzen 5 3600 6-Core
Powersupply: Fractal Design Ion+ Platinum 860W PSU
SSD: Samsung 850 EVO 250GB
Hard Drives: 4 WD Blue 4TB 5400 RPM Hard Drives

Since I was repurposing the SSD and hard drives from my previous NAS, I didn’t buy those for this build. But here is the estimated cost of the NAS assuming those were included: $1,357.47 + tax.

(NOTE: Full disclosure, the links above are affiliate links to Amazon.)

A couple of notes on my hardware choices…

The case is amazing. It’s big, roomy, and extremely well-designed. It is also absolutely silent and does a great job with cable management. It also has plenty of room for hard drives, which I absolutely love. It’s also understated. I don’t need flashing lights with my NAS. I need a discrete box that makes no noise.

My new fileserver. It’s absolutely silent. It may be a little large, but that gives me plenty of space for the components I want.

I had originally considered a different GPU, the PNY Quadro P2000. A lot of Plex forums suggested it was a real beast when it came to hardware transcoding for video. By the time I put this together, these were really hard to find and very expensive. I looked around and the GeForce GTX 1060 had higher benchmarks at a much lower price. You can see my testing data below to see how well it works and whether I made the right choice.

I also considered an AMD Threadripper over a standard Ryzen, but I also realized that I was passing the video transcoding to a GPU with this build (my last one used the CPU), which meant I really didn’t need that much CPU power. Again, you can see in the benchmarks below how well this paid off.

The remaining hardware choices were pretty straightforward. The SSD is small because it only houses the OS. All the storage is on the hard drives. I kept the ZFS raid (see details below) and can upgrade it by simply buying bigger hard drives in the future and swapping the smaller ones out, making this NAS fairly future proof for at least the next few years.

Software

I changed very little from the previous NAS when it comes to software. I installed the latest Kubuntu LTS, 20.04. I am running the latest versions of Plex, Crashplan, tinyMediaManager, kTorrent, and nomachine. I am using NFS to access my server directly from other computers within the network. These are all detailed in my previous build.

I also kept my ZFS file system. Conveniently, I was able to transfer the raid right over to my new NAS, which I detail below.

Test Results

To test how well my new build did, I ran a couple of tests. First, I tried to simultaneously stream a 4K video to 5 devices – my TV, two Google Pixel 3 phones, a Google Pixel phone, and a laptop (all on my home network). The Google Pixel couldn’t handle the 4K video, so I ended up streaming a different 1080p video instead. My previous NAS couldn’t stream a single 4K video. This one handled all 5 streams like a champ, as shown in the video below:

I also wanted to make sure that my Plex server was using the GPU for converting videos, so I took that same 4K video and set it to synchronize with my phone at 720p. On my previous NAS, converting a 31gb 4K video to a 720p video would have taken hours. Plex passed the conversion on to the GPU and it took less than 10 minutes.

To make sure your Plex server is using your GPU, you need to set it to do so in the settings. It’s under Settings->Transcoder. Click on “Use hardware acceleration when available” and “Use hardware-accelerated video encoding.”

NOTE: To monitor the CPU, I used Ksysguard, which ships with Kubuntu. To monitor the GPU, I used “nvtop,” which can be installed from most distribution repositories.

Headless Monitor Issue

One of the problems I have been struggling with for months now (and had a similar issue with my previous NAS) was setting up a virtual screen/monitor. Here’s the problem…

I actually do the initial installation of the operating system using a monitor that I plug into the NAS. But I don’t want to keep a monitor out, sitting near my NAS/fileserver all the time. I want the NAS to be “headless” – meaning no monitor is attached. Once I get the operating system installed, I first install SSH (just in case I screw something up, ’cause you’re always going to screw something up). Then I install my remote management software, nomachine. Once I have nomachine installed, I can unplug the monitor, mouse, and keyboard and take care of everything else remotely. However, I found out with my previous NAS build, that the X server that manages sessions on Kubuntu, doesn’t set up a monitor if it doesn’t detect one being attached physically. In other words, if I restart the computer with no monitor attached, the X server correctly detects that there is no monitor attached and doesn’t set up a monitor in the X session.

As a result, when I would try to remotely connect to my NAS using a VNC client, the client would have to try to generate a monitor and the result was always problematic – either nothing would show up or it would be really slow and sluggish. I get that the X server doesn’t want to use resources to run a monitor if there isn’t a monitor connected. That’s a feature, not a bug. But it is a challenge to solve this problem. With my new NAS, it took me about 2 hours to finally figure out a solution. So I don’t have to go through this again, I’m going to post the solution here in detail.

With my previous NAS, I didn’t have a graphics card installed. I let the CPU do all the processing, which meant I needed a different solution than the one I had employed before (here’s the old solution). With my new NAS, I wanted a graphics card so I could pass off some of the video processing to the GPU instead. As noted above, I bought an NVIDIA graphics card, which Kubuntu recognized when I installed the OS and appropriately added the recommended NVIDIA drivers. My graphics card also runs the monitor. This was the key to solving my headless monitor issue.

Basically, what you need to do is tell the X Server to create a monitor even though one isn’t attached. You do this by creating a “xorg.conf” file that is stored in the /etc/X11/ directory. Once the NAS is up and running, you can actually let the NVIDIA X Server Settings application create the necessary xorg.conf file, for the most part. Here’s what you do. With the NVIDIA drivers installed and the NVIDIA X Server Settings application installed, launch the NVIDIA X Server Settings application. Go to the second option down on that window that reads, “X Server Display Configuration.”

Near the bottom of that window is a button that reads, “Save to X Configuration File.” This is nearly the answer to all our problems.

When you click on that, it will pop up a window that will allow you to preview the code it is going to add to /etc/X11/xorg.conf, which is the X server’s configuration file for the monitor. That code will be based on your current monitor – whatever is currently physically attached to the computer. Go ahead and follow the prompt and it will generate the xorg.conf file.

However, you now need to make two modifications to the file. I use “nano” to edit text files:

sudo nano /etc/X11/xorg.conf

First, you need to add the following to the Device Section of the xorg.conf file:

Option “AllowEmptyInitialConfiguration”

This code tells the X Server that it’s okay to create a screen/monitor without a physical monitor connected. (Got this information from here).

Second, you need to add the dimensions of the virtual screen you want to set up to the “Display” SubSection of the “Screen” Section of the xorg.conf file, like this:

Virtual 1440 900

This creates a virtual monitor/screen with the dimensions indicated. (Got this information from here). Here is the complete xorg.conf file I am using for my NAS:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 440.64

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Acer AL1917W"
    HorizSync       31.0 - 84.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 3GB"
    Option	   "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
	Virtual 1440 900
    EndSubSection
EndSection

With the above xorg.conf file (which is located in /etc/X11/, so, /etc/X11/xorg.conf), I can then shutdown my NAS, unplug the mouse, keyboard, and monitor, then restart it and use nomachine to completely control the NAS. Here’s how it looks when I pull it up:

This approach will only work if you have an NVIDIA graphics card. If you don’t, you’ll need to take a different approach. This site may point you in the right direction.

ZFS Transfer

As I detailed in my previous NAS build, I opted to go with ZFS for storing my files using a raidz2 array (4 x 4tb drives). It provides, IMO, the optimal balance of speed and redundancy. With just over 4tb of files on my ZFS array in my old NAS, I didn’t really want to have to copy all of those files over to the new. As it turns out, ZFS has the ability to move physical disks to a new device and recreate a ZFS pool. Hallelujah!

On the old NAS, I shut down all connections to my NAS from external devices, restarted the machine, and then used the following command:

sudo zpool export

This basically sets up the ZFS pool so it is ready to be transferred to another machine. I then physically removed all four 4tb drives from the old NAS, moved them to the new one, and got everything ready to import the new NAS. I installed the following packages first:

sudo apt-get install zfsutils-linux nfs-kernel-server zfs-initramfs watchdog

The above packages also installed the following packages:

libnvpair1linux libuutil1linux libzfs2linux libzpool2linux zfs-zed keyutils libnfsidmap2 libtirpc-common libtirpc3 nfs-common rpcbind

With those installed, I checked to see if I had any pools (I didn’t, of course, I hadn’t set any up):

zpool status

Then, I used the following command to look for the pool that was spread across the four hard drives:

sudo zpool import

Beautifully, it immediately found the pool (ZFSNAS) and gave me a bunch of useful information:

pool: ZFSNAS
id: 11715369608980340525
state: ONLINE
status: The pool was last accessed by another system.
action: The pool can be imported using its name or numeric identifier and the '-f' flag.
see: http://zfsonlinux.org/msg/ZFS-8000-EY
config:
 ZFSNAS      ONLINE
      raidz2-0  ONLINE
        sdd     ONLINE
        sdb     ONLINE
        sde     ONLINE
        sdc     ONLINE

Honestly, I cheered when I saw this. It was going to work. I then used the following command to import my pool:

sudo zpool import -f ZFSNAS

Then, just to be sure everything worked, I checked my pool status:

zpool status

And up popped my zpool. It did tell me that I needed to upgrade my pool, which I proceeded to do. And, with that, my pool from my old NAS was transferred to my new NAS intact. No need to copy over the files. ZFS is definitely the way to go when it comes to NAS file storage. I’m increasingly happy with ZFS!

NOTE: I bought a 10gb external drive and copied everything onto it just to be extra cautious. Turns out, I didn’t need to do that. But, better safe than sorry.

 578 total views,  25 views today

LibreOffice – exporting high-resolution TIFF/TIF files

As a scholar who regularly publishes work with charts and graphs, I’m often confronted with varied requirements from publishers for the format in which they want the charts and graphs. Most often, the format is as a TIFF/TIF file, typically with at least 300 dpi and somewhere around 1500×1500 pixels. I make most of my charts in LibreOffice Calc, though occasionally I make some in R as well.

I have recently been editing several volumes in which I had to manage the charts and graphs of other scholars as well. As the editor, I had to make sure the final images met the criteria detailed above. Since scholars often make charts and graphs in Word, it took a little finagling to come up with a quick and easy way to export the images in the format needed by the publisher. Since I did finally figure this out, I figured I’d post it here so I remember how to do this in the future. Luckily, LibreOffice works extremely well with these formats (for the most part), which makes this quite easy.

LibreOffice Calc

Assuming you have created your chart/graph in LibreOffice Calc, exporting it into a TIF format should be fairly easy, though it requires an unfortunate extra step. Here’s a chart I created in LibreOffice Calc:

The LibreOffice programmers make it so you can just right-click on the graph and select “Export as Image.”

When you do this, you’ll get this pop-up window asking where you want to save the image and, more importantly, the format:

Here’s where you get a problem. If you select TIFF, you’ll get a .tif file, but the resolution will be basically the same as what you see on your screen, like this:

Ideally, LibreOffice would ask you what DPI and resolution you want once you select the TIFF format and would then export the chart in that resolution and you’d be done in one simple step. Alas, that’s not an option when you export from LibreOffice Calc.

What you can do instead is copy your chart, open an empty LibreOffice Writer document, and paste it into the document, like this:

Then, go up to File -> Export, like this:

You’ll get the same prompt as before asking what you want to name the file and format. Name the file and select PNG format then click “Save.” What you’re looking for is the window that pops up next:

In this window, you can change the DPI to 300 (do this first) and then change the width and height (they are typically linked, so, if you change one, the other automatically changes). When you’re done, click “OK.” The file you’ll get will be 300 DPI and whatever pixels you chose:

Now, open that file with any image editing software (I’m using Gwenview on KDE for this example) and simply select File->Save As:

Now select the TIFF format. Once you save it, you’ll have a TIFF file with the proper DPI and resolution per the publisher’s instructions. The resulting TIFF file will be huge, but it will meet the criteria of the publisher:

NOTE:

The other way to do this is to copy your chart into a LibreOffice Draw file that has been modified with a huge area (e.g., 4000×4000 pixels). You can then expand your chart to file the area in the LibreOffice Draw document and then export the image. However, depending on the original format of your chart/graph, you may have to resize the text if you do this, which is a pain. However, this will give you a much larger image file. But the approach above is much easier.

The tutorial above used LibreOffice 6.4.4.2.

 511 total views,  13 views today

Linux – Video Tag Editing

Not everyone may be as particular as I am about having my files organized, but I like to make sure everything is where it’s supposed to be. I make sure my music is tagged accurately. I also like to have my video files tagged correctly. What does that mean? Just like with audio files, video container formats include as part of the file some tags that provide information about the file. Those tags can include the name of the video, the year, and other information (e.g., genre, performers, etc.). If you rip files or have digital copies, it’s not really necessary to update the information in the tags. However, depending on the software you use to play your video files, having that information included in the tags substantially increases the odds that your video player will be able to figure out what the video is and will then be able to retrieve any other relevant data. Thus, having accurate metadata in your video files is nice. It’s not necessary, but nice.

I was cleaning up some video files the other data and realized that I didn’t have accurate tags in some of them. I opened the video in VLC and then clicked on “Tools” -> “Media Information”:

I wanted to see the tags in the video file.

Here’s what VLC saw:

Yep, I’m working with Frozen!

As you can see, it didn’t have any tags filled except “Encoded by.” It actually filled the title by pulling the name of the video file itself. The minimum tags that should be included in a video file are: title and year, but including genre and some of the performers is always nice.

While there are a number of music file tag editors that work very well on Linux (e.g., Picard), I have struggled to find a good video metatag editor for Linux. I had one that was working for a while, Puddletag, which actually worked quite well even though it only billed itself as a tag editor for music files. However, Puddletag does not appear to be maintained anymore and, as of Kubuntu 20.04, it is no longer in Ubuntu’s repositories and the PPA does not contain the correct release file. I could try building it from source, but I wanted to see if there was a good alternative.

After googling around, I found one that seems to work quite well – Tag Editor. (You have to love the Linux community: call the software exactly what it does!) Here’s the GitHub site. And here’s where you can download an AppImage (I went with “tageditor-latest-x86_64.AppImage”), which worked great on Kubuntu 20.04.

Once you’ve downloaded the AppImage, you can set it to be executable (right-click and select “properties” then, on the “permissions” tab, select “executable”) or just double-click it and allow it to be executed. It should load.

In the left pane, navigate to your video file:

Once you find the file, you can see all of the tags that can be edited. Fill in the information:

Once you’ve filled in the tags you want to add or modify, click on “Save” at the bottom of the screen:

I particularly like this next feature. Once you click save, it shows the progress and actually tells you what stage it is at in saving the tags in the file:

Progress is in the circle with robust information on what it is doing next to it.

Tag Editor also does something that I actually questioned at first until it saved my bacon – it makes a backup of the file before it writes the new file. The backup file is named the same as the original file but with a new file extension: “.bak”.

You can see the backup copy of Frozen (“Frozen.m4v.bak”) just below the updated copy.

I initially thought this was just going to be annoying as I’d have to go through and delete all the backup copies once I was done. However, I did run into a couple of files that, for whatever reason, could not be modified. Partway through the tag saving process, I got an error message. Sure enough, Tag Editor, in writing the file, had stopped midway through. If a backup file wasn’t made, I would have lost the video. I don’t know exactly what caused the errors, but I quickly learned to appreciate this feature.

Just to illustrate that the tags were updated, I opened the new file in VLC and went back to the media information:

As you can see, the Title, Date, and Genre fields are now filled with accurate information.

Unlike, say, mp3 audio files, video files can take quite some time to update because the file has to be re-written. With a very fast computer, this won’t take an exorbitant amount of time. But it is a much lengthier process than updating tags in mp3 audio files.

 1,283 total views,  15 views today

LibreOffice 6.4.3.2 – Not Showing Greek Letters/Symbols

I ran into an issue the other day that ended up taking me hours to solve, in part because I couldn’t find any other solutions online, which is pretty unusual these days.

Here was the issue: I was evaluating a paper (I’m an academic and read lots of papers) that had a bunch of Greek letters/symbols in it as part of a regression formula. On my computer running Kubuntu 19.10 with LibreOffice 6.3, the Greek letters showed up perfectly fine. On my laptop, which I had just reformatted and on which was a fresh install of Kubuntu 20.04 with Libreoffice 6.4.3.2, the Greek letters were all showing up as something other than Greek letters – odd symbols or dingbats or something. Here’s the version number from a fresh install of Kubuntu 20.04:

And here’s what was being displayed in LibreOffice with the document:

Those familiar with the Greek alphabet will clearly see that these odd dingbats or symbols are definitely not from the Greek alphabet.

I spent about three hours googling for a solution and trying various suggestions. Google is usually a Linux user’s best friend and it’s common that someone else has had the same issue or something similar. Alas, no luck this time. No one, as far as I could tell, had run into this exact issue before. The closest problems seemed to suggest that the problem wasn’t with LibreOffice but with my Linux installation and that I was missing some language packs. Specifically, these semi-related issues suggested I needed to install a language pack with Cyrillic characters. This suggestion seemed reasonable as this version of LibreOffice didn’t seem to ship with support for Cyrillic characters:

Screenshot from LibreOffice for inserting special characters; Greek is not included by default.

I installed a Cyrillic language package from the repositories and restarted my computer. Nothing. I was still getting dingbats instead of Greek letters. I tried about 10 more Cyrillic language packages thinking that maybe I hadn’t found just the right one, searching through the repositories for anything that mentioned Greek or Cyrillic. Haphazardly adding language packages doesn’t seem like a good approach, but I was getting desperate. Even so, it didn’t help. I still couldn’t display the Greek letters in the document.

Next, I tried uninstalling and reinstalling the same version of LibreOffice – 6.4.3.2, which is the version shipping with Kubuntu 20.04. That didn’t work.

After a couple of hours and no solution, I decided that I’d try a different version of LibreOffice. On their website, LibreOffice makes two additional release candidates or development versions available. I could have gone straight to 7.0.0, which was in Alpha, but I opted instead for version 6.4.4.2. To uninstall LibreOffice, I used the following commands (see here):

sudo apt-get remove --purge libreoffice*
sudo apt-get clean
sudo apt-get autoremove

To install the new version, you have to untar the files you downloaded then navigate to the DEBS folder you just unpacked, then run the following:

sudo dpkg -i *.deb

After installing LibreOffice 6.4.4.2, I opened the file that was having issues and, lo and behold, it worked just fine:

There are my lovely alphas, betas, sigmas, epsilons, and omegas!

I’m assuming this is a bug in LibreOffice 6.4.3.2 or, at a minimum, the folks who packaged that version left something out of it. Either way, I was frustrated enough at the end that I realized I needed to post a solution for others who may run into this. Since Ubuntu/Kubuntu 20.04 is an LTS (long-term support) release, having a serious bug shipping in the included version of LibreOffice is, no doubt, going to frustrate many users.

I spent a solid three hours on something that was working perfectly fine in LibreOffice 6.3 but broken in 6.4.3.2. That’s annoying. I’m a huge fan of LibreOffice and prefer it far and above MS Office. It’s mature enough software now that little regressions like this really shouldn’t happen.

 1,857 total views,  14 views today

Plex on Linux – Video Files Not Detected

I added a number of video files to my Plex server the other day and, when I checked Plex, some of them had not shown up in the corresponding library. I tried the obvious solutions. First, I selected the options for the library and then chose “Scan Library Files”:

That will often solve the problem, but it didn’t. Then I went for the bigger ask for my Plex server and selected “Manage Library -> Refresh all Metadata”:

That didn’t solve the problem either. Since my Plex server is on Linux, it took me a minute to think it through, but I wondered if the files I had put into the library had the appropriate permissions for Plex.

(Quick aside for those not used to Linux permissions. All files and folders on Linux have permissions assigned to them that dictate what can and cannot be done with them. Basically, it’s a 3×3 set of permissions. There are three options for what can be done with a file: Read, Write, Execute. Then there are three categories of those who can interface with the file: Owner, Group, Others. Thus, you can set the Owner to be able to Read, Write, and Execute a file while not allowing the Group or Others to do the same. Any combination of these permissions is theoretically possible.)

A quick check of the files on my Plex server showed that, indeed, some of the files had permissions settings that were likely interfering with Plex’s ability to index the files:

In the image above, you can see that the permissions for the two lower files (the first and second half of the Sevilla vs CFR Cluj game) are 600 with me as the owner and not “plex.”

My immediate response was to change the permissions to make them fully accessible to make sure that Plex could read them. To do that, I used the following command:

sudo chmod 777 -R /plexserver/videos/newfiles

Security gurus will freak out about this as I basically made those files accessible with no restrictions whatsoever. But, it did solve the problem with Plex. As soon as I changed the permissions, Plex was able to detect and index the files. However, that’s not best Linux security practice.

The general rule of thumb for Linux permissions is that you should grant sufficient permissions to do what you need but should never grant more lenient permissions than you need to. It turns out, Plex has a very nice article on Linux permissions. Based on that article, the command I should have used for those files was:

sudo chmod 644 -R /plexserver/videos/newfiles

Once I changed the permissions, my Plex server was able to find and index the file.

Technically, what I should probably do is make the user “plex” an owner of the files, which would then allow me to keep the permissions as restrictive as possible. That is done with the “chown” command. If I did that, I could simply give the plex user ownership and then leave the permissions such that the owner can read and write to the file (so, 600). Both of these options actually work, with the first being more permissive than the second. But, you can see with my files that I set one to 644 with me as the owner and another at 600 with plex as the owner:

And, in this screenshot, you can see that Plex was able to recognize them both and index them since it now has “read” permissions for the file:

So, what is the best approach here? If you’re lazy, you could set all the permissions to 777. That gives Plex (and everyone else) complete access to all your media files. If you want to be somewhat restrictive, you could set the permissions for media files in Plex to 644, which gives the owner read/write access and the plex user, if it is not an owner of the file, read access. If you want to be more secure, you could set the permissions to 600 and set the plex user as an owner of the file, which would restrict the permissions for the file to read/write for the owners and no access for everyone else.

 2,494 total views,  7 views today

Plex – Sports Videos Library

I use Plex to manage my music and video libraries. I actually don’t watch sports very often. The one exception is when I’m grading papers (I’m a college professor). I’ve found that watching soccer/futbol matches in the background while I grade papers breaks up the monotony of grading. With finals coming up, I thought it would be a good idea to record a few games so I had about 10 hours of soccer matches to watch while I grade papers. But I also realized that I wouldn’t remember which matches I had watched, how far into them I was, and I might want to watch some on my TV and others on my computer. Thus, why not put the matches on Plex?

That’s when I realized that Plex doesn’t really have a way to organize sports events. Plex is remarkably good at pulling the relevant information for movies and TV shows (I actually use tinyMediaManager to do the renaming and organizing for movies and TV shows, then put them into the respective Plex folders, which works extremely well). But Plex doesn’t have built-in functionality for recognizing sports events. That, in itself, isn’t a problem. I just need it to recognize the files in a library and keep track of what I’ve watched and what I haven’t. So, here’s how I organized the files.

I created a new top-level folder next to the same folder where I store my movies and TV shows that I called “sports”:

Inside, I created a separate folder for the league I wanted to watch – English Premier League, UEFA Europa League, etc. If I was planning on keeping the games after I watched them, I would have added a folder below that for the year, but I delete the recorded games after I watch them. So, the folder structure looks like this:

I then named the files as follows: [DATE]-[TEAM1 VS TEAM2]. This structure is visible in the above image.

In Plex, click on settings:

Scroll down to “MANAGE” Libraries and click on it:

Click on ADD LIBRARY

In the window that pops up, select “Other Videos.” That lets Plex know that it doesn’t need to try to retrieve metadata for the videos (this is also the option I choose for my home movies):

Name the folder. I called mine “sports”:

Click “Next” then find the top-level folder you created earlier:

Once you’ve found the folder, you’re ready to click ADD LIBRARY.

This tutorial was done using Plex 4.32.1. With that version, you have the option of pinning libraries to your home screen. I went ahead and pinned sports to my home screen so I can see it quickly:

Click on the library and you should see a list of all the sports videos you have in the library:

As you can see in the image above, I had started watching one of the games when I made this tutorial. This is why using Plex to watch the games is so nice – it keeps track of where I was and I can switch between devices.

NOTE: Tutorial created using Plex version 4.32.1.

 2,782 total views,  12 views today

LibreOffice Calc: Graphs with Two y-axes with Different Scales

While a bit technical, it’s occasionally useful to plot multiple data series that have very different scales in the same chart. Let me give an example to illustrate. Let’s say I want to see whether the number of Mormon temples being built aligns with the number of Mormon stakes (akin to a Catholic diocese) that are organized over time. (I’m a sociologist who studies religion; you’ll just have to go with my examples.)

However, the number of Mormon temples is in the hundreds while the number of Mormon stakes is in the thousands. If I plot them both on the same chart with the same y-axis (that’s the vertical axis), the number of Mormon temples is going to look really small and I won’t be able to see the variation over time in the number of temples, like this:

The chart shows that stakes have increased, but it looks like the number of temples has barely moved. LibreOffice Calc automatically creates the scale used for the y-axis based on the scale of the larger of the two data series, in this case, the number of stakes. Thus, the maximum value is 4,000 and the minimum is 0. What I want to do in this tutorial is to illustrate how to add a second y-axis on the right side of the chart that uses a different scale that is more appropriate for the number of temples.

To begin with, go ahead and create your chart with at least two data series, as I have shown in other tutorials, like this one. Once you have your chart with two data series complete, now it’s time to add a second y-axis with a different scale.

First, click on your chart then double-click it to open chart editing. Then, select the chart area by clicking on one of the axes (left or right doesn’t matter) and then right-click it. You’ll get a context menu with the option “Insert/Delete axes…” Select that:

In the window that pops up, you’ll see a second column labeled “Secondary Axes.” You want to select “Y axis.”

Click “OK” and you’ll see that a second y-axis has been added to your chart on the right side using the same metric as the left side:

The next steps are pretty straightforward, but before you do them, you should pause and think for a second so you don’t have to go back and undo what you’re about to do. You’re going to change the scale of one of the two y-axes, but which axis do you want to change? There isn’t a right or wrong answer here. Generally speaking, I typically see charts like this with the smaller of the two ranges assigned to the left axis and the larger assigned to the right axis, but, again, it is entirely up to you which way you choose to go. At this point, though, you need to make a decision. Then you can move to the next step.

I’m going to follow my suggestion above and change the y-axis on the left to a scale that fits with the number of temples (so, a smaller range of values) and keep the y-axis on the right with the larger range for the number of stakes. But before I change the scales of the axes, I need to tell LibreOffice which data series is going to align with which axis. Here’s how. Click on one of your data series lines, then right-click it and select “Format Data Series.”

In the window that pops up, you’ll see on the “Options” tab right at the top an option that says, “Align Data Series to” and then “Primary Y axis” (this is the one on the left of the chart) or “Secondary Y axis” (this is the one on the right of the chart). Since I selected the number of temples first, I’m going to leave that one aligned to the Primary Y axis:

Hit OK. Then select the other line (in my case, the number of stakes), right-click it, and select “Format Data Series.” On the “Options” tab, I’m going to select to align this line with the “Secondary Y axis”:

Once you do that, you’ll see that LibreOffice automatically adjusts the scale of the other axis. Here’s how my chart now looks:

You can see that it changed the scale of the Primary Y-axis (the one on the left) to a maximum of 250 to reflect the smaller range of that data series. If you want to customize the scale used, you can always click on the axis you want to modify and then right-click it and select “Format Axis”:

In the window that pops up, you can modify the scale of the axis by clicking on the “Scale” tab. If you want to change the values, click on the box next to “Automatic” to unselect it so you can put in your own values, then customize the value you add, like this:

When you have modified the scale to your satisfaction, select “OK” and your graph will be updated with the scale you want, like this:

The resulting chart now has two axes with different scales. It would be a good idea at this point to label the axes to reflect the differences. Simply right-click on the chart and select “Insert Titles.” In that window, add appropriate titles. The left y-axis is simply the Axes while the right y-axis is considered the “Secondary Axes”:

And your final graph will look something like this:

That’s how you can create a chart with two axes in LibreOffice Calc.

NOTE: This example was done in LibreOffice Calc version: 6.4.2.2 on a Linux-based operating system (Kubuntu 19.10).

 3,782 total views,  21 views today

LibreOffice Calc: Interpolating Missing Values in Graphs

Here’s my situation. I have some data over time but I’m missing values in specific years. I want to graph that data but would rather not have to estimate all of the missing values. It turns out, LibreOffice Calc can do that for you in your chart. Here’s how…

Imagine I’m plotting the number of congregations in the LDS Church over time (weird example, I’m sure you’re thinking, but I’m a sociologist who studies religion, so, yeah, that’s what I do). I have the number of congregations in 1841, 1849, 1901, etc. Basically, I have the number in certain years, but I’m missing the number of congregations in lots of other years. I could interpolate the missing values (Excel has this function built in; LibreOffice Calc does not, but you can do it following the approach I have detailed here). But, I don’t really need to do that for my project. I just need a chart that shows the growth of congregations over time.

My data are organized into two columns. Column A is years and ranges from 1841 through 2019. Column B is the number of congregations with the values I have and lots of blank cells:

Select the cells you want to plot (A1:B176 in my case) then click on “Insert Chart”:

You’ll get this window:

Since I want a Line chart, I’m going to select “Line” and because I want “points and lines,” I’m going to select that option as well. I also want “Smooth” lines rather than “Straight” lines, so I select that option, too:

Click “Next >” at the bottom. Since you already selected your Data range, you shouldn’t have to change that. However, we do want the “First column as label” for the x-axis of the chart. So, select that option:

Then select “Next >”. You shouldn’t have to change anything on the Data Series tab, so you can hit “Next >” again. On the Chart Elements tab, you’ll want to describe your chart elements. Add a Title and label your x-axis and y-axis. I also didn’t need a legend since I’m only plotting one data series, so I turned that off:

Then click “Finish.” You’ll have a chart, but it only has the points for the years when you have data, like this:

To add a line connecting the points and interpolating the missing data, click on the chart, then double-click it to modify the chart. Once you’re inside the chart, click on one of the points to select the data series, then right-click and select “Format data series”:

On the “Options” tab you’ll see “Plot Options” and just below that, “Plot missing values.” The default is “Leave gap.” Select “Continue line” and it will interpolate the missing values for you:

Select “Ok” and your line chart will now actually have a line, like this:

There you have it. A line chart with interpolated missing values in LibreOffice Calc without you having to calculate all of the missing values.

NOTE: This example was done in LibreOffice Calc version: 6.4.2.2 on a Linux-based operating system (Kubuntu 19.10).

 2,782 total views,  21 views today