[-] thingsiplay@beehaw.org 1 points 5 minutes ago

Oh, I deleted my reply a while ago. But you seem to be able to see it still.

The Videos name change is meant, if I mount the folder on my drive to /home/name/Videos, then next time I mount anything to that place when replacing the drive, then /home/name/Videos will stay the same. That means any application using that path won't change. That's the majority how I use my multiple internal drives. I just mount them to fixed positions I use for decades, like in my home.

I prefer directories over partitions, because I can easily rename directories and place them to other places without ever partitioning or resizing again.

Why? Are you talking about removing the drive that contains /?

About the not being able to boot, no I don't mean the drive that contains the root /. When I mount drives with the /etc/fstab file, then the system tries to mount them on boot time. If the directory that is mounted or the drive is no longer available or I unplug it (lets say when I replace my Documents drive), then at boot time the system tries to mount something that does no longer exist in their view, according to the fstab file.

By default (at least on my current system EndevaourOS, based on Arch) the system stops booting. It gives me the option to ignore that mount entry, so I can boot again. But if I had not this option to ignore, then one has to edit the /etc/fstab file to outcomment those sections; in example with a boot cd or usb drive. Normally not a problem, but just telling it here, so in case you know what to do (if you ever go that route).

[-] thingsiplay@beehaw.org 9 points 8 hours ago* (last edited 8 hours ago)

For anyone who is not aware, Waydroid is not just an emulator, it makes Android apps seamlessly integrated into the system like local applications (obviously with limitations and only to a certain degree!).

[-] thingsiplay@beehaw.org 7 points 1 day ago

The problem with this approach is, that they get to decide who is a journalist and who is not.

[-] thingsiplay@beehaw.org 7 points 1 day ago

I don't know man, chat apps and systems like Twitter and Mastodon aren't a good place for journalism. I had to stop using both, its just full of chats and any kind of messages from all over the place, including advertisements and links and what not. Not a good place to discuss anything. To me these are just advertisement platforms.

[-] thingsiplay@beehaw.org 9 points 1 day ago

I wasn't talking about the technical implementation or differences in how they are handled, but more of a personal judgement. To me every Sponsored link is an advertisement, everywhere, not only in Firefox.

[-] thingsiplay@beehaw.org 24 points 2 days ago

At Firefox > Settings > Home turn off Sponsored Shortcuts.

[-] thingsiplay@beehaw.org 19 points 2 days ago

I just have an empty new tab page. There is no need to use about:config to set this setting. The Firefox > Settings > Home the homepage for new windows or new tabs separately. At least the recent activity for Visited pages is useful for new window. I highly recommend to Sponsored Shortcuts, which is an alternative term for advertisement. Or just turn off the Firefox Home for newtabs by setting it to Blank Page.

[-] thingsiplay@beehaw.org 13 points 2 days ago

For the language itself, maybe. But never discourage people from learning something new. He seems to be excited and has motivation. There are also lot of legacy code, which would never get ported or maintained if nobody learns the language anymore, only a few old people at that point (look what happens to COBOL).

[-] thingsiplay@beehaw.org 15 points 2 days ago

Source is the Steam hardware survey set to show Linux data only. He forgot to mention the statement is only true for Steam Gamers, not for all of Linux desktops outside of Steam.

~ https://store.steampowered.com/hwsurvey/?platform=linux

[-] thingsiplay@beehaw.org 10 points 2 days ago

Steam Deck is a desktop. It is exactly the same PC hardware and software you are using on your desktop PC. It runs the same games and is software compatible. Steam Deck is a desktop PC.

Android has a different hardware (not x86 compatible), is focused on phones, its eco system of software is not compatible with PC and in reverse does not run your PC software. Android based smartphones are not a PC.

[-] thingsiplay@beehaw.org 41 points 2 days ago

Half of the Linux machines on Steam, not the entirety of Linux.

46
submitted 5 days ago* (last edited 5 days ago) by thingsiplay@beehaw.org to c/gaming@beehaw.org

A documentary not only about how CoD 4, but how CoD came into in the first place. I'm currently a few minutes into the video and want to share it here. Documentaries by Ahoy are always enjoyable, without too much fluff and jokes. Highly recomended.

If you don't like YouTube, here is an alternate link with more privacy: https://invidious.nerdvpn.de/watch?v=FXD5_7wqr1U

Edit: Just noticed the above invidious link from the nerdvpn server is not available at the moment. Here is an alternate Invidious link from a different server: https://yewtu.be/watch?v=FXD5_7wqr1U

51
Game Recording Steam Beta (store.steampowered.com)
28
submitted 1 month ago* (last edited 1 month ago) by thingsiplay@beehaw.org to c/foss@beehaw.org

Solution: Thanks for finding the solution, kate (in the comments). The option to control this is --extractor-retries .


I recently start using SponsorBlock feature with yt-dlp . When it looks up SponsorBlock server, it tries 3 times to connect and download information. I would like to increase the retries for this specifically, but could not find the right setting or option in the manual (man yt-dlp) and help (yt-dlp --help). I would like to increase it to at least 5 or maybe even 10 retries per video.

I've noticed for sometimes it cannot login within the first 3 look ups, but when I retry the command after that it will just look up fine. Therefore an increase in the retries setting would be helpful. Especially helpful when downloading entire playlists, leaving it for some time alone.

16
submitted 1 month ago* (last edited 1 month ago) by thingsiplay@beehaw.org to c/linux@lemmy.ml

Project name is changed from "ytdl" to "yt-dlp-lemon", after user "lol" in the comments convinced me. Thank you for the suggestion! Remember to change the directory name at ~/.local/share/ytdl to ~/.local/share/yt-dlp-lemon .


The terror continues...

10 days ago I posted the initial version of this script. Since then lot of changed and added. Here some of those changes since v0.1:

  • -h is now much more simple, to see full help use -H
  • -f to repackage to another container format, or -F to force re-encoding video content with a codec to any other format
  • -s and -b will operate on sponsors only, and -S and -B on complete list of SponsorBlock segments
  • similarly -e and -d will only embed and download only a few extra metadata and files, -E and -D does all extra files and data
  • new -R will download and name files in reverse order, with index starting at 1 for the bottom file, useful for playlists who add newest entry to top
  • by default all file names are simplified and sanitized a little bit, even if no option -r (for very strict) is used

My goal is to make the usage of yt-dlp itself easier with this script, without the need to study help, the manual and to write a configuration file and a script. And you don't need to test it with various sources. It does not everything what yt-dlp offers, but most of the stuff in the way I like it.

git clone https://github.com/thingsiplay/yt-dlp-lemon
cd yt-dlp-lemon
chmod +x yt-dlp-lemon
./yt-dlp-lemon -h

Output from simple help:

$ yt-dlp-lemon -h
yt-dlp-lemon [options] [url...]

Simple wrapper to yt-dlp with only a subset of options.

options:
-h                show help and exit
-H                show all options, notes and exit
-m HEIGHT         max height
-f FORMAT         repack format
-I                no ignore file
-s                add chapter marks + recognize sponsors
-b                remove sponsored segments
-c                split file by chapters
-p                playlist mode
-a                audio mode
-d                download description files
-e                embed meta and chapters
-q                show filepath only
-x                skip download

Copyright © 2024 Tuncay D. https://github.com/thingsiplay/yt-dlp-lemon
52
submitted 1 month ago* (last edited 1 month ago) by thingsiplay@beehaw.org to c/linux@lemmy.ml

Today I'm here again to terrorize this community with my Bash scripts nobody asked for.

This new biggest is a script evolved from a much simpler version found at biggest.sh to something more complex and complete. Now there are even options to show a simple horizontal bar and relative percentage numbers instead the file size itself.

It's a script to control du command in combination with several other standard Linux utilities. I'm well aware of these alternative applications to help visualizing what the biggest files on the system are. Well, I like these kind of scripts and I like its not too much bloated. And especially the output as paths can be combined with other tools easily. It's also kinda fun doing this. Edit: Forgot to mention, it also reads stdin pipe, as output from another program like find in example.

Have a good day.

35
submitted 1 month ago by thingsiplay@beehaw.org to c/linux@lemmy.ml

ytdl is a small script for Linux as an alternative interface to yt-dlp (which itself is a fork from youtube-dl, to download YouTube videos). My goal is to make some of its functionality a bit more accessible for the daily usage. This includes predefined settings and narrowing it down to options I care most about.

7
submitted 1 month ago* (last edited 1 month ago) by thingsiplay@beehaw.org to c/python@programming.dev

Solved: Thanks to a user with this reply: https://programming.dev/comment/10034690


cross-posted from: https://beehaw.org/post/13901165

Hi all. I have a little problem and don't know how to solve. A CLI program in Python is broken since Python 3.12. It was working in Python 3.11. The reason is, that Python 3.12 changed how subclassing of a pathlib.Path works (basically fixed an issue), which now breaks a workaround.

The class in question is:

class File(PosixPath):
    def __new__(cls, *args: Any, **kwargs: Any) -> Any:
        return cls._from_parts(args).expanduser().resolve()  # type: ignore

    def __init__(self, source: str | Path, *args: Any) -> None:
        super().__init__()
        self.__source = Path(source)

    @property
    def source(self) -> Path:
        return self.__source

    @property
    def modified(self) -> Time:
        return Time.fromtimestamp(os.path.getmtime(self))

    @property
    def changed(self) -> Time:
        return Time.fromtimestamp(os.path.getctime(self))

    @property
    def accessed(self) -> Time:
        return Time.fromtimestamp(os.path.getatime(self))

    # Calculate sha512 hash of self file and compare result to the
    # checksum found in given file. Return True if identical.
    def verify_sha512(self, file: File, buffer_size: int = 4096) -> bool:
        compare_hash: str = file.read_text().split(" ")[0]
        self_hash: str = ""
        self_checksum = hashlib.sha512()
        with open(self.as_posix(), "rb") as f:
            for chunk in iter(lambda: f.read(buffer_size), b""):
                self_checksum.update(chunk)
            self_hash = self_checksum.hexdigest()
        return self_hash == compare_hash

and I get this error when running the script:

Traceback (most recent call last):
File "/home/tuncay/.local/bin/geprotondl", line 1415, in 
sys.exit(main())
^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1334, in main
arguments, status = parse_arguments(argv)
^^^^^^^^^^^^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1131, in parse_arguments
default, status = default_install_dir()
^^^^^^^^^^^^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1101, in default_install_dir
steam_root: File = File(path)
^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 97, in __new__
return cls._from_parts(args).expanduser().resolve()  # type: ignore
^^^^^^^^^^^^^^^
AttributeError: type object 'File' has no attribute '_from_parts'. Did you mean: '_load_parts'?

Now replacing _from_parts with _load_parts does not work either and I get this message in that case:

Traceback (most recent call last):
File "/home/tuncay/.local/bin/geprotondl", line 1415, in 
sys.exit(main())
^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1334, in main
arguments, status = parse_arguments(argv)
^^^^^^^^^^^^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1131, in parse_arguments
default, status = default_install_dir()
^^^^^^^^^^^^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1101, in default_install_dir
steam_root: File = File(path)
^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 97, in __new__
return cls._load_parts(args).expanduser().resolve()  # type: ignore
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/pathlib.py", line 408, in _load_parts
paths = self._raw_paths
^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute '_raw_paths'

I have searched the web and don't understand how to fix this. Has anyone an idea what to do?

13
submitted 1 month ago* (last edited 1 month ago) by thingsiplay@beehaw.org to c/programming@programming.dev

Solution was quite easy. Thanks to the user reply here: beehaw.org/comment/3535588 or programming.dev/comment/10034690 (Not sure if the links actually work as expected...)


Hi all. I have a little problem and don't know how to solve. A CLI program in Python is broken since Python 3.12. It was working in Python 3.11. The reason is, that Python 3.12 changed how subclassing of a pathlib.Path works (basically fixed an issue), which now breaks a workaround.

The class in question is:

class File(PosixPath):
    def __new__(cls, *args: Any, **kwargs: Any) -> Any:
        return cls._from_parts(args).expanduser().resolve()  # type: ignore

    def __init__(self, source: str | Path, *args: Any) -> None:
        super().__init__()
        self.__source = Path(source)

    @property
    def source(self) -> Path:
        return self.__source

    @property
    def modified(self) -> Time:
        return Time.fromtimestamp(os.path.getmtime(self))

    @property
    def changed(self) -> Time:
        return Time.fromtimestamp(os.path.getctime(self))

    @property
    def accessed(self) -> Time:
        return Time.fromtimestamp(os.path.getatime(self))

    # Calculate sha512 hash of self file and compare result to the
    # checksum found in given file. Return True if identical.
    def verify_sha512(self, file: File, buffer_size: int = 4096) -> bool:
        compare_hash: str = file.read_text().split(" ")[0]
        self_hash: str = ""
        self_checksum = hashlib.sha512()
        with open(self.as_posix(), "rb") as f:
            for chunk in iter(lambda: f.read(buffer_size), b""):
                self_checksum.update(chunk)
            self_hash = self_checksum.hexdigest()
        return self_hash == compare_hash

and I get this error when running the script:

Traceback (most recent call last):
File "/home/tuncay/.local/bin/geprotondl", line 1415, in 
sys.exit(main())
^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1334, in main
arguments, status = parse_arguments(argv)
^^^^^^^^^^^^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1131, in parse_arguments
default, status = default_install_dir()
^^^^^^^^^^^^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1101, in default_install_dir
steam_root: File = File(path)
^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 97, in __new__
return cls._from_parts(args).expanduser().resolve()  # type: ignore
^^^^^^^^^^^^^^^
AttributeError: type object 'File' has no attribute '_from_parts'. Did you mean: '_load_parts'?

Now replacing _from_parts with _load_parts does not work either and I get this message in that case:

Traceback (most recent call last):
File "/home/tuncay/.local/bin/geprotondl", line 1415, in 
sys.exit(main())
^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1334, in main
arguments, status = parse_arguments(argv)
^^^^^^^^^^^^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1131, in parse_arguments
default, status = default_install_dir()
^^^^^^^^^^^^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 1101, in default_install_dir
steam_root: File = File(path)
^^^^^^^^^^
File "/home/tuncay/.local/bin/geprotondl", line 97, in __new__
return cls._load_parts(args).expanduser().resolve()  # type: ignore
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/pathlib.py", line 408, in _load_parts
paths = self._raw_paths
^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute '_raw_paths'

I have searched the web and don't understand how to fix this. Has anyone an idea what to do?

49
My Linux Command Line Tools (thingsiplay.game.blog)
submitted 1 month ago by thingsiplay@beehaw.org to c/linux@lemmy.ml

A short list with categories of my smol terminal focused tools, scripts and functions I have created over the years. There are some general purpose and very specific ones. This list was needed, because in Github it was a bit cluttered. Maybe, just maybe, you find something useful or inspiring in there.

17
submitted 1 month ago by thingsiplay@beehaw.org to c/linux@lemmy.ml

A week ago I started a little script to format the output of file and path listings from other programs. It got a little bit out of hand and I implemented lot of advanced features into the fmt commands; kind of a sub language to define how the output should be formatted and structured. Entire idea is to give it paths, process the stream (not the file content itself, but the path representing a file) and output them again.

fpath accepts two type of input: a) either as arguments like fpath *.txt or b) from stdin like ls -1 | fpath . With additional options and commands the output can be colored and reformatted to something entirely different. In example with -F option the advanced formatting is possible, such as fpath -F '{.size} {name}' as a simple example.

There is lot of functionality (based on Python, yes this is a Python script), such as {reverse}{name}{/reverse} to reverse font color and background of the segment that is enclosed by the command, a slice to get a subset as a range from the entire path {-1:}, or {center:80}text{/center} to add spaces to get centered text, or just {ext} to output the extension, {mime} to output the file mime type, or even execute arbitrary programs {!grep:a}{path}{/!} to reduce output that has an a in the path.

Did I over engineer it again? Or just ignore most stuff and use it with the most simple options, should be enough anyway: fpath -t -s red *.txt

61
submitted 1 month ago* (last edited 1 month ago) by thingsiplay@beehaw.org to c/gaming@beehaw.org

I just watched an excellent 2 hour (just needed to edit title, as I noticed it was 2 hours and not 1, wow time really flew away!) long documentary. The build up in stages and showing the evolution of the best players achievements, is intense and very well edited, narrated and written documentary!

I know 1 hour is long and I wasn't planning to watch everything, but time flew away. If you have any slight interest into this topic, I highly recommend you to take some time to watch. The video itself is broken up in 5 or so sections. So you could just watch a section at a time, if 2 hour is too long. There is a specific reveal that I do not want spoil, which was epic. Just insanity!

BTW have fun. Edit: Here some timestamps:

  1. 2:32 Chapter 1
  2. 11:39 Chapter 2
  3. 16:28 Chapter 3: ENEOOGEZ
  4. 25:48 Chapter 4: Hypertapping
  5. 31:45 Chapter 5: The Next Generation
  6. 49:00 Chapter 6: Rolling
  7. 1:00:27 Chapter 7: Vaulting & Scaling
  8. 1:15:25 Chapter 8: Colors
  9. 1:25:00 Chapter 9: Crash

For anyone who don't want to watch it on YouTube, here is a link to an Invidious instance:

https://invidious.nerdvpn.de/watch?v=mOJlg8g8_yw

11
submitted 1 month ago* (last edited 1 month ago) by thingsiplay@beehaw.org to c/linux@lemmy.ml

Hi all. Yesterday I posted a program/script which is focused on path based text formatting, such as output from ls or find. Today I want to share new version. I'm proud, even though its limited in its usefulness, but today I solved an issue that was complicated to me (and a few other issues).

Linux command file is used to display file type and mime information, which is super handy. Reason why this was complicated to me is, as I want it to run only once for all paths together for performance reasons. For over thousand files instead taking more than a minute execution time, its down to under 2 seconds when displaying file type information (which includes spawning file process in the background). A few examples:

$ find Desktop/*.* -maxdepth 0 | fpath -F'{type}   \t{name}'
text/plain      append.cfg
text/plain      dynamic.cfg
image/png       nearest.png
image/png       new.png

$ find Desktop/*.* -maxdepth 0 | fpath -a -F'{path}\n\t{file}'
/home/tuncay/Desktop/append.cfg
        ASCII text
/home/tuncay/Desktop/dynamic.cfg
        ASCII text
/home/tuncay/Desktop/nearest.png
        PNG image data, 1920 x 1440, 8-bit/color RGB, non-interlaced
/home/tuncay/Desktop/new.png
        PNG image data, 1920 x 1440, 8-bit/color RGB, non-interlaced

Update v0.3:

Rather than creating a new post, I want to note that I have a huge update. First off, the performance is increased drastically with recent optimizations. Even thousands of paths are now processed very fast (until operations reading from file system is involved).

Just to put into perspective: When I search and output list of paths with time baloosearch6 "a" in my home, I get 8468 files and it takes 0m0,048s. Now when I pipe that into fpath with default processing and without options, it takes 0m0,086s to process. But with a more complex command that involves reading file stats (like size and such) and colored output and a slice:

time baloosearch6 "a" | fpath -F'{.mode}  {.size} \t{-3:-1}: {blue}{name} {}' -sred

it only takes 0m0,200s to execute! But using {file} or {type} or {mime} will still take a long time, even if the subshell process is run only once (it will still read the information for every file):

time baloosearch6 "a" | fpath -F'{file}'

took 3m54,233s to run. But what do you expect with approx. 8 thousand files. Without this script, it would take the same amount of time when running bare metal file command on all of these files.

Secondly, I have implemented a slice command that works very well. It's like the index {3} thing, but now you can set a {start:end} range to not only get a single part, but all parts within that range. It even works with negative numbers like {-3:} to get the last three parts of a path. An empty index means to get everything until end of path.

I'm quite happy how this program turned to be out. Python (at least for me with Python v3.12) is not that slow after all.

view more: next ›

thingsiplay

joined 1 year ago