Archive for *nix

ALT Linux realtime kernel

https://www.altlinux.org/Kernel/build_unpackaged
https://www.altlinux.org/Kernel/getting_sources
https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/preemptrt_setup
https://wiki.linuxaudio.org/wiki/system_configuration

5.10:
git clone -n -o gears/std-def https://git.altlinux.org/gears/k/kernel-image-std-def.git linux-rt
git checkout tags/v5.10.192
xzcat ../patch-5.10.192-rt92.patch.xz | patch -p1

6.4:
git clone -n -o gears/un-def https://git.altlinux.org/gears/k/kernel-image-un-def.git linux-rt
git checkout tags/kernel-image-un-def-6.4.6-alt1
xzcat ../patch-6.4.6-rt8.patch.xz | patch -p1
make mrproper
scripts/kconfig/merge_config.sh -m config config-$HOSTTYPE config-std
make olddefconfig
Activate “Fully Preemptible Kernel (Real-Time)” option from “General setup” / “Preemption Model” then SAVE and EXIT.

Btrfs create snapshot and send | receive to backup

btrfs subvolume snapshot -r @astralinux @astralinux_ro
btrfs send /mnt/btrfs/@astralinux_ro | btrfs receive /mnt/flash
btrfs subvolume snapshot /mnt/flash/@astralinux_ro /mnt/flash/@astralinux
btrfs property set -f -ts /mnt/btrfs/@astralinux_ro ro false
btrfs property set -f -ts /mnt/flash/@astralinux_ro ro false
rm -rf /mnt/btrfs/@astralinux_ro
rm -rf /mnt/flash/@astralinux_ro

RSYNC — клонирование системы

rsync -vaHAXS --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/lost+found"} -e ssh root@192.168.x.x:/ /mnt

rsync -aHAXS SOURCE_DIR DESTINATION_DIR

-H, --hard-links      preserve hard links
-A, --acls            preserve ACLs (implies -p)
-X, --xattrs          preserve extended attributes
-S, --sparse          handle sparse files efficiently

OpenWrt links

https://openwrt.org/toh/tp-link/archer_c5_v4

Корневая файловая система на внешнем устройстве (extroot)

https://athunder.livejournal.com/646951.html

No icons in skrooge (ALT Linux)

sudo apt-get install qt5ct
sudo apt-get install icon-theme-breeze

Далее настроить тему в qt5ct

Cisco IOU on ALT Linux

https://linux-faq.ru/page/komanda-hostid

Нужно создать /etc/hostid -> genhostid.py

#!/usr/bin/python
 
from sys import argv, exit
from struct import pack
 
filename = "/etc/hostid"
 
if len(argv) != 2:
    print("Usage: genhostid.py <hostid>")
    exit(1)
 
if argv[1].startswith("0x"):
    hostid = int(argv[1][2:], 16)
else:
    hostid = int(argv[1])
 
hostid = pack("I", hostid)
open(filename,"wb").write(hostid)

$ sudo python genhostid.py 0x00010203

Далее CiscoIOUKeygen3f.py

pidof / killall in OpenBSD

# cat /sbin/pidof
#!/bin/sh
ps axc -o pid,command | awk "/`echo $1`/ {print \$1}"

# cat /sbin/killall
#!/bin/sh
kill `/sbin/pidof $1`

https://misc.openbsd.narkive.com/Bj3bNWTv/reason-against-pidof-killall

Бекап диска в Linux

Бекап:

sudo sh -c "dd if=/dev/nvme0n1 status=progress | xz -T0 -c > /mnt/Win10_21H2_Russian_x64.img.xz"

Восстановление:

sudo sh -c "xz -T0 -d -c /mnt/Win10_21H2_Russian_x64.img.xz | dd of=/dev/nvme0n1 status=progress"

Upgrade Ampache

https://github-wiki-see.page/m/ampache/ampache/wiki/Upgrade

How To Configure Seafile Server on Debian 11 / Debian 10

https://techviewleo.com/how-to-configure-seafile-server-on-debian/