Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[Mint] Transmission Remote GUI: download directory path is not absolute

Every few months, I run into this issue when adding a torrent to transgui:

Although there is a 5-year-old closed issue on this bug, which also led to a code adjustment, this bug still seems to exist: https://github.com/transmission-remote-gui/transgui/issues/1270
The user Kethsar has probably already found the right cause and gives some hints on how to solve it. At least it helped me to find a workaround:

  • close transgui if it’s running, otherwise your changes will get overwritten again
  • nano ~/.config/Transmission\ Remote\ GUI/transgui.ini
  • search for the [AddTorrent.transmission]section
  • remove some entries which a related, e.g.
Folder1=/my/path/1
FolHit1=1
FolExt1=
LastDt1=18.02.2024

Folder2=/my/path/2
FolHit2=3
FolExt2=
LastDt2=18.02.2024

...
  • save & quit nano
  • start trangui again and try to add a torrent again

It seems like the issues occurs, when the [AddTorrent.transmission] section reaches Folder50.

[Git] Branch Commands

https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging

https://git-scm.com/book/en/v2/Git-Branching-Branch-Management

# create branch, switch to it and commit changes
git checkout -b hotfix
git commit -a -m 'Commit changes for fix'

# go back to main branch
git checkout main

# merge branch changes to main
git merge hotfix

# delete branch after merging, as it is not needed anymore
git branch -d hotfix

# check on which branch your are
git status

# list all branches including last commit on each branch
git branch -vv

# check which branches are already merged and which are not
git branch --merged
git branch --no-merged

# rename branche locally
git branch --move bad-branch-name corrected-branch-name

# push new name to github/gitlab
git push --set-upstream origin corrected-branch-name

# displays local and remote branches
git branch --all

# delete remote branch
git push origin --delete bad-branch-name

# push branch to remote 
git push origin hotfix

[Linux Mint] Wemos D1 Mini (ESP8266) not recognized

I had a few D1 Minis lying around that I wanted to flash WLED onto. But when plugging into my main PC running Linux Mint 21, no device got recognized. The D1 Mini was just flashing its blue LED light 2 times and that was all. I had already checked before, whether the USB cable is also a Data Link cable, because now and then you accidentally grab a USB cable which is charging only.

Since I was pretty sure it wasn’t a hardware problem, I checked dmesg for any suspicious messages. I’m using an alias named klog to beautify the output.

sudo dmesg -t -L=never -l emerg,alert,crit,err,warn --human --nopager

And indeed there were some messages regarding USB.

usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1

Since brltty is software for people with visual impairment, I don’t need it and therefore uninstalled it.

sudo apt remove brltty
sudo apt autoclean && sudo apt autoremove

And after removing brltty, my D1 Mini got recognized immediately. Fortunately, the solution was very simple. 🙂

Update 19.01.2024: If you receive Cannot open /dev/ttyUSB0: Permission denied errors, when writing to the esp, you have to add your user to the dialout group and re-login. (*)

sudo usermod -a -G dialout $USER

[Git] Error on Windows using VSCode Dev Container

After connecting to a local dev container using Visual Studio Code and trying to clone a private project from Github I got the following error:

Cloning into 'myProject'...
warning: url has no scheme: helperselector
fatal: credential url cannot be parsed: helperselector

The only way I could remove this error was deleting the helperselector settings. So open the git config with:

git config --edit --global

and remove the the helperselector block (the first two lines). You will now get asked again for your credentials when cloning a project.

[Mint] Sharkoon PureWriter Keyboard not recognized after suspend

In January 2020 I bought a Sharkoon PureWriter Keyboard and since then I had the problem that the keyboard got not recognized after my PC (which runs on Linux Mint) was coming back from suspend mode. Back then I couldn’t find a solution and was just hoping that a newer kernel release will fix this problem in the future. But it did not. So today I was searching again and stumbled again across this post, but now I noticed the new answer from April this year. And it finally solved it!

https://askubuntu.com/questions/1044988/usb-ports-not-working-after-resume-from-sleep-on-ubuntu-18-04

First check with usbreset for the device name and then create the script under the following path:

sudo micro /lib/systemd/system-sleep/reset-keyboard 
#!/bin/sh

case $1 in
  post)
    usbreset "USB-HID Keyboard"
    ;;
esac

And as a last step we make it executable:

sudo chmod +x /lib/systemd/system-sleep/reset-keyboard

[Terminal] Using rsync with –backup and –delete together

I’m using rsync to create backups from my NAS to an external HDD. The command looks like this:

rsync -azP --delete --exclude=/.zfs -b --backup-dir=Backup /mnt/nfs/photos/ /media/nocin/externalBackup/photos/ 
rsync parameterdescription
-a –archiveThis is equivalent to -rlptgoD. It is a quick way of saying you want recursion and
want to preserve almost everything.
-z –compressWith this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted
-PThe -P option is equivalent to –partial –progress. Its purpose is to make it much easier to specify these two options for a long transfer that may be interrupted.
–deleteThis tells rsync to delete extraneous files from the receiving side (ones that aren’t on the sending side)
–excludeexclude files matching PATTERN
-b –backup-dirWith this option preexisting destination files are renamed with a ~ extension as each file is transferred. You can control where the backup file goes and what (if any) suffix gets appended using the –backup-dir and –suffix options.

But somehow it always created the Backup folder recursively again inside the Backup folder. So the first run created the /Backup folder, after the second run I’ve got /Backup/Backup, after the third run /Backup/Backup/Backup and so on..

The solution was to exclude the Backup directory using the --exclude command.

rsync -azP --delete --exclude=/.zfs --exclude=Backup -b --backup-dir=Backup /mnt/nfs/photos/ /media/nocin/externalBackup/photos/ 

I found a good explanation for this behaviour here: https://www.jveweb.net/en/archives/2011/02/using-rsync-and-cron-to-automate-incremental-backups.html

“If we are storing backups in the destination folder, or in a directory inside of the destination folder, the --delete parameter is going to delete old backups, as they are not in the source folder. Or attempt to as in the following situation:

Say, we already have a folder called backup inside of the destination directory, and we use rsync again, using --backup-dir=backup one more time. As rsync is going to attempt to delete every file and folder that is not in the source directory, it would backup the backup folder, which would create a backup folder inside our already existing backup folder, and then it would attempt to delete the backup folder and fail because it is using it to backup files.”