There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

themoonisacheese ,
@themoonisacheese@sh.itjust.works avatar

Date modified can be obtained by ls assuming you haven’t touched the files. Ffprobe is your friend for video length.

sibloure ,

I’ve been using ChatGPT to help come up with bash scripts like this. Make sure you test the script out on a folder of dummy files first if you’re not sure.

PoisonedPrisonPanda ,

Chatgpt is your friend here. ;)

Gutless2615 , (edited )

It literally is. This is a great use case for going down the chat gpt approach. It will help you throw together a script for this quickly.

LastoftheDinosaurs ,
@LastoftheDinosaurs@lemmy.world avatar

deleted_by_author

  • Loading...
  • PoisonedPrisonPanda ,

    for simple code snippets chatgpt can give you a really nice performance boost. plain routines where there is more syntax to write than actual cognitive thinking to do can be perfectly outsourced.

    PoisonedPrisonPanda ,

    yeah but in 80% of the time the less complex solutions are more quickly resolved using chatgpt.

    waiting for another human is not instantaneous.

    Mechanize ,

    Probably I’m misreading it, but isn’t this kind of answer basically saying “google it”?

    I don’t want to sound rude, but my english is kind of failing me, I’m just curious, but what’s the point?

    One of the reasons of this kind of public forum is to share knowledge and experiences. ChatGPT is a closed, private, garden where the answer will just die.

    I could get a “I don’t really know the answer but I used ChatGPT and it gave me this:” followed by a script, or something like that.

    I know, this is off-topic and I’m sorry, I’m just really interested in Why, considering it’s said multiple times in this comment section.

    PoisonedPrisonPanda ,

    chatgpt is built on the foundations of stackoverflow etc. therefore yeah it is kind of googling it.

    however the nature of the generative approach of chatgpt gives you tailored answers.

    when you google your question you get abstract answers for other related questions. with an explanation of how doing it. e.g. when I dont understand something but want to I will google it - to gain knowledge.

    but with chatpgt you can specify - hey I want a functiom that does this and that in prints me a string/double using that format. chatpgt gives me exactly what I want - without fiddling with format strings etc. anithet example is regex. for my field of experience I am no core developer, therefore for me everything is a tool to get what I want. chatpgt can give this me in a more comfortable way. I dont need to master regex. but it is very helpful. therefore Im outsourcing that kind of work.

    One of the reasons of this kind of public forum is to share knowledge and experiences. ChatGPT is a closed, private, garden where the answer will just die.

    I agree that for a general standpoint this is valid. however for such simple questions we do not need new forums asking about the already discussed stuff. this is just repetition and we do not like duplicates (which is why forum rules are strict about this)

    so I dont see any issue here.

    could get a “I don’t really know the answer but I used ChatGPT and it gave me this:” followed by a script, or something like that.

    that is the total responsibility by the user and has nothing to do with chatgpt. its the same as running ambiguous linux commands as sudo. its not the fault of stackoverflow, the reddit thread or linus itself. its the users fault.

    therefore if such thing you mentioned happens. but it can be rejected - one should now about the culprits and strenghts of chatgpt.

    edit: as you can see the top voted comment is a human made answer (could also be a chatpgt bot?).

    so we are not yet doomed. ;)

    INeedMana ,
    @INeedMana@lemmy.world avatar

    Let’s see

    Hi @ChatGPT , write a bash script that extracts date of modification including seconds from all .jpg and .mp4 files in the current directory and prints it out

    PoisonedPrisonPanda ,

    cool thing. I assume it works by piping the linked comments to the API, with the private API key of the bot maker?

    INeedMana , (edited )
    @INeedMana@lemmy.world avatar

    AFAIK no and yes ;)

    It sends only the comment where the bot is referenced (no context, no chaining. Each comment is a separate prompt) and it does use the private account of the creator. In the topic where it got announced you can see that at some point it ran out of limit and started generating using 3.5

    PoisonedPrisonPanda ,

    right. makes sense. thanks for digging into this monster thread tho.

    may your day be blessed.

    db2 ,

    Use ffprobe to get video info, it makes it dead easy. Practically a one liner.

    eager_eagle ,
    @eager_eagle@lemmy.world avatar

    maybe something like this using mediainfo and exiftool?

    <pre style="background-color:#ffffff;">
    <span style="color:#323232;">#!/bin/bash
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">for file in *.jpg *.mp4; do
    </span><span style="color:#323232;">    # Extract date and time from file's metadata
    </span><span style="color:#323232;">    if [[ $file == *.jpg ]]; then
    </span><span style="color:#323232;">        datetime=$(exiftool -DateTimeOriginal -d "%Y%m%d_%H%M%S" "$file" | awk -F': ' '{print $2}')
    </span><span style="color:#323232;">    else
    </span><span style="color:#323232;">        datetime=$(mediainfo --Output="General;%File_Modified_Date%" "$file" | awk -F' ' '{print $1"_"$2}' | tr -d ':' | tr -d '-')
    </span><span style="color:#323232;">    fi
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">    # If datetime was found, rename the file 
    </span><span style="color:#323232;">    if [ -n "$datetime" ]; then
    </span><span style="color:#323232;">        # Extract extension of file 
    </span><span style="color:#323232;">        ext="${file##*.}"
    </span><span style="color:#323232;">        # Rename file with date and time as prefix (remove echo after testing it)
    </span><span style="color:#323232;">        echo mv -- "$file" "${datetime}.${ext}"
    </span><span style="color:#323232;">    fi
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">done
    </span>
    
    Dirk ,
    @Dirk@lemmy.ml avatar

    You could use stat to get this information based on the file itself. And with jhead for example you can get the additional meta data in the files, stored in the EXIF and IPTC tags.

    Both can be used in scripts.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines