Click here for archives 2005-2019

Decompress files — unp seems to do what dtrx did

Published: Wed Feb 01 2023 00:00:00 GMT+0000 (Coordinated Universal Time)

Had some files that needed unpacking and was reaching for dtrx, but wasn't installed and also not in the Ubuntu repos. Found unp which seems to do more or less the same thing. Haven't tried it on zip files to unzip, tarballs, 7zip or other stuff yet though. Just .xz .

https://unix.stackexchange.com/questions/436984/decompressing-archive-to-a-single-folder


Getting gratis DaVinci Resolve 18.0 to work on Ubuntu 22.04

Published: Sun Jan 29 2023 00:00:00 GMT+0000 (Coordinated Universal Time)

Video formats

The final thing that made it work was realising that not all video formats are accepted by the free version. It will happily import them, but they can not be dragged on to the time line. Or if you succeed in creating a new timeline with them on, nothing is played as the play head traverses through them. This ffmpeg script seems to work to convert files:

ffmpeg -i infile.mp4 -vcodec mjpeg -q:v 2 -acodec pcm_s16be -q:a 0 -f mov outfile.mov

Described here: https://www.reddit.com/r/davinciresolve/comments/pxicvk/comment/ho2inmz/ , In fact there is listed a batch command:

mkdir transcoded; for i in *.mp4; do ffmpeg -i "$i" -vcodec mjpeg -q:v 2 -acodec pcm_s16be -q:a 0 -f mov "transcoded/${i%.*}.mov"; done

Video card always on

It seems you need an external video card to run Resolve too, and the card must be active when running the installation script. Or you will get missing license key once you run the application with the graphics card.

Not that there comes any license key with the free version.

In order to switch to the card being always on I used the nvidia-settings app. I tried to do it also with some CLI command but it did not seem to stick.


Disable middle click actions from the mouse in Ubuntu 22.10

Published: Sun Dec 25 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Summary: No system wide setting has worked for me so far. You can open about:config in Firefox, search for "middle" and set to false as much as you can find there. In VS code you can search for "editor.selectionClipboard" and set it to false.

A dodgy mouse keeps middle clicking when the scroll wheel is used. This lead to a flurry of new tabs in Firefox and text all over the place in VS Code.

See: https://askubuntu.com/questions/1419274/middle-click-paste-disable for the VS Code setting.


How to install Chromium with apt-get on Ubuntu so you can use extensions that need to reach out

Published: Sun Dec 25 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Summary: Use a repository from the Linux Mint distribution. Promote chromium there and demote everything else from that Mint repository.Mint is like Ubuntu, but have decided to not go down the snap path.

Instructions

The instructions are copied from here with very light editing such as a newer Mint (una → vera) https://askubuntu.com/questions/1386738/how-to-install-chromium-from-the-linux-mint-repositories-in-ubuntu :

Make a backup of the stuff from the snap chromium you want to keep, such as bookmarks

Uninstall snap's Chromium, and if you installed it via apt, remember to also uninstall chromium-browser there or you will get a conflict that prevents Mint's Chromium from being installed

Create an apt source file for the Mint repository:

echo "deb http://packages.linuxmint.com vera upstream" | sudo tee /etc/apt/sources.list.d/mint-vera.list

To prevent NO_PUBKEY you have to add the GPG key by this:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A1715D88E1DF1F24 40976EAF437D05B5 3B4FE6ACC0B21F32 A6616109451BBBF2

Then update package lists by apt: sudo apt update

Prevent installation of other packages by pin-file:

cat <<EOF | sudo tee /etc/apt/preferences.d/pin-chromium
Package: *
Pin: release o=linuxmint
Pin-Priority: -1
Package: chromium
Pin: release o=linuxmint
Pin-Priority: 1000
EOF

Install chromium:

sudo apt install chromium

Snap will be able to do it in the future

Some browser extensions cannot work with snap versions of Firefox and Chromium and snap is what Ubuntu offers nowadays. The snap people are working on making extensions that need to communicate outside the sandbox to work in both in Firefox and Chromium, and it seems they have a solution you can use for Firefox, if you snap install firefox-beta. Untested by me. Once they get the irons wrinkled out as one says, they will make this work for Firefox normal and for Chromium.

See: https://www.omgubuntu.co.uk/2022/07/ubuntu-devs-fix-another-frustrating-firefox-snap-flaw

A proxy server inside of the Chromium snap

You could conceivable get some glue to work inside the snap for e.g. Chromium, similar to this guide for Firefox and Flatpak:

https://discourse.flathub.org/t/how-to-run-firefox-and-keepassxc-in-a-flatpak-and-get-the-keepassxc-browser-add-on-to-work/437

In that case you'd put a proxy binary inside the snap and some JSON for the browser.


If Ubuntu Linux on the desktop was a car

Published: Sun Dec 25 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

If Ubuntu Linux on the desktop was a car

Today when I went out to the garage, two wheels were missing from the car. After some searching it turned out to be a conflict between the mechanic and the guy who changes the wheels to winter tyres. I pinned the mechanic to the ground and praised the tyre guy a 1000 times, and the wheels snapped on again.

A security update (UPS update) had disabled old unsafe driving modes such as driving in reverse. It was just a question of going under the engine hood to file off two serial numbers and I could after a restart, back out of the garage.

The car keeps middle-honking when I turn the steering wheel but there is no workaround as of right now.


How to know if your Linux machine is on 5GHz WiFi and what channel

Published: Fri Dec 09 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

In a terminal, just issue:

iwconfig

And for one network interface you will get something like this, where "5.18GHz" indicates you're on the higher band:

wlp1s0    IEEE 802.11  ESSID:"My dual band WiFi"  
      Mode:Managed  Frequency:5.18 GHz  Access Point: FF:FF:FF:FF:FF:FF   
      Bit Rate=6 Mb/s   Tx-Power=20 dBm   
      Retry short limit:7   RTS thr:off   Fragment thr:off
      Power Management:on
      Link Quality=51/70  Signal level=-59 dBm  
      Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
      Tx excessive retries:0  Invalid misc:0   Missed beacon:0

If you want to know what channel you're on you can install the iw command e.g. with apt on Ubuntu and get something like this:

Interface wlp1s0
    ifindex 3
    wdev 0x1
    addr ff:ff:ff:ff:ff:ff
    type managed
    wiphy 0
    channel 36 (5180 MHz), width: 80 MHz, center1: 5210 MHz
    txpower 20.00 dBm
    multicast TXQ:
        qsz-byt    qsz-pkt    flows    drops    marks    overlmt    hashcol    tx-bytes    tx-packets
        0    0    0    0    0    0    0    0        0

which indicates channel 36 in this case. But I guess that was probably obvious from the frequency anyway in the previous query?

Source: https://superuser.com/questions/485588/determine-channel-of-wireless-interface


Pipewire got the sound back for YouTube videos on Ubuntu 22.04

Published: Mon Nov 14 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Sound disappeared in Firefox sometimes and did not come back, while playing YouTube videos. Only recourse seemed to be to restart the computer! I got it back by installing a new sound system called pipewire, see instructions here: https://ubuntuhandbook.org/index.php/2022/04/pipewire-replace-pulseaudio-ubuntu-2204/

Seems to be a problem for a certain Intel chipset?

Discussion here: https://askubuntu.com/questions/1406874/youtube-freezing-videos-in-fresh-22-04-installation


encfs needs some tweaks to work on Ubuntu 22.04, better to replace it

Published: Mon Nov 14 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

encfs is an old deprecated way of encrypting a volume. It may have problems working on newer Linuxes, unless you allow OpenSSL to use old stuff. More info here: https://askubuntu.com/questions/1405656/encfs-segfault-in-version-22-04

It's better to replace encfs with something better, such as the pretty much standard luks/luks2.


Can you trust sites that furnish apks for Android?

Published: Mon Nov 14 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Well, the answer from me is that I don't know but some seem more trustworthy than others. apkmirror has a known team behind while e.g. apkpure does not. According to this comparison, apkpure has had malware included, and no one knows who's behind the site: https://www.slant.co/versus/7899/22173/~apkmirror_vs_apkpure

So if choosing between these two, https://apkmirror.com seems the better option. If it's good enough, no idea.


Got access to a luks2 encrypted USB boot drive that borked

Published: Sat Aug 20 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Preliminary notes. I wasn't exactly sure what I was doing here. Maybe it was already mounted and that was the problem. Anyway, files saved.

A USB boot disk with luks2 and LVM refused to boot. Needed to save the files from it.

I connected it to another computer.

Used this to figure out its /dev/sd(letter)(number):

sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

It was /dev/sdc6. Opened it into a logical volume name that I made up, "my_encrypted_volume":

sudo cryptsetup luksOpen /dev/sdc6 my_encrypted_volume

Made a local mount point in the home directory

mkdir -p mnt/rescue

Mounted it there:

sudo mount /dev/mapper/my_encrypted_volume mnt/rescue

And that did not work for me, it may work for you. I got an error message about:

mount: unknown filesystem type 'LVM2_member'

I figured out its LVM(?) name by issuing:

sudo pvscan

Then took that name, e.g.: "root-vg" and issued:

sudo vgchange -a n root-vg
sudo vgchange -a y root-vg

…to make Linux mark it as inactive, then active again. Got this info from this page:

https://svennd.be/mount-unknown-filesystem-type-lvm2_member/

And then it could be mounted and then accessed under $HOME/mnt/rescue. Copied files off of it with:

rsync -rh --progress mnt/rescue/path/to/files /media/username/mybackudisk/backups/

The lsblk dance I got from https://askubuntu.com/questions/182446/how-do-i-view-all-available-hdds-partitions .


Simple 3 point lighting rules for a talking head

Published: Thu Jun 09 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Simple 3 point lighting rules for a talking head. I took these from a video, published here as notes for myself only. Don't take lighting advice from me without double checking!

First light, right or left (maybe camera's left best?). 45 degree angle, a bit above the subject if you want Rembrandt's triangle. No sharp light, since it casts sharp shadows

Second light, same setup but opposite side. Less light.

Third light, directly opposite first light but higher up, out of shot.

Background should be darker on the more lit side of the face. Background overall in between the brightness of the left and right side of the face of the subject.

Background can have complement colours, each side.

Source: https://www.youtube.com/watch?v=AUmu1e78Bhk


How to make a systemd Linux check its boot disk on startup

Published: Wed Jun 01 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

To make a systemd Linux check its boot disk on startup, you provide a special boot parameter, fsck.mode=force. So in /etc/grub something like:

GRUB_CMDLINE_LINUX_DEFAULT="quiet fsck.mode=force"

And then remember to update grub.

Source: https://www.cyberciti.biz/faq/linux-force-fsck-on-the-next-reboot-or-boot-sequence/


How to get one icon per window in the Ubuntu 22.04 dock

Published: Sat May 28 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Updated 2022-11-26: What seems to work for me now on Ubuntu 22.10 is to install a Firefox extension which then smoothly and a bit worryingly integrates with gnome on my desktop.

The extension can then be installed from here: https://extensions.gnome.org/extension/1160/dash-to-panel/

Old text:

You have to download dash-to-panel. This can be done by installing gnome extensions manager from the standard repos. Then choose "Browse" and type a search string to find dash-to-panel. Nota bene that gnome extensions manager only presents the first twelve or so search results, so you've got to do a reasonably precise search.

Once installed, you can configure dash-to-panel either from gnome extensions manager or from gnome extensions app.

gnome extensions manager:

gnome extensions app (in Swedish)

In either one go to dash-to-panel's settings and under "Behavior" select "Ungroup programs" (sorry about the Swedish):

And your dock, if it's vertical will start to look like this:


Bash — How to give a file to a command without making a file

Published: Thu Apr 14 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

You can use heretext. The syntax seems to be:

commmand <<< $"file contents"

Tested by me. Or use single quotes. See: https://stackoverflow.com/questions/5852643/piping-in-on-the-command-line-simulating-a-file


Linux — How to get rid of something on screen you don't know where it comes from

Published: Tue Mar 22 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

How to get rid of something (a window) on screen you don't know where it comes from:

xprop _NET_WM_PID

This will get you the process id. At least it did for me. Use:

ps aux

plus grep to find out what the process is. Then kill.


Red light improved vision

Published: Wed Nov 24 2021 00:00:00 GMT+0000 (Coordinated Universal Time)

This is a study that brings together two phenomena that even individually I did not consider important until recently. One that the time of day could massively influence treatment, and the other that light of different frequencies can have profound effects on our cells.

In this study exposure to 670nm light once a week in the morning improved vision.

https://www.nature.com/articles/s41598-021-02311-1


A temporary diskless desktop Linux

Published: Fri Nov 19 2021 00:00:00 GMT+0000 (Coordinated Universal Time)

What if you could have a Linux desktop environment that cannot save things to disk because there is no longer any disk? This could be good for knowing that your USB boot stick remains pristine. Add "toram" to the boot parameters without the quotes.


How to shrink a bootable disk image

Published: Wed Nov 10 2021 00:00:00 GMT+0000 (Coordinated Universal Time)

This method worked for me. I had a 64GB disk image made from a botable USB stick, and I wanted to shrink it down so that it could fit on 16GB memory sticks.

https://superuser.com/questions/610819/how-to-resize-img-file-created-with-dd#comment2505407_1583784

Short summary in case of bit rot:

lsblk
sudo umount <the device from lsblk>
dd if=<the device from lsblk> of=/path/to/file/myimage.img
sudo modprobe loop
sudo losetup -f

That would give you the next free loop device number. If it were 25, then:

sudo losetup /dev/loop25 myimage.img
sudo partprobe /dev/loop25
sudo gparted /dev/loop25

Resize inside of Gparted

Then:

sudo losetup -d /dev/loop25
fdisk -l myimage.img

Check the end block and the block size from that command. If end block is 9181183 and block size is 512, then issue:

truncate --size=$[(9181183+1)*512] myimage.img

Gymnasieingenjör is "Certified upper secondary school engineer"

Published: Sun Nov 07 2021 00:00:00 GMT+0000 (Coordinated Universal Time)

A Swedish degree that I never figured out what it was called in English, apparently is supposed to be called "Certified upper secondary school engineer". So that's one for your CVs, in case you did that extra year.


And this is what solved my sound problem this time (Ubuntu)

Published: Sat Nov 06 2021 00:00:00 GMT+0000 (Coordinated Universal Time)

Pulseaudio reported a dummy device, alsamixer said there were devices, but they had no controls. Ubuntu 21.10 on a laptop with a graphics card.

Anyway, what solved it was to add this to /etc/default/grub, to the GRUB_CMDLINE_LINUX_DEFAULT line:

snd_hda_intel.dmic_detect=0

And then:

sudo grub-mkconfig -o /boot/grub/grub.cfg