Articles

Linux desktop and shell tips: Fedora, zsh, Midnight Commander, KVM

· 1 min readlinuxzshmcsoftdevel

Fedora / GNOME

Decimal period instead of comma on the numpad

gsettings set org.gnome.desktop.input-sources xkb-options "['kpdl:comma']"

Source: askubuntu.com

Clean up /var/cache/PackageKit

sudo pkcon refresh force -c -1

Better font rendering in Firefox

Create ~/.fonts.conf with the configuration from this StackExchange answer.

Back up an SD card

  1. Insert the card.
  2. Find its device name: fdisk -l, lsblk, df.
  3. Unmount it from the terminal (not with the eject button in Nautilus): umount /dev/sdb1
  4. Copy the whole card to an image file:
dd bs=4M if=/dev/sdb of=nextcloud210313.img

KVM snapshots

Inside the virsh shell:

snapshot-create-as --domain f20 --name 'f20-spice'
snapshot-list f20
snapshot-revert f20 --snapshotname f20-spice

For better integration of Windows guests: spice-guest-tools

Resize all images in a directory

With ImageMagick, to 500 px wide (overwrites the files):

for file in *.jpeg; do convert $file -resize 500x $file; done

Show the hostname in the zsh prompt

Add to ~/.zshrc, on the right side:

export RPROMPT="%m"

or at the beginning of the prompt:

PROMPT="%m $PROMPT"

Midnight Commander

Use your own editor and viewer

Set the system default editor:

sudo update-alternatives --config editor

or turn off Configuration > Builtin editor and viewer in mc and add to ~/.zshrc:

export EDITOR=nvim
export VIEWER=nvim

Open files with the default macOS application

In the mc extension file:

regex/\.(.*)$
    Open=(open %f &)

Vim: replace in the whole file

:%s/foo/bar/g

All articles

See also

linuxsoftdevel

Linux server administration: a practical cheatsheet

Security checks, certificates, scheduled jobs, disks and backups, network diagnostics and basic system configuration — commands I use on Linux servers.

ovhlinuxsoftdevel

OVH Public Cloud: moving instances, adding disks and swapping the gateway

Moving virtual servers with the OpenStack client, attaching a new block storage disk, and replacing the private network gateway when the public IP is blacklisted.

softdevelPL

Notuj swobodnie, niech AI zadba o resztę

Od zawsze, im więcej notowałem, tym mniej użyteczny stawał się mój notes, czy to papierowy, czy elektroniczny.