bastion

joined 2 years ago
[โ€“] bastion 7 points 1 day ago

The best advice was gratuitous.

[โ€“] bastion 1 points 1 day ago

good looking out.

[โ€“] bastion 1 points 1 day ago* (last edited 1 day ago)

you know, you could also either include a lossy copy next to the lossless ones, then rsync only lossy extensions, or, if that pollutes your collection, have a separate but identically-structured directory tree, where all your lossless files have lossy copies. Then, you can rsync both folders (send-only) to your single remote (lossy extensions only).

but, yeah, Git really isn't the tool for this, agreed.

[โ€“] bastion 28 points 1 week ago* (last edited 1 week ago)

the car is already purchased. the debt is to the bank. not making payments is irrelevant.

[โ€“] bastion 6 points 1 week ago

It's you, not them.

[โ€“] bastion 3 points 1 week ago (3 children)

Make a script. I'd use xonsh or python with sh.py.

  • create a dict for remote to local filename map
  • walk your local collection
    • for each file, determine what the correct remote name (including a valid extension) would be, and add the pair to the dict, with remote filenames as keys, local filenames as values
  • make a set like local_munged_names from that dict's keys
  • walk your remote tree, and store the filenames in a set like remote_names
  • names_to_upload = local_munged_names - remote_names
  • for each name in names to upload, look up the local filename from the remote to local filename map. Then, encode it if it needs encoding, and upload.
[โ€“] bastion 1 points 1 week ago* (last edited 1 week ago)

Yes, because

In the first kind of language, the thought process is basically: I have the flow of execution, starting at the top of the file. If I want to make a library, I should build the things I want to build, then get out of the way.

Note the "I have the flow of execution", and the "if I want to build a library".

If you just want to build an executable, do as you wish, you already have the flow of execution.

If you want to build a library, make the relevant classes and functions and get out of the way (i.e., no IO, no long-running tasks).

If you want to combine them, use the main name check - or, make a package and do entry points that way. Either way works, because both can fulfill the goal of staying out of the way of those importing this as a library.

[โ€“] bastion 2 points 1 week ago* (last edited 1 week ago)
[โ€“] bastion 1 points 1 week ago

oh. I never really thought of myself as diabolical. Since I guess by that definition I am, maybe I should learn Python.

[โ€“] bastion 1 points 1 week ago
[โ€“] bastion 5 points 1 week ago* (last edited 1 week ago) (1 children)

It simply swaps some things around to make things more confusing, then goes into an infinite loop (whether or not you import or execute it standalone). it's no different than just including in the global scope:

while True:
    pass

I was kinda lazy with the fuckery, tbh. I could have gotten much more confusing, but don't have too much time today. :-)

Maybe I should do a post in programmer humor about preventing arbitrary execution of your python code, and make it sound like it prevents security flaws. ..which, technically, it does - if your code isn't executing, and instead a useless infinite loop is executing, there's nothing to exploit.

[โ€“] bastion 0 points 1 week ago (2 children)

came here to see if Fedora had a --download-only equivalent.

111
submitted 10 months ago* (last edited 10 months ago) by bastion to c/whatisthisthing@lemmy.world
 

This awful creature was, according to my partner, found under or black walnut tree, attached to or emerging from the neck of a very-recently killed bunny that the dog had (killed within the last ~15m). Any idea what it is? More pics available.

It's not smooth like a slug/leech, but has a textured surface. It looks like a grub, but what would a grub be doing attached to a bunny? It has an obvious mouth and anus. She described the mouth part as "hexagonal", which she saw open while it was alive, coming off of or out of the Bunny's neck (it was in or by by a wound it didn't necessarily inflict).

I think it's probably just congealed evil and should be thrown into a fire, along with everything it touched except the puppy, and that's how it's going to get me.

My opinion is obviously tongue-in-cheek, but what is this really?

view more: next โ€บ