[–] 1 point 1 year ago

In Linux you only need dd to burn an iso to a usb stick, but, you can use something 'pretty', too.

sudo mintstick -m iso

I have an alias for it: alias burn='sudo mintstick -m iso'

or

sudo dd if=/path/to/filename.iso of=/dev/sdX bs=4M status=progress

  • source
  • submitted 1 year ago* (last edited 1 year ago) by to c/linux@programming.dev
     

    The goal was to be able to have a function to randomly pick a movie for me to watch.

    I made a text file with one movie title per line that included random flicks top-of-my-head, adding 10. Then, I went and exported some imdb lists, which was so handy because csv files. So, export one list, open it in calc; highlight, and then copy the title column. Simple. I pasted it into my movies list file.

    I did this maybe 7 times which gave me a good sized list of movies - then, I needed to remove duplicates, so, I saved the file and ran this on it:

    cat films.txt | sort | uniq > films2.txt

    I opened the new file and double entries were stacked so I could go through and delete redundant rows, of which, there weren't very many. Now, I have a file with 1892 lines, each line being a movie title. Handy.

    Of course, now, I need to randomly be able to choose a title (line) from the file because I can't be bothered to open the thing and read through it every time I need some inspiration, or, guidance. That's where shuf comes in - look:

    shuf -n 1 films.txt

    Dayum! And the final step of my goal is to make this available, so, bash alias and keybind.

    I added the following to my ~/.bash_aliases file:

    alias pick='shuf -n 1 films.txt'

    I made a bash script with the following command in it and then bound the script to some keys in rc.xml:

    #!/bin/bash
    bash -c 'notify-send -i /usr/share/icons/gnome/256x256/emotes/face-glasses.png -t 5000 "Watch this one" "$(shuf -n 1 films.txt)" '
    

    the keybind:

        <keybind key="C-A-p">
          <action name="Execute">
            <command>sh ~/bin/pick.sh</command>
          </action>
        </keybind>
    

    Awesome linux for every day stuff.