LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > linux-related notes
User Name
Password

Notices


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
  1. Old Comment

    Poor, but acceptable, work-around to the lack of image previews for XCF and ORA (maybe other formats as well)

    I see you're using convert for the ORA previews, so I guess you are using GraphicsMagick? At least on Sid, GM supports XCF.

    If so, give this one a shot:

    Code:
    convert -layers merge -quality 72 ${1} ${however_you_want_to_name_preview}
    would perhaps knock down your script to :

    Code:
    function make_thumbnail() {
        new_filename=${1/./_}_preview.png
        convert_flags="-layers merge -quality 72"
        case ${1##*.} in
            ora)
                # Check ORA version and proceed...?
                unzip -p ${1} mergedimage.png | convert png:- ${convert_flags} ${new_filename}
                ;;
            xcf)
                convert ${convert_flags} ${1} ${new_filename}
                ;;
        esac
    }
    Of course you don't need to make it a function, but doesn't hurt either if you want to add it to a larger library later on.
    Posted 09-27-2016 at 09:30 AM by goumba goumba is offline
    Updated 09-27-2016 at 09:44 AM by goumba
  2. Old Comment

    [MYSTERY SOLVED] What does "echo ???????????????" really do?

    It would probably have been more obvious if I hadn't had the impression that it was somehow echoing history entries, for some reason.
    Posted 04-28-2016 at 08:01 AM by the dsc the dsc is offline
  3. Old Comment

    [MYSTERY SOLVED] What does "echo ???????????????" really do?

    erm,
    I don't know why that didn't "click" earlier.

    Glad it worked out.
    Posted 04-21-2016 at 08:27 PM by Habitual Habitual is offline
  4. Old Comment

    [MYSTERY SOLVED] What does "echo ???????????????" really do?

    Code:
    18:07 dsc / $ \echo ????
    boot home proc root sbin
    (Didn't know this inverted dash shorthand for the non-aliased executable, cool)

    Just noticed something similar happens even with printf, with a less "parsed" output (no newlines, as usual), and somewhat different as well:

    Code:
    18:12 dsc / $ printf ????
    boot18:12 dsc / $ 
    18:12 dsc / $ \printf ????
    boot18:12 dsc / $ 
    18:12 dsc / $

    And also with plain bash (I guess):

    Code:
    18:43 dsc / $ bash --norc
    bash-4.3$ echo ????
    boot home proc root sbin
    bash-4.3$

    Eventually I'll boot on Debian to see if it does the same.

    Still on Ubuntu Wily, the mystery-folder/file through "?????" is also present in other commands, such as ls:

    Code:
    18:57 dsc / $ echo ???
    bin dev etc lib mnt opt run smb srv sys tmp usr var
    18:57 dsc / $ ls -1 ???
    bin:
    bash
    bunzip2
    bzcat
    
    [...]
    Posted 04-21-2016 at 04:07 PM by the dsc the dsc is offline
    Updated 04-21-2016 at 04:59 PM by the dsc
  5. Old Comment
    Posted 04-21-2016 at 06:09 AM by Habitual Habitual is offline
  6. Old Comment

    Opera Presto had the best GUI ever. Ever.

    Quote:
    It is still the open code Apple put out a long time ago. everyone just gives it a new name.
    Including Apple whom originally forked it from KDE's KHTML.


    I've been trying out the beta of Vivaldi and so far I like what I see.It's kind of what I was expecting from Opera when they first announced that they would be switching to webkit/blink, but unfortunately Opera decided to abandon their existing user base and go in a completely different direction with the new Opera Browser.

    I won't be returning to an Opera product: they've burnt that bridge. What I'm not sure of yet is whether I want to become invested in another proprietary solution (Vivaldi) given the lessons learnt from what happened with Opera/Presto and more recently Google's decision to kill off 32bit Chrome. "Once bitten..." and all that.
    Posted 03-24-2016 at 05:41 AM by GazL GazL is offline
  7. Old Comment

    Opera Presto had the best GUI ever. Ever.

    As a long time user of Opera presto I strayed after support was dropped. Today I downloaded the RPM and used slackware rpm2tgz and installed it.
    I am back as a opera user. I spend many hours building the chromium CEF3 webkit and looking at opera source code it seems these developers understand the needs of a browser. I love my speed dial. TY Opera for going open source all the way.
    Google forked webkit and called it something new. It is still the open code Apple put out a long time ago. everyone just gives it a new name.
    and started using the ppapi client. that is a wrapper.
    I think I will put a slackware build together when I have time.
    Posted 03-23-2016 at 04:08 PM by Drakeo Drakeo is offline
  8. Old Comment

    Parsing script arguments in bash, without getopt(s)

    While I agree with the above, I use something similar to #1 if for some reason I want to avoid getopts. Instead of testing the number of arguments remaining, I test the value of $1.

    I don't understand why the author of the second "solution" chose to shift within every condition. using shift at the end of the loop like the first to me would be less error prone (what if you add an argument, and forget to add shift?).
    Posted 03-20-2016 at 01:00 PM by goumba goumba is offline
  9. Old Comment

    Parsing script arguments in bash, without getopt(s)

    Using '=' to separate a short-option from its argument, or using a space to separate a long-option from its argument are non-standard and best avoided. I wouldn't recommend either of the above solutions in their current form.
    Posted 03-14-2016 at 08:08 AM by GazL GazL is offline
  10. Old Comment

    Fixing the annoying firefox' associations issue once and for all

    Linux has to makeup somehow, for not having viruses. "Linux doesn't have virus - it doesn't need them".
    Posted 01-10-2016 at 10:16 PM by the dsc the dsc is offline
  11. Old Comment

    Fixing the annoying firefox' associations issue once and for all

    Ok, when updating Calligra the desktop link quite naturally comes back...
    But otherwise the recipe seems to work as it should.

    update-desktop-database clearly needs to handle priorities between the applications in some way.
    Posted 01-05-2016 at 09:55 PM by joakim joakim is offline
  12. Old Comment

    Fixing the annoying firefox' associations issue once and for all

    I've got no mimeapps.list on my machine. I can temporarily solve problem by editing /usr/share/applications/mimeinfo.cache.

    Problem is that after a while (probably some update) it goes back to previous (e.g. using krita for pdfs )

    From Arch http://https://wiki.archlinux.org/in...t_applications I got
    Quote:
    When the program update-desktop-database is run (usually as root during the (un)installation of a package), it updates files called mimeinfo.cache
    Running update-desktop-database --verbose I see that it reads from /usr/share/applications/.

    Thus, removing the file /usr/share/applications/kde4/krita_pdf.desktop
    and then running update-desktop-database I conclude that my /usr/share/applications/mimeinfo.cache at least for the moment looks as it should .

    Let's hope it stays that way!
    /Joakim

    PS. I'm on Gentoo and KDE
    Posted 12-29-2015 at 06:12 AM by joakim joakim is offline
  13. Old Comment

    Download files from a list while (re)naming them at the same time

    Youtube-dl is specialized in certain "big" sites, and tries to guess some others as "generic". I think there's the risk that it won't always know how to give a meaningful file name, using something akin to a file "ID" or the actual remote file name, whatever it may be. Maybe the meta-data would be just "podcast 23123132" or whatever.

    But it never occurred to me to try to use it for non-video multimedia sites, even though often I use it to download just the audio from youtube itself. Got to try it sometime. But I bet it would be more likely to work on sites such as soundcloud.com than something like im-this-random-guy-who-has-this-podcast.com.
    Posted 12-04-2015 at 12:40 AM by the dsc the dsc is offline
  14. Old Comment

    Download files from a list while (re)naming them at the same time

    Quote:
    Originally Posted by jheengut View Comment
    why don't you use youtube-dlyoutube-dl, you can even program it to perform renaming according to its meta-data.
    though it is still limited to multimedia files only
    Posted 12-01-2015 at 05:24 AM by jheengut jheengut is offline
  15. Old Comment

    Download files from a list while (re)naming them at the same time

    why don't you use youtube-dlyoutube-dl, you can even program it to perform renaming according to its meta-data.
    Posted 12-01-2015 at 05:23 AM by jheengut jheengut is offline
  16. Old Comment

    Collection of random small tricks

    Just another box not setup as my previous post but showing what Debian Jessie provides. I am current with dist-upgrades on this box today.

    Code:
    $ apt-cache policy youtube-dl
    youtube-dl:
      Installed: (none)
      Candidate: 2014.08.05-1+deb8u1
      Version table:
         2014.08.05-1+deb8u1 0
            500 http://ftp.gr.debian.org/debian/ jessie/main i386 Packages
    using cclive on this unit

    Code:
    $ apt-cache policy cclive
    cclive:
      Installed: 0.7.16-2+b1
      Candidate: 0.7.16-2+b1
      Version table:
     *** 0.7.16-2+b1 0
            500 http://ftp.gr.debian.org/debian/ jessie/main i386 Packages
            100 /var/lib/dpkg/status
    Posted 09-30-2015 at 03:11 PM by rokytnji rokytnji is offline
  17. Old Comment

    Collection of random small tricks

    The irony is that I get:

    Code:
     youtube-dl --version
    2015.01.23.4
    (And right now 2015.09.28)

    So it's actually mpv that misunderstands the newer version as an old one, perhaps due to deprecated syntax or something.


    Hey, but for some reason with the latest update it worked! Go figure...
    Posted 09-30-2015 at 12:47 PM by the dsc the dsc is offline
    Updated 09-30-2015 at 12:50 PM by the dsc
  18. Old Comment

    Collection of random small tricks

    Jessies package manager version is too old also

    Code:
    harry@biker:~
    $ mpv https://www.youtube.com/watch?v=DI9irFLcVgA
    Playing: https://www.youtube.com/watch?v=DI9irFLcVgA
    [ytdl_hook] Your version of youtube-dl is too old! You need at least version '2014.11.26', try running `youtube-dl -U`. 
    Failed to recognize file format.
    Just for grins

    Code:
    root@biker:/home/harry# youtube-dl -U
    It looks like you installed youtube-dl with a package manager, pip, setup.py or a tarball. Please use that to update.
    Not happening on this install. I like your way better.
    Posted 09-27-2015 at 12:23 PM by rokytnji rokytnji is offline
  19. Old Comment

    Collection of random small tricks

    I just had to test this out out of curiosity. Worked for me in AntiX 15.
    I had installed youtube-dl during my install process. Using Debian Jessie.

    http://www.imagebam.com/image/b2ffbf438020349
    Posted 09-27-2015 at 12:09 PM by rokytnji rokytnji is offline
  20. Old Comment

    [solved?] New GTK2 bug? Maybe it's a QtCurve bug. Theme changes randomly

    deleted -- added to the body of the post as an edition. I had the impression I couldn't edit anymore after a short time, but it's not so.
    Posted 09-07-2015 at 01:29 AM by the dsc the dsc is offline
    Updated 09-07-2015 at 01:36 AM by the dsc

  



All times are GMT -5. The time now is 07:29 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration