Linux Quickies

  • “Unable to Connect to RDP Server” in Remmina or Other RDP client – most probably your keys have changed.
    rm ~/.freerdp/known_hosts
  • Quick Folder sizes
    du -h --exclude "./.*" --max-depth=1
  • Find files by Users, Group, Time
    find /home -user sundru –name sun.txt
    find /home -group sungrp –name sun.txt
    find /home -ctime +30 –name sun.txt - file changed older than 30 days
    find /home -cmin -30                - files changed within last 30 mins
  • Awk and Grep
    grep "somestr" sun.txt | awk '{print $1}'
    ls -l|awk '{print $9}'             - unsafe for filenames with spaces.
    find . -maxdepth 1 -type f -printf '%f\n'  - safer
  • Replace String in a bunch of files
    method 1 : grep -rl matchstring /home/ | xargs sed -i 's/matchstring/replacestr/g'
    method 2 : perl -pi -e 's/you/me/g' file1 file2 file3
  • Seapine Test Track ( ttstudio protocol  or any custom protocol ) xdg-mime registration on new Xenial Xerus 16.04
    sudo apt-get install libappindicator1
    sudo apt-get install libfreeimage3
    sudo apt-get install libgstreamer0.10-0
    sudo apt-get install libgstreamer-plugins-base0.10-0
    sudo apt-get install libglib2.0-0
    sudo apt-get install libglib2.0-bin
    sudo apt-get install libfreetype6:i386
    sudo apt-get install libfontconfig1:i386 libsm6:i386 libfreetype6:i386 libglib2.0-0:i386
    sudo apt-get install libxrender1:i386
    sudo apt-get install libfontconfig1:i386
    sudo apt-get install libstdc++6
    

    Check your tturlredirector.desktop file (remove absolute path reference)

    sudo vi /usr/share/applications/tturlredirector.desktop
    sundru@DONKEY2: -_002
    

    Default the handler

    xdg-mime default tturlredirector.desktop x-scheme-handler/ttstudio

    Test your mime handler

    tturlredirector ttstudio://someurl:99//testdb/rqmt?number=8475

    Real test from a browser or console :

    xdg-open ttstudio://someurl:99//testdb/rqmt?number=8475
  • Leave a Reply

    Your email address will not be published. Required fields are marked *