Skip to content

Instantly share code, notes, and snippets.

View klingtnet's full-sized avatar
a damn fine cup of coffee

Andreas Linz klingtnet

a damn fine cup of coffee
View GitHub Profile
@klingtnet
klingtnet / how-to-run-melodics-on-linux-using-wine.md
Created February 25, 2018 17:02
How to run melodics on Linux using Wine

How to run melodics on Linux using Wine

export PULSE_LATENCY_MSEC=5\
    && export WINEPREFIX="/home/alinz/.wine"\
    && wine "$USER/.wine/dosdevices/c:/Program Files/Melodics/Melodics.exe"
@klingtnet
klingtnet / rclone-galcier-type-scaleway-backup-restore.md
Created August 14, 2021 10:59
A note on restoring glacier type backups with rclone and scaleway

Restoring backups with rclone that are stored as [C14/Glacier cold storage][glacier] on Scaleway will fail with Failed to copy: failed to open source object: AccessDenied: Access Denied..

# create backup
$ rclone --s3-storage-class=GLACIER sync backup/ scaleway-encrypted:
...
# try to restore
$ rclone --s3-storage-class=GLACIER sync scaleway-encrypted: backup/
Failed to copy: failed to open source object: AccessDenied: Access Denied.
...
@klingtnet
klingtnet / firewire-audio-interface-jack2-linux.md
Last active November 16, 2023 09:38
Use firewire audio interface with JACK2 in Arch Linux
  • Blacklist firewire sound kernel modules to prevent ALSA and PulseAudio from managing them by creating a file like /etc/modprobe.d/blacklist-snd-firewire.conf:
# This fixes the usage of firewire soundcards with Jack by
# preventing ALSA from handling the device.
# Only modules used for the Edirol FA-66 are blacklisted.
#
# For details refer to:
# https://wiki.archlinux.org/index.php/JACK_Audio_Connection_Kit
# https://github.com/takaswie/snd-firewire-improve/blob/315dcdc4e430d44a6e109a015beecb8515fbe634/sound/firewire/Kconfig
@klingtnet
klingtnet / how-to-upgrade-nvmw-ssd-firmware-on-linux.md
Last active September 16, 2023 23:37
How to upgrade [Lenovo] NVMe SSD firmware on Linux

The instructions were tested on a Lenovo X1 Carbon 5th Gen (X1C5) on Arch Linux but should be applicable to other Lenovo models and Linux distributions.

BACKUP YOUR DATA! I created a bootable Ubuntu Image like this:

$ sudo sh -c 'curl --location --silent --fail "http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso" | pv > /dev/<your-usb-drive>'
# note that pv is only there to show progress, it is perfectly fine to redirect curl to the usb drive directly.

then I booted from this drive by pressing F12 on reboot and dumped my NVMe disk to an external hard drive like this:

@klingtnet
klingtnet / how-to-switch-from-grub2-to-systemd-boot-for-lvm_luks-systems.md
Last active June 15, 2023 06:46
How to switch from GRUB2 to systemd-boot for LVM/LUKS systems

How to switch from GRUB2 to systemd-boot (Arch Linux)

$ sudo su
$ bootctl install
$ cat <<EOF>/boot/loader/loader.conf
#https://wiki.archlinux.org/index.php/Systemd-boot#Configuration

# menu timeout
timeout 3
@klingtnet
klingtnet / enable-hibernate-arch-linux.md
Created November 22, 2016 17:23
Enable hiberate in Arch Linux usind kernel 4+, grub2 and a swapfile

This guide is based on the hibernate article from the Arch wiki.

  • edit /etc/default/grub and add resume as well as resume_offset kernel parameters
    • resume=UUID=abcd-efgh contains the UUID of the partition on which the swapfile resides. In most cases the swapfile resides in root, to identify the root parition's UUID run blkid or lsblk -O.
    • resume_offset=1234 is the offset of the swapfile from the partition start. The offset is the first entry in the physical_offset column of the output of filefrag -v /swapfile.
    • update grub: grub-mkconfig -o /boot/grub/grub.cfg
    • example: GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=75972c96-f909-4419-aba4-80c1b74bd605 resume_offset=1492992"
  • add the resume module hook to /etc/mkinitcpio.conf:
    • HOOKS="base udev resume autodetect ...
  • rebuild the initramfs mkinitcpio -p linux
  • Most information was taken from the [release notes].
  • Release is schedules for February 2023. Releases happened between 16th and 25th in the past, so I assume that 1.20 will be released end of February as well.

Context

Package context received WithCancelCause which allows to cancel a context with a given error. This is pretty nice to have something more meaningful than the usual context.Canceled error, that won't tell you anything about why something got canceled. (playground)

Errors

@klingtnet
klingtnet / ryzen-random-reboots-fix.md
Last active November 22, 2022 07:59
Ryzen Linux random reboots in idle state

My Ryzen 7 3700X desktop machine had random reboots when in idle. Stress tests worked fine over many hours, no problem there. There's a Gentoo Wiki entry that recommends to set idle=nomwait and processor.max_cstate=5. For me, it did not work and neither did the tips from this kernel Bug report. Those random reboots disappeared after I reset my BIOS to optimized factory defaults. The only change I apply to those factory defaults is to apply the XMP profile of memory modules. It turned out that, if the XMP settings were applied, the random reboot appeared again. Luckily i stumbled over this linustechtips forum thread where someone said that power down mode needs to be disabled. Someone else said that they fixed this issue by setting the RAM voltage to 1.36V instead of 1.35V. Anyways, disabling _power down mod

@klingtnet
klingtnet / pipewire-on-arch-linux-gnome.md
Last active September 11, 2022 18:35
Pipewire on Arch Linux (Gnome)

Those are the only instructions I need to run to have a fully working Pipewire setup that is compatible with PulseAudio, Jack and ALSA:

$ yay -Rcns pulseaudio-jack
# note that pipewire-jack-dropin is an AUR package
$ yay -S pipewire-{jack,jack-dropin,alsa,pulse}
$ systemctl --user enable pipewire pipewire-pulse pipewire-media-session
$ systemctl reboot
# done
@klingtnet
klingtnet / how-to-remove-bloatware-from-android-without-root-using-adb-only.md
Created July 27, 2019 11:10
How to remove bloatware from android without root using adb only

How to remove bloatware from android without root using adb only

  1. Make sure that USB debugging is enabled.
  2. Deactivate all bloatware apps.
  3. List the names of all deactivated packages:
$ adb shell pm list packages -d