OC by @[email protected]

A while ago I made a tiny function in my ~/.zshrc to download a video from the link in my clipboard. I use this nearly every day to share videos with people without forcing them to watch it on whatever site I found it. What’s a script/alias that you use a lot?

# Download clipboard to tmp with yt-dlp
tmpv() {
  cd /tmp/ && yt-dlp "$(wl-paste)"
}
  • confusedpuppy@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    I have a computer and 3 devices I wanted to transfer files between but every available solution was either too awkward which made things annoying, or too bulky with more than what I needed.

    I ended up writing a long script (around 1000 lines but I’m generous with spacing so I can read my own code easily) using rsync to deal with transferring files and whole directories with a single command. I can even chain together multiple rsync commands back to back so that I can quickly transfer multiple files or directories in one command. Instead of trying to refer to a wall of text full of rsync commands, I can make something like this:

    alias rtPHONEmedia="doas rtransfer /home/dell-pc/.sync/phone/.sync-phone_02_playlists /home/dell-pc/.sync/phone/.sync-phone_03_arbeit /home/dell-pc/.sync/phone/.sync-phone_04_albums /home/dell-pc/.sync/phone/.sync-phone_05_soulseek /home/dell-pc/.sync/phone/.sync-phone_06_youtube"

    This will copy everything from a specific folders on my phone, and store them neatly organized into my storage partition on my computer SSD. This also includes all the necessary information including SSH username, address and ID keys.

    I can then run alias rtARCHIVEfull="doas rtransfer /home/dell-pc/.sync/computer/.sync-computer_01_archive-full" to quickly copy that storage partition on my computer to my external backup SSD.

    I use it so often. It’s especially nice because I can work on a file on my computer and quickly update the file to the remote address location, putting it directly where I need it to be immediately.